lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8C3ZcMgHuBtIjFR@gmail.com>
Date: Thu, 27 Feb 2025 20:05:09 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "Chang S. Bae" <chang.seok.bae@...el.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, tglx@...utronix.de,
	mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com
Subject: Re: [PATCH RFC v1 02/11] x86/fpu/xstate: Introduce xstate order
 table and accessor macro


* Chang S. Bae <chang.seok.bae@...el.com> wrote:

> The kernel has largely assumed that higher xstate component numbers
> correspond to later offsets in the buffer. However, this assumption does
> not hold for the non-compacted format, where a newer state component may
> have a lower offset.
> 
> When iterating over xstate components in offset order, using the feature
> number as an index may be misleading. At the same time, the CPU exposes
> each component’s size and offset based on its feature number, making it a
> key for state information.
> 
> To provide flexibility in handling xstate ordering, add a mapping table:
> feature order -> feature number. This new array stores feature numbers in
> offset order, accompanied by an accessor macro.
> 
> The macro enables sequential traversal of xstate components based on
> their actual buffer positions, given a feature bitmask. This will be
> particularly useful for computing customized non-compacted format sizes
> and sequentially accessing xstate offsets over non-compacted buffers.
> 
> Suggested-by: Dave Hansen <dave.hansen@...ux.intel.com>
> Signed-off-by: Chang S. Bae <chang.seok.bae@...el.com>
> ---
> This lays the groundwork for handling APX, which has feature number 19
> but appears immediately after FEATURE_YMM, occupying the space previously
> reserved for the now-deprecated MPX state.

So why not just reuse the MPX feature number and have some sort of 
extended feature bit that tells us and userspace that it's APX? The 
xsave area is getting reused anyway - causing all this indirection and 
trouble ...

Since we don't really do much for MPX in the kernel, and APX is not 
supposed to be used by the kernel either, it should be pretty much a 
shoe-in, right?

What's the scope of MPX support in actual processors out in the wild?

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