Re: [PATCH v5 2/7] x86/fpu: Drop @perm from guest pseudo FPU container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/10/2025 12:24 AM, Chao Gao wrote:
Remove @perm from the guest pseudo FPU container. The field is
initialized during allocation and never used later.

Rename fpu_init_guest_permissions() to show that its sole purpose is to
lock down guest permissions.

Suggested-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx>

This patch appears to be new in V3, as I can see from the diff here:

https://github.com/ChangSeokBae/kernel/compare/xstate-scet-chao-v2...xstate-scet-chao-v3

However, I don’t see any relevant comment from Maxim on your V2 series. Unlike patch 1, this one doesn’t include a URL referencing the suggestion either -- so I suspect the Suggested-by tag might be incorrect.
@@ -255,7 +252,7 @@ bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu)
  	if (WARN_ON_ONCE(fpu_user_cfg.default_size > gfpu->uabi_size))
  		gfpu->uabi_size = fpu_user_cfg.default_size;
- fpu_init_guest_permissions(gfpu);
+	fpu_lock_guest_permissions();

As a future improvement, you might consider updating this to:

    if (xstate_get_guest_group_perm() & FPU_GUEST_PERM_LOCKED)
        fpu_lock_guest_permissions();

Or, embed the check inside fpu_lock_guest_permissions():

    if (xstate_get_guest_group_perm() & FPU_GUEST_PERM_LOCKED)
        return;

But for this patch itself, the change looks good to me. Please feel free to add my tag:

    Reviewed-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>

Thanks,
Chang




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux