Re: [PATCH v6 08/33] KVM: arm64: Use accessor functions for core regs

From: Marc Zyngier

Date: Tue Aug 18 2026 - 08:54:15 EST


On Tue, 18 Aug 2026 10:29:24 +0100,
Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:
>
> On Thu, Aug 13, 2026 at 10:56:37AM +0100, Marc Zyngier wrote:
> > On Wed, 12 Aug 2026 16:36:04 +0100,
> > Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:
> > >

[...]

> > > diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
> > > index b01d6622b872..773f6c8e5026 100644
> > > --- a/arch/arm64/kvm/guest.c
> > > +++ b/arch/arm64/kvm/guest.c
> > > @@ -134,19 +134,19 @@ static void *core_reg_addr(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
> > > KVM_REG_ARM_CORE_REG(regs.regs[30]):
> > > off -= KVM_REG_ARM_CORE_REG(regs.mregs[0]);
> > > off /= 2;
> > > - return &vcpu->arch.ctxt.regs.regs[off];
> > > + return &vcpu_gp_regs(vcpu)[off];
> >
> > Doesn't this belong to the previous patch?
> >
>
> My thoughts about positioning this change in this patch:
>
> The previous patch changes the semantics of vcpu_gp_regs and just
> touched the part where the old semantic of the function was used.
> This is mainly done by not using vcpu_gp_regs where it was used before
> as it cannot be used to access e.g. pstate anymore.
>
> This patch then introduces and *uses* new accessor functions for
> abstractions (and uses the vcpu_gp_regs abstraction where it was not
> used before).
> -> The patch changes direct accesses to using accessor functions.
>
> However, I have no strong feelings for this. If you want this in the
> previous patch, I can do that.

I think it'd make more sense. You can capture this in the commit
message to make it clear.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.