Re: [PATCH v2 3/8] x86: Grant AMX permission for guest

2022-02-25 Thread Yang Zhong
On Thu, Feb 17, 2022 at 02:44:10PM +0100, Paolo Bonzini wrote: > On 2/17/22 06:58, Yang Zhong wrote: > >>+ > >>+if ((mask & XSTATE_XTILE_DATA_MASK) == XSTATE_XTILE_DATA_MASK) { > >>+bitmask = kvm_arch_get_supported_cpuid(s, 0xd, 0, R_EAX); > >>+if (!(bitmask &

Re: [PATCH v2 3/8] x86: Grant AMX permission for guest

2022-02-17 Thread Paolo Bonzini
On 2/17/22 06:58, Yang Zhong wrote: + +if ((mask & XSTATE_XTILE_DATA_MASK) == XSTATE_XTILE_DATA_MASK) { +bitmask = kvm_arch_get_supported_cpuid(s, 0xd, 0, R_EAX); +if (!(bitmask & XSTATE_XTILE_DATA_MASK)) { Paolo, last time you suggested below changes for here: rc =

Re: [PATCH v2 3/8] x86: Grant AMX permission for guest

2022-02-16 Thread Yang Zhong
On Wed, Feb 16, 2022 at 10:04:29PM -0800, Yang Zhong wrote: > Kernel allocates 4K xstate buffer by default. For XSAVE features > which require large state component (e.g. AMX), Linux kernel > dynamically expands the xstate buffer only after the process has > acquired the necessary permissions.

[PATCH v2 3/8] x86: Grant AMX permission for guest

2022-02-16 Thread Yang Zhong
Kernel allocates 4K xstate buffer by default. For XSAVE features which require large state component (e.g. AMX), Linux kernel dynamically expands the xstate buffer only after the process has acquired the necessary permissions. Those are called dynamically- enabled XSAVE features (or dynamic