1. 28 Jul, 2014 11 commits
    • Paul Mackerras's avatar
      KVM: PPC: Book3S: Controls for in-kernel sPAPR hypercall handling · 699a0ea0
      Paul Mackerras authored
      This provides a way for userspace controls which sPAPR hcalls get
      handled in the kernel.  Each hcall can be individually enabled or
      disabled for in-kernel handling, except for H_RTAS.  The exception
      for H_RTAS is because userspace can already control whether
      individual RTAS functions are handled in-kernel or not via the
      KVM_PPC_RTAS_DEFINE_TOKEN ioctl, and because the numeric value for
      H_RTAS is out of the normal sequence of hcall numbers.
      
      Hcalls are enabled or disabled using the KVM_ENABLE_CAP ioctl for the
      KVM_CAP_PPC_ENABLE_HCALL capability on the file descriptor for the VM.
      The args field of the struct kvm_enable_cap specifies the hcall number
      in args[0] and the enable/disable flag in args[1]; 0 means disable
      in-kernel handling (so that the hcall will always cause an exit to
      userspace) and 1 means enable.  Enabling or disabling in-kernel
      handling of an hcall is effective across the whole VM.
      
      The ability for KVM_ENABLE_CAP to be used on a VM file descriptor
      on PowerPC is new, added by this commit.  The KVM_CAP_ENABLE_CAP_VM
      capability advertises that this ability exists.
      
      When a VM is created, an initial set of hcalls are enabled for
      in-kernel handling.  The set that is enabled is the set that have
      an in-kernel implementation at this point.  Any new hcall
      implementations from this point onwards should not be added to the
      default set without a good reason.
      
      No distinction is made between real-mode and virtual-mode hcall
      implementations; the one setting controls them both.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      699a0ea0
    • Mihai Caraman's avatar
      KVM: PPC: e500mc: Enhance tlb invalidation condition on vcpu schedule · 1f0eeb7e
      Mihai Caraman authored
      On vcpu schedule, the condition checked for tlb pollution is too loose.
      The tlb entries of a vcpu become polluted (vs stale) only when a different
      vcpu within the same logical partition runs in-between. Optimize the tlb
      invalidation condition keeping last_vcpu per logical partition id.
      
      With the new invalidation condition, a guest shows 4% performance improvement
      on P5020DS while running a memory stress application with the cpu oversubscribed,
      the other guest running a cpu intensive workload.
      
      Guest - old invalidation condition
        real 3.89
        user 3.87
        sys 0.01
      
      Guest - enhanced invalidation condition
        real 3.75
        user 3.73
        sys 0.01
      
      Host
        real 3.70
        user 1.85
        sys 0.00
      
      The memory stress application accesses 4KB pages backed by 75% of available
      TLB0 entries:
      
      char foo[ENTRIES][4096] __attribute__ ((aligned (4096)));
      
      int main()
      {
      	char bar;
      	int i, j;
      
      	for (i = 0; i < ITERATIONS; i++)
              	for (j = 0; j < ENTRIES; j++)
                  		bar = foo[j][0];
      
      	return 0;
      }
      Signed-off-by: default avatarMihai Caraman <mihai.caraman@freescale.com>
      Reviewed-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      1f0eeb7e
    • Alexander Graf's avatar
      KVM: PPC: Book3S PR: Fix sparse endian checks · f396df35
      Alexander Graf authored
      While sending sparse with endian checks over the code base, it triggered at
      some places that were missing casts or had wrong types. Fix them up.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      f396df35
    • Alexander Graf's avatar
      KVM: PPC: Book3S PR: Fix ABIv2 on LE · da166fac
      Alexander Graf authored
      We switched to ABIv2 on Little Endian systems now which gets rid of the
      dotted function names. Branch to the actual functions when we see such
      a system.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      da166fac
    • Anton Blanchard's avatar
      KVM: PPC: Assembly functions exported to modules need _GLOBAL_TOC() · ad7d4584
      Anton Blanchard authored
      Both kvmppc_hv_entry_trampoline and kvmppc_entry_trampoline are
      assembly functions that are exported to modules and also require
      a valid r2.
      
      As such we need to use _GLOBAL_TOC so we provide a global entry
      point that establishes the TOC (r2).
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      ad7d4584
    • Anton Blanchard's avatar
      KVM: PPC: Book3S HV: Fix ABIv2 indirect branch issue · 05a308c7
      Anton Blanchard authored
      To establish addressability quickly, ABIv2 requires the target
      address of the function being called to be in r12.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      05a308c7
    • Alexander Graf's avatar
      KVM: PPC: Book3S PR: Handle hyp doorbell exits · 568fccc4
      Alexander Graf authored
      If we're running PR KVM in HV mode, we may get hypervisor doorbell interrupts.
      Handle those the same way we treat normal doorbells.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      568fccc4
    • Alexander Graf's avatar
      KVM: PPC: Book3s HV: Fix tlbie compile error · f6bf3a66
      Alexander Graf authored
      Some compilers complain about uninitialized variables in the compute_tlbie_rb
      function. When you follow the code path you'll realize that we'll never get
      to that point, but the compiler isn't all that smart.
      
      So just default to 4k page sizes for everything, making the compiler happy
      and the code slightly easier to read.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      f6bf3a66
    • Alexander Graf's avatar
      KVM: PPC: Book3s PR: Disable AIL mode with OPAL · fb4188ba
      Alexander Graf authored
      When we're using PR KVM we must not allow the CPU to take interrupts
      in virtual mode, as the SLB does not contain host kernel mappings
      when running inside the guest context.
      
      To make sure we get good performance for non-KVM tasks but still
      properly functioning PR KVM, let's just disable AIL whenever a vcpu
      is scheduled in.
      
      This is fundamentally different from how we deal with AIL on pSeries
      type machines where we disable AIL for the whole machine as soon as
      a single KVM VM is up.
      
      The reason for that is easy - on pSeries we do not have control over
      per-cpu configuration of AIL. We also don't want to mess with CPU hotplug
      races and AIL configuration, so setting it per CPU is easier and more
      flexible.
      
      This patch fixes running PR KVM on POWER8 bare metal for me.
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      fb4188ba
    • Aneesh Kumar K.V's avatar
      KVM: PPC: BOOK3S: PR: Emulate instruction counter · 06da28e7
      Aneesh Kumar K.V authored
      Writing to IC is not allowed in the privileged mode.
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      06da28e7
    • Aneesh Kumar K.V's avatar
      KVM: PPC: BOOK3S: PR: Emulate virtual timebase register · 8f42ab27
      Aneesh Kumar K.V authored
      virtual time base register is a per VM, per cpu register that needs
      to be saved and restored on vm exit and entry. Writing to VTB is not
      allowed in the privileged mode.
      Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      [agraf: fix compile error]
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      8f42ab27
  2. 06 Jul, 2014 1 commit
  3. 30 Jun, 2014 11 commits
  4. 26 Jun, 2014 1 commit
  5. 19 Jun, 2014 16 commits