Skip to content

Commit 1d14c97

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Let GICv3 save/restore honor visibility attribute
The GICv3 save/restore code never needed any visibility attribute, but that's about to change. Make vgic_v3_has_cpu_sysregs_attr() check the visibility in case a register is hidden. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20250714122634.3334816-6-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent ce7a1cf commit 1d14c97

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

arch/arm64/kvm/vgic-sys-reg-v3.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,12 @@ static u64 attr_to_id(u64 attr)
341341

342342
int vgic_v3_has_cpu_sysregs_attr(struct kvm_vcpu *vcpu, struct kvm_device_attr *attr)
343343
{
344-
if (get_reg_by_id(attr_to_id(attr->attr), gic_v3_icc_reg_descs,
345-
ARRAY_SIZE(gic_v3_icc_reg_descs)))
344+
const struct sys_reg_desc *r;
345+
346+
r = get_reg_by_id(attr_to_id(attr->attr), gic_v3_icc_reg_descs,
347+
ARRAY_SIZE(gic_v3_icc_reg_descs));
348+
349+
if (r && !sysreg_hidden(vcpu, r))
346350
return 0;
347351

348352
return -ENXIO;

0 commit comments

Comments
 (0)