1. 27 Apr, 2017 3 commits
    • Paul Mackerras's avatar
      Merge remote-tracking branch 'remotes/powerpc/topic/xive' into kvm-ppc-next · fb7dcf72
      Paul Mackerras authored
      This merges in the powerpc topic/xive branch to bring in the code for
      the in-kernel XICS interrupt controller emulation to use the new XIVE
      (eXternal Interrupt Virtualization Engine) hardware in the POWER9 chip
      directly, rather than via a XICS emulation in firmware.
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      fb7dcf72
    • Denis Kirjanov's avatar
      KVM: PPC: Book3S HV: Avoid preemptibility warning in module initialization · db4b0dfa
      Denis Kirjanov authored
      With CONFIG_DEBUG_PREEMPT, get_paca() produces the following warning
      in kvmppc_book3s_init_hv() since it calls debug_smp_processor_id().
      
      There is no real issue with the xics_phys field.
      If paca->kvm_hstate.xics_phys is non-zero on one cpu, it will be
      non-zero on them all.  Therefore this is not fixing any actual
      problem, just the warning.
      
      [  138.521188] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/5596
      [  138.521308] caller is .kvmppc_book3s_init_hv+0x184/0x350 [kvm_hv]
      [  138.521404] CPU: 5 PID: 5596 Comm: modprobe Not tainted 4.11.0-rc3-00022-gc7e790c5 #1
      [  138.521509] Call Trace:
      [  138.521563] [c0000007d018b810] [c0000000023eef10] .dump_stack+0xe4/0x150 (unreliable)
      [  138.521694] [c0000007d018b8a0] [c000000001f6ec04] .check_preemption_disabled+0x134/0x150
      [  138.521829] [c0000007d018b940] [d00000000a010274] .kvmppc_book3s_init_hv+0x184/0x350 [kvm_hv]
      [  138.521963] [c0000007d018ba00] [c00000000191d5cc] .do_one_initcall+0x5c/0x1c0
      [  138.522082] [c0000007d018bad0] [c0000000023e9494] .do_init_module+0x84/0x240
      [  138.522201] [c0000007d018bb70] [c000000001aade18] .load_module+0x1f68/0x2a10
      [  138.522319] [c0000007d018bd20] [c000000001aaeb30] .SyS_finit_module+0xc0/0xf0
      [  138.522439] [c0000007d018be30] [c00000000191baec] system_call+0x38/0xfc
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      db4b0dfa
    • Benjamin Herrenschmidt's avatar
      KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller · 5af50993
      Benjamin Herrenschmidt authored
      This patch makes KVM capable of using the XIVE interrupt controller
      to provide the standard PAPR "XICS" style hypercalls. It is necessary
      for proper operations when the host uses XIVE natively.
      
      This has been lightly tested on an actual system, including PCI
      pass-through with a TG3 device.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [mpe: Cleanup pr_xxx(), unsplit pr_xxx() strings, etc., fix build
       failures by adding KVM_XIVE which depends on KVM_XICS and XIVE, and
       adding empty stubs for the kvm_xive_xxx() routines, fixup subject,
       integrate fixes from Paul for building PR=y HV=n]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      5af50993
  2. 26 Apr, 2017 1 commit
    • Nicholas Piggin's avatar
      powerpc/64s: Revert setting of LPCR[LPES] on POWER9 · 8bf8f2e8
      Nicholas Piggin authored
      The XIVE enablement patches included a change to set the LPES (Logical
      Partitioning Environment Selector) bit (bit # 3) in LPCR (Logical Partitioning
      Control Register) on POWER9 hosts. This bit sets external interrupts to guest
      delivery mode, which uses SRR0/1. The host's EE interrupt handler is written to
      expect HSRR0/1 (for earlier CPUs). This should be fine because XIVE is
      configured not to deliver EEs to the host (Hypervisor Virtulization Interrupt is
      used instead) so the EE handler should never be executed.
      
      However a bug in interrupt controller code, hardware, or odd configuration of a
      simulator could result in the host getting an EE incorrectly. Keeping the EE
      delivery mode matching the host EE handler prevents strange crashes due to using
      the wrong exception registers.
      
      KVM will configure the LPCR to set LPES prior to running a guest so that EEs are
      delivered to the guest using SRR0/1.
      
      Fixes: 08a1e650 ("powerpc: Fixup LPCR:PECE and HEIC setting on POWER9")
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      [mpe: Massage change log to avoid referring to LPES0 which is now renamed LPES]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      8bf8f2e8
  3. 21 Apr, 2017 6 commits
  4. 20 Apr, 2017 19 commits
  5. 13 Apr, 2017 1 commit
    • Radim Krčmář's avatar
      KVM: nVMX: fix AD condition when handling EPT violation · 33251870
      Radim Krčmář authored
      I have introduced this bug when applying and simplifying Paolo's patch
      as we agreed on the list.  The original was "x &= ~y; if (z) x |= y;".
      
      Here is the story of a bad workflow:
      
        A maintainer was already testing with the intended change, but it was
        applied only to a testing repo on a different machine.  When the time
        to push tested patches to kvm/next came, he realized that this change
        was missing and quickly added it to the maintenance repo, didn't test
        again (because the change is trivial, right), and pushed the world to
        fire.
      
      Fixes: ae1e2d10 ("kvm: nVMX: support EPT accessed/dirty bits")
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      33251870
  6. 12 Apr, 2017 10 commits