aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-12-20 10:34:43 -0500
committerAvi Kivity <avi@redhat.com>2012-04-08 05:51:19 -0400
commitd30f6e480055e5be12e7a03fd11ea912a451daa5 (patch)
treee6c367e6f1da4da67b3a395a1a735a09e52067c0 /arch/powerpc/kernel/asm-offsets.c
parentcfac57847a67c4903f34a77e971521531bbc7c77 (diff)
KVM: PPC: booke: category E.HV (GS-mode) support
Chips such as e500mc that implement category E.HV in Power ISA 2.06 provide hardware virtualization features, including a new MSR mode for guest state. The guest OS can perform many operations without trapping into the hypervisor, including transitions to and from guest userspace. Since we can use SRR1[GS] to reliably tell whether an exception came from guest state, instead of messing around with IVPR, we use DO_KVM similarly to book3s. Current issues include: - Machine checks from guest state are not routed to the host handler. - The guest can cause a host oops by executing an emulated instruction in a page that lacks read permission. Existing e500/4xx support has the same problem. Includes work by Ashish Kalra <Ashish.Kalra@freescale.com>, Varun Sethi <Varun.Sethi@freescale.com>, and Liu Yu <yu.liu@freescale.com>. Signed-off-by: Scott Wood <scottwood@freescale.com> [agraf: remove pt_regs usage] Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kernel/asm-offsets.c')
-rw-r--r--arch/powerpc/kernel/asm-offsets.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 34b8afe94a50..bbede5882c5b 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -116,6 +116,9 @@ int main(void)
116#ifdef CONFIG_KVM_BOOK3S_32_HANDLER 116#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
117 DEFINE(THREAD_KVM_SVCPU, offsetof(struct thread_struct, kvm_shadow_vcpu)); 117 DEFINE(THREAD_KVM_SVCPU, offsetof(struct thread_struct, kvm_shadow_vcpu));
118#endif 118#endif
119#ifdef CONFIG_KVM_BOOKE_HV
120 DEFINE(THREAD_KVM_VCPU, offsetof(struct thread_struct, kvm_vcpu));
121#endif
119 122
120 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 123 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
121 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); 124 DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
@@ -387,6 +390,7 @@ int main(void)
387#ifdef CONFIG_KVM 390#ifdef CONFIG_KVM
388 DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack)); 391 DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack));
389 DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid)); 392 DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
393 DEFINE(VCPU_GUEST_PID, offsetof(struct kvm_vcpu, arch.pid));
390 DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr)); 394 DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));
391 DEFINE(VCPU_VRSAVE, offsetof(struct kvm_vcpu, arch.vrsave)); 395 DEFINE(VCPU_VRSAVE, offsetof(struct kvm_vcpu, arch.vrsave));
392 DEFINE(VCPU_FPRS, offsetof(struct kvm_vcpu, arch.fpr)); 396 DEFINE(VCPU_FPRS, offsetof(struct kvm_vcpu, arch.fpr));
@@ -429,9 +433,11 @@ int main(void)
429 DEFINE(VCPU_SHARED_MAS4, offsetof(struct kvm_vcpu_arch_shared, mas4)); 433 DEFINE(VCPU_SHARED_MAS4, offsetof(struct kvm_vcpu_arch_shared, mas4));
430 DEFINE(VCPU_SHARED_MAS6, offsetof(struct kvm_vcpu_arch_shared, mas6)); 434 DEFINE(VCPU_SHARED_MAS6, offsetof(struct kvm_vcpu_arch_shared, mas6));
431 435
436 DEFINE(VCPU_KVM, offsetof(struct kvm_vcpu, kvm));
437 DEFINE(KVM_LPID, offsetof(struct kvm, arch.lpid));
438
432 /* book3s */ 439 /* book3s */
433#ifdef CONFIG_KVM_BOOK3S_64_HV 440#ifdef CONFIG_KVM_BOOK3S_64_HV
434 DEFINE(KVM_LPID, offsetof(struct kvm, arch.lpid));
435 DEFINE(KVM_SDR1, offsetof(struct kvm, arch.sdr1)); 441 DEFINE(KVM_SDR1, offsetof(struct kvm, arch.sdr1));
436 DEFINE(KVM_HOST_LPID, offsetof(struct kvm, arch.host_lpid)); 442 DEFINE(KVM_HOST_LPID, offsetof(struct kvm, arch.host_lpid));
437 DEFINE(KVM_HOST_LPCR, offsetof(struct kvm, arch.host_lpcr)); 443 DEFINE(KVM_HOST_LPCR, offsetof(struct kvm, arch.host_lpcr));
@@ -446,7 +452,6 @@ int main(void)
446 DEFINE(VCPU_DAR, offsetof(struct kvm_vcpu, arch.shregs.dar)); 452 DEFINE(VCPU_DAR, offsetof(struct kvm_vcpu, arch.shregs.dar));
447#endif 453#endif
448#ifdef CONFIG_PPC_BOOK3S 454#ifdef CONFIG_PPC_BOOK3S
449 DEFINE(VCPU_KVM, offsetof(struct kvm_vcpu, kvm));
450 DEFINE(VCPU_VCPUID, offsetof(struct kvm_vcpu, vcpu_id)); 455 DEFINE(VCPU_VCPUID, offsetof(struct kvm_vcpu, vcpu_id));
451 DEFINE(VCPU_PURR, offsetof(struct kvm_vcpu, arch.purr)); 456 DEFINE(VCPU_PURR, offsetof(struct kvm_vcpu, arch.purr));
452 DEFINE(VCPU_SPURR, offsetof(struct kvm_vcpu, arch.spurr)); 457 DEFINE(VCPU_SPURR, offsetof(struct kvm_vcpu, arch.spurr));
@@ -597,6 +602,12 @@ int main(void)
597 DEFINE(VCPU_HOST_SPEFSCR, offsetof(struct kvm_vcpu, arch.host_spefscr)); 602 DEFINE(VCPU_HOST_SPEFSCR, offsetof(struct kvm_vcpu, arch.host_spefscr));
598#endif 603#endif
599 604
605#ifdef CONFIG_KVM_BOOKE_HV
606 DEFINE(VCPU_HOST_MAS4, offsetof(struct kvm_vcpu, arch.host_mas4));
607 DEFINE(VCPU_HOST_MAS6, offsetof(struct kvm_vcpu, arch.host_mas6));
608 DEFINE(VCPU_EPLC, offsetof(struct kvm_vcpu, arch.eplc));
609#endif
610
600#ifdef CONFIG_KVM_EXIT_TIMING 611#ifdef CONFIG_KVM_EXIT_TIMING
601 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu, 612 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
602 arch.timing_exit.tv32.tbu)); 613 arch.timing_exit.tv32.tbu));