1. 06 8月, 2012 1 次提交
  2. 06 5月, 2012 3 次提交
  3. 08 4月, 2012 4 次提交
  4. 03 4月, 2012 2 次提交
  5. 02 4月, 2012 1 次提交
  6. 20 3月, 2012 1 次提交
  7. 05 3月, 2012 9 次提交
  8. 26 12月, 2011 1 次提交
  9. 17 11月, 2011 1 次提交
  10. 01 11月, 2011 1 次提交
    • P
      powerpc: include export.h for files using EXPORT_SYMBOL/THIS_MODULE · 93087948
      Paul Gortmaker 提交于
      Fix failures in powerpc associated with the previously allowed
      implicit module.h presence that now lead to things like this:
      
      arch/powerpc/mm/mmu_context_hash32.c:76:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
      arch/powerpc/mm/tlb_hash32.c:48:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
      arch/powerpc/kernel/pci_32.c:51:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
      arch/powerpc/kernel/iomap.c:36:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
      arch/powerpc/platforms/44x/canyonlands.c:126:1: error: type defaults to 'int' in declaration of 'EXPORT_SYMBOL'
      arch/powerpc/kvm/44x.c:168:59: error: 'THIS_MODULE' undeclared (first use in this function)
      
      [with several contibutions from Stephen Rothwell <sfr@canb.auug.org.au>]
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      93087948
  11. 26 9月, 2011 4 次提交
    • P
      KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode · 02143947
      Paul Mackerras 提交于
      This simplifies the way that the book3s_pr makes the transition to
      real mode when entering the guest.  We now call kvmppc_entry_trampoline
      (renamed from kvmppc_rmcall) in the base kernel using a normal function
      call instead of doing an indirect call through a pointer in the vcpu.
      If kvm is a module, the module loader takes care of generating a
      trampoline as it does for other calls to functions outside the module.
      
      kvmppc_entry_trampoline then disables interrupts and jumps to
      kvmppc_handler_trampoline_enter in real mode using an rfi[d].
      That then uses the link register as the address to return to
      (potentially in module space) when the guest exits.
      
      This also simplifies the way that we call the Linux interrupt handler
      when we exit the guest due to an external, decrementer or performance
      monitor interrupt.  Instead of turning on the MMU, then deciding that
      we need to call the Linux handler and turning the MMU back off again,
      we now go straight to the handler at the point where we would turn the
      MMU on.  The handler will then return to the virtual-mode code
      (potentially in the module).
      
      Along the way, this moves the setting and clearing of the HID5 DCBZ32
      bit into real-mode interrupts-off code, and also makes sure that
      we clear the MSR[RI] bit before loading values into SRR0/1.
      
      The net result is that we no longer need any code addresses to be
      stored in vcpu->arch.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      02143947
    • A
      KVM: PPC: Add sanity checking to vcpu_run · af8f38b3
      Alexander Graf 提交于
      There are multiple features in PowerPC KVM that can now be enabled
      depending on the user's wishes. Some of the combinations don't make
      sense or don't work though.
      
      So this patch adds a way to check if the executing environment would
      actually be able to run the guest properly. It also adds sanity
      checks if PVR is set (should always be true given the current code
      flow), if PAPR is only used with book3s_64 where it works and that
      HV KVM is only used in PAPR mode.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      af8f38b3
    • A
      KVM: PPC: Support SC1 hypercalls for PAPR in PR mode · a668f2bd
      Alexander Graf 提交于
      PAPR defines hypercalls as SC1 instructions. Using these, the guest modifies
      page tables and does other privileged operations that it wouldn't be allowed
      to do in supervisor mode.
      
      This patch adds support for PR KVM to trap these instructions and route them
      through the same PAPR hypercall interface that we already use for HV style
      KVM.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a668f2bd
    • A
      KVM: PPC: Add support for explicit HIOR setting · a15bd354
      Alexander Graf 提交于
      Until now, we always set HIOR based on the PVR, but this is just wrong.
      Instead, we should be setting HIOR explicitly, so user space can decide
      what the initial HIOR value is - just like on real hardware.
      
      We keep the old PVR based way around for backwards compatibility, but
      once user space uses the SREGS based method, we drop the PVR logic.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a15bd354
  12. 12 7月, 2011 6 次提交
    • P
      KVM: PPC: Move guest enter/exit down into subarch-specific code · df6909e5
      Paul Mackerras 提交于
      Instead of doing the kvm_guest_enter/exit() and local_irq_dis/enable()
      calls in powerpc.c, this moves them down into the subarch-specific
      book3s_pr.c and booke.c.  This eliminates an extra local_irq_enable()
      call in book3s_pr.c, and will be needed for when we do SMT4 guest
      support in the book3s hypervisor mode code.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      df6909e5
    • P
      KVM: PPC: Pass init/destroy vm and prepare/commit memory region ops down · f9e0554d
      Paul Mackerras 提交于
      This arranges for the top-level arch/powerpc/kvm/powerpc.c file to
      pass down some of the calls it gets to the lower-level subarchitecture
      specific code.  The lower-level implementations (in booke.c and book3s.c)
      are no-ops.  The coming book3s_hv.c will need this.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f9e0554d
    • P
      KVM: PPC: Split out code from book3s.c into book3s_pr.c · f05ed4d5
      Paul Mackerras 提交于
      In preparation for adding code to enable KVM to use hypervisor mode
      on 64-bit Book 3S processors, this splits book3s.c into two files,
      book3s.c and book3s_pr.c, where book3s_pr.c contains the code that is
      specific to running the guest in problem state (user mode) and book3s.c
      contains code which should apply to all Book 3S processors.
      
      In doing this, we abstract some details, namely the interrupt offset,
      updating the interrupt pending flag, and detecting if the guest is
      in a critical section.  These are all things that will be different
      when we use hypervisor mode.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f05ed4d5
    • P
      KVM: PPC: Move fields between struct kvm_vcpu_arch and kvmppc_vcpu_book3s · c4befc58
      Paul Mackerras 提交于
      This moves the slb field, which represents the state of the emulated
      SLB, from the kvmppc_vcpu_book3s struct to the kvm_vcpu_arch, and the
      hpte_hash_[v]pte[_long] fields from kvm_vcpu_arch to kvmppc_vcpu_book3s.
      This is in accord with the principle that the kvm_vcpu_arch struct
      represents the state of the emulated CPU, and the kvmppc_vcpu_book3s
      struct holds the auxiliary data structures used in the emulation.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      c4befc58
    • P
      KVM: PPC: Fix machine checks on 32-bit Book3S · 149dbdb1
      Paul Mackerras 提交于
      Commit 69acc0d3ba ("KVM: PPC: Resolve real-mode handlers through
      function exports") resulted in vcpu->arch.trampoline_lowmem and
      vcpu->arch.trampoline_enter ending up with kernel virtual addresses
      rather than physical addresses.  This is OK on 64-bit Book3S machines,
      which ignore the top 4 bits of the effective address in real mode,
      but on 32-bit Book3S machines, accessing these addresses in real mode
      causes machine check interrupts, as the hardware uses the whole
      effective address as the physical address in real mode.
      
      This fixes the problem by using __pa() to convert these addresses
      to physical addresses.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      149dbdb1
    • A
      KVM: PPC: Resolve real-mode handlers through function exports · a22a2dac
      Alexander Graf 提交于
      Up until now, Book3S KVM had variables stored in the kernel that a kernel module
      or the kvm code in the kernel could read from to figure out where some real mode
      helper functions are located.
      
      This is all unnecessary. The high bits of the EA get ignore in real mode, so we
      can just use the pointer as is. Also, it's a lot easier on relocations when we
      use the normal way of resolving the address to a function, instead of jumping
      through hoops.
      
      This patch fixes compilation with CONFIG_RELOCATABLE=y.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a22a2dac
  13. 20 5月, 2011 1 次提交
  14. 18 3月, 2011 1 次提交
  15. 12 1月, 2011 1 次提交
  16. 24 10月, 2010 3 次提交
    • A
      KVM: PPC: Implement Level interrupts on Book3S · 17bd1580
      Alexander Graf 提交于
      The current interrupt logic is just completely broken. We get a notification
      from user space, telling us that an interrupt is there. But then user space
      expects us that we just acknowledge an interrupt once we deliver it to the
      guest.
      
      This is not how real hardware works though. On real hardware, the interrupt
      controller pulls the external interrupt line until it gets notified that the
      interrupt was received.
      
      So in reality we have two events: pulling and letting go of the interrupt line.
      
      To maintain backwards compatibility, I added a new request for the pulling
      part. The letting go part was implemented earlier already.
      
      With this in place, we can now finally start guests that do not randomly stall
      and stop to work at random times.
      
      This patch implements above logic for Book3S.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      17bd1580
    • A
      KVM: PPC: Don't put MSR_POW in MSR · 296c19d0
      Alexander Graf 提交于
      On Book3S a mtmsr with the MSR_POW bit set indicates that the OS is in
      idle and only needs to be waked up on the next interrupt.
      
      Now, unfortunately we let that bit slip into the stored MSR value which
      is not what the real CPU does, so that we ended up executing code like
      this:
      
      	r = mfmsr();
      	/* r containts MSR_POW */
      	mtmsr(r | MSR_EE);
      
      This obviously breaks, as we're going into idle mode in code sections that
      don't expect to be idling.
      
      This patch masks MSR_POW out of the stored MSR value on wakeup, making
      guests happy again.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      296c19d0
    • A
      KVM: PPC: Update int_pending also on dequeue · 9ee18b1e
      Alexander Graf 提交于
      When having a decrementor interrupt pending, the dequeuing happens manually
      through an mtdec instruction. This instruction simply calls dequeue on that
      interrupt, so the int_pending hint doesn't get updated.
      
      This patch enables updating the int_pending hint also on dequeue, thus
      correctly enabling guests to stay in guest contexts more often.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      9ee18b1e