Skip to content

Commit ebc88ea

Browse files
iamjpnmpe
authored andcommitted
KVM: PPC: Book3S HV: Use accessors for VCPU registers
Introduce accessor generator macros for Book3S HV VCPU registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230914030600.16993-7-jniethe5@gmail.com
1 parent c8ae9b3 commit ebc88ea

File tree

3 files changed

+139
-72
lines changed

3 files changed

+139
-72
lines changed

arch/powerpc/kvm/book3s_64_mmu_radix.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <asm/kvm_ppc.h>
1717
#include <asm/kvm_book3s.h>
18+
#include "book3s_hv.h"
1819
#include <asm/page.h>
1920
#include <asm/mmu.h>
2021
#include <asm/pgalloc.h>
@@ -294,9 +295,9 @@ int kvmppc_mmu_radix_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
294295
} else {
295296
if (!(pte & _PAGE_PRIVILEGED)) {
296297
/* Check AMR/IAMR to see if strict mode is in force */
297-
if (vcpu->arch.amr & (1ul << 62))
298+
if (kvmppc_get_amr_hv(vcpu) & (1ul << 62))
298299
gpte->may_read = 0;
299-
if (vcpu->arch.amr & (1ul << 63))
300+
if (kvmppc_get_amr_hv(vcpu) & (1ul << 63))
300301
gpte->may_write = 0;
301302
if (vcpu->arch.iamr & (1ul << 62))
302303
gpte->may_execute = 0;

0 commit comments

Comments
 (0)