The SIGSTKSZ constant may not represent enough stack size in some
architectures as the hardware state size grows.
Use getauxval(AT_MINSIGSTKSZ) to increase the stack size.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
The test measures the kernel's signal delivery with different (enough vs.
insufficient) stack sizes.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Revised test messages again
Context Switch")
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: H.J. Lu
Cc: Fenghua Yu
Cc: Dave Martin
Cc: Michael Ellerman
Cc: x...@kernel.org
Cc: libc-al...@sourceware.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ke
the kernel allows new source code to discover and use a sufficient
alternate signal stack size, this check is still necessary to protect
binaries with insufficient alternate signal stack size from data
corruption.
Suggested-by: Jann Horn
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Reviewed
, and helper functions for the
calculation to be used in a new user interface. Set max_frame_size to a
system-wide worst-case value, instead of storing multiple app-specific
values.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Acked-by: H.J. Lu
Cc: x...@kernel.org
Cc: linux-kernel
Define the AT_MINSIGSTKSZ in generic Linux. It is already used as generic
ABI in glibc's generic elf.h, and this define will prevent future namespace
conflicts. In particular, x86 is also using this generic definition.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Carlos O'Donell
Cc
-1-chang.seok@intel.com/
Chang S. Bae (6):
uapi: Define the aux vector AT_MINSIGSTKSZ
x86/signal: Introduce helpers to get the maximum signal frame size
x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ
selftest/sigaltstack: Use the AT_MINSIGSTKSZ aux vector if available
x86/signal
The test measures the kernel's signal delivery with different (enough vs.
insufficient) stack sizes.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Revised test messages again
-chang.seok@intel.com/
[10]:
https://lore.kernel.org/lkml/20210203172242.29644-1-chang.seok@intel.com/
Chang S. Bae (6):
uapi: Define the aux vector AT_MINSIGSTKSZ
x86/signal: Introduce helpers to get the maximum signal frame size
x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ
the kernel allows new source code to discover and use a sufficient
alternate signal stack size, this check is still necessary to protect
binaries with insufficient alternate signal stack size from data
corruption.
Suggested-by: Jann Horn
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Reviewed
The SIGSTKSZ constant may not represent enough stack size in some
architectures as the hardware state size grows.
Use getauxval(AT_MINSIGSTKSZ) to increase the stack size.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Context Switch")
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: H.J. Lu
Cc: Fenghua Yu
Cc: Dave Martin
Cc: Michael Ellerman
Cc: x...@kernel.org
Cc: libc-al...@sourceware.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ke
, and helper functions for the
calculation to be used in a new user interface. Set max_frame_size to a
system-wide worst-case value, instead of storing multiple app-specific
values.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Acked-by: H.J. Lu
Cc: x...@kernel.org
Cc: linux-kernel
Define the AT_MINSIGSTKSZ in generic Linux. It is already used as generic
ABI in glibc's generic elf.h, and this define will prevent future namespace
conflicts. In particular, x86 is also using this generic definition.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Carlos O'Donell
Cc
-point (BF16) elements.
Here we add AMX to the kernel/user ABI, by enumerating the capability.
E.g., /proc/cpuinfo: amx_tile, amx_bf16, amx_int8
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/include/asm/cpufeatures.h | 3
is feature).
Rename XFEATURE_MASK_USER_SUPPORTED to XFEATURE_MASK_USER_ENABLED to be
aligned with the new parameters.
While this cmdline is currently enabled only for AMX, it is intended to be
easily enabled to be useful for future XSAVE-enabled features.
Signed-off-by: Chang S. Bae
Reviewed-
ify in the signal handler that the signal frame
excludes AMX data when the signaled thread has initialized AMX state.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-kselft...@vger.kernel.org
---
Changes from v3:
* Removed 'no functio
that there will be gaps in the
XCR0 feature bit numbers.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v1:
* Rebased on the upstream kernel (5.10)
---
arch/x86/kernel/fpu/xstate.c | 41
initialized its AMX state.
Collect the test cases of validating those operations together, as they
share some common setup for the AMX state.
These test cases do not depend on AMX compiler support, as they employ
userspace-XSAVE directly to access AMX state.
Signed-off-by: Chang S. Bae
Reviewed
to represent the embedded
buffer.
Every child process will set the pointer on its creation. And the initial
task sets it before dealing with soft FPU.
No functional change.
Suggested-by: Borislav Petkov
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel
ptrace() may update xstate data before the target task has taken an XFD
fault and expanded the xstate buffer. Detect this case and allocate a
sufficient buffer to support the request. Also, disable the (now
unnecessary) associated first-use fault.
Signed-off-by: Chang S. Bae
Reviewed-by: Len
to find a component's offset accordingly.
When copying an initial value, explicitly check the init_fpstate coverage.
If not found, reset the memory in the destination. Otherwise, copy values
from init_fpstate.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel
()
xfirstuse_not_detected()
The #NM handler induces the xstate buffer expansion to save the first-used
states.
The XFD feature is enabled only for the compacted format. If the kernel
uses the standard format, the buffer has to be always enough for all the
states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len
embedded
buffer size by excluding the dynamic user states from the maximum size.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Updated the changelog. (Borislav Petkov)
* Updated the code comment. (Borislav Petkov
In 64-bit mode, include the AMX state components in
XFEATURE_MASK_USER_SUPPORTED.
The XFD feature will be used to dynamically expand the xstate per-task
buffer on the first use.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch
it for the address finder.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Added the function description in the kernel-doc style. (Borislav Petkov)
* Removed 'no functional change' in the changelog. (Borislav Petkov)
---
arch/x86
as the user buffer size.
No functional change. Those sizes have no difference, as the buffer is not
dynamic yet.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
Changes from v3:
* Added as a new patch to add
. The states are named as 'dynamic'
supervisor states. Some define and helper are not named with dynamic
supervisor states, so rename them.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Updated
Extend copy_xregs_to_kernel() to receive a mask argument of which states to
save, in preparation for dynamic user state handling.
Update KVM to set a valid fpu->state_mask, so it can continue to share with
the core code.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
to
configure XCOMP_BV for the compacted format.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
Changes from v3:
* Updated the changelog. (Borislav Petkov)
* Updated the function comment to use
. The first implementation supports
8KB.
Check the XTILEDATA state size dynamically. The feature introduces the new
tile register, TMM. Define one register struct only and read the number of
registers from CPUID. Cross-check the overall size with CPUID again.
Signed-off-by: Chang S. Bae
Reviewed
but having
initial data with zeros.
Expand copy_xregs_to_kernel_booting() to receive a mask argument of which
states to save.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Removed the helper functions. (Borislav Petkov
Have all the functions copying xstate take a struct fpu * pointer in
preparation for dynamic state buffer support.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Updated the changelog
Have all the functions finding xstate address take a struct fpu * pointer
in preparation for dynamic state buffer support.
init_fpstate is a special case, which is indicated by a null pointer
parameter to get_xsave_addr() and __raw_xsave_addr().
No functional change.
Signed-off-by: Chang S. Bae
new field and helper to initialize the buffer.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Updated code comments. (Borislav Petkov)
* Used vzalloc() instead of vmalloc() with memset(). (Borislav Petkov)
* Removed the
Have the function restoring xstate take a struct fpu * pointer in
preparation for dynamic state buffer support.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
Changes from v3:
* Updated
rnel.org/lkml/20201001203913.9125-1-chang.seok@intel.com/
[5]:
https://lore.kernel.org/lkml/20201119233257.2939-1-chang.seok@intel.com/
[6]:
https://lore.kernel.org/lkml/20201223155717.19556-1-chang.seok@intel.com/
Chang S. Bae (22):
x86/fpu/xstate: Modify the initialization helper t
that confusing helper and simply check
the feature in the first place -- if XSAVES is available or not.
Cleanup only. No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Dave Hansen
Cc: Borislav Petkov
Cc: linux-kernel@vger.kernel.org
Cc: x...@kernel.org
---
Changes from v1
The test measures the kernel's signal delivery with different (enough vs.
insufficient) stack sizes.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Borislav Petkov
Cc: x...@kernel.org
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Revised
, and helper functions for the
calculation to be used in a new user interface. Set max_frame_size to a
system-wide worst-case value, instead of storing multiple app-specific
values.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Acked-by: H.J. Lu
Cc: Borislav Petkov
Cc: x...@kernel.org
Cc
signal stack size, this check is still necessary
to protect binaries with insufficient alternate signal stack size from data
corruption.
Suggested-by: Jann Horn
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Reviewed-by: Jann Horn
Cc: Borislav Petkov
Cc: Jann Horn
Cc: x...@kernel.org
Cc
to the support
added for ARM in commit 94b07c1f8c39 ("arm64: signal: Report signal frame
size to userspace via auxv").
Reported-by: Florian Weimer
Fixes: c2bc11f10a39 ("x86, AVX-512: Enable AVX-512 States Context Switch")
Signed-off-by: Chang S. Bae
Reviewed-by: Len Br
/lkml/20210115211038.2072-1-chang.seok@intel.com/
Chang S. Bae (5):
uapi: Move the aux vector AT_MINSIGSTKSZ define to uapi
x86/signal: Introduce helpers to get the maximum signal frame size
x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ
x86/signal: Detect and prevent an alternate
Move the AT_MINSIGSTKSZ definition to generic Linux from arm64. It is
already used as generic ABI in glibc's generic elf.h, and this move will
prevent future namespace conflicts. In particular, x86 will re-use this
generic definition.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc
and simply test for what we want to
know in the first place -- if we have XSAVES or not.
Cleanup only. No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Dave Hansen
Cc: Borislav Petkov
Cc: linux-kernel@vger.kernel.org
Cc: x...@kernel.org
---
arch/x86/include/asm/fpu
The test measures the kernel's signal delivery with different (enough vs.
insufficient) stack sizes.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Borislav Petkov
Cc: x...@kernel.org
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v3:
* Revised
signal stack size, this check is still necessary
to protect binaries with insufficient alternate signal stack size from data
corruption.
Suggested-by: Jann Horn
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Reviewed-by: Jann Horn
Cc: Borislav Petkov
Cc: Jann Horn
Cc: x...@kernel.org
Cc
, and helper functions for the
calculation to be used in a new user interface. Set max_frame_size to a
system-wide worst-case value, instead of storing multiple app-specific
values.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Acked-by: H.J. Lu
Cc: Borislav Petkov
Cc: x...@kernel.org
Cc
@intel.com/
[7]: https://lore.kernel.org/lkml/20201119190237.626-1-chang.seok@intel.com/
[8]:
https://lore.kernel.org/lkml/20201223015312.4882-1-chang.seok@intel.com/
Chang S. Bae (4):
x86/signal: Introduce helpers to get the maximum signal frame size
x86/elf: Support a new ELF aux
to the support
added for ARM in commit 94b07c1f8c39 ("arm64: signal: Report signal frame
size to userspace via auxv").
Reported-by: Florian Weimer
Fixes: c2bc11f10a39 ("x86, AVX-512: Enable AVX-512 States Context Switch")
Signed-off-by: Chang S. Bae
Reviewed-by: Len Br
is feature).
Rename XFEATURE_MASK_USER_SUPPORTED to XFEATURE_MASK_USER_ENABLED to be
aligned with the new parameters.
While this cmdline is currently enabled only for AMX, it is intended to be
easily enabled to be useful for future XSAVE-enabled features.
Signed-off-by: Chang S. Bae
Reviewed-
In 64-bit mode, include the AMX state components in
XFEATURE_MASK_USER_SUPPORTED.
The XFD feature will be used to dynamically allocate per-task XSAVE
buffer on first use.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86
supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Updated the changelog with task->fpu removed. (Boris Petkov)
---
arch/x86/include/asm/fpu/internal.h | 10 ++
arch/x86/include/asm/
initialized its AMX state.
Collect the test cases of validating those operations together, as they
share some common setup for the AMX state.
These test cases do not depend on AMX compiler support, as they employ
user-space-XSAVE directly to access AMX state.
Signed-off-by: Chang S. Bae
Reviewed
. The first implementation supports
8KB.
Check the XTILEDATA state size dynamically. The feature introduces the new
tile register, TMM. Define one register struct only and read the number of
registers from CPUID. Cross-check the overall size with CPUID again.
Signed-off-by: Chang S. Bae
Reviewed
that there will be gaps in the
XCR0 feature bit numbers.
No functional change, until hardware with bit number gaps in XCR0.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v1:
* Rebased on the upstream kernel (5.10)
---
arch/x86/kernel
-point (BF16) elements.
Here we add AMX to the kernel/user ABI, by enumerating the capability.
E.g., /proc/cpuinfo: amx_tile, amx_bf16, amx_int8
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/include/asm/cpufeatures.h | 3
supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Updated the changelog with task->fpu removed. (Boris Petkov)
* Updated the code comments.
---
arch/x86/kernel/fpu/regset.c |
to be large but having
initial data with zeros.
No functional change until the kernel supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Updated the changelog for clarification.
* Updated
r size.
No functional change until the kernel supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Updated the changelog with task->fpu removed. (Boris Petkov)
* Replaced 'area' wit
.
No functional change until the kernel enables dynamic user states and XFD.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Changed to enable XFD only when the compacted format is used.
* Updated the changelog with task
().
Also, fpstate_init_xstate() now accepts the state component bitmap to
configure XCOMP_BV for the compacted format.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
Changes from v2
buffer size by
excluding the dynamic user states from the maximum xstate size.
No functional change, until the kernel enables dynamic buffer support.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
Changes from
S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Updated the changelog with task->fpu removed. (Boris Petkov)
---
arch/x86/kernel/fpu/xstate.c | 55 +++-
1 file changed, 41 insertions(+), 14 deleti
In preparation for dynamic xstate buffer expansion, update the xstate
restore function parameters to equally handle static in-line xstate buffer,
as well as dynamically allocated xstate buffer.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc
.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Updated the changelog for clarification.
---
arch/x86/include/asm/fpu/xstate.h | 12 +++-
arch/x86/kernel/fpu/xstate.c | 29 +++--
2
it for the address finder.
No functional change until the kernel enables dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/kernel/fpu/xstate.c | 82 +++-
1 file changed, 52 insertions(+), 30
-1-chang.seok@intel.com/
Chang S. Bae (21):
x86/fpu/xstate: Modify initialization helper to handle both static and
dynamic buffers
x86/fpu/xstate: Modify state copy helpers to handle both static and
dynamic buffers
x86/fpu/xstate: Modify address finders to handle both static an
In preparation for dynamic xstate buffer expansion, update the xstate
copy function parameters to equally handle static in-line buffer, as well
as dynamically allocated xstate buffer.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel
() and __raw_xsave_addr().
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
Changes from v2:
* Updated the changelog with task->fpu removed. (Boris Petkov)
Changes from v1:
* Reba
ask to select states.
KVM used to save all xstate via copy_xregs_to_kernel(). Update KVM to set a
valid fpu->state_mask, which will be necessary to correctly handle dynamic
state buffers.
No functional change until the kernel supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len
ify in the signal handler that the signal frame
excludes AMX data when the signaled thread has initialized AMX state.
No functional change until the kernel supports the dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-kse
The test measures the kernel's signal delivery with different (enough vs.
insufficient) stack sizes.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Borislav Petkov
Cc: x...@kernel.org
Cc: linux-kselft...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v2:
* Revised
on systems with large XSAVE state. The
effort to increase the size typically used for altstacks reduces the
frequency of these overflows, but this approach is still useful for legacy
binaries.
Suggested-by: Jann Horn
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: Jann Horn
Cc: x...@kernel.org
to the support
added for ARM in commit 94b07c1f8c39 ("arm64: signal: Report signal frame
size to userspace via auxv").
Reported-by: Florian Weimer
Fixes: c2bc11f10a39 ("x86, AVX-512: Enable AVX-512 States Context Switch")
Signed-off-by: Chang S. Bae
Reviewed-by: Len Br
, and helper functions for the
calculation to be used in a new user interface. Set max_frame_size to a
system-wide worst-case value, instead of storing multiple app-specific
values.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Acked-by: H.J. Lu
Cc: Borislav Petkov
Cc: x...@kernel.org
Cc
?id=153531
[5]:
https://blog.linuxplumbersconf.org/2017/ocw/system/presentations/4671/original/plumbers-dm-2017.pdf
[6]:
https://lore.kernel.org/lkml/20200929205746.6763-1-chang.seok@intel.com/
[7]: https://lore.kernel.org/lkml/20201119190237.626-1-chang.seok@intel.com/
Chang S. Bae (4
code follows the AES-NI implementation. It has higher priority than
the AES-NI as providing key protection.
Signed-off-by: Chang S. Bae
Cc: Herbert Xu
Cc: x...@kernel.org
Cc: linux-cry...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/crypto/Makefile | 3 +
arch/x86
The test validates the internal key to be the same in all CPUs.
It performs the validation again with the Suspend-To-RAM (ACPI S3) state.
Signed-off-by: Chang S. Bae
Cc: linux-kernel@vger.kernel.org
Cc: linux-kselft...@vger.kernel.org
---
tools/testing/selftests/x86/Makefile| 2 +-
tools
Add a kernel config option to enable the feature (disabled by default) at
compile-time.
Also, add a new command-line parameter -- 'nokeylocker' to disable the
feature at boot-time.
Signed-off-by: Chang S. Bae
Cc: x...@kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
.
Disable the feature when the copy fails (or the backup corrupts). The
shutdown is considered too noisy. A new key is considerable only when
threads can be synchronously suspended.
Signed-off-by: Chang S. Bae
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux...@vger.kernel.org
---
arch/x86
Key Locker internal key in a CPU state can be backed up in a platform
register. The backup can be also copied back to a CPU state. This mechanism
is useful to restore the key (after system sleep).
Add MSRs for the internal key backup, copy, and status check.
Signed-off-by: Chang S. Bae
Cc: x
value to other CPUs.
This randomization option is disabled when hardware does not support the
key backup.
Signed-off-by: Chang S. Bae
Cc: Mark Brown
Cc: x...@kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/include/asm/keylocker.h | 2 +-
arch/x86/kernel/cpu
as the load is done.
The BIOS may disable the feature. Check the dynamic CPUID bit
(KEYLOCKER_CPUID_EBX_AESKLE) at first.
Add byte code for LOADIWKEY -- an instruction to load the internal key, in
the 'x86-opcode-map.txt' file to avoid objtool's misinterpretation.
Signed-off-by: Chang S. Bae
Cc: x
-specific CPUID leaf and bits for the feature
enablement.
Key Locker is on the disabled list, which is useful for compile-time
configuration later.
Signed-off-by: Chang S. Bae
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86
/content/dam/develop/external/us/en/documents/343965-intel-key-locker-speci$
Chang S. Bae (8):
x86/cpufeature: Enumerate Key Locker feature
x86/cpu: Load Key Locker internal key at boot-time
x86/msr-index: Add MSRs for Key Locker internal key
x86/power: Restore Key Locker internal key from
The xstate infrastructure is not flexible to support dynamic areas in
task->fpu. Make the xstate copy functions to access task->fpu directly.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/inclu
use status and handling #NM
trap:
xfirstuse_enabled()
xfirstuse_not_detected()
The #NM handler induces the xstate area expansion to save the first-used
states.
No functional change until the kernel enables dynamic user states and XFD.
Signed-off-by: Chang S. Bae
Reviewed-by:
at does NOT have AMX
compiled into XFEATURE_MASK_USER_ENABLED (assuming the kernel is new enough
to support this feature).
While this cmdline is currently enabled only for AMX, it is intended to be
easily enabled to be useful for future XSAVE-enabled features.
Signed-off-by: Chang S. Bae
Reviewed-
xstate() now accepts the state component bitmap to configure
XCOMP_BV.
No functional change.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
arch/x86/include/asm/fpu/internal.h | 6 +++---
arch/x86/kernel/fpu/
ptrace() may request an update to task->fpu that has not yet been
allocated. Detect this case and allocate task->fpu to support the request.
Also, disable the (now unnecessary) associated first-use fault.
No functional change until the kernel supports dynamic user states.
Signed-off-by: C
. The first implementation supports
8KB.
Check the XTILEDATA state size dynamically. The feature introduces the new
tile register, TMM. Define one register struct only and read the number of
registers from CPUID. Cross-check the overall size with CPUID again.
Signed-off-by: Chang S. Bae
Reviewed
igned-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes from v1:
* Removed unneeded interrupt masking (Andy Lutomirski)
* Added vmalloc() error tracing (Dave Hansen, PeterZ, and Andy Lutomirski)
---
arch/x86/include/asm/fpu/types
E's instruction mask to select states.
KVM saves xstate in guest_fpu and user_fpu. With the change, the KVM code
needs to ensure a valid fpu->state_mask before XSAVE.
No functional change until the kernel supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.
has initialized its AMX state.
Collect the test cases of validating those operations together, as they
share some common setup for the AMX state.
These test cases do not depend on AMX compiler support, as they employ
user-space-XSAVE directly to access AMX state.
Signed-off-by: Chang S. Bae
ate.
No functional change until the kernel supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/kernel/fpu/xstate.c | 55 +++-
1 file changed, 41 insertions(+), 14 deleti
nly.
No functional change as long as the kernel does not support the dynamic
area.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: k...@vger.kernel.org
---
arch/x86/include/asm/processor.h | 10 ++-
arch/x86/kernel/fpu/core.c |
@intel.com/
Chang S. Bae (22):
x86/fpu/xstate: Modify area init helper prototypes to access all the
possible areas
x86/fpu/xstate: Modify xstate copy helper prototypes to access all the
possible areas
x86/fpu/xstate: Modify address finder prototypes to access all the
possible areas
it for the address finder.
No functional change until the kernel enables dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/kernel/fpu/xstate.c | 82 +++-
1 file changed, 52 insertions(+), 30
change until the kernel supports dynamic user states.
Signed-off-by: Chang S. Bae
Reviewed-by: Len Brown
Cc: x...@kernel.org
Cc: linux-kernel@vger.kernel.org
---
arch/x86/include/asm/fpu/internal.h | 10 ++
arch/x86/include/asm/fpu/xstate.h | 10 ++
arch/x86/include/asm/trace/f
1 - 100 of 510 matches
Mail list logo