Loading arch/powerpc/include/asm/kvm_book3s_64.h +4 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, rb |= 1; /* L field */ rb |= r & 0xff000 & ((1ul << a_pgshift) - 1); /* LP field */ } /* * This sets both bits of the B field in the PTE. 0b1x values are * reserved, but those will have been filtered by kvmppc_do_h_enter. */ rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8; /* B field */ return rb; } Loading arch/powerpc/kvm/book3s_hv.c +28 −2 Original line number Diff line number Diff line Loading @@ -3726,7 +3726,20 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc) kvmppc_set_host_core(pcpu); guest_exit_irqoff(); context_tracking_guest_exit(); if (!vtime_accounting_enabled_this_cpu()) { local_irq_enable(); /* * Service IRQs here before vtime_account_guest_exit() so any * ticks that occurred while running the guest are accounted to * the guest. If vtime accounting is enabled, accounting uses * TB rather than ticks, so it can be done without enabling * interrupts here, which has the problem that it accounts * interrupt processing overhead to the host. */ local_irq_disable(); } vtime_account_guest_exit(); local_irq_enable(); Loading Loading @@ -4510,7 +4523,20 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit, kvmppc_set_host_core(pcpu); guest_exit_irqoff(); context_tracking_guest_exit(); if (!vtime_accounting_enabled_this_cpu()) { local_irq_enable(); /* * Service IRQs here before vtime_account_guest_exit() so any * ticks that occurred while running the guest are accounted to * the guest. If vtime accounting is enabled, accounting uses * TB rather than ticks, so it can be done without enabling * interrupts here, which has the problem that it accounts * interrupt processing overhead to the host. */ local_irq_disable(); } vtime_account_guest_exit(); local_irq_enable(); Loading arch/powerpc/kvm/book3s_hv_rm_mmu.c +9 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,15 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags, if (kvm_is_radix(kvm)) return H_FUNCTION; /* * The HPTE gets used by compute_tlbie_rb() to set TLBIE bits, so * these functions should work together -- must ensure a guest can not * cause problems with the TLBIE that KVM executes. */ if ((pteh >> HPTE_V_SSIZE_SHIFT) & 0x2) { /* B=0b1x is a reserved value, disallow it. */ return H_PARAMETER; } psize = kvmppc_actual_pgsz(pteh, ptel); if (!psize) return H_PARAMETER; Loading arch/powerpc/kvm/booke.c +15 −1 Original line number Diff line number Diff line Loading @@ -1042,7 +1042,21 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr) } trace_kvm_exit(exit_nr, vcpu); guest_exit_irqoff(); context_tracking_guest_exit(); if (!vtime_accounting_enabled_this_cpu()) { local_irq_enable(); /* * Service IRQs here before vtime_account_guest_exit() so any * ticks that occurred while running the guest are accounted to * the guest. If vtime accounting is enabled, accounting uses * TB rather than ticks, so it can be done without enabling * interrupts here, which has the problem that it accounts * interrupt processing overhead to the host. */ local_irq_disable(); } vtime_account_guest_exit(); local_irq_enable(); Loading Loading
arch/powerpc/include/asm/kvm_book3s_64.h +4 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, rb |= 1; /* L field */ rb |= r & 0xff000 & ((1ul << a_pgshift) - 1); /* LP field */ } /* * This sets both bits of the B field in the PTE. 0b1x values are * reserved, but those will have been filtered by kvmppc_do_h_enter. */ rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8; /* B field */ return rb; } Loading
arch/powerpc/kvm/book3s_hv.c +28 −2 Original line number Diff line number Diff line Loading @@ -3726,7 +3726,20 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc) kvmppc_set_host_core(pcpu); guest_exit_irqoff(); context_tracking_guest_exit(); if (!vtime_accounting_enabled_this_cpu()) { local_irq_enable(); /* * Service IRQs here before vtime_account_guest_exit() so any * ticks that occurred while running the guest are accounted to * the guest. If vtime accounting is enabled, accounting uses * TB rather than ticks, so it can be done without enabling * interrupts here, which has the problem that it accounts * interrupt processing overhead to the host. */ local_irq_disable(); } vtime_account_guest_exit(); local_irq_enable(); Loading Loading @@ -4510,7 +4523,20 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit, kvmppc_set_host_core(pcpu); guest_exit_irqoff(); context_tracking_guest_exit(); if (!vtime_accounting_enabled_this_cpu()) { local_irq_enable(); /* * Service IRQs here before vtime_account_guest_exit() so any * ticks that occurred while running the guest are accounted to * the guest. If vtime accounting is enabled, accounting uses * TB rather than ticks, so it can be done without enabling * interrupts here, which has the problem that it accounts * interrupt processing overhead to the host. */ local_irq_disable(); } vtime_account_guest_exit(); local_irq_enable(); Loading
arch/powerpc/kvm/book3s_hv_rm_mmu.c +9 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,15 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags, if (kvm_is_radix(kvm)) return H_FUNCTION; /* * The HPTE gets used by compute_tlbie_rb() to set TLBIE bits, so * these functions should work together -- must ensure a guest can not * cause problems with the TLBIE that KVM executes. */ if ((pteh >> HPTE_V_SSIZE_SHIFT) & 0x2) { /* B=0b1x is a reserved value, disallow it. */ return H_PARAMETER; } psize = kvmppc_actual_pgsz(pteh, ptel); if (!psize) return H_PARAMETER; Loading
arch/powerpc/kvm/booke.c +15 −1 Original line number Diff line number Diff line Loading @@ -1042,7 +1042,21 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr) } trace_kvm_exit(exit_nr, vcpu); guest_exit_irqoff(); context_tracking_guest_exit(); if (!vtime_accounting_enabled_this_cpu()) { local_irq_enable(); /* * Service IRQs here before vtime_account_guest_exit() so any * ticks that occurred while running the guest are accounted to * the guest. If vtime accounting is enabled, accounting uses * TB rather than ticks, so it can be done without enabling * interrupts here, which has the problem that it accounts * interrupt processing overhead to the host. */ local_irq_disable(); } vtime_account_guest_exit(); local_irq_enable(); Loading