Skip to content

Commit e8ebedb

Browse files
mikeympe
authored andcommitted
KVM: PPC: Book3S HV: Return error from h_set_dabr() on POWER9
POWER7 compat mode guests can use h_set_dabr on POWER9. POWER9 should use the DAWR but since it's disabled there we can't. This returns H_UNSUPPORTED on a h_set_dabr() on POWER9 where the DAWR is disabled. Current Linux guests ignore this error, so they will silently not get the DAWR (sigh). The same error code is being used by POWERVM in this case. Signed-off-by: Michael Neuling <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 398e712 commit e8ebedb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

arch/powerpc/include/asm/hvcall.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
#define H_P8 -61
8989
#define H_P9 -62
9090
#define H_TOO_BIG -64
91+
#define H_UNSUPPORTED -67
9192
#define H_OVERLAP -68
9293
#define H_INTERRUPT -69
9394
#define H_BAD_DATA -70

arch/powerpc/kvm/book3s_hv_rmhandlers.S

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,8 +2563,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
25632563
li r3,0
25642564
blr
25652565

2566+
2:
2567+
BEGIN_FTR_SECTION
2568+
/* POWER9 with disabled DAWR */
2569+
li r3, H_UNSUPPORTED
2570+
blr
2571+
END_FTR_SECTION_IFCLR(CPU_FTR_DAWR)
25662572
/* Emulate H_SET_DABR/X on P8 for the sake of compat mode guests */
2567-
2: rlwimi r5, r4, 5, DAWRX_DR | DAWRX_DW
2573+
rlwimi r5, r4, 5, DAWRX_DR | DAWRX_DW
25682574
rlwimi r5, r4, 2, DAWRX_WT
25692575
clrrdi r4, r4, 3
25702576
std r4, VCPU_DAWR(r3)

0 commit comments

Comments
 (0)