1. 18 10月, 2013 2 次提交
  2. 17 10月, 2013 4 次提交
  3. 04 9月, 2013 1 次提交
  4. 18 7月, 2013 1 次提交
  5. 11 7月, 2013 1 次提交
  6. 02 5月, 2013 2 次提交
  7. 27 4月, 2013 6 次提交
  8. 17 4月, 2013 1 次提交
  9. 22 3月, 2013 1 次提交
  10. 05 3月, 2013 3 次提交
  11. 10 1月, 2013 2 次提交
    • A
      KVM: PPC: BookE: Implement EPR exit · 1c810636
      Alexander Graf 提交于
      The External Proxy Facility in FSL BookE chips allows the interrupt
      controller to automatically acknowledge an interrupt as soon as a
      core gets its pending external interrupt delivered.
      
      Today, user space implements the interrupt controller, so we need to
      check on it during such a cycle.
      
      This patch implements logic for user space to enable EPR exiting,
      disable EPR exiting and EPR exiting itself, so that user space can
      acknowledge an interrupt when an external interrupt has successfully
      been delivered into the guest vcpu.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      1c810636
    • A
      KVM: PPC: Only WARN on invalid emulation · 5a33169e
      Alexander Graf 提交于
      When we hit an emulation result that we didn't expect, that is an error,
      but it's nothing that warrants a BUG(), because it can be guest triggered.
      
      So instead, let's only WARN() the user that this happened.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      5a33169e
  12. 14 12月, 2012 1 次提交
  13. 06 12月, 2012 2 次提交
    • P
      KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT · a2932923
      Paul Mackerras 提交于
      A new ioctl, KVM_PPC_GET_HTAB_FD, returns a file descriptor.  Reads on
      this fd return the contents of the HPT (hashed page table), writes
      create and/or remove entries in the HPT.  There is a new capability,
      KVM_CAP_PPC_HTAB_FD, to indicate the presence of the ioctl.  The ioctl
      takes an argument structure with the index of the first HPT entry to
      read out and a set of flags.  The flags indicate whether the user is
      intending to read or write the HPT, and whether to return all entries
      or only the "bolted" entries (those with the bolted bit, 0x10, set in
      the first doubleword).
      
      This is intended for use in implementing qemu's savevm/loadvm and for
      live migration.  Therefore, on reads, the first pass returns information
      about all HPTEs (or all bolted HPTEs).  When the first pass reaches the
      end of the HPT, it returns from the read.  Subsequent reads only return
      information about HPTEs that have changed since they were last read.
      A read that finds no changed HPTEs in the HPT following where the last
      read finished will return 0 bytes.
      
      The format of the data provides a simple run-length compression of the
      invalid entries.  Each block of data starts with a header that indicates
      the index (position in the HPT, which is just an array), the number of
      valid entries starting at that index (may be zero), and the number of
      invalid entries following those valid entries.  The valid entries, 16
      bytes each, follow the header.  The invalid entries are not explicitly
      represented.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      [agraf: fix documentation]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a2932923
    • A
      KVM: PPC: Support eventfd · 0e673fb6
      Alexander Graf 提交于
      In order to support the generic eventfd infrastructure on PPC, we need
      to call into the generic KVM in-kernel device mmio code.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      0e673fb6
  14. 28 11月, 2012 1 次提交
  15. 06 10月, 2012 12 次提交
    • S
      KVM: PPC: set IN_GUEST_MODE before checking requests · 5bd1cf11
      Scott Wood 提交于
      Avoid a race as described in the code comment.
      
      Also remove a related smp_wmb() from booke's kvmppc_prepare_to_enter().
      I can't see any reason for it, and the book3s_pr version doesn't have it.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      5bd1cf11
    • P
      KVM: PPC: Book3S HV: Fix updates of vcpu->cpu · a47d72f3
      Paul Mackerras 提交于
      This removes the powerpc "generic" updates of vcpu->cpu in load and
      put, and moves them to the various backends.
      
      The reason is that "HV" KVM does its own sauce with that field
      and the generic updates might corrupt it. The field contains the
      CPU# of the -first- HW CPU of the core always for all the VCPU
      threads of a core (the one that's online from a host Linux
      perspective).
      
      However, the preempt notifiers are going to be called on the
      threads VCPUs when they are running (due to them sleeping on our
      private waitqueue) causing unload to be called, potentially
      clobbering the value.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a47d72f3
    • P
      KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly · dfe49dbd
      Paul Mackerras 提交于
      This adds an implementation of kvm_arch_flush_shadow_memslot for
      Book3S HV, and arranges for kvmppc_core_commit_memory_region to
      flush the dirty log when modifying an existing slot.  With this,
      we can handle deletion and modification of memory slots.
      
      kvm_arch_flush_shadow_memslot calls kvmppc_core_flush_memslot, which
      on Book3S HV now traverses the reverse map chains to remove any HPT
      (hashed page table) entries referring to pages in the memslot.  This
      gets called by generic code whenever deleting a memslot or changing
      the guest physical address for a memslot.
      
      We flush the dirty log in kvmppc_core_commit_memory_region for
      consistency with what x86 does.  We only need to flush when an
      existing memslot is being modified, because for a new memslot the
      rmap array (which stores the dirty bits) is all zero, meaning that
      every page is considered clean already, and when deleting a memslot
      we obviously don't care about the dirty bits any more.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      dfe49dbd
    • P
      KVM: PPC: Move kvm->arch.slot_phys into memslot.arch · a66b48c3
      Paul Mackerras 提交于
      Now that we have an architecture-specific field in the kvm_memory_slot
      structure, we can use it to store the array of page physical addresses
      that we need for Book3S HV KVM on PPC970 processors.  This reduces the
      size of struct kvm_arch for Book3S HV, and also reduces the size of
      struct kvm_arch_memory_slot for other PPC KVM variants since the fields
      in it are now only compiled in for Book3S HV.
      
      This necessitates making the kvm_arch_create_memslot and
      kvm_arch_free_memslot operations specific to each PPC KVM variant.
      That in turn means that we now don't allocate the rmap arrays on
      Book3S PR and Book E.
      
      Since we now unpin pages and free the slot_phys array in
      kvmppc_core_free_memslot, we no longer need to do it in
      kvmppc_core_destroy_vm, since the generic code takes care to free
      all the memslots when destroying a VM.
      
      We now need the new memslot to be passed in to
      kvmppc_core_prepare_memory_region, since we need to initialize its
      arch.slot_phys member on Book3S HV.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a66b48c3
    • B
      KVM: PPC: booke: Add watchdog emulation · f61c94bb
      Bharat Bhushan 提交于
      This patch adds the watchdog emulation in KVM. The watchdog
      emulation is enabled by KVM_ENABLE_CAP(KVM_CAP_PPC_BOOKE_WATCHDOG) ioctl.
      The kernel timer are used for watchdog emulation and emulates
      h/w watchdog state machine. On watchdog timer expiry, it exit to QEMU
      if TCR.WRC is non ZERO. QEMU can reset/shutdown etc depending upon how
      it is configured.
      Signed-off-by: NLiu Yu <yu.liu@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      [bharat.bhushan@freescale.com: reworked patch]
      Signed-off-by: NBharat Bhushan <bharat.bhushan@freescale.com>
      [agraf: adjust to new request framework]
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f61c94bb
    • A
      KVM: PPC: Add return value to core_check_requests · 7c973a2e
      Alexander Graf 提交于
      Requests may want to tell us that we need to go back into host state,
      so add a return value for the checks.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      7c973a2e
    • A
      KVM: PPC: Add return value in prepare_to_enter · 7ee78855
      Alexander Graf 提交于
      Our prepare_to_enter helper wants to be able to return in more circumstances
      to the host than only when an interrupt is pending. Broaden the interface a
      bit and move even more generic code to the generic helper.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      7ee78855
    • A
      KVM: PPC: Ignore EXITING_GUEST_MODE mode · 206c2ed7
      Alexander Graf 提交于
      We don't need to do anything when mode is EXITING_GUEST_MODE, because
      we essentially are outside of guest mode and did everything it asked
      us to do by the time we check it.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      206c2ed7
    • A
      KVM: PPC: Move kvm_guest_enter call into generic code · 3766a4c6
      Alexander Graf 提交于
      We need to call kvm_guest_enter in booke and book3s, so move its
      call to generic code.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3766a4c6
    • A
      KVM: PPC: Book3S: PR: Rework irq disabling · bd2be683
      Alexander Graf 提交于
      Today, we disable preemption while inside guest context, because we need
      to expose to the world that we are not in a preemptible context. However,
      during that time we already have interrupts disabled, which would indicate
      that we are in a non-preemptible context.
      
      The reason the checks for irqs_disabled() fail for us though is that we
      manually control hard IRQs and ignore all the lazy EE framework. Let's
      stop doing that. Instead, let's always use lazy EE to indicate when we
      want to disable IRQs, but do a special final switch that gets us into
      EE disabled, but soft enabled state. That way when we get back out of
      guest state, we are immediately ready to process interrupts.
      
      This simplifies the code drastically and reduces the time that we appear
      as preempt disabled.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      bd2be683
    • A
      KVM: PPC: Use same kvmppc_prepare_to_enter code for booke and book3s_pr · 03d25c5b
      Alexander Graf 提交于
      We need to do the same things when preparing to enter a guest for booke and
      book3s_pr cores. Fold the generic code into a generic function that both call.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      03d25c5b
    • A
      KVM: PPC: Expose SYNC cap based on mmu notifiers · f4800b1f
      Alexander Graf 提交于
      Semantically, the "SYNC" cap means that we have mmu notifiers available.
      Express this in our #ifdef'ery around the feature, so that we can be sure
      we don't miss out on ppc targets when they get their implementation.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f4800b1f