Skip to content
  1. May 09, 2013
  2. May 08, 2013
    • Asias He's avatar
      KVM: Fix kvm_irqfd_init initialization · 7dac16c3
      Asias He authored
      
      
      In commit a0f155e9 'KVM: Initialize irqfd from kvm_init()', when
      kvm_init() is called the second time (e.g kvm-amd.ko and kvm-intel.ko),
      kvm_arch_init() will fail with -EEXIST, then kvm_irqfd_exit() will be
      called on the error handling path. This way, the kvm_irqfd system will
      not be ready.
      
      This patch fix the following:
      
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffff81c0721e>] _raw_spin_lock+0xe/0x30
      PGD 0
      Oops: 0002 [#1] SMP
      Modules linked in: vhost_net
      CPU 6
      Pid: 4257, comm: qemu-system-x86 Not tainted 3.9.0-rc3+ #757 Dell Inc. OptiPlex 790/0V5HMK
      RIP: 0010:[<ffffffff81c0721e>]  [<ffffffff81c0721e>] _raw_spin_lock+0xe/0x30
      RSP: 0018:ffff880221721cc8  EFLAGS: 00010046
      RAX: 0000000000000100 RBX: ffff88022dcc003f RCX: ffff880221734950
      RDX: ffff8802208f6ca8 RSI: 000000007fffffff RDI: 0000000000000000
      RBP: ffff880221721cc8 R08: 0000000000000002 R09: 0000000000000002
      R10: 00007f7fd01087e0 R11: 0000000000000246 R12: ffff8802208f6ca8
      R13: 0000000000000080 R14: ffff880223e2a900 R15: 0000000000000000
      FS:  00007f7fd38488e0(0000) GS:ffff88022dcc0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 000000022309f000 CR4: 00000000000427e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process qemu-system-x86 (pid: 4257, threadinfo ffff880221720000, task ffff880222bd5640)
      Stack:
       ffff880221721d08 ffffffff810ac5c5 ffff88022431dc00 0000000000000086
       0000000000000080 ffff880223e2a900 ffff8802208f6ca8 0000000000000000
       ffff880221721d48 ffffffff810ac8fe 0000000000000000 ffff880221734000
      Call Trace:
       [<ffffffff810ac5c5>] __queue_work+0x45/0x2d0
       [<ffffffff810ac8fe>] queue_work_on+0x8e/0xa0
       [<ffffffff810ac949>] queue_work+0x19/0x20
       [<ffffffff81009b6b>] irqfd_deactivate+0x4b/0x60
       [<ffffffff8100a69d>] kvm_irqfd+0x39d/0x580
       [<ffffffff81007a27>] kvm_vm_ioctl+0x207/0x5b0
       [<ffffffff810c9545>] ? update_curr+0xf5/0x180
       [<ffffffff811b66e8>] do_vfs_ioctl+0x98/0x550
       [<ffffffff810c1f5e>] ? finish_task_switch+0x4e/0xe0
       [<ffffffff81c054aa>] ? __schedule+0x2ea/0x710
       [<ffffffff811b6bf7>] sys_ioctl+0x57/0x90
       [<ffffffff8140ae9e>] ? trace_hardirqs_on_thunk+0x3a/0x3c
       [<ffffffff81c0f602>] system_call_fastpath+0x16/0x1b
      Code: c1 ea 08 38 c2 74 0f 66 0f 1f 44 00 00 f3 90 0f b6 03 38 c2 75 f7 48 83 c4 08 5b c9 c3 55 48 89 e5 66 66 66 66 90 b8 00 01 00 00 <f0> 66 0f c1 07 89 c2 66 c1 ea 08 38 c2 74 0c 0f 1f 00 f3 90 0f
      RIP  [<ffffffff81c0721e>] _raw_spin_lock+0xe/0x30
      RSP <ffff880221721cc8>
      CR2: 0000000000000000
      ---[ end trace 13fb1e4b6e5ab21f ]---
      
      Signed-off-by: default avatarAsias He <asias@redhat.com>
      Acked-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
      7dac16c3
  3. May 05, 2013
  4. May 02, 2013
    • Paul Mackerras's avatar
      KVM: PPC: Book3S: Add API for in-kernel XICS emulation · 5975a2e0
      Paul Mackerras authored
      
      
      This adds the API for userspace to instantiate an XICS device in a VM
      and connect VCPUs to it.  The API consists of a new device type for
      the KVM_CREATE_DEVICE ioctl, a new capability KVM_CAP_IRQ_XICS, which
      functions similarly to KVM_CAP_IRQ_MPIC, and the KVM_IRQ_LINE ioctl,
      which is used to assert and deassert interrupt inputs of the XICS.
      
      The XICS device has one attribute group, KVM_DEV_XICS_GRP_SOURCES.
      Each attribute within this group corresponds to the state of one
      interrupt source.  The attribute number is the same as the interrupt
      source number.
      
      This does not support irq routing or irqfd yet.
      
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      5975a2e0
  5. Apr 26, 2013
  6. Apr 16, 2013
  7. Apr 08, 2013
  8. Apr 07, 2013
  9. Mar 19, 2013
  10. Mar 11, 2013
  11. Mar 05, 2013
  12. Mar 04, 2013
  13. Feb 28, 2013
    • Sasha Levin's avatar
      hlist: drop the node parameter from iterators · b67bfe0d
      Sasha Levin authored
      
      
      I'm not sure why, but the hlist for each entry iterators were conceived
      
              list_for_each_entry(pos, head, member)
      
      The hlist ones were greedy and wanted an extra parameter:
      
              hlist_for_each_entry(tpos, pos, head, member)
      
      Why did they need an extra pos parameter? I'm not quite sure. Not only
      they don't really need it, it also prevents the iterator from looking
      exactly like the list iterator, which is unfortunate.
      
      Besides the semantic patch, there was some manual work required:
      
       - Fix up the actual hlist iterators in linux/list.h
       - Fix up the declaration of other iterators based on the hlist ones.
       - A very small amount of places were using the 'node' parameter, this
       was modified to use 'obj->member' instead.
       - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
       properly, so those had to be fixed up manually.
      
      The semantic patch which is mostly the work of Peter Senna Tschudin is here:
      
      @@
      iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;
      
      type T;
      expression a,c,d,e;
      identifier b;
      statement S;
      @@
      
      -T b;
          <+... when != b
      (
      hlist_for_each_entry(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue(a,
      - b,
      c) S
      |
      hlist_for_each_entry_from(a,
      - b,
      c) S
      |
      hlist_for_each_entry_rcu(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_rcu_bh(a,
      - b,
      c, d) S
      |
      hlist_for_each_entry_continue_rcu_bh(a,
      - b,
      c) S
      |
      for_each_busy_worker(a, c,
      - b,
      d) S
      |
      ax25_uid_for_each(a,
      - b,
      c) S
      |
      ax25_for_each(a,
      - b,
      c) S
      |
      inet_bind_bucket_for_each(a,
      - b,
      c) S
      |
      sctp_for_each_hentry(a,
      - b,
      c) S
      |
      sk_for_each(a,
      - b,
      c) S
      |
      sk_for_each_rcu(a,
      - b,
      c) S
      |
      sk_for_each_from
      -(a, b)
      +(a)
      S
      + sk_for_each_from(a) S
      |
      sk_for_each_safe(a,
      - b,
      c, d) S
      |
      sk_for_each_bound(a,
      - b,
      c) S
      |
      hlist_for_each_entry_safe(a,
      - b,
      c, d, e) S
      |
      hlist_for_each_entry_continue_rcu(a,
      - b,
      c) S
      |
      nr_neigh_for_each(a,
      - b,
      c) S
      |
      nr_neigh_for_each_safe(a,
      - b,
      c, d) S
      |
      nr_node_for_each(a,
      - b,
      c) S
      |
      nr_node_for_each_safe(a,
      - b,
      c, d) S
      |
      - for_each_gfn_sp(a, c, d, b) S
      + for_each_gfn_sp(a, c, d) S
      |
      - for_each_gfn_indirect_valid_sp(a, c, d, b) S
      + for_each_gfn_indirect_valid_sp(a, c, d) S
      |
      for_each_host(a,
      - b,
      c) S
      |
      for_each_host_safe(a,
      - b,
      c, d) S
      |
      for_each_mesh_entry(a,
      - b,
      c, d) S
      )
          ...+>
      
      [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
      [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
      [akpm@linux-foundation.org: checkpatch fixes]
      [akpm@linux-foundation.org: fix warnings]
      [akpm@linux-foudnation.org: redo intrusive kvm changes]
      Tested-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b67bfe0d
  14. Feb 11, 2013
Loading