Re: [PATCH] arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function

2014-12-17 Thread Alexander Graf
On 07.12.14 23:29, Rickard Strandqvist wrote: Remove the function inst_set_field() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se Thanks, applied all

Re: [PATCH] KVM: PPC: Book3S HV: Simplify locking around stolen time calculations

2014-12-17 Thread Alexander Graf
On 04.12.14 06:43, Paul Mackerras wrote: Currently the calculations of stolen time for PPC Book3S HV guests uses fields in both the vcpu struct and the kvmppc_vcore struct. The fields in the kvmppc_vcore struct are protected by the vcpu-arch.tbacct_lock of the vcpu that has taken

Re: [PATCH] KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

2014-12-17 Thread Alexander Graf
On 04.12.14 01:48, Suresh E. Warrier wrote: This patch adds trace points in the guest entry and exit code and also for exceptions handled by the host in kernel mode - hypercalls and page faults. The new events are added to /sys/kernel/debug/tracing/events under a new subsystem called kvm_hv.

Re: [PATCH] powerpc: powernv: Return to cpu offline loop when finished in KVM guest

2014-12-17 Thread Alexander Graf
On 03.12.14 04:48, Paul Mackerras wrote: When a secondary hardware thread has finished running a KVM guest, we currently put that thread into nap mode using a nap instruction in the KVM code. This changes the code so that instead of doing a nap instruction directly, we instead cause the

Re: [PATCH 0/5] Fixes and improvements for HV KVM on PPC

2014-12-17 Thread Alexander Graf
On 03.12.14 03:30, Paul Mackerras wrote: This series of patches is based on Alex Graf's kvm-ppc-queue branch and is intended for the 3.19 merge window. It starts by removing the code to support HV KVM on PPC970 processors. This code is hardly used now since there are not many HV-capable

Re: [PATCH 4/5] KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.

2014-12-17 Thread Alexander Graf
On 03.12.14 03:30, Paul Mackerras wrote: From: Michael Ellerman mich...@ellerman.id.au Some PowerNV systems include a hardware random-number generator. This HWRNG is present on POWER7+ and POWER8 chips and is capable of generating one 64-bit random number every microsecond. The random

[PULL 01/18] KVM: PPC: BookE: Improve irq inject tracepoint

2014-12-17 Thread Alexander Graf
When injecting an IRQ, we only document which IRQ priority (which translates to IRQ type) gets injected. However, when reading traces you don't necessarily have all the numbers in your head to know which IRQ really is meant. This patch converts the IRQ number field to a symbolic name that is in

[PULL 03/18] KVM: PPC: Book3S HV: Fix computation of tlbie operand

