diff options
author | Michael Neuling <mikey@neuling.org> | 2014-01-08 05:25:21 -0500 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-01-27 10:01:00 -0500 |
commit | b005255e12a311d2c87ea70a7c7b192b2187c22c (patch) | |
tree | 739892c411d395a7e4181bc2dc58c54d851d595f /arch/powerpc/kernel | |
parent | e0b7ec058c0eb7ba8d5d937d81de2bd16db6970e (diff) |
KVM: PPC: Book3S HV: Context-switch new POWER8 SPRs
This adds fields to the struct kvm_vcpu_arch to store the new
guest-accessible SPRs on POWER8, adds code to the get/set_one_reg
functions to allow userspace to access this state, and adds code to
the guest entry and exit to context-switch these SPRs between host
and guest.
Note that DPDES (Directed Privileged Doorbell Exception State) is
shared between threads on a core; hence we store it in struct
kvmppc_vcore and have the master thread save and restore it.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 332ae66883e4..043900abbbb0 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -432,6 +432,7 @@ int main(void) | |||
432 | DEFINE(VCPU_XER, offsetof(struct kvm_vcpu, arch.xer)); | 432 | DEFINE(VCPU_XER, offsetof(struct kvm_vcpu, arch.xer)); |
433 | DEFINE(VCPU_CTR, offsetof(struct kvm_vcpu, arch.ctr)); | 433 | DEFINE(VCPU_CTR, offsetof(struct kvm_vcpu, arch.ctr)); |
434 | DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr)); | 434 | DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr)); |
435 | DEFINE(VCPU_TAR, offsetof(struct kvm_vcpu, arch.tar)); | ||
435 | DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr)); | 436 | DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr)); |
436 | DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.pc)); | 437 | DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.pc)); |
437 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE | 438 | #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE |
@@ -484,11 +485,17 @@ int main(void) | |||
484 | DEFINE(VCPU_VCPUID, offsetof(struct kvm_vcpu, vcpu_id)); | 485 | DEFINE(VCPU_VCPUID, offsetof(struct kvm_vcpu, vcpu_id)); |
485 | DEFINE(VCPU_PURR, offsetof(struct kvm_vcpu, arch.purr)); | 486 | DEFINE(VCPU_PURR, offsetof(struct kvm_vcpu, arch.purr)); |
486 | DEFINE(VCPU_SPURR, offsetof(struct kvm_vcpu, arch.spurr)); | 487 | DEFINE(VCPU_SPURR, offsetof(struct kvm_vcpu, arch.spurr)); |
488 | DEFINE(VCPU_IC, offsetof(struct kvm_vcpu, arch.ic)); | ||
489 | DEFINE(VCPU_VTB, offsetof(struct kvm_vcpu, arch.vtb)); | ||
487 | DEFINE(VCPU_DSCR, offsetof(struct kvm_vcpu, arch.dscr)); | 490 | DEFINE(VCPU_DSCR, offsetof(struct kvm_vcpu, arch.dscr)); |
488 | DEFINE(VCPU_AMR, offsetof(struct kvm_vcpu, arch.amr)); | 491 | DEFINE(VCPU_AMR, offsetof(struct kvm_vcpu, arch.amr)); |
489 | DEFINE(VCPU_UAMOR, offsetof(struct kvm_vcpu, arch.uamor)); | 492 | DEFINE(VCPU_UAMOR, offsetof(struct kvm_vcpu, arch.uamor)); |
493 | DEFINE(VCPU_IAMR, offsetof(struct kvm_vcpu, arch.iamr)); | ||
490 | DEFINE(VCPU_CTRL, offsetof(struct kvm_vcpu, arch.ctrl)); | 494 | DEFINE(VCPU_CTRL, offsetof(struct kvm_vcpu, arch.ctrl)); |
491 | DEFINE(VCPU_DABR, offsetof(struct kvm_vcpu, arch.dabr)); | 495 | DEFINE(VCPU_DABR, offsetof(struct kvm_vcpu, arch.dabr)); |
496 | DEFINE(VCPU_DAWR, offsetof(struct kvm_vcpu, arch.dawr)); | ||
497 | DEFINE(VCPU_DAWRX, offsetof(struct kvm_vcpu, arch.dawrx)); | ||
498 | DEFINE(VCPU_CIABR, offsetof(struct kvm_vcpu, arch.ciabr)); | ||
492 | DEFINE(VCPU_HFLAGS, offsetof(struct kvm_vcpu, arch.hflags)); | 499 | DEFINE(VCPU_HFLAGS, offsetof(struct kvm_vcpu, arch.hflags)); |
493 | DEFINE(VCPU_DEC, offsetof(struct kvm_vcpu, arch.dec)); | 500 | DEFINE(VCPU_DEC, offsetof(struct kvm_vcpu, arch.dec)); |
494 | DEFINE(VCPU_DEC_EXPIRES, offsetof(struct kvm_vcpu, arch.dec_expires)); | 501 | DEFINE(VCPU_DEC_EXPIRES, offsetof(struct kvm_vcpu, arch.dec_expires)); |
@@ -497,8 +504,10 @@ int main(void) | |||
497 | DEFINE(VCPU_PRODDED, offsetof(struct kvm_vcpu, arch.prodded)); | 504 | DEFINE(VCPU_PRODDED, offsetof(struct kvm_vcpu, arch.prodded)); |
498 | DEFINE(VCPU_MMCR, offsetof(struct kvm_vcpu, arch.mmcr)); | 505 | DEFINE(VCPU_MMCR, offsetof(struct kvm_vcpu, arch.mmcr)); |
499 | DEFINE(VCPU_PMC, offsetof(struct kvm_vcpu, arch.pmc)); | 506 | DEFINE(VCPU_PMC, offsetof(struct kvm_vcpu, arch.pmc)); |
507 | DEFINE(VCPU_SPMC, offsetof(struct kvm_vcpu, arch.spmc)); | ||
500 | DEFINE(VCPU_SIAR, offsetof(struct kvm_vcpu, arch.siar)); | 508 | DEFINE(VCPU_SIAR, offsetof(struct kvm_vcpu, arch.siar)); |
501 | DEFINE(VCPU_SDAR, offsetof(struct kvm_vcpu, arch.sdar)); | 509 | DEFINE(VCPU_SDAR, offsetof(struct kvm_vcpu, arch.sdar)); |
510 | DEFINE(VCPU_SIER, offsetof(struct kvm_vcpu, arch.sier)); | ||
502 | DEFINE(VCPU_SLB, offsetof(struct kvm_vcpu, arch.slb)); | 511 | DEFINE(VCPU_SLB, offsetof(struct kvm_vcpu, arch.slb)); |
503 | DEFINE(VCPU_SLB_MAX, offsetof(struct kvm_vcpu, arch.slb_max)); | 512 | DEFINE(VCPU_SLB_MAX, offsetof(struct kvm_vcpu, arch.slb_max)); |
504 | DEFINE(VCPU_SLB_NR, offsetof(struct kvm_vcpu, arch.slb_nr)); | 513 | DEFINE(VCPU_SLB_NR, offsetof(struct kvm_vcpu, arch.slb_nr)); |
@@ -508,6 +517,19 @@ int main(void) | |||
508 | DEFINE(VCPU_TRAP, offsetof(struct kvm_vcpu, arch.trap)); | 517 | DEFINE(VCPU_TRAP, offsetof(struct kvm_vcpu, arch.trap)); |
509 | DEFINE(VCPU_CFAR, offsetof(struct kvm_vcpu, arch.cfar)); | 518 | DEFINE(VCPU_CFAR, offsetof(struct kvm_vcpu, arch.cfar)); |
510 | DEFINE(VCPU_PPR, offsetof(struct kvm_vcpu, arch.ppr)); | 519 | DEFINE(VCPU_PPR, offsetof(struct kvm_vcpu, arch.ppr)); |
520 | DEFINE(VCPU_FSCR, offsetof(struct kvm_vcpu, arch.fscr)); | ||
521 | DEFINE(VCPU_PSPB, offsetof(struct kvm_vcpu, arch.pspb)); | ||
522 | DEFINE(VCPU_TFHAR, offsetof(struct kvm_vcpu, arch.tfhar)); | ||
523 | DEFINE(VCPU_TFIAR, offsetof(struct kvm_vcpu, arch.tfiar)); | ||
524 | DEFINE(VCPU_TEXASR, offsetof(struct kvm_vcpu, arch.texasr)); | ||
525 | DEFINE(VCPU_EBBHR, offsetof(struct kvm_vcpu, arch.ebbhr)); | ||
526 | DEFINE(VCPU_EBBRR, offsetof(struct kvm_vcpu, arch.ebbrr)); | ||
527 | DEFINE(VCPU_BESCR, offsetof(struct kvm_vcpu, arch.bescr)); | ||
528 | DEFINE(VCPU_CSIGR, offsetof(struct kvm_vcpu, arch.csigr)); | ||
529 | DEFINE(VCPU_TACR, offsetof(struct kvm_vcpu, arch.tacr)); | ||
530 | DEFINE(VCPU_TCSCR, offsetof(struct kvm_vcpu, arch.tcscr)); | ||
531 | DEFINE(VCPU_ACOP, offsetof(struct kvm_vcpu, arch.acop)); | ||
532 | DEFINE(VCPU_WORT, offsetof(struct kvm_vcpu, arch.wort)); | ||
511 | DEFINE(VCPU_SHADOW_SRR1, offsetof(struct kvm_vcpu, arch.shadow_srr1)); | 533 | DEFINE(VCPU_SHADOW_SRR1, offsetof(struct kvm_vcpu, arch.shadow_srr1)); |
512 | DEFINE(VCORE_ENTRY_EXIT, offsetof(struct kvmppc_vcore, entry_exit_count)); | 534 | DEFINE(VCORE_ENTRY_EXIT, offsetof(struct kvmppc_vcore, entry_exit_count)); |
513 | DEFINE(VCORE_NAP_COUNT, offsetof(struct kvmppc_vcore, nap_count)); | 535 | DEFINE(VCORE_NAP_COUNT, offsetof(struct kvmppc_vcore, nap_count)); |
@@ -517,6 +539,7 @@ int main(void) | |||
517 | DEFINE(VCORE_TB_OFFSET, offsetof(struct kvmppc_vcore, tb_offset)); | 539 | DEFINE(VCORE_TB_OFFSET, offsetof(struct kvmppc_vcore, tb_offset)); |
518 | DEFINE(VCORE_LPCR, offsetof(struct kvmppc_vcore, lpcr)); | 540 | DEFINE(VCORE_LPCR, offsetof(struct kvmppc_vcore, lpcr)); |
519 | DEFINE(VCORE_PCR, offsetof(struct kvmppc_vcore, pcr)); | 541 | DEFINE(VCORE_PCR, offsetof(struct kvmppc_vcore, pcr)); |
542 | DEFINE(VCORE_DPDES, offsetof(struct kvmppc_vcore, dpdes)); | ||
520 | DEFINE(VCPU_SLB_E, offsetof(struct kvmppc_slb, orige)); | 543 | DEFINE(VCPU_SLB_E, offsetof(struct kvmppc_slb, orige)); |
521 | DEFINE(VCPU_SLB_V, offsetof(struct kvmppc_slb, origv)); | 544 | DEFINE(VCPU_SLB_V, offsetof(struct kvmppc_slb, origv)); |
522 | DEFINE(VCPU_SLB_SIZE, sizeof(struct kvmppc_slb)); | 545 | DEFINE(VCPU_SLB_SIZE, sizeof(struct kvmppc_slb)); |