ppc patch queue 2015-08-22
Subsystems (3)
Hi Paolo,
This is my current patch queue for ppc. Please pull.
Alex
The following changes since commit 4d283ec908e617fa28bcb06bce310206f0655d67:
x86/kvm: Rename VMX's segment access rights defines (2015-08-15 00:47:13 +0200)
are available in the git repository at:
git://github.com/agraf/linux-2.6.git tags/signed-kvm-ppc-next
for you to fetch changes up to c63517c2e3810071359af926f621c1f784388c3f:
KVM: PPC: Book3S: correct width in XER handling (2015-08-22 11:16:19 +0200)
----------------------------------------------------------------
Patch queue for ppc - 2015-08-22
Highlights for KVM PPC this time around:
- Book3S: A few bug fixes
- Book3S: Allow micro-threading on POWER8
----------------------------------------------------------------
Paul Mackerras (7):
KVM: PPC: Book3S HV: Make use of unused threads when running guests
KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8
KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE
KVM: PPC: Book3S HV: Fix bug in dirty page tracking
KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD
KVM: PPC: Book3S HV: Fix preempted vcore list locking
KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation
Sam bobroff (1):
KVM: PPC: Book3S: correct width in XER handling
Thomas Huth (2):
KVM: PPC: Remove PPC970 from KVM_BOOK3S_64_HV text in Kconfig
KVM: PPC: Fix warnings from sparse
Tudor Laurentiu (2):
KVM: PPC: fix suspicious use of conditional operator
KVM: PPC: add missing pt_regs initialization
arch/powerpc/include/asm/kvm_book3s.h | 5 +- arch/powerpc/include/asm/kvm_book3s_asm.h | 22 +- arch/powerpc/include/asm/kvm_booke.h | 4 +- arch/powerpc/include/asm/kvm_host.h | 24 +- arch/powerpc/include/asm/ppc-opcode.h | 2 +- arch/powerpc/kernel/asm-offsets.c | 9 + arch/powerpc/kvm/Kconfig | 8 +- arch/powerpc/kvm/book3s.c | 3 +- arch/powerpc/kvm/book3s_32_mmu_host.c | 1 + arch/powerpc/kvm/book3s_64_mmu_host.c | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 +- arch/powerpc/kvm/book3s_emulate.c | 1 + arch/powerpc/kvm/book3s_hv.c | 660 ++++++++++++++++++++++++++---- arch/powerpc/kvm/book3s_hv_builtin.c | 32 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 161 +++++++- arch/powerpc/kvm/book3s_hv_rm_xics.c | 4 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 128 +++++- arch/powerpc/kvm/book3s_paired_singles.c | 2 +- arch/powerpc/kvm/book3s_segment.S | 4 +- arch/powerpc/kvm/booke.c | 1 + arch/powerpc/kvm/e500_mmu.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- 22 files changed, 938 insertions(+), 146 deletions(-)
[PULL 01/12] KVM: PPC: fix suspicious use of conditional operator
From: Tudor Laurentiu <[email protected]>
This was signaled by a static code analysis tool.
--- arch/powerpc/kvm/e500_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/e500_mmu.c +1 -1
@@ -377,7 +377,7 @@ int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, gva_t ea) | MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]); vcpu->arch.shared->mas1 (vcpu->arch.shared->mas6 &MAS6_SPID0 ) - | (vcpu->arch.shared->mas6 & (MAS6_SAS ?MAS1_TS :0 )) + | ((vcpu->arch.shared->mas6 &MAS6_SAS ) ?MAS1_TS :0 ) | (vcpu->arch.shared->mas4 &MAS4_TSIZED (~0 )); vcpu->arch.shared->mas2 &=MAS2_EPN ; vcpu->arch.shared->mas2 |= vcpu->arch.shared->mas4 &
Signature · 1 line
1.8.1.4
[PULL 02/12] KVM: PPC: Remove PPC970 from KVM_BOOK3S_64_HV text in Kconfig
In reply to Alexander GrafFrom: Thomas Huth <[email protected]>
Since the PPC970 support has been removed from the kvm-hv kernel module recently, we should also reflect this change in the help text of the corresponding Kconfig option.
--- arch/powerpc/kvm/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/kvm/Kconfig +4 -4
@@ -74,14 +74,14 @@ config KVM_BOOK3S_64 If unsure, say N. config KVM_BOOK3S_64_HV - tristate "KVM support for POWER7 and PPC970 using hypervisor mode in host" + tristate "KVM for POWER7 and later using hypervisor mode in host" depends on KVM_BOOK3S_64 && PPC_POWERNV select KVM_BOOK3S_HV_POSSIBLE select MMU_NOTIFIER select CMA ---help--- Support running unmodified book3s_64 guest kernels in - virtual machines on POWER7 and PPC970 processors that have + virtual machines on POWER7 and newer processors that have hypervisor mode available to the host. If you say Y here, KVM will use the hardware virtualization
@@ -89,8 +89,8 @@ config KVM_BOOK3S_64_HV guest operating systems will run at full hardware speed using supervisor and user modes. However, this also means that KVM is not usable under PowerVM (pHyp), is only usable - on POWER7 (or later) processors and PPC970-family processors, - and cannot emulate a different processor from the host processor. + on POWER7 or later processors, and cannot emulate a + different processor from the host processor. If unsure, say N.
Signature · 1 line
1.8.1.4
[PULL 03/12] KVM: PPC: Fix warnings from sparse
In reply to Alexander GrafFrom: Thomas Huth <[email protected]>
When compiling the KVM code for POWER with "make C=1", sparse complains about functions missing proper prototypes and a 64-bit constant missing the ULL prefix. Let's fix this by making the functions static or by including the proper header with the prototypes, and by appending a ULL prefix to the constant PPC_MPPE_ADDRESS_MASK.
--- arch/powerpc/include/asm/ppc-opcode.h | 2 +- arch/powerpc/kvm/book3s.c | 3 ++- arch/powerpc/kvm/book3s_32_mmu_host.c | 1 + arch/powerpc/kvm/book3s_64_mmu_host.c | 1 + arch/powerpc/kvm/book3s_emulate.c | 1 + arch/powerpc/kvm/book3s_hv.c | 8 ++++---- arch/powerpc/kvm/book3s_paired_singles.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-)
arch/powerpc/include/asm/ppc-opcode.h +1 -1
@@ -287,7 +287,7 @@/* POWER8 Micro Partition Prefetch (MPP) parameters */ /* Address mask is common for LOGMPP instruction and MPPR SPR */ -#define PPC_MPPE_ADDRESS_MASK 0xffffffffc000 +#define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL/* Bits 60 and 61 of MPP SPR should be set to one of the following */ /* Aborting the fetch is indeed setting 00 in the table size bits */
arch/powerpc/kvm/book3s.c +2 -1
@@ -240,7 +240,8 @@ void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, ulong flags)kvmppc_book3s_queue_irqprio (vcpu,BOOK3S_INTERRUPT_INST_STORAGE ); } -int kvmppc_book3s_irqprio_deliver (struct kvm_vcpu *vcpu,unsigned int priority) +static int kvmppc_book3s_irqprio_deliver (struct kvm_vcpu *vcpu, +unsigned int priority) {int deliver =1 ;int vec =0 ;
arch/powerpc/kvm/book3s_32_mmu_host.c +1 -0
@@ -26,6 +26,7 @@#include <asm/machdep.h> #include <asm/mmu_context.h> #include <asm/hw_irq.h> +#include "book3s.h" /* #define DEBUG_MMU */ /* #define DEBUG_SR */
arch/powerpc/kvm/book3s_64_mmu_host.c +1 -0
@@ -28,6 +28,7 @@#include <asm/mmu_context.h> #include <asm/hw_irq.h> #include "trace_pr.h" +#include "book3s.h" #define PTE_SIZE 12
arch/powerpc/kvm/book3s_emulate.c +1 -0
@@ -23,6 +23,7 @@#include <asm/reg.h> #include <asm/switch_to.h> #include <asm/time.h> +#include "book3s.h" #define OP_19_XOP_RFID 18#define OP_19_XOP_RFI 50
arch/powerpc/kvm/book3s_hv.c +4 -4
@@ -214,12 +214,12 @@ static void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr)kvmppc_end_cede (vcpu); } -void kvmppc_set_pvr_hv (struct kvm_vcpu *vcpu,u32 pvr) +static void kvmppc_set_pvr_hv (struct kvm_vcpu *vcpu,u32 pvr) { vcpu->arch.pvr = pvr; } -int kvmppc_set_arch_compat (struct kvm_vcpu *vcpu,u32 arch_compat) +static int kvmppc_set_arch_compat (struct kvm_vcpu *vcpu,u32 arch_compat) {unsigned long pcr =0 ;struct kvmppc_vcore *vc = vcpu->arch.vcore;
@@ -259,7 +259,7 @@ int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)return 0 ; } -void kvmppc_dump_regs (struct kvm_vcpu *vcpu) +static void kvmppc_dump_regs (struct kvm_vcpu *vcpu) {int r;
@@ -292,7 +292,7 @@ void kvmppc_dump_regs(struct kvm_vcpu *vcpu) vcpu->arch.last_inst); } -struct kvm_vcpu *kvmppc_find_vcpu (struct kvm *kvm,int id) +static struct kvm_vcpu *kvmppc_find_vcpu (struct kvm *kvm,int id) {int r;struct kvm_vcpu *v, *ret =NULL ;
arch/powerpc/kvm/book3s_paired_singles.c +1 -1
@@ -352,7 +352,7 @@ static inline u32 inst_get_field(u32 inst, int msb, int lsb)return kvmppc_get_field (inst, msb +32 , lsb +32 ); } -bool kvmppc_inst_is_paired_single (struct kvm_vcpu *vcpu,u32 inst) +static bool kvmppc_inst_is_paired_single (struct kvm_vcpu *vcpu,u32 inst) {if (!(vcpu->arch.hflags &BOOK3S_HFLAG_PAIRED_SINGLE ))return false;
arch/powerpc/kvm/powerpc.c +1 -1
@@ -660,7 +660,7 @@ int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)return kvmppc_core_pending_dec (vcpu); } -enum hrtimer_restart kvmppc_decrementer_wakeup (struct hrtimer *timer) +static enum hrtimer_restart kvmppc_decrementer_wakeup (struct hrtimer *timer) {struct kvm_vcpu *vcpu;
Signature · 1 line
1.8.1.4
[PULL 04/12] KVM: PPC: add missing pt_regs initialization
In reply to Alexander GrafFrom: Tudor Laurentiu <[email protected]>
On this switch branch the regs initialization
doesn't happen so add it.
This was found with the help of a static
code analysis tool.
--- arch/powerpc/kvm/booke.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kvm/booke.c +1 -0
@@ -933,6 +933,7 @@ static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,#endif break ;case BOOKE_INTERRUPT_CRITICAL : +kvmppc_fill_pt_regs (®s);unknown_exception (®s);break ;case BOOKE_INTERRUPT_DEBUG :
Signature · 1 line
1.8.1.4
[PULL 05/12] KVM: PPC: Book3S HV: Make use of unused threads when running guests
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
When running a virtual core of a guest that is configured with fewer threads per core than the physical cores have, the extra physical threads are currently unused. This makes it possible to use them to run one or more other virtual cores from the same guest when certain conditions are met. This applies on POWER7, and on POWER8 to guests with one thread per virtual core. (It doesn't apply to POWER8 guests with multiple threads per vcore because they require a 1-1 virtual to physical thread mapping in order to be able to use msgsndp and the TIR.)
The idea is that we maintain a list of preempted vcores for each physical cpu (i.e. each core, since the host runs single-threaded). Then, when a vcore is about to run, it checks to see if there are any vcores on the list for its physical cpu that could be piggybacked onto this vcore's execution. If so, those additional vcores are put into state VCORE_PIGGYBACK and their runnable VCPU threads are started as well as the original vcore, which is called the master vcore.
After the vcores have exited the guest, the extra ones are put back onto the preempted list if any of their VCPUs are still runnable and not idle.
This means that vcpu->arch.ptid is no longer necessarily the same as the physical thread that the vcpu runs on. In order to make it easier for code that wants to send an IPI to know which CPU to target, we now store that in a new field in struct vcpu_arch, called thread_cpu.
--- arch/powerpc/include/asm/kvm_host.h | 19 +- arch/powerpc/kernel/asm-offsets.c | 2 + arch/powerpc/kvm/book3s_hv.c | 333 ++++++++++++++++++++++++++------ arch/powerpc/kvm/book3s_hv_builtin.c | 7 +- arch/powerpc/kvm/book3s_hv_rm_xics.c | 4 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 5 + 6 files changed, 298 insertions(+), 72 deletions(-)
arch/powerpc/include/asm/kvm_host.h +14 -5
@@ -278,7 +278,9 @@ struct kvmppc_vcore {u16 last_cpu;u8 vcore_state;u8 in_guest; +struct kvmppc_vcore *master_vcore;struct list_head runnable_threads; +struct list_head preempt_list;spinlock_t lock;wait_queue_head_t wq;spinlock_t stoltb_lock;/* protects stolen_tb and preempt_tb */
@@ -300,12 +302,18 @@ struct kvmppc_vcore {#define VCORE_EXIT_MAP (vc) ((vc)->entry_exit_map >> 8)#define VCORE_IS_EXITING (vc) (VCORE_EXIT_MAP(vc) != 0) -/* Values for vcore_state */ +/* +* Values for vcore_state. +* Note that these are arranged such that lower values +* (< VCORE_SLEEPING) don't require stolen time accounting +* on load/unload, and higher values do. +*/ #define VCORE_INACTIVE 0 -#define VCORE_SLEEPING 1 -#define VCORE_PREEMPT 2 -#define VCORE_RUNNING 3 -#define VCORE_EXITING 4 +#define VCORE_PREEMPT 1 +#define VCORE_PIGGYBACK 2 +#define VCORE_SLEEPING 3 +#define VCORE_RUNNING 4 +#define VCORE_EXITING 5/* * Struct used to manage memory for a virtual processor area
@@ -619,6 +627,7 @@ struct kvm_vcpu_arch {int trap;int state;int ptid; +int thread_cpu;bool timer_running;wait_queue_head_t cpu_run;
arch/powerpc/kernel/asm-offsets.c +2 -0
@@ -512,6 +512,8 @@ int main(void) DEFINE(VCPU_VPA, offsetof(struct kvm_vcpu, arch.vpa.pinned_addr)); DEFINE(VCPU_VPA_DIRTY, offsetof(struct kvm_vcpu, arch.vpa.dirty)); DEFINE(VCPU_HEIR, offsetof(struct kvm_vcpu, arch.emul_inst)); +DEFINE (VCPU_CPU , offsetof(struct kvm_vcpu , cpu)); + DEFINE(VCPU_THREAD_CPU, offsetof(struct kvm_vcpu, arch.thread_cpu));#endif #ifdef CONFIG_PPC_BOOK3S DEFINE (VCPU_VCPUID , offsetof(struct kvm_vcpu , vcpu_id));
arch/powerpc/kvm/book3s_hv.c +272 -61
521 lines not on this page · raw message
arch/powerpc/kvm/book3s_hv_builtin.c +4 -3
@@ -110,14 +110,15 @@ void __init kvm_cma_reserve(void)long int kvmppc_rm_h_confer (struct kvm_vcpu *vcpu,int target,unsigned int yield_count) { -struct kvmppc_vcore *vc = vcpu->arch.vcore; +struct kvmppc_vcore *vc = local_paca->kvm_hstate.kvm_vcore; +int ptid = local_paca->kvm_hstate.ptid;int threads_running;int threads_ceded;int threads_conferring;u64 stop =get_tb () +10 * tb_ticks_per_usec;int rv =H_SUCCESS ;/* => don't yield */ -set_bit (vcpu->arch.ptid, &vc->conferring_threads); +set_bit (ptid, &vc->conferring_threads);while ((get_tb () < stop) && !VCORE_IS_EXITING (vc)) { threads_running =VCORE_ENTRY_MAP (vc); threads_ceded = vc->napping_threads;
@@ -127,7 +128,7 @@ long int kvmppc_rm_h_confer(struct kvm_vcpu *vcpu, int target,break ; } } -clear_bit (vcpu->arch.ptid, &vc->conferring_threads); +clear_bit (ptid, &vc->conferring_threads);return rv; }
arch/powerpc/kvm/book3s_hv_rm_xics.c +1 -3
@@ -67,14 +67,12 @@ static void icp_rm_set_vcpu_irq(struct kvm_vcpu *vcpu, }/* Check if the core is loaded, if not, too hard */ - cpu = vcpu->cpu; + cpu = vcpu->arch.thread_cpu;if (cpu <0 || cpu >= nr_cpu_ids) { this_icp->rm_action |=XICS_RM_KICK_VCPU ; this_icp->rm_kick_target = vcpu;return ; } -/* In SMT cpu will always point to thread 0, we adjust it */ - cpu += vcpu->arch.ptid;smp_mb ();kvmhv_rm_send_ipi (cpu);
arch/powerpc/kvm/book3s_hv_rmhandlers.S +5 -0
@@ -1176,6 +1176,11 @@ mc_cont: ld r9, HSTATE_KVM_VCPU(r13) lwz r12, VCPU_TRAP(r9) + /* Stop others sending VCPU interrupts to this physical CPU */ + li r0, -1 + stw r0, VCPU_CPU(r9) + stw r0, VCPU_THREAD_CPU(r9) + /* Save guest CTRL register, set runlatch to 1 */ mfspr r6,SPRN_CTRLF stw r6,VCPU_CTRL(r9)
Signature · 1 line
1.8.1.4
[PULL 06/12] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
This builds on the ability to run more than one vcore on a physical core by using the micro-threading (split-core) modes of the POWER8 chip. Previously, only vcores from the same VM could be run together, and (on POWER8) only if they had just one thread per core. With the ability to split the core on guest entry and unsplit it on guest exit, we can run up to 8 vcpu threads from up to 4 different VMs, and we can run multiple vcores with 2 or 4 vcpus per vcore.
Dynamic micro-threading is only available if the static configuration of the cores is whole-core mode (unsplit), and only on POWER8.
To manage this, we introduce a new kvm_split_mode struct which is shared across all of the subcores in the core, with a pointer in the paca on each thread. In addition we extend the core_info struct to have information on each subcore. When deciding whether to add a vcore to the set already on the core, we now have two possibilities:
(a) piggyback the vcore onto an existing subcore, or (b) start a new subcore.
Currently, when any vcpu needs to exit the guest and switch to host virtual mode, we interrupt all the threads in all subcores and switch the core back to whole-core mode. It may be possible in future to allow some of the subcores to keep executing in the guest while subcore 0 switches to the host, but that is not implemented in this patch.
This adds a module parameter called dynamic_mt_modes which controls which micro-threading (split-core) modes the code will consider, as a bitmap. In other words, if it is 0, no micro-threading mode is considered; if it is 2, only 2-way micro-threading is considered; if it is 4, only 4-way, and if it is 6, both 2-way and 4-way micro-threading mode will be considered. The default is 6.
With this, we now have secondary threads which are the primary thread for their subcore and therefore need to do the MMU switch. These threads will need to be started even if they have no vcpu to run, so we use the vcore pointer in the PACA rather than the vcpu pointer to trigger them.
It is now possible for thread 0 to find that an exit has been requested before it gets to switch the subcore state to the guest. In that case we haven't added the guest's timebase offset to the timebase, so we need to be careful not to subtract the offset in the guest exit path. In fact we just skip the whole path that switches back to host context, since we haven't switched to the guest context.
--- arch/powerpc/include/asm/kvm_book3s_asm.h | 20 ++ arch/powerpc/include/asm/kvm_host.h | 3 + arch/powerpc/kernel/asm-offsets.c | 7 + arch/powerpc/kvm/book3s_hv.c | 367 ++++++++++++++++++++++++++---- arch/powerpc/kvm/book3s_hv_builtin.c | 25 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 113 +++++++-- 6 files changed, 473 insertions(+), 62 deletions(-)
arch/powerpc/include/asm/kvm_book3s_asm.h +20 -0
@@ -25,6 +25,12 @@#define XICS_MFRR 0xc#define XICS_IPI 2/* interrupt source # for IPIs */ +/* Maximum number of threads per physical core */ +#define MAX_SMT_THREADS 8 + +/* Maximum number of subcores per physical core */ +#define MAX_SUBCORES 4 +#ifdef __ASSEMBLY__#ifdef CONFIG_KVM_BOOK3S_HANDLER
@@ -65,6 +71,19 @@ kvmppc_resume_\intno:#else /*__ASSEMBLY__ */ +struct kvmppc_vcore ; + +/* Struct used for coordinating micro-threading (split-core) mode changes */ +struct kvm_split_mode { +unsigned long rpr; +unsigned long pmmar; +unsigned long ldbar; +u8 subcore_size; +u8 do_nap; +u8 napped[MAX_SMT_THREADS ]; +struct kvmppc_vcore *master_vcs[MAX_SUBCORES ]; +}; +/* * This struct goes in the PACA on 64-bit processors. It is used * to store host state that needs to be saved when we enter a guest
@@ -100,6 +119,7 @@ struct kvmppc_host_state {u64 host_spurr;u64 host_dscr;u64 dec_expires; +struct kvm_split_mode *kvm_split_mode;#endif #ifdef CONFIG_PPC_BOOK3S_64 u64 cfar;
arch/powerpc/include/asm/kvm_host.h +3 -0
@@ -302,6 +302,9 @@ struct kvmppc_vcore {#define VCORE_EXIT_MAP (vc) ((vc)->entry_exit_map >> 8)#define VCORE_IS_EXITING (vc) (VCORE_EXIT_MAP(vc) != 0) +/* This bit is used when a vcore exit is triggered from outside the vcore */ +#define VCORE_EXIT_REQ 0x10000 +/* * Values for vcore_state. * Note that these are arranged such that lower values
arch/powerpc/kernel/asm-offsets.c +7 -0
@@ -676,7 +676,14 @@ int main(void)HSTATE_FIELD (HSTATE_DSCR , host_dscr);HSTATE_FIELD (HSTATE_DABR , dabr);HSTATE_FIELD (HSTATE_DECEXP , dec_expires); +HSTATE_FIELD (HSTATE_SPLIT_MODE , kvm_split_mode);DEFINE (IPI_PRIORITY ,IPI_PRIORITY ); +DEFINE (KVM_SPLIT_RPR , offsetof(struct kvm_split_mode , rpr)); +DEFINE (KVM_SPLIT_PMMAR , offsetof(struct kvm_split_mode , pmmar)); +DEFINE (KVM_SPLIT_LDBAR , offsetof(struct kvm_split_mode , ldbar)); +DEFINE (KVM_SPLIT_SIZE , offsetof(struct kvm_split_mode , subcore_size)); +DEFINE (KVM_SPLIT_DO_NAP , offsetof(struct kvm_split_mode , do_nap)); +DEFINE (KVM_SPLIT_NAPPED , offsetof(struct kvm_split_mode , napped));#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */ #ifdef CONFIG_PPC_BOOK3S_64
arch/powerpc/kvm/book3s_hv.c +320 -46
493 lines not on this page · raw message
arch/powerpc/kvm/book3s_hv_builtin.c +24 -1
@@ -239,7 +239,8 @@ void kvmhv_commence_exit(int trap) {struct kvmppc_vcore *vc = local_paca->kvm_hstate.kvm_vcore;int ptid = local_paca->kvm_hstate.ptid; -int me, ee; +struct kvm_split_mode *sip = local_paca->kvm_hstate.kvm_split_mode; +int me, ee, i;/* Set our bit in the threads-exiting-guest map in the 0xff00 bits of vcore->entry_exit_map */
@@ -259,4 +260,26 @@ void kvmhv_commence_exit(int trap)*/ if (trap !=BOOK3S_INTERRUPT_HV_DECREMENTER )kvmhv_interrupt_vcore (vc, ee & ~(1 << ptid)); + +/* +* If we are doing dynamic micro-threading, interrupt the other +* subcores to pull them out of their guests too. +*/ +if (!sip) +return ; + +for (i =0 ; i <MAX_SUBCORES ; ++i) { + vc = sip->master_vcs[i]; +if (!vc) +break ; +do { + ee = vc->entry_exit_map; +/* Already asked to exit? */ +if ((ee >>8 ) !=0 ) +break ; + }while (cmpxchg (&vc->entry_exit_map, ee, + ee |VCORE_EXIT_REQ ) != ee); +if ((ee >>8 ) =0 ) +kvmhv_interrupt_vcore (vc, ee); + } }
arch/powerpc/kvm/book3s_hv_rmhandlers.S +98 -15
193 lines not on this page · raw message
Signature · 1 line
1.8.1.4
[PULL 07/12] KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
The reference (R) and change (C) bits in a HPT entry can be set by hardware at any time up until the HPTE is invalidated and the TLB invalidation sequence has completed. This means that when removing a HPTE, we need to read the HPTE after the invalidation sequence has completed in order to obtain reliable values of R and C. The code in kvmppc_do_h_remove() used to do this. However, commit 6f22bd3265fb ("KVM: PPC: Book3S HV: Make HTAB code LE host aware") removed the read after invalidation as a side effect of other changes. This restores the read of the HPTE after invalidation.
The user-visible effect of this bug would be that when migrating a guest, there is a small probability that a page modified by the guest and then unmapped by the guest might not get re-transmitted and thus the destination might end up with a stale copy of the page.
--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
arch/powerpc/kvm/book3s_hv_rm_mmu.c +12 -6
@@ -421,14 +421,20 @@ long kvmppc_do_h_remove(struct kvm *kvm, unsigned long flags, rev =real_vmalloc_addr (&kvm->arch.revmap[pte_index]); v = pte & ~HPTE_V_HVLOCK ;if (v &HPTE_V_VALID ) { -u64 pte1; - - pte1 =be64_to_cpu (hpte[1 ]); hpte[0 ] &= ~cpu_to_be64 (HPTE_V_VALID ); - rb =compute_tlbie_rb (v, pte1, pte_index); + rb =compute_tlbie_rb (v,be64_to_cpu (hpte[1 ]), pte_index);do_tlbies (kvm, &rb,1 ,global_invalidates (kvm, flags), true); -/* Read PTE low word after tlbie to get final R/C values */ -remove_revmap_chain (kvm, pte_index, rev, v, pte1); +/* +* The reference (R) and change (C) bits in a HPT +* entry can be set by hardware at any time up until +* the HPTE is invalidated and the TLB invalidation +* sequence has completed. This means that when +* removing a HPTE, we need to re-read the HPTE after +* the invalidation sequence has completed in order to +* obtain reliable values of R and C. +*/ +remove_revmap_chain (kvm, pte_index, rev, v, +be64_to_cpu (hpte[1 ])); } r = rev->guest_rpte & ~HPTE_GR_RESERVED ;note_hpte_modification (kvm, rev);
Signature · 1 line
1.8.1.4
[PULL 08/12] KVM: PPC: Book3S HV: Fix bug in dirty page tracking
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
This fixes a bug in the tracking of pages that get modified by the guest. If the guest creates a large-page HPTE, writes to memory somewhere within the large page, and then removes the HPTE, we only record the modified state for the first normal page within the large page, when in fact the guest might have modified some other normal page within the large page.
To fix this we use some unused bits in the rmap entry to record the order (log base 2) of the size of the page that was modified, when removing an HPTE. Then in kvm_test_clear_dirty_npages() we use that order to return the correct number of modified pages.
The same thing could in principle happen when removing a HPTE at the host's request, i.e. when paging out a page, except that we never page out large pages, and the guest can only create large-page HPTEs if the guest RAM is backed by large pages. However, we also fix this case for the sake of future-proofing.
The reference bit is also subject to the same loss of information. We don't make the same fix here for the reference bit because there isn't an interface for userspace to find out which pages the guest has referenced, whereas there is one for userspace to find out which pages the guest has modified. Because of this loss of information, the kvm_age_hva_hv() and kvm_test_age_hva_hv() functions might incorrectly say that a page has not been referenced when it has, but that doesn't matter greatly because we never page or swap out large pages.
--- arch/powerpc/include/asm/kvm_book3s.h | 1 + arch/powerpc/include/asm/kvm_host.h | 2 ++ arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 +++++++- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/kvm_book3s.h +1 -0
@@ -158,6 +158,7 @@ extern pfn_t kvmppc_gpa_to_pfn(struct kvm_vcpu *vcpu, gpa_t gpa, bool writing, bool *writable);extern void kvmppc_add_revmap_chain (struct kvm *kvm,struct revmap_entry *rev,unsigned long *rmap,long pte_index,int realmode); +extern void kvmppc_update_rmap_change (unsigned long *rmap,unsigned long psize);extern void kvmppc_invalidate_hpte (struct kvm *kvm,__be64 *hptep,unsigned long pte_index); void kvmppc_clear_ref_hpte(struct kvm *kvm, __be64 *hptep,
arch/powerpc/include/asm/kvm_host.h +2 -0
@@ -205,8 +205,10 @@ struct revmap_entry {*/ #define KVMPPC_RMAP_LOCK_BIT 63#define KVMPPC_RMAP_RC_SHIFT 32 +#define KVMPPC_RMAP_CHG_SHIFT 48#define KVMPPC_RMAP_REFERENCED (HPTE_R_R << KVMPPC_RMAP_RC_SHIFT)#define KVMPPC_RMAP_CHANGED (HPTE_R_C << KVMPPC_RMAP_RC_SHIFT) +#define KVMPPC_RMAP_CHG_ORDER (0x3ful << KVMPPC_RMAP_CHG_SHIFT)#define KVMPPC_RMAP_PRESENT 0x100000000ul#define KVMPPC_RMAP_INDEX 0xfffffffful
arch/powerpc/kvm/book3s_64_mmu_hv.c +7 -1
@@ -761,6 +761,8 @@ static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp,/* Harvest R and C */ rcbits =be64_to_cpu (hptep[1 ]) & (HPTE_R_R |HPTE_R_C ); *rmapp |= rcbits <<KVMPPC_RMAP_RC_SHIFT ; +if (rcbits &HPTE_R_C ) +kvmppc_update_rmap_change (rmapp, psize);if (rcbits & ~rev[i].guest_rpte) { rev[i].guest_rpte = ptel | rcbits;note_hpte_modification (kvm, &rev[i]);
@@ -927,8 +929,12 @@ static int kvm_test_clear_dirty_npages(struct kvm *kvm, unsigned long *rmapp) retry:lock_rmap (rmapp);if (*rmapp &KVMPPC_RMAP_CHANGED ) { - *rmapp &= ~KVMPPC_RMAP_CHANGED ; +long change_order = (*rmapp &KVMPPC_RMAP_CHG_ORDER ) + >>KVMPPC_RMAP_CHG_SHIFT ; + *rmapp &= ~(KVMPPC_RMAP_CHANGED |KVMPPC_RMAP_CHG_ORDER ); npages_dirty =1 ; +if (change_order >PAGE_SHIFT ) + npages_dirty =1ul << (change_order -PAGE_SHIFT ); }if (!(*rmapp &KVMPPC_RMAP_PRESENT )) {unlock_rmap (rmapp);
arch/powerpc/kvm/book3s_hv_rm_mmu.c +17 -0
@@ -12,6 +12,7 @@#include <linux/kvm_host.h> #include <linux/hugetlb.h> #include <linux/module.h> +#include <linux/log2.h> #include <asm/tlbflush.h> #include <asm/kvm_ppc.h>
@@ -97,6 +98,20 @@ void kvmppc_add_revmap_chain(struct kvm *kvm, struct revmap_entry *rev, }EXPORT_SYMBOL_GPL (kvmppc_add_revmap_chain); +/* Update the changed page order field of an rmap entry */ +void kvmppc_update_rmap_change (unsigned long *rmap,unsigned long psize) +{ +unsigned long order; + +if (!psize) +return ; + order =ilog2 (psize); + order <<=KVMPPC_RMAP_CHG_SHIFT ; +if (order > (*rmap &KVMPPC_RMAP_CHG_ORDER )) + *rmap = (*rmap & ~KVMPPC_RMAP_CHG_ORDER ) | order; +} +EXPORT_SYMBOL_GPL (kvmppc_update_rmap_change); +/* Remove this HPTE from the chain for a real page */ static void remove_revmap_chain(struct kvm *kvm, long pte_index, struct revmap_entry *rev,
@@ -131,6 +146,8 @@ static void remove_revmap_chain(struct kvm *kvm, long pte_index, *rmap = (*rmap & ~KVMPPC_RMAP_INDEX ) | head; } *rmap |= rcbits <<KVMPPC_RMAP_RC_SHIFT ; +if (rcbits &HPTE_R_C ) +kvmppc_update_rmap_change (rmap,hpte_page_size (hpte_v, hpte_r));unlock_rmap (rmap); }
Signature · 1 line
1.8.1.4
[PULL 09/12] KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
This adds implementations for the H_CLEAR_REF (test and clear reference bit) and H_CLEAR_MOD (test and clear changed bit) hypercalls.
When clearing the reference or change bit in the guest view of the HPTE, we also have to clear it in the real HPTE so that we can detect future references or changes. When we do so, we transfer the R or C bit value to the rmap entry for the underlying host page so that kvm_age_hva_hv(), kvm_test_age_hva_hv() and kvmppc_hv_get_dirty_log() know that the page has been referenced and/or changed.
These hypercalls are not used by Linux guests. These implementations have been tested using a FreeBSD guest.
--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 126 ++++++++++++++++++++++++++++++-- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 +- 2 files changed, 121 insertions(+), 9 deletions(-)
arch/powerpc/kvm/book3s_hv_rm_mmu.c +119 -7
@@ -112,25 +112,38 @@ void kvmppc_update_rmap_change(unsigned long *rmap, unsigned long psize) }EXPORT_SYMBOL_GPL (kvmppc_update_rmap_change); +/* Returns a pointer to the revmap entry for the page mapped by a HPTE */ +static unsigned long *revmap_for_hpte (struct kvm *kvm,unsigned long hpte_v, +unsigned long hpte_gr) +{ +struct kvm_memory_slot *memslot; +unsigned long *rmap; +unsigned long gfn; + + gfn =hpte_rpn (hpte_gr,hpte_page_size (hpte_v, hpte_gr)); + memslot =__gfn_to_memslot (kvm_memslots_raw (kvm), gfn); +if (!memslot) +return NULL ; + + rmap =real_vmalloc_addr (&memslot->arch.rmap[gfn - memslot->base_gfn]); +return rmap; +} +/* Remove this HPTE from the chain for a real page */ static void remove_revmap_chain (struct kvm *kvm,long pte_index,struct revmap_entry *rev,unsigned long hpte_v,unsigned long hpte_r) {struct revmap_entry *next, *prev; -unsigned long gfn, ptel, head; -struct kvm_memory_slot *memslot; +unsigned long ptel, head;unsigned long *rmap;unsigned long rcbits; rcbits = hpte_r & (HPTE_R_R |HPTE_R_C ); ptel = rev->guest_rpte |= rcbits; - gfn =hpte_rpn (ptel,hpte_page_size (hpte_v, ptel)); - memslot =__gfn_to_memslot (kvm_memslots_raw (kvm), gfn); -if (!memslot) + rmap =revmap_for_hpte (kvm, hpte_v, ptel); +if (!rmap)return ; - - rmap =real_vmalloc_addr (&memslot->arch.rmap[gfn - memslot->base_gfn]);lock_rmap (rmap); head = *rmap &KVMPPC_RMAP_INDEX ;
@@ -678,6 +691,105 @@ long kvmppc_h_read(struct kvm_vcpu *vcpu, unsigned long flags,return H_SUCCESS ; } +long kvmppc_h_clear_ref (struct kvm_vcpu *vcpu,unsigned long flags, +unsigned long pte_index) +{ +struct kvm *kvm = vcpu->kvm; +__be64 *hpte; +unsigned long v, r, gr; +struct revmap_entry *rev; +unsigned long *rmap; +long ret =H_NOT_FOUND ; + +if (pte_index >= kvm->arch.hpt_npte) +return H_PARAMETER ; + + rev =real_vmalloc_addr (&kvm->arch.revmap[pte_index]); + hpte = (__be64 *)(kvm->arch.hpt_virt + (pte_index <<4 )); +while (!try_lock_hpte (hpte,HPTE_V_HVLOCK )) +cpu_relax (); + v =be64_to_cpu (hpte[0 ]); + r =be64_to_cpu (hpte[1 ]); +if (!(v & (HPTE_V_VALID |HPTE_V_ABSENT ))) + goto out; + + gr = rev->guest_rpte; +if (rev->guest_rpte &HPTE_R_R ) { + rev->guest_rpte &= ~HPTE_R_R ; +note_hpte_modification (kvm, rev); + } +if (v &HPTE_V_VALID ) { + gr |= r & (HPTE_R_R |HPTE_R_C ); +if (r &HPTE_R_R ) { +kvmppc_clear_ref_hpte (kvm, hpte, pte_index); + rmap =revmap_for_hpte (kvm, v, gr); +if (rmap) { +lock_rmap (rmap); + *rmap |=KVMPPC_RMAP_REFERENCED ; +unlock_rmap (rmap); + } + } + } + vcpu->arch.gpr[4 ] = gr; + ret =H_SUCCESS ; + out: +unlock_hpte (hpte, v & ~HPTE_V_HVLOCK ); +return ret; +} + +long kvmppc_h_clear_mod (struct kvm_vcpu *vcpu,unsigned long flags, +unsigned long pte_index) +{ +struct kvm *kvm = vcpu->kvm; +__be64 *hpte; +unsigned long v, r, gr; +struct revmap_entry *rev; +unsigned long *rmap; +long ret =H_NOT_FOUND ; + +if (pte_index >= kvm->arch.hpt_npte) +return H_PARAMETER ; + + rev =real_vmalloc_addr (&kvm->arch.revmap[pte_index]); + hpte = (__be64 *)(kvm->arch.hpt_virt + (pte_index <<4 )); +while (!try_lock_hpte (hpte,HPTE_V_HVLOCK )) +cpu_relax (); + v =be64_to_cpu (hpte[0 ]); + r =be64_to_cpu (hpte[1 ]); +if (!(v & (HPTE_V_VALID |HPTE_V_ABSENT ))) + goto out; + + gr = rev->guest_rpte; +if (gr &HPTE_R_C ) { + rev->guest_rpte &= ~HPTE_R_C ; +note_hpte_modification (kvm, rev); + } +if (v &HPTE_V_VALID ) { +/* need to make it temporarily absent so C is stable */ + hpte[0 ] |=cpu_to_be64 (HPTE_V_ABSENT ); +kvmppc_invalidate_hpte (kvm, hpte, pte_index); + r =be64_to_cpu (hpte[1 ]); + gr |= r & (HPTE_R_R |HPTE_R_C ); +if (r &HPTE_R_C ) { +unsigned long psize =hpte_page_size (v, r); + hpte[1 ] =cpu_to_be64 (r & ~HPTE_R_C ); +eieio (); + rmap =revmap_for_hpte (kvm, v, gr); +if (rmap) { +lock_rmap (rmap); + *rmap |=KVMPPC_RMAP_CHANGED ; +kvmppc_update_rmap_change (rmap, psize); +unlock_rmap (rmap); + } + } + } + vcpu->arch.gpr[4 ] = gr; + ret =H_SUCCESS ; + out: +unlock_hpte (hpte, v & ~HPTE_V_HVLOCK ); +return ret; +} +void kvmppc_invalidate_hpte (struct kvm *kvm,__be64 *hptep,unsigned long pte_index) {
arch/powerpc/kvm/book3s_hv_rmhandlers.S +2 -2
@@ -1904,8 +1904,8 @@ hcall_real_table: .long DOTSYM(kvmppc_h_remove) - hcall_real_table .long DOTSYM(kvmppc_h_enter) - hcall_real_table .long DOTSYM(kvmppc_h_read) - hcall_real_table - .long 0 /* 0x10 - H_CLEAR_MOD */ - .long 0 /* 0x14 - H_CLEAR_REF */ + .long DOTSYM(kvmppc_h_clear_mod) - hcall_real_table + .long DOTSYM(kvmppc_h_clear_ref) - hcall_real_table .long DOTSYM(kvmppc_h_protect) - hcall_real_table .long DOTSYM(kvmppc_h_get_tce) - hcall_real_table .long DOTSYM(kvmppc_h_put_tce) - hcall_real_table
Signature · 1 line
1.8.1.4
[PULL 10/12] KVM: PPC: Book3S HV: Fix preempted vcore list locking
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
When a vcore gets preempted, we put it on the preempted vcore list for the current CPU. The runner task then calls schedule() and comes back some time later and takes itself off the list. We need to be careful to lock the list that it was put onto, which may not be the list for the current CPU since the runner task may have moved to another CPU.
--- arch/powerpc/kvm/book3s_hv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv.c +2 -1
@@ -1962,10 +1962,11 @@ static void kvmppc_vcore_preempt(struct kvmppc_vcore *vc)static void kvmppc_vcore_end_preempt (struct kvmppc_vcore *vc) { -struct preempted_vcore_list *lp =this_cpu_ptr (&preempted_vcores); +struct preempted_vcore_list *lp;kvmppc_core_end_stolen (vc);if (!list_empty (&vc->preempt_list)) { + lp = &per_cpu (preempted_vcores, vc->pcpu);spin_lock (&lp->lock);list_del_init (&vc->preempt_list);spin_unlock (&lp->lock);
Signature · 1 line
1.8.1.4
[PULL 11/12] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation
In reply to Alexander GrafFrom: Paul Mackerras <[email protected]>
Whenever a vcore state is VCORE_PREEMPT we need to be counting stolen time for it. This currently isn't the case when we have a vcore that no longer has any runnable threads in it but still has a runner task, so we do an explicit call to kvmppc_core_start_stolen() in that case.
--- arch/powerpc/kvm/book3s_hv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_hv.c +7 -2
@@ -2283,9 +2283,14 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master) }list_del_init (&vc->preempt_list);if (!is_master) { - vc->vcore_state = vc->runner ?VCORE_PREEMPT :VCORE_INACTIVE ; -if (still_running >0 ) +if (still_running >0 ) {kvmppc_vcore_preempt (vc); + }else if (vc->runner) { + vc->vcore_state =VCORE_PREEMPT ; +kvmppc_core_start_stolen (vc); + }else { + vc->vcore_state =VCORE_INACTIVE ; + }if (vc->n_runnable >0 && vc->runner =NULL ) {/* make sure there's a candidate runner awake */ vcpu = list_first_entry(&vc->runnable_threads,
Signature · 1 line
1.8.1.4
[PULL 12/12] KVM: PPC: Book3S: correct width in XER handling
In reply to Alexander GrafFrom: Sam bobroff <[email protected]>
In 64 bit kernels, the Fixed Point Exception Register (XER) is a 64 bit field (e.g. in kvm_regs and kvm_vcpu_arch) and in most places it is accessed as such.
This patch corrects places where it is accessed as a 32 bit field by a 64 bit kernel. In some cases this is via a 32 bit load or store instruction which, depending on endianness, will cause either the lower or upper 32 bits to be missed. In another case it is cast as a u32, causing the upper 32 bits to be cleared.
This patch corrects those places by extending the access methods to 64 bits.
--- arch/powerpc/include/asm/kvm_book3s.h | 4 ++-- arch/powerpc/include/asm/kvm_book3s_asm.h | 2 +- arch/powerpc/include/asm/kvm_booke.h | 4 ++-- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 +++--- arch/powerpc/kvm/book3s_segment.S | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-)
arch/powerpc/include/asm/kvm_book3s.h +2 -2
@@ -226,12 +226,12 @@ static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu)return vcpu->arch.cr; } -static inline void kvmppc_set_xer (struct kvm_vcpu *vcpu,u32 val) +static inline void kvmppc_set_xer (struct kvm_vcpu *vcpu,ulong val) { vcpu->arch.xer = val; } -static inline u32 kvmppc_get_xer (struct kvm_vcpu *vcpu) +static inline ulong kvmppc_get_xer (struct kvm_vcpu *vcpu) {return vcpu->arch.xer; }
arch/powerpc/include/asm/kvm_book3s_asm.h +1 -1
@@ -132,7 +132,7 @@ struct kvmppc_book3s_shadow_vcpu {bool in_use;ulong gpr[14 ];u32 cr; -u32 xer; +ulong xer;ulong ctr;ulong lr;ulong pc;
arch/powerpc/include/asm/kvm_booke.h +2 -2
@@ -54,12 +54,12 @@ static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu)return vcpu->arch.cr; } -static inline void kvmppc_set_xer (struct kvm_vcpu *vcpu,u32 val) +static inline void kvmppc_set_xer (struct kvm_vcpu *vcpu,ulong val) { vcpu->arch.xer = val; } -static inline u32 kvmppc_get_xer (struct kvm_vcpu *vcpu) +static inline ulong kvmppc_get_xer (struct kvm_vcpu *vcpu) {return vcpu->arch.xer; }
arch/powerpc/kvm/book3s_hv_rmhandlers.S +3 -3
@@ -944,7 +944,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) blt hdec_soon ld r6, VCPU_CTR(r4) - lwz r7, VCPU_XER(r4) + ld r7, VCPU_XER(r4) mtctr r6 mtxer r7
@@ -1181,7 +1181,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) mfctr r3 mfxer r4 std r3, VCPU_CTR(r9) - stw r4, VCPU_XER(r9) + std r4, VCPU_XER(r9) /* If this is a page table miss then see if it's theirs or ours */ cmpwi r12, BOOK3S_INTERRUPT_H_DATA_STORAGE
@@ -1763,7 +1763,7 @@ kvmppc_hdsi: bl kvmppc_msr_interrupt fast_interrupt_c_return: 6: ld r7, VCPU_CTR(r9) - lwz r8, VCPU_XER(r9) + ld r8, VCPU_XER(r9) mtctr r7 mtxer r8 mr r4, r9
arch/powerpc/kvm/book3s_segment.S +2 -2
@@ -123,7 +123,7 @@ no_dcbz32_on: PPC_LL r8, SVCPU_CTR(r3) PPC_LL r9, SVCPU_LR(r3) lwz r10, SVCPU_CR(r3) - lwz r11, SVCPU_XER(r3) + PPC_LL r11, SVCPU_XER(r3) mtctr r8 mtlr r9
@@ -237,7 +237,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) mfctr r8 mflr r9 - stw r5, SVCPU_XER(r13) + PPC_STL r5, SVCPU_XER(r13) PPC_STL r6, SVCPU_FAULT_DAR(r13) stw r7, SVCPU_FAULT_DSISR(r13) PPC_STL r8, SVCPU_CTR(r13)
Signature · 1 line
1.8.1.4
Paolo Bonzini
maintainerQuoted 3 lines · Alexander Graf
Hi Paolo,
This is my current patch queue for ppc. Please pull.
Done, but this queue has not been in linux-next. Please push to kvm-ppc-next on your github Linux tree as well; please keep an eye on Steven Rothwell's messages in the next few days, and I'll send the pull request sometimes next week via webmail if everything goes fine.
Paolo
Quoted 72 lines
Alex
The following changes since commit
4d283ec908e617fa28bcb06bce310206f0655d67:x86/kvm: Rename VMX's segment access rights defines (2015-08-15 00:47:13 +0200)
are available in the git repository at:
git://github.com/agraf/linux-2.6.gittags/signed-kvm-ppc-nextfor you to fetch changes up to
c63517c2e3810071359af926f621c1f784388c3f:KVM: PPC: Book3S: correct width in XER handling (2015-08-22 11:16:19 +0200)
----------------------------------------------------------------
Patch queue for ppc - 2015-08-22Highlights for KVM PPC this time around:
- Book3S: A few bug fixes
- Book3S: Allow micro-threading on POWER8----------------------------------------------------------------
Paul Mackerras (7):
KVM: PPC: Book3S HV: Make use of unused threads when running guests
KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8
KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE
KVM: PPC: Book3S HV: Fix bug in dirty page tracking
KVM: PPC: Book3S HV: ImplementH_CLEAR_REFandH_CLEAR_MOD
KVM: PPC: Book3S HV: Fix preempted vcore list locking
KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculationSam bobroff (1):
KVM: PPC: Book3S: correct width in XER handlingThomas Huth (2):
KVM: PPC: Remove PPC970 fromKVM_BOOK3S_64_HVtext inKconfig
KVM: PPC: Fix warnings from sparseTudor Laurentiu (2):
KVM: PPC: fix suspicious use of conditional operator
KVM: PPC: add missingpt_regsinitializationarch/powerpc/include/asm/kvm_book3s.h | 5 +- arch/powerpc/include/asm/kvm_book3s_asm.h | 22 +- arch/powerpc/include/asm/kvm_booke.h | 4 +- arch/powerpc/include/asm/kvm_host.h | 24 +- arch/powerpc/include/asm/ppc-opcode.h | 2 +- arch/powerpc/kernel/asm-offsets.c | 9 + arch/powerpc/kvm/Kconfig | 8 +- arch/powerpc/kvm/book3s.c | 3 +- arch/powerpc/kvm/book3s_32_mmu_host.c | 1 + arch/powerpc/kvm/book3s_64_mmu_host.c | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 8 +- arch/powerpc/kvm/book3s_emulate.c | 1 + arch/powerpc/kvm/book3s_hv.c | 660 ++++++++++++++++++++++++++---- arch/powerpc/kvm/book3s_hv_builtin.c | 32 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 161 +++++++- arch/powerpc/kvm/book3s_hv_rm_xics.c | 4 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 128 +++++- arch/powerpc/kvm/book3s_paired_singles.c | 2 +- arch/powerpc/kvm/book3s_segment.S | 4 +- arch/powerpc/kvm/booke.c | 1 + arch/powerpc/kvm/e500_mmu.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- 22 files changed, 938 insertions(+), 146 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Paolo Bonzini
Quoted 3 lines · Alexander Graf
Hi Paolo,
This is my current patch queue for ppc. Please pull.
Done, but this queue has not been in linux-next. Please push to kvm-ppc-next on your github Linux tree as well; please keep an eye on
Ah, sorry. I pushed to kvm-ppc-next in parallel to sending the request.
Quoted 2 lines
Steven Rothwell's messages in the next few days, and I'll send the pull request sometimes next week via webmail if everything goes fine.
Nothing exciting came in so far, so I hope we're good :).
Alex
Paolo Bonzini
maintainerQuoted 8 lines · Alexander Graf
Quoted 6 lines
Quoted 3 lines
Hi Paolo,
This is my current patch queue for ppc. Please pull.
Done, but this queue has not been in linux-next. Please push to kvm-ppc-next on your github Linux tree as well; please keep an eye on
Ah, sorry. I pushed to kvm-ppc-next in parallel to sending the request.
No problem, and Linus in the end did do an rc8 so I can wait till I'm back for sending the PPC/ARM pull request.
Paolo