[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd14e94f-dbf8-4a2b-9e92-66dd23a3940b@intel.com>
Date: Fri, 18 Apr 2025 13:51:02 -0700
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Chao Gao <chao.gao@...el.com>, <x86@...nel.org>,
<linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>, <tglx@...utronix.de>,
<dave.hansen@...el.com>, <seanjc@...gle.com>, <pbonzini@...hat.com>
CC: <peterz@...radead.org>, <rick.p.edgecombe@...el.com>,
<weijiang.yang@...el.com>, <john.allen@....com>, <bp@...en8.de>,
<xin3.li@...el.com>, Maxim Levitsky <mlevitsk@...hat.com>, Ingo Molnar
<mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter
Anvin" <hpa@...or.com>, Samuel Holland <samuel.holland@...ive.com>, "Mitchell
Levy" <levymitchell0@...il.com>, Stanislav Spassov <stanspas@...zon.de>,
"Eric Biggers" <ebiggers@...gle.com>
Subject: Re: [PATCH v5 2/7] x86/fpu: Drop @perm from guest pseudo FPU
container
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@...hat.com>
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@...el.com>
Thanks,
Chang
Powered by blists - more mailing lists