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/include/asm/reg.h | |
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/include/asm/reg.h')
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 5c45787d551e..2f41e6475648 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -223,6 +223,11 @@ | |||
223 | #define CTRL_TE 0x00c00000 /* thread enable */ | 223 | #define CTRL_TE 0x00c00000 /* thread enable */ |
224 | #define CTRL_RUNLATCH 0x1 | 224 | #define CTRL_RUNLATCH 0x1 |
225 | #define SPRN_DAWR 0xB4 | 225 | #define SPRN_DAWR 0xB4 |
226 | #define SPRN_CIABR 0xBB | ||
227 | #define CIABR_PRIV 0x3 | ||
228 | #define CIABR_PRIV_USER 1 | ||
229 | #define CIABR_PRIV_SUPER 2 | ||
230 | #define CIABR_PRIV_HYPER 3 | ||
226 | #define SPRN_DAWRX 0xBC | 231 | #define SPRN_DAWRX 0xBC |
227 | #define DAWRX_USER (1UL << 0) | 232 | #define DAWRX_USER (1UL << 0) |
228 | #define DAWRX_KERNEL (1UL << 1) | 233 | #define DAWRX_KERNEL (1UL << 1) |
@@ -260,6 +265,8 @@ | |||
260 | #define SPRN_HRMOR 0x139 /* Real mode offset register */ | 265 | #define SPRN_HRMOR 0x139 /* Real mode offset register */ |
261 | #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */ | 266 | #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */ |
262 | #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ | 267 | #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ |
268 | #define SPRN_IC 0x350 /* Virtual Instruction Count */ | ||
269 | #define SPRN_VTB 0x351 /* Virtual Time Base */ | ||
263 | /* HFSCR and FSCR bit numbers are the same */ | 270 | /* HFSCR and FSCR bit numbers are the same */ |
264 | #define FSCR_TAR_LG 8 /* Enable Target Address Register */ | 271 | #define FSCR_TAR_LG 8 /* Enable Target Address Register */ |
265 | #define FSCR_EBB_LG 7 /* Enable Event Based Branching */ | 272 | #define FSCR_EBB_LG 7 /* Enable Event Based Branching */ |
@@ -368,6 +375,8 @@ | |||
368 | #define DER_EBRKE 0x00000002 /* External Breakpoint Interrupt */ | 375 | #define DER_EBRKE 0x00000002 /* External Breakpoint Interrupt */ |
369 | #define DER_DPIE 0x00000001 /* Dev. Port Nonmaskable Request */ | 376 | #define DER_DPIE 0x00000001 /* Dev. Port Nonmaskable Request */ |
370 | #define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */ | 377 | #define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */ |
378 | #define SPRN_DHDES 0x0B1 /* Directed Hyp. Doorbell Exc. State */ | ||
379 | #define SPRN_DPDES 0x0B0 /* Directed Priv. Doorbell Exc. State */ | ||
371 | #define SPRN_EAR 0x11A /* External Address Register */ | 380 | #define SPRN_EAR 0x11A /* External Address Register */ |
372 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ | 381 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ |
373 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ | 382 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ |
@@ -427,6 +436,7 @@ | |||
427 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 436 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
428 | #define SPRN_IABR2 0x3FA /* 83xx */ | 437 | #define SPRN_IABR2 0x3FA /* 83xx */ |
429 | #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ | 438 | #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ |
439 | #define SPRN_IAMR 0x03D /* Instr. Authority Mask Reg */ | ||
430 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ | 440 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ |
431 | #define HID4_LPES0 (1ul << (63-0)) /* LPAR env. sel. bit 0 */ | 441 | #define HID4_LPES0 (1ul << (63-0)) /* LPAR env. sel. bit 0 */ |
432 | #define HID4_RMLS2_SH (63 - 2) /* Real mode limit bottom 2 bits */ | 442 | #define HID4_RMLS2_SH (63 - 2) /* Real mode limit bottom 2 bits */ |
@@ -541,6 +551,7 @@ | |||
541 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ | 551 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ |
542 | #endif | 552 | #endif |
543 | #define SPRN_TIR 0x1BE /* Thread Identification Register */ | 553 | #define SPRN_TIR 0x1BE /* Thread Identification Register */ |
554 | #define SPRN_PSPB 0x09F /* Problem State Priority Boost reg */ | ||
544 | #define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ | 555 | #define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ |
545 | #define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ | 556 | #define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ |
546 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ | 557 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ |
@@ -682,6 +693,7 @@ | |||
682 | #define SPRN_EBBHR 804 /* Event based branch handler register */ | 693 | #define SPRN_EBBHR 804 /* Event based branch handler register */ |
683 | #define SPRN_EBBRR 805 /* Event based branch return register */ | 694 | #define SPRN_EBBRR 805 /* Event based branch return register */ |
684 | #define SPRN_BESCR 806 /* Branch event status and control register */ | 695 | #define SPRN_BESCR 806 /* Branch event status and control register */ |
696 | #define SPRN_WORT 895 /* Workload optimization register - thread */ | ||
685 | 697 | ||
686 | #define SPRN_PMC1 787 | 698 | #define SPRN_PMC1 787 |
687 | #define SPRN_PMC2 788 | 699 | #define SPRN_PMC2 788 |
@@ -698,6 +710,11 @@ | |||
698 | #define SIER_SIHV 0x1000000 /* Sampled MSR_HV */ | 710 | #define SIER_SIHV 0x1000000 /* Sampled MSR_HV */ |
699 | #define SIER_SIAR_VALID 0x0400000 /* SIAR contents valid */ | 711 | #define SIER_SIAR_VALID 0x0400000 /* SIAR contents valid */ |
700 | #define SIER_SDAR_VALID 0x0200000 /* SDAR contents valid */ | 712 | #define SIER_SDAR_VALID 0x0200000 /* SDAR contents valid */ |
713 | #define SPRN_TACR 888 | ||
714 | #define SPRN_TCSCR 889 | ||
715 | #define SPRN_CSIGR 890 | ||
716 | #define SPRN_SPMC1 892 | ||
717 | #define SPRN_SPMC2 893 | ||
701 | 718 | ||
702 | /* When EBB is enabled, some of MMCR0/MMCR2/SIER are user accessible */ | 719 | /* When EBB is enabled, some of MMCR0/MMCR2/SIER are user accessible */ |
703 | #define MMCR0_USER_MASK (MMCR0_FC | MMCR0_PMXE | MMCR0_PMAO) | 720 | #define MMCR0_USER_MASK (MMCR0_FC | MMCR0_PMXE | MMCR0_PMAO) |