Skip to content

Commit 1a1e686

Browse files
ShivaprasadGBhatmpe
authored andcommitted
KVM: PPC: Book3S HV: Add one-reg interface for DEXCR register
The patch adds a one-reg register identifier which can be used to read and set the DEXCR for the guest during enter/exit with KVM_REG_PPC_DEXCR. The specific SPR KVM API documentation too updated. Signed-off-by: Shivaprasad G Bhat <[email protected]> Reviewed-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 009f6f4 commit 1a1e686

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ registers, find a list below:
24412441
PPC KVM_REG_PPC_PTCR 64
24422442
PPC KVM_REG_PPC_DAWR1 64
24432443
PPC KVM_REG_PPC_DAWRX1 64
2444+
PPC KVM_REG_PPC_DEXCR 64
24442445
PPC KVM_REG_PPC_TM_GPR0 64
24452446
...
24462447
PPC KVM_REG_PPC_TM_GPR31 64

arch/powerpc/include/asm/kvm_host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ struct kvm_vcpu_arch {
599599
ulong dawrx0;
600600
ulong dawr1;
601601
ulong dawrx1;
602+
ulong dexcr;
602603
ulong ciabr;
603604
ulong cfar;
604605
ulong ppr;

arch/powerpc/include/uapi/asm/kvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ struct kvm_ppc_cpu_char {
645645
#define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3)
646646
#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4)
647647
#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5)
648+
#define KVM_REG_PPC_DEXCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc6)
648649

649650
/* Transactional Memory checkpointed state:
650651
* This is all GPRs, all VSX regs and a subset of SPRs

arch/powerpc/kvm/book3s_hv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,6 +2349,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
23492349
case KVM_REG_PPC_DAWRX1:
23502350
*val = get_reg_val(id, kvmppc_get_dawrx1_hv(vcpu));
23512351
break;
2352+
case KVM_REG_PPC_DEXCR:
2353+
*val = get_reg_val(id, kvmppc_get_dexcr_hv(vcpu));
2354+
break;
23522355
case KVM_REG_PPC_CIABR:
23532356
*val = get_reg_val(id, kvmppc_get_ciabr_hv(vcpu));
23542357
break;
@@ -2592,6 +2595,9 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
25922595
case KVM_REG_PPC_DAWRX1:
25932596
kvmppc_set_dawrx1_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP);
25942597
break;
2598+
case KVM_REG_PPC_DEXCR:
2599+
kvmppc_set_dexcr_hv(vcpu, set_reg_val(id, *val));
2600+
break;
25952601
case KVM_REG_PPC_CIABR:
25962602
kvmppc_set_ciabr_hv(vcpu, set_reg_val(id, *val));
25972603
/* Don't allow setting breakpoints in hypervisor code */

arch/powerpc/kvm/book3s_hv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr0, 64, KVMPPC_GSID_DAWR0)
116116
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64, KVMPPC_GSID_DAWR1)
117117
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64, KVMPPC_GSID_DAWRX0)
118118
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64, KVMPPC_GSID_DAWRX1)
119+
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dexcr, 64, KVMPPC_GSID_DEXCR)
119120
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64, KVMPPC_GSID_CIABR)
120121
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64, KVMPPC_GSID_WORT)
121122
KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ppr, 64, KVMPPC_GSID_PPR)

0 commit comments

Comments
 (0)