2014-12-17 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The B (segment size) field in the RB operand for the tlbie instruction is two bits, which we get from the top two bits of the first doubleword of the HPT entry to be invalidated. These bits go in bits 8 and 9 of the RB operand (bits 54 and 55 in IBM bit

[PULL 06/18] KVM: PPC: Book3S HV: Fix inaccuracies in ICP emulation for H_IPI

2014-12-17 Thread Alexander Graf
From: Suresh E. Warrier warr...@linux.vnet.ibm.com This fixes some inaccuracies in the state machine for the virtualized ICP when implementing the H_IPI hcall (Set_MFFR and related states): 1. The old code wipes out any pending interrupts when the new MFRR is more favored than the CPPR but

[PULL 07/18] KVM: PPC: Book3S HV: ptes are big endian

2014-12-17 Thread Alexander Graf
From: Cédric Le Goater c...@fr.ibm.com When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg8.html

[PULL 08/18] KVM: PPC: Book3S HV: Check wait conditions before sleeping in kvmppc_vcore_blocked

2014-12-17 Thread Alexander Graf
From: Suresh E. Warrier warr...@linux.vnet.ibm.com The kvmppc_vcore_blocked() code does not check for the wait condition after putting the process on the wait queue. This means that it is possible for an external interrupt to become pending, but the vcpu to remain asleep until the next

[PULL 10/18] arch: powerpc: kvm: book3s.c: Remove some unused functions

2014-12-17 Thread Alexander Graf
From: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se Removes some functions that are not used anywhere: kvmppc_core_load_guest_debugstate() kvmppc_core_load_host_debugstate() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard

[PULL 18/18] KVM: PPC: Book3S: Enable in-kernel XICS emulation by default

2014-12-17 Thread Alexander Graf
From: Anton Blanchard an...@samba.org The in-kernel XICS emulation is faster than doing it all in QEMU and it has got a lot of testing, so enable it by default. Signed-off-by: Anton Blanchard an...@samba.org Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Alexander Graf

[PULL 12/18] arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function

2014-12-17 Thread Alexander Graf
From: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se Remove the function inst_set_field() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se

[PULL 02/18] KVM: PPC: Book3S HV: Add missing HPTE unlock

2014-12-17 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com In kvm_test_clear_dirty(), if we find an invalid HPTE we move on to the next HPTE without unlocking the invalid one. In fact we should never find an invalid and unlocked HPTE in the rmap chain, but for robustness we should unlock it. This

[PULL 04/18] KVM: PPC: Book3S HV: Fix an issue where guest is paused on receiving HMI

2014-12-17 Thread Alexander Graf
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com When we get an HMI (hypervisor maintenance interrupt) while in a guest, we see that guest enters into paused state. The reason is, in kvmppc_handle_exit_hv it falls through default path and returns to host instead of resuming guest. This causes

[PULL 13/18] KVM: PPC: Book3S HV: Simplify locking around stolen time calculations

2014-12-17 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently the calculations of stolen time for PPC Book3S HV guests uses fields in both the vcpu struct and the kvmppc_vcore struct. The fields in the kvmppc_vcore struct are protected by the vcpu-arch.tbacct_lock of the vcpu that has taken responsibility for

[PULL 05/18] KVM: PPC: Book3S HV: Fix KSM memory corruption

2014-12-17 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Testing with KSM active in the host showed occasional corruption of guest memory. Typically a page that should have contained zeroes would contain values that look like the contents of a user process stack (values such as 0x_3fff__xxx). Code

[PULL 17/18] KVM: PPC: Book3S HV: Improve H_CONFER implementation

2014-12-17 Thread Alexander Graf
From: Sam Bobroff sam.bobr...@au1.ibm.com Currently the H_CONFER hcall is implemented in kernel virtual mode, meaning that whenever a guest thread does an H_CONFER, all the threads in that virtual core have to exit the guest. This is bad for performance because it interrupts the other threads

[PULL 11/18] arch: powerpc: kvm: book3s_pr.c: Remove unused function

2014-12-17 Thread Alexander Graf
From: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se Remove the function get_fpr_index() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se

[PULL 09/18] arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function

2014-12-17 Thread Alexander Graf
From: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se Remove the function sr_nx() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se Signed-off-by:

[PULL 15/18] KVM: PPC: Book3S HV: Remove code for PPC970 processors

2014-12-17 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This removes the code that was added to enable HV KVM to work on PPC970 processors. The PPC970 is an old CPU that doesn't support virtualizing guest memory. Removing PPC970 support also lets us remove the code for allocating and managing contiguous

[PULL 16/18] KVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register

2014-12-17 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org There are two ways in which a guest instruction can be obtained from the guest in the guest exit code in book3s_hv_rmhandlers.S. If the exit was caused by a Hypervisor Emulation interrupt (i.e. an illegal instruction), the offending instruction is in the

[PULL 00/18] ppc patch queue 2014-12-18

2014-12-17 Thread Alexander Graf
Hi Paolo, This is my current patch queue for ppc. Please pull. After the merge with Linus' tree, e500v2 compilation will be broken because commit 69111bac42f5 broke it upstream. Could you please take care to apply the fix I CC'ed you on for it? Thanks! Alex The following changes since

[PULL 14/18] KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

2014-12-17 Thread Alexander Graf
From: Suresh E. Warrier warr...@linux.vnet.ibm.com This patch adds trace points in the guest entry and exit code and also for exceptions handled by the host in kernel mode - hypercalls and page faults. The new events are added to /sys/kernel/debug/tracing/events under a new subsystem called