On Fri, Apr 18, 2025 at 01:51:02PM -0700, Chang S. Bae wrote: >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. v3 was the version where I truly began refining the patches based on my understanding, the historical discussion, and feedback on v2 [*]. While reviewing the historical discussion, I found Maxim's suggestion to be valuable: https://lore.kernel.org/kvm/af972fe5981b9e7101b64de43c7be0a8cc165323.camel@xxxxxxxxxx/ So, I implemented it in v3, but I should have included the link. [*] v2 was simply a resend of v1 https://lore.kernel.org/kvm/20241126101710.62492-1-chao.gao@xxxxxxxxx/ >> @@ -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 a lot.