diff options
author | Paul Mackerras <paulus@samba.org> | 2011-06-28 20:26:11 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:16:58 -0400 |
commit | 969391c58a4efb8411d6881179945f425ad9cbb5 (patch) | |
tree | 77ec5f178feee26c453033b7456ad789d3393482 | |
parent | aa04b4cc5be64b4fb9ef4e0fdf2418e2f4737fb2 (diff) |
powerpc, KVM: Split HVMODE_206 cpu feature bit into separate HV and architecture bits
This replaces the single CPU_FTR_HVMODE_206 bit with two bits, one to
indicate that we have a usable hypervisor mode, and another to indicate
that the processor conforms to PowerISA version 2.06. We also add
another bit to indicate that the processor conforms to ISA version 2.01
and set that for PPC970 and derivatives.
Some PPC970 chips (specifically those in Apple machines) have a
hypervisor mode in that MSR[HV] is always 1, but the hypervisor mode
is not useful in the sense that there is no way to run any code in
supervisor mode (HV=0 PR=0). On these processors, the LPES0 and LPES1
bits in HID4 are always 0, and we use that as a way of detecting that
hypervisor mode is not useful.
Where we have a feature section in assembly code around code that
only applies on POWER7 in hypervisor mode, we use a construct like
END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
The definition of END_FTR_SECTION_IFSET is such that the code will
be enabled (not overwritten with nops) only if all bits in the
provided mask are set.
Note that the CPU feature check in __tlbie() only needs to check the
ARCH_206 bit, not the HVMODE bit, because __tlbie() can only get called
if we are running bare-metal, i.e. in hypervisor mode.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/powerpc/include/asm/cputable.h | 14 | ||||
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 16 | ||||
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_power7.S | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_ppc970.S | 26 | ||||
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/paca.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_64_mmu_hv.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_hv.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_builtin.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_segment.S | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_native_64.c | 4 |
11 files changed, 56 insertions, 26 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index c0d842cfd012..e30442c539ce 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -179,8 +179,9 @@ extern const char *powerpc_base_platform; | |||
179 | #define LONG_ASM_CONST(x) 0 | 179 | #define LONG_ASM_CONST(x) 0 |
180 | #endif | 180 | #endif |
181 | 181 | ||
182 | 182 | #define CPU_FTR_HVMODE LONG_ASM_CONST(0x0000000200000000) | |
183 | #define CPU_FTR_HVMODE_206 LONG_ASM_CONST(0x0000000800000000) | 183 | #define CPU_FTR_ARCH_201 LONG_ASM_CONST(0x0000000400000000) |
184 | #define CPU_FTR_ARCH_206 LONG_ASM_CONST(0x0000000800000000) | ||
184 | #define CPU_FTR_CFAR LONG_ASM_CONST(0x0000001000000000) | 185 | #define CPU_FTR_CFAR LONG_ASM_CONST(0x0000001000000000) |
185 | #define CPU_FTR_IABR LONG_ASM_CONST(0x0000002000000000) | 186 | #define CPU_FTR_IABR LONG_ASM_CONST(0x0000002000000000) |
186 | #define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000) | 187 | #define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000) |
@@ -401,9 +402,10 @@ extern const char *powerpc_base_platform; | |||
401 | CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \ | 402 | CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \ |
402 | CPU_FTR_STCX_CHECKS_ADDRESS) | 403 | CPU_FTR_STCX_CHECKS_ADDRESS) |
403 | #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | 404 | #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
404 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 405 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_201 | \ |
405 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \ | 406 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \ |
406 | CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS) | 407 | CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS | \ |
408 | CPU_FTR_HVMODE) | ||
407 | #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | 409 | #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
408 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 410 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
409 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 411 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
@@ -417,13 +419,13 @@ extern const char *powerpc_base_platform; | |||
417 | CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \ | 419 | CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \ |
418 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR) | 420 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_CFAR) |
419 | #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | 421 | #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
420 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_HVMODE_206 |\ | 422 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\ |
421 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 423 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
422 | CPU_FTR_COHERENT_ICACHE | \ | 424 | CPU_FTR_COHERENT_ICACHE | \ |
423 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ | 425 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ |
424 | CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ | 426 | CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ |
425 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ | 427 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ |
426 | CPU_FTR_ICSWX | CPU_FTR_CFAR) | 428 | CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE) |
427 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | 429 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
428 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 430 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
429 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 431 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 20a053c14270..ddbe57ae8584 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -307,6 +307,7 @@ | |||
307 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ | 307 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ |
308 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ | 308 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ |
309 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ | 309 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ |
310 | #define HID0_HDICE_SH (63 - 23) /* 970 HDEC interrupt enable */ | ||
310 | #define HID0_EMCP (1<<31) /* Enable Machine Check pin */ | 311 | #define HID0_EMCP (1<<31) /* Enable Machine Check pin */ |
311 | #define HID0_EBA (1<<29) /* Enable Bus Address Parity */ | 312 | #define HID0_EBA (1<<29) /* Enable Bus Address Parity */ |
312 | #define HID0_EBD (1<<28) /* Enable Bus Data Parity */ | 313 | #define HID0_EBD (1<<28) /* Enable Bus Data Parity */ |
@@ -362,6 +363,13 @@ | |||
362 | #define SPRN_IABR2 0x3FA /* 83xx */ | 363 | #define SPRN_IABR2 0x3FA /* 83xx */ |
363 | #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ | 364 | #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ |
364 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ | 365 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ |
366 | #define HID4_LPES0 (1ul << (63-0)) /* LPAR env. sel. bit 0 */ | ||
367 | #define HID4_RMLS2_SH (63 - 2) /* Real mode limit bottom 2 bits */ | ||
368 | #define HID4_LPID5_SH (63 - 6) /* partition ID bottom 4 bits */ | ||
369 | #define HID4_RMOR_SH (63 - 22) /* real mode offset (16 bits) */ | ||
370 | #define HID4_LPES1 (1 << (63-57)) /* LPAR env. sel. bit 1 */ | ||
371 | #define HID4_RMLS0_SH (63 - 58) /* Real mode limit top bit */ | ||
372 | #define HID4_LPID1_SH 0 /* partition ID top 2 bits */ | ||
365 | #define SPRN_HID4_GEKKO 0x3F3 /* Gekko HID4 */ | 373 | #define SPRN_HID4_GEKKO 0x3F3 /* Gekko HID4 */ |
366 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | 374 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ |
367 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ | 375 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ |
@@ -811,28 +819,28 @@ | |||
811 | mfspr rX,SPRN_SPRG_PACA; \ | 819 | mfspr rX,SPRN_SPRG_PACA; \ |
812 | FTR_SECTION_ELSE_NESTED(66); \ | 820 | FTR_SECTION_ELSE_NESTED(66); \ |
813 | mfspr rX,SPRN_SPRG_HPACA; \ | 821 | mfspr rX,SPRN_SPRG_HPACA; \ |
814 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE_206, 66) | 822 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE, 66) |
815 | 823 | ||
816 | #define SET_PACA(rX) \ | 824 | #define SET_PACA(rX) \ |
817 | BEGIN_FTR_SECTION_NESTED(66); \ | 825 | BEGIN_FTR_SECTION_NESTED(66); \ |
818 | mtspr SPRN_SPRG_PACA,rX; \ | 826 | mtspr SPRN_SPRG_PACA,rX; \ |
819 | FTR_SECTION_ELSE_NESTED(66); \ | 827 | FTR_SECTION_ELSE_NESTED(66); \ |
820 | mtspr SPRN_SPRG_HPACA,rX; \ | 828 | mtspr SPRN_SPRG_HPACA,rX; \ |
821 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE_206, 66) | 829 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE, 66) |
822 | 830 | ||
823 | #define GET_SCRATCH0(rX) \ | 831 | #define GET_SCRATCH0(rX) \ |
824 | BEGIN_FTR_SECTION_NESTED(66); \ | 832 | BEGIN_FTR_SECTION_NESTED(66); \ |
825 | mfspr rX,SPRN_SPRG_SCRATCH0; \ | 833 | mfspr rX,SPRN_SPRG_SCRATCH0; \ |
826 | FTR_SECTION_ELSE_NESTED(66); \ | 834 | FTR_SECTION_ELSE_NESTED(66); \ |
827 | mfspr rX,SPRN_SPRG_HSCRATCH0; \ | 835 | mfspr rX,SPRN_SPRG_HSCRATCH0; \ |
828 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE_206, 66) | 836 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE, 66) |
829 | 837 | ||
830 | #define SET_SCRATCH0(rX) \ | 838 | #define SET_SCRATCH0(rX) \ |
831 | BEGIN_FTR_SECTION_NESTED(66); \ | 839 | BEGIN_FTR_SECTION_NESTED(66); \ |
832 | mtspr SPRN_SPRG_SCRATCH0,rX; \ | 840 | mtspr SPRN_SPRG_SCRATCH0,rX; \ |
833 | FTR_SECTION_ELSE_NESTED(66); \ | 841 | FTR_SECTION_ELSE_NESTED(66); \ |
834 | mtspr SPRN_SPRG_HSCRATCH0,rX; \ | 842 | mtspr SPRN_SPRG_HSCRATCH0,rX; \ |
835 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE_206, 66) | 843 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_HVMODE, 66) |
836 | 844 | ||
837 | #else /* CONFIG_PPC_BOOK3S_64 */ | 845 | #else /* CONFIG_PPC_BOOK3S_64 */ |
838 | #define GET_SCRATCH0(rX) mfspr rX,SPRN_SPRG_SCRATCH0 | 846 | #define GET_SCRATCH0(rX) mfspr rX,SPRN_SPRG_SCRATCH0 |
diff --git a/arch/powerpc/kernel/cpu_setup_power7.S b/arch/powerpc/kernel/cpu_setup_power7.S index 2ef6749688e9..76797c5105d6 100644 --- a/arch/powerpc/kernel/cpu_setup_power7.S +++ b/arch/powerpc/kernel/cpu_setup_power7.S | |||
@@ -45,12 +45,12 @@ _GLOBAL(__restore_cpu_power7) | |||
45 | blr | 45 | blr |
46 | 46 | ||
47 | __init_hvmode_206: | 47 | __init_hvmode_206: |
48 | /* Disable CPU_FTR_HVMODE_206 and exit if MSR:HV is not set */ | 48 | /* Disable CPU_FTR_HVMODE and exit if MSR:HV is not set */ |
49 | mfmsr r3 | 49 | mfmsr r3 |
50 | rldicl. r0,r3,4,63 | 50 | rldicl. r0,r3,4,63 |
51 | bnelr | 51 | bnelr |
52 | ld r5,CPU_SPEC_FEATURES(r4) | 52 | ld r5,CPU_SPEC_FEATURES(r4) |
53 | LOAD_REG_IMMEDIATE(r6,CPU_FTR_HVMODE_206) | 53 | LOAD_REG_IMMEDIATE(r6,CPU_FTR_HVMODE) |
54 | xor r5,r5,r6 | 54 | xor r5,r5,r6 |
55 | std r5,CPU_SPEC_FEATURES(r4) | 55 | std r5,CPU_SPEC_FEATURES(r4) |
56 | blr | 56 | blr |
diff --git a/arch/powerpc/kernel/cpu_setup_ppc970.S b/arch/powerpc/kernel/cpu_setup_ppc970.S index 27f2507279d8..12fac8df01c5 100644 --- a/arch/powerpc/kernel/cpu_setup_ppc970.S +++ b/arch/powerpc/kernel/cpu_setup_ppc970.S | |||
@@ -76,7 +76,7 @@ _GLOBAL(__setup_cpu_ppc970) | |||
76 | /* Do nothing if not running in HV mode */ | 76 | /* Do nothing if not running in HV mode */ |
77 | mfmsr r0 | 77 | mfmsr r0 |
78 | rldicl. r0,r0,4,63 | 78 | rldicl. r0,r0,4,63 |
79 | beqlr | 79 | beq no_hv_mode |
80 | 80 | ||
81 | mfspr r0,SPRN_HID0 | 81 | mfspr r0,SPRN_HID0 |
82 | li r11,5 /* clear DOZE and SLEEP */ | 82 | li r11,5 /* clear DOZE and SLEEP */ |
@@ -90,7 +90,7 @@ _GLOBAL(__setup_cpu_ppc970MP) | |||
90 | /* Do nothing if not running in HV mode */ | 90 | /* Do nothing if not running in HV mode */ |
91 | mfmsr r0 | 91 | mfmsr r0 |
92 | rldicl. r0,r0,4,63 | 92 | rldicl. r0,r0,4,63 |
93 | beqlr | 93 | beq no_hv_mode |
94 | 94 | ||
95 | mfspr r0,SPRN_HID0 | 95 | mfspr r0,SPRN_HID0 |
96 | li r11,0x15 /* clear DOZE and SLEEP */ | 96 | li r11,0x15 /* clear DOZE and SLEEP */ |
@@ -109,6 +109,14 @@ load_hids: | |||
109 | sync | 109 | sync |
110 | isync | 110 | isync |
111 | 111 | ||
112 | /* Try to set LPES = 01 in HID4 */ | ||
113 | mfspr r0,SPRN_HID4 | ||
114 | clrldi r0,r0,1 /* clear LPES0 */ | ||
115 | ori r0,r0,HID4_LPES1 /* set LPES1 */ | ||
116 | sync | ||
117 | mtspr SPRN_HID4,r0 | ||
118 | isync | ||
119 | |||
112 | /* Save away cpu state */ | 120 | /* Save away cpu state */ |
113 | LOAD_REG_ADDR(r5,cpu_state_storage) | 121 | LOAD_REG_ADDR(r5,cpu_state_storage) |
114 | 122 | ||
@@ -117,11 +125,21 @@ load_hids: | |||
117 | std r3,CS_HID0(r5) | 125 | std r3,CS_HID0(r5) |
118 | mfspr r3,SPRN_HID1 | 126 | mfspr r3,SPRN_HID1 |
119 | std r3,CS_HID1(r5) | 127 | std r3,CS_HID1(r5) |
120 | mfspr r3,SPRN_HID4 | 128 | mfspr r4,SPRN_HID4 |
121 | std r3,CS_HID4(r5) | 129 | std r4,CS_HID4(r5) |
122 | mfspr r3,SPRN_HID5 | 130 | mfspr r3,SPRN_HID5 |
123 | std r3,CS_HID5(r5) | 131 | std r3,CS_HID5(r5) |
124 | 132 | ||
133 | /* See if we successfully set LPES1 to 1; if not we are in Apple mode */ | ||
134 | andi. r4,r4,HID4_LPES1 | ||
135 | bnelr | ||
136 | |||
137 | no_hv_mode: | ||
138 | /* Disable CPU_FTR_HVMODE and exit, since we don't have HV mode */ | ||
139 | ld r5,CPU_SPEC_FEATURES(r4) | ||
140 | LOAD_REG_IMMEDIATE(r6,CPU_FTR_HVMODE) | ||
141 | andc r5,r5,r6 | ||
142 | std r5,CPU_SPEC_FEATURES(r4) | ||
125 | blr | 143 | blr |
126 | 144 | ||
127 | /* Called with no MMU context (typically MSR:IR/DR off) to | 145 | /* Called with no MMU context (typically MSR:IR/DR off) to |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 5bc06fdfa6c0..a5345380bef3 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -75,7 +75,7 @@ BEGIN_FTR_SECTION | |||
75 | b .power7_wakeup_noloss | 75 | b .power7_wakeup_noloss |
76 | 2: b .power7_wakeup_loss | 76 | 2: b .power7_wakeup_loss |
77 | 9: | 77 | 9: |
78 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE_206) | 78 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) |
79 | #endif /* CONFIG_PPC_P7_NAP */ | 79 | #endif /* CONFIG_PPC_P7_NAP */ |
80 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD, | 80 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD, |
81 | NOTEST, 0x100) | 81 | NOTEST, 0x100) |
@@ -173,7 +173,7 @@ hardware_interrupt_hv: | |||
173 | _MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt, | 173 | _MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt, |
174 | EXC_STD, SOFTEN_TEST_PR) | 174 | EXC_STD, SOFTEN_TEST_PR) |
175 | KVM_HANDLER(PACA_EXGEN, EXC_STD, 0x500) | 175 | KVM_HANDLER(PACA_EXGEN, EXC_STD, 0x500) |
176 | ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE_206) | 176 | ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) |
177 | 177 | ||
178 | STD_EXCEPTION_PSERIES(0x600, 0x600, alignment) | 178 | STD_EXCEPTION_PSERIES(0x600, 0x600, alignment) |
179 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x600) | 179 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x600) |
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index efeb88184182..0a5a899846bb 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
@@ -167,7 +167,7 @@ void setup_paca(struct paca_struct *new_paca) | |||
167 | * if we do a GET_PACA() before the feature fixups have been | 167 | * if we do a GET_PACA() before the feature fixups have been |
168 | * applied | 168 | * applied |
169 | */ | 169 | */ |
170 | if (cpu_has_feature(CPU_FTR_HVMODE_206)) | 170 | if (cpu_has_feature(CPU_FTR_HVMODE)) |
171 | mtspr(SPRN_SPRG_HPACA, local_paca); | 171 | mtspr(SPRN_SPRG_HPACA, local_paca); |
172 | #endif | 172 | #endif |
173 | mtspr(SPRN_SPRG_PACA, local_paca); | 173 | mtspr(SPRN_SPRG_PACA, local_paca); |
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 96ba96a16abf..212dcd8fc50b 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c | |||
@@ -128,7 +128,8 @@ void kvmppc_map_vrma(struct kvm *kvm, struct kvm_userspace_memory_region *mem) | |||
128 | 128 | ||
129 | int kvmppc_mmu_hv_init(void) | 129 | int kvmppc_mmu_hv_init(void) |
130 | { | 130 | { |
131 | if (!cpu_has_feature(CPU_FTR_HVMODE_206)) | 131 | if (!cpu_has_feature(CPU_FTR_HVMODE) || |
132 | !cpu_has_feature(CPU_FTR_ARCH_206)) | ||
132 | return -EINVAL; | 133 | return -EINVAL; |
133 | memset(lpid_inuse, 0, sizeof(lpid_inuse)); | 134 | memset(lpid_inuse, 0, sizeof(lpid_inuse)); |
134 | set_bit(mfspr(SPRN_LPID), lpid_inuse); | 135 | set_bit(mfspr(SPRN_LPID), lpid_inuse); |
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 04da135cae61..dc70e7745ab3 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -443,7 +443,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
443 | 443 | ||
444 | int kvmppc_core_check_processor_compat(void) | 444 | int kvmppc_core_check_processor_compat(void) |
445 | { | 445 | { |
446 | if (cpu_has_feature(CPU_FTR_HVMODE_206)) | 446 | if (cpu_has_feature(CPU_FTR_HVMODE) && |
447 | cpu_has_feature(CPU_FTR_ARCH_206)) | ||
447 | return 0; | 448 | return 0; |
448 | return -EIO; | 449 | return -EIO; |
449 | } | 450 | } |
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c index 736df3cbbc55..7315ec6e8177 100644 --- a/arch/powerpc/kvm/book3s_hv_builtin.c +++ b/arch/powerpc/kvm/book3s_hv_builtin.c | |||
@@ -90,8 +90,8 @@ void kvm_rma_init(void) | |||
90 | void *rma; | 90 | void *rma; |
91 | struct page *pg; | 91 | struct page *pg; |
92 | 92 | ||
93 | /* Only do this on POWER7 in HV mode */ | 93 | /* Only do this in HV mode */ |
94 | if (!cpu_has_feature(CPU_FTR_HVMODE_206)) | 94 | if (!cpu_has_feature(CPU_FTR_HVMODE)) |
95 | return; | 95 | return; |
96 | 96 | ||
97 | if (!kvm_rma_size || !kvm_rma_count) | 97 | if (!kvm_rma_size || !kvm_rma_count) |
diff --git a/arch/powerpc/kvm/book3s_segment.S b/arch/powerpc/kvm/book3s_segment.S index 134501691ad0..aed32e517212 100644 --- a/arch/powerpc/kvm/book3s_segment.S +++ b/arch/powerpc/kvm/book3s_segment.S | |||
@@ -170,7 +170,7 @@ BEGIN_FTR_SECTION | |||
170 | mfspr r4,SPRN_HSRR1 | 170 | mfspr r4,SPRN_HSRR1 |
171 | andi. r12,r12,0x3ffd | 171 | andi. r12,r12,0x3ffd |
172 | b 2f | 172 | b 2f |
173 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE_206) | 173 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) |
174 | #endif | 174 | #endif |
175 | 1: mfsrr0 r3 | 175 | 1: mfsrr0 r3 |
176 | mfsrr1 r4 | 176 | mfsrr1 r4 |
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c index dfd764896db0..b44f5f803052 100644 --- a/arch/powerpc/mm/hash_native_64.c +++ b/arch/powerpc/mm/hash_native_64.c | |||
@@ -51,7 +51,7 @@ static inline void __tlbie(unsigned long va, int psize, int ssize) | |||
51 | va &= ~0xffful; | 51 | va &= ~0xffful; |
52 | va |= ssize << 8; | 52 | va |= ssize << 8; |
53 | asm volatile(ASM_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0), %2) | 53 | asm volatile(ASM_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0), %2) |
54 | : : "r" (va), "r"(0), "i" (CPU_FTR_HVMODE_206) | 54 | : : "r" (va), "r"(0), "i" (CPU_FTR_ARCH_206) |
55 | : "memory"); | 55 | : "memory"); |
56 | break; | 56 | break; |
57 | default: | 57 | default: |
@@ -61,7 +61,7 @@ static inline void __tlbie(unsigned long va, int psize, int ssize) | |||
61 | va |= ssize << 8; | 61 | va |= ssize << 8; |
62 | va |= 1; /* L */ | 62 | va |= 1; /* L */ |
63 | asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2) | 63 | asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2) |
64 | : : "r" (va), "r"(0), "i" (CPU_FTR_HVMODE_206) | 64 | : : "r" (va), "r"(0), "i" (CPU_FTR_ARCH_206) |
65 | : "memory"); | 65 | : "memory"); |
66 | break; | 66 | break; |
67 | } | 67 | } |