The 2023 architecture extensions have allocated some new ID registers, add
them to the KVM system register descriptions so that they are visible to
guests.
Signed-off-by: Mark Brown
---
arch/arm64/kvm/sys_regs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch
Add the hwcaps added for the 2023 DPISA extensions to the hwcaps test
program.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/abi/hwcap.c | 217 ++
1 file changed, 217 insertions(+)
diff --git a/tools/testing/selftests/arm64/abi/hwcap.c
b/tools/testing
FEAT_FPMR defines a new register FMPR which is available at all ELs and is
discovered via ID_AA64PFR2_EL1.FPMR, add this to the set of registers that
get-reg-list knows to check for with the required identification register
depdendency.
Signed-off-by: Mark Brown
---
tools/testing/selftests/kvm
The 2023 architecture extensions allocated some previously usused feature
registers, add comments mapping the names in get-reg-list as we do for the
other allocated registers.
Signed-off-by: Mark Brown
---
tools/testing/selftests/kvm/aarch64/get-reg-list.c | 4 ++--
1 file changed, 2 insertions
On Thu, Oct 26, 2023 at 05:10:47PM +, Edgecombe, Rick P wrote:
> On Mon, 2023-10-23 at 19:32 +0100, Mark Brown wrote:
> > Right. We're already adding the cost of the extra map_shadow_stack()
> > so
> > it doesn't seem that out of scope. We could also allow
On Fri, Oct 27, 2023 at 12:49:59PM +0100, szabolcs.n...@arm.com wrote:
> The 10/26/2023 13:40, Deepak Gupta wrote:
> > In general, I am assuming such placement requirements emanate because
> > regular stack holds data (local args, etc) as well and thus software may
> > make assumptions about how s
On Fri, Oct 27, 2023 at 07:08:41PM +0100, Joey Gouly wrote:
> Add PKEY support to signals, by saving and restoring POR_EL0 from the
> stackframe.
Reviewed-by: Mark Brown
signature.asc
Description: PGP signature
On Fri, Oct 27, 2023 at 07:08:47PM +0100, Joey Gouly wrote:
> + {
> + .name = "POE",
> + .at_hwcap = AT_HWCAP2,
> + .hwcap_bit = HWCAP2_POE,
> + .cpuinfo = "poe",
> + .sigill_fn = poe_sigill,
> + },
We should set sigill_reliable
On Fri, Oct 27, 2023 at 07:08:48PM +0100, Joey Gouly wrote:
> Teach the signal frame parsing about the new POE frame, avoids warning when it
> is generated.
Reviewed-by: Mark Brown
signature.asc
Description: PGP signature
On Thu, Nov 02, 2023 at 07:15:58PM +0530, Naresh Kamboju wrote:
> On Thu, 2 Nov 2023 at 17:41, Aishwarya TCV wrote:
> > https://storage.kernelci.org/mainline/master/v6.6-9152-gdeefd5024f07/arm64/defconfig%2Bkselftest/gcc-10/logs/kselftest.log
...
> May be due to, A loop of symlinks that are poi
On Tue, Nov 07, 2023 at 06:43:25PM +0530, Naresh Kamboju wrote:
> # # SVE-VL-64-0: Expected
> [390439044000390480003904c0003904000139044001390480013904c0013904000239044002390480023904c0023904000339044003390480033904c003]
> <>
You've elided *lots* of error reports from the actual test which su
On Mon, Nov 06, 2023 at 11:09:44AM -0600, Rob Herring wrote:
> A simple solution would be instead of passing the source tree root to
> dt-extract-compatibles, pass 'arch', 'drivers', and 'sound' instead.
> There shouldn't be compatibles anywhere else.
This does seem like a reasonable quick fix th
On Tue, Nov 07, 2023 at 08:14:59PM +0530, Naresh Kamboju wrote:
> On Tue, 7 Nov 2023 at 19:51, Mark Brown wrote:
> > This all seems very surprising, especially given that AFAICT there are
> > no changes in stable-6.6-rc for arch/arm64.
> We do not see on the mainline a
On Thu, Nov 09, 2023 at 06:57:08PM +0530, Naresh Kamboju wrote:
> Following kernel panic noticed while running selftests: exec: load_address
> on Fastmodels (FVP) running Linux next-20231109.
>
Copying in Kees and Eric who maintain the exec API.
> Reported-by: Linux Kernel Functional Testing
>
oduce vcpu
configs")
Reviewed-by: Andrew Jones
Signed-off-by: Mark Brown
---
Changes in v3:
- Rebase this bugfix onto v6.7-rc1
- Link to v2:
https://lore.kernel.org/r/20231017-kvm-get-reg-list-str-init-v2-1-ee30b1df3...@kernel.org
Changes in v2:
- Update Fixes: tag.
- Link to
ogram that duplicates the boilerplace for tracing a
target and doesn't actually run the traced program.
Signed-off-by: Mark Brown
---
Changes in v2:
- Rebase onto v6.7-rc1.
- Link to v1:
https://lore.kernel.org/r/20231026-arm64-2023-dpisa-v1-0-8470dd989...@kernel.org
---
Mark Brown (21):
ar
DDI0601 2023-09 defines a new system register ID_AA64PFR2_EL1 which
enumerates FPMR and some new MTE features. Add a definition of this
register.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 21 +
1 file changed, 21 insertions(+)
diff --git a/arch/arm64/tools
DDI0601 2023-09 adds a new system register ID_AA64ISAR3_EL1 enumerating
new floating point and TLB invalidation features. Add a defintion for it.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 17 +
1 file changed, 17 insertions(+)
diff --git a/arch/arm64/tools/sysreg
DDI0601 2023-09 defines a new feature register ID_AA64FPFR0_EL1 which
enumerates a number of FP8 related features. Add a definition for it.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 29 +
1 file changed, 29 insertions(+)
diff --git a/arch/arm64/tools
DDI0601 2023-09 defines some new fields in previously RES0 space in
ID_AA64ISAR2_EL1, together with one new enum value. Update the system
register definition to reflect this.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 24 ++--
1 file changed, 22 insertions(+), 2
The 2023-09 release of DDI0601 defines a number of new feature enumeration
fields in ID_AA64SMFR0_EL1. Add these fields.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 30 +++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/tools
DDI0601 2023-09 defines some new fields in SCTLR_EL1 controlling new MTE
and floating point features. Update our sysreg definition to reflect these.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/tools
DDI0601 2023-09 defines a new sysrem register FPMR (Floating Point Mode
Register) which configures the new FP8 features. Add a definition of this
register.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 23 +++
1 file changed, 23 insertions(+)
diff --git a/arch
DDI0601 2023-09 defines new fields in HCRX_EL2 controlling access to new
system registers, update our definition of HCRX_EL2 to reflect this.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/tools/sysreg b
The 2023 architecture extensions have defined several new ID registers,
hook them up to the cpufeature code so we can add feature checks and hwcaps
based on their contents.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/cpu.h | 3 +++
arch/arm64/kernel/cpufeature.c | 28
means that it is not practical to extend that
directly.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/cpufeature.h | 5 +
arch/arm64/include/asm/fpsimd.h | 2 ++
arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/include/asm/processor.h | 2 ++
arch/arm64/kernel/cpufeature.c
Expose FPMR in the signal context on systems where it is supported. The
kernel validates the exact size of the FPSIMD registers so we can't readily
add it to fpsimd_context without disruption.
Signed-off-by: Mark Brown
---
arch/arm64/include/uapi/asm/sigcontext.h | 8 +
arch/arm64/k
Add a new regset to expose FPMR via ptrace. It is not added to the FPSIMD
registers since that structure is exposed elsewhere without any allowance
for extension we don't add there.
Signed-off-by: Mark Brown
---
arch/arm64/kernel/ptrace.c | 42 ++
in
.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/kvm_arm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index b85f46a73e21..9f9239d86900 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include
FPMR specific trap and rely on the floating point access trap to
detect guest floating point usage.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/kvm_arm.h| 2 +-
arch/arm64/include/asm/kvm_host.h | 4 +++-
arch/arm64/kvm/fpsimd.c | 20
The 2023 architecture extensions have allocated some new ID registers, add
them to the KVM system register descriptions so that they are visible to
guests.
Signed-off-by: Mark Brown
---
arch/arm64/kvm/sys_regs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch
Verify that a FPMR frame is generated on systems that support FPMR and not
generated otherwise.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/signal/.gitignore| 1 +
.../arm64/signal/testcases/fpmr_siginfo.c | 82 ++
2 files changed, 83 insertions
Teach the generic signal frame parsing code about the newly added FPMR
frame, avoiding warnings every time one is generated.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/signal/testcases/testcases.c | 8
tools/testing/selftests/arm64/signal/testcases/testcases.h | 1 +
2
Add the hwcaps added for the 2023 DPISA extensions to the hwcaps test
program.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/abi/hwcap.c | 217 ++
1 file changed, 217 insertions(+)
diff --git a/tools/testing/selftests/arm64/abi/hwcap.c
b/tools/testing
The 2023 architecture extensions include a large number of floating point
features, most of which simply add new instructions. Add hwcaps so that
userspace can enumerate these features.
Signed-off-by: Mark Brown
---
Documentation/arch/arm64/elf_hwcaps.rst | 49
The 2023 architecture extensions allocated some previously usused feature
registers, add comments mapping the names in get-reg-list as we do for the
other allocated registers.
Signed-off-by: Mark Brown
---
tools/testing/selftests/kvm/aarch64/get-reg-list.c | 4 ++--
1 file changed, 2 insertions
FEAT_FPMR defines a new register FMPR which is available at all ELs and is
discovered via ID_AA64PFR2_EL1.FPMR, add this to the set of registers that
get-reg-list knows to check for with the required identification register
depdendency.
Signed-off-by: Mark Brown
---
tools/testing/selftests/kvm
GCS series and since we need to detect if shadow stacks are supported it
seemed sensible to roll it in here.
[1] https://lore.kernel.org/r/20231009-arm64-gcs-v6-0-78e55deaa...@kernel.org/
Signed-off-by: Mark Brown
---
Changes in v2:
- Rebase onto v6.7-rc1.
- Remove ability to provide preallocated sha
Since multiple architectures have support for shadow stacks and we need to
select support for this feature in several places in the generic code
provide a generic config option that the architectures can select.
Suggested-by: David Hildenbrand
Signed-off-by: Mark Brown
---
arch/x86/Kconfig
that
into the shadow stack code rather than individual fields.
Signed-off-by: Mark Brown
---
arch/x86/include/asm/shstk.h | 11 +++
arch/x86/kernel/process.c| 2 +-
arch/x86/kernel/shstk.c | 30 +-
include/linux/sched/task.h | 2 ++
include/uapi
change.
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3.c | 77 -
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/clone3/clone3.c
b/tools/testing/selftests/clone3/clone3.c
index 3c9bf0cd82a8..1108bd8e36d6
lone3() may return
-E2BIG due to the use of newer struct versions. Currently no tests need
this but it will become an issue for testing clone3() support for shadow
stacks, the support for shadow stacks is already present on x86.
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3.
map_shadow_stack().
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3.c | 68 +++
tools/testing/selftests/clone3/clone3_selftests.h | 7 +++
2 files changed, 75 insertions(+)
diff --git a/tools/testing/selftests/clone3/clone3.c
b/tools/testing/selftests
On Wed, Nov 15, 2023 at 12:45:45AM +, Edgecombe, Rick P wrote:
> On Tue, 2023-11-14 at 20:05 +0000, Mark Brown wrote:
> > + if (size < 8)
> > + return (unsigned long)ERR_PTR(-EINVAL);
> What is the intention here? The check in map_sha
On Tue, Nov 14, 2023 at 11:11:58PM +, Edgecombe, Rick P wrote:
> On Tue, 2023-11-14 at 20:05 +0000, Mark Brown wrote:
> > + shadow_stack = syscall(__NR_map_shadow_stack, 0,
> > getpagesize(), 0);
> Hmm, x86 fails this call if user shadow stack is not supported in the
simply
not logged at all when skipped and all are logged with different names) but
these are less disruptive since the skips are all based on not being run as
root, a condition likely to be stable for a given test system.
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3_set_tid.c
On Tue, Nov 14, 2023 at 11:22:16PM +, Edgecombe, Rick P wrote:
> On Tue, 2023-11-14 at 20:05 +0000, Mark Brown wrote:
> > +config ARCH_HAS_USER_SHADOW_STACK
> > + bool
> > + help
> > + The architecture has hardware support for userspace shadow
>
On Wed, Nov 15, 2023 at 04:20:12PM +, szabolcs.n...@arm.com wrote:
> The 11/15/2023 12:36, Mark Brown wrote:
> > On Wed, Nov 15, 2023 at 12:45:45AM +, Edgecombe, Rick P wrote:
> > > On Tue, 2023-11-14 at 20:05 +, Mark Brown wrote:
> > > >
On Wed, Nov 15, 2023 at 10:31:21AM -0800, Joe Perches wrote:
> On Wed, 2023-11-15 at 19:43 +0200, Nikolai Kondrashov wrote:
> > Introduce a new 'V:' ("Verify") field to MAINTAINERS. The field accepts
> > a name of a test suite which is required to be executed for each
> > contribution to the subsys
On Wed, Nov 15, 2023 at 07:43:49PM +0200, Nikolai Kondrashov wrote:
> Introduce a new tag, 'Tested-with:', documented in the
> Documentation/process/submitting-patches.rst file. The tag is expected
> to reference the documented test suites, similarly to the 'V:' field,
> and to certify that the su
On Thu, Nov 16, 2023 at 10:32:06AM +, szabolcs.n...@arm.com wrote:
> The 11/16/2023 00:52, Edgecombe, Rick P wrote:
> > On Wed, 2023-11-15 at 18:43 +0000, Mark Brown wrote:
> while CLONE_VFORK allows the child to use the parent shadow
> stack (parent and child cannot execute a
The za-fork test does not output a newline when reporting the result of
the one test it runs, causing the counts printed by kselftest to be
included in the test name. Add the newline.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/fp/za-fork.c | 2 +-
1 file changed, 1 insertion
On Thu, Nov 16, 2023 at 02:14:24PM +0200, Nikolai Kondrashov wrote:
> Yes, that would be better indeed. However, checkpatch.pl doesn't process
> cover letters, and so we would have no automated way to advertise and nudge
> people towards testing.
Back when I used to run checkpatch it seemed to co
On Thu, Nov 16, 2023 at 01:55:07PM +, szabolcs.n...@arm.com wrote:
> The 11/16/2023 12:33, Mark Brown wrote:
> > On Thu, Nov 16, 2023 at 10:32:06AM +, szabolcs.n...@arm.com wrote:
> > > i guess the tricky case is stack!=0 && shadow_stack_size==0:
> > > t
On Thu, Nov 16, 2023 at 12:52:09AM +, Edgecombe, Rick P wrote:
> On Wed, 2023-11-15 at 18:43 +0000, Mark Brown wrote:
> > > end marker token (0) needs it i guess.
> > x86 doesn't currently have end markers. Actually, that's a point -
> > should we add a
On Thu, Nov 16, 2023 at 06:11:17PM +, Edgecombe, Rick P wrote:
> Now that I've thought about it more, removing the CLONE_VFORK part of
> the logic has several downsides. It is a little extra work to create
> and unmap a shadow stack for an operation that is supposed to be this
> limited fast t
On Mon, Nov 20, 2023 at 12:40:39PM +, Gustavo Padovan wrote:
> I also wonder how to make for subsystems that will have different test
> suites (eg something in kselftests and an external test suite). Would
> an alternative be pointing to a Documentation page with detailed info?
Why not just a
On Fri, Nov 17, 2023 at 01:12:46PM -0800, Deepak Gupta wrote:
> On Tue, Nov 14, 2023 at 11:11:58PM +, Edgecombe, Rick P wrote:
> > It seems like there will be a need for some generic method of checking
> > if shadow stack is enabled. Maybe a more generic compiler
> > intrinsic/builtin or glibc
On Fri, Nov 17, 2023 at 05:43:26PM +, Edgecombe, Rick P wrote:
> Either of those seem fine to me, but it would be nice to get it vetted
> by the libc folks before committing. I'd maybe lean towards the one you
> suggested without the new flag.
I'll go with just taking the stack size as a para
On Mon, Nov 20, 2023 at 03:51:31PM -0500, Theodore Ts'o wrote:
> What we have at work is a way to upload the test results summary
> (e.g., just KTAP result lines, or the xfstests junit XML) along with
> test run metadata (e.g., what was the kernel commit on which the test
> was run, and the test h
eries and since we need to detect if shadow stacks are supported it
seemed sensible to roll it in here.
[1] https://lore.kernel.org/r/20231009-arm64-gcs-v6-0-78e55deaa...@kernel.org/
Signed-off-by: Mark Brown
---
Changes in v3:
- Rebase onto v6.7-rc2.
- Remove stale shadow_stack in internal kargs
Since multiple architectures have support for shadow stacks and we need to
select support for this feature in several places in the generic code
provide a generic config option that the architectures can select.
Suggested-by: David Hildenbrand
Acked-by: David Hildenbrand
Signed-off-by: Mark
stack code rather than individual fields.
Signed-off-by: Mark Brown
---
arch/x86/include/asm/shstk.h | 11 ++---
arch/x86/kernel/process.c| 2 +-
arch/x86/kernel/shstk.c | 59 ++--
include/linux/sched/task.h | 1 +
include/uapi/linux/sched.h
change.
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3.c | 77 -
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/tools/testing/selftests/clone3/clone3.c
b/tools/testing/selftests/clone3/clone3.c
index 3c9bf0cd82a8..1108bd8e36d6
lone3() may return
-E2BIG due to the use of newer struct versions. Currently no tests need
this but it will become an issue for testing clone3() support for shadow
stacks, the support for shadow stacks is already present on x86.
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3.
succeeds when the enable failed.
Signed-off-by: Mark Brown
---
tools/testing/selftests/clone3/clone3.c | 117 ++
tools/testing/selftests/clone3/clone3_selftests.h | 7 ++
2 files changed, 124 insertions(+)
diff --git a/tools/testing/selftests/clone3/clone3.c
b
On Tue, Nov 21, 2023 at 01:04:50AM -0500, Theodore Ts'o wrote:
> On Mon, Nov 20, 2023 at 10:27:33PM +0000, Mark Brown wrote:
> > This is the sort of thing that kcidb (which Nikolai works on) is good at
> > ingesting, I actually do push all my CI's test resul
On Tue, Nov 21, 2023 at 12:21:37PM +, Szabolcs Nagy wrote:
> The 11/21/2023 11:17, Christian Brauner wrote:
> > I have a few questions that are probably me just not knowing much about
> > shadow stacks so hopefully I'm not asking you write a thesis by
> > accident:
One thing it feels like it'
On Tue, Nov 21, 2023 at 06:36:10PM +0800, David Gow wrote:
> The other question is how to handle outdated results when a new patch
> revision is sent out. Personally, I think this is something we can
> solve similarly to 'Reviewed-by', depending on the extent of the
> changes and cost of the tests
[1] https://lore.kernel.org/lkml/20230213045351.3945824-1-de...@rivosinc.com/
Signed-off-by: Mark Brown
---
Changes in v7:
- Rebase onto v6.7-rc2 via the clone3() patch series.
- Change the token used to cap the stack during signal handling to be
compatible with GCSPOPM.
- Fix flags for new
.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/mman.h | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/include/asm/mman.h b/arch/arm64/include/asm/mman.h
index 5966ee4a6154..c21849ffdd88 100644
--- a/arch/arm64/include/asm/mman.h
+++ b/arch/arm64
locking interface reworked. The set status prctl()
is also reworked to just set flags, if setting/reading the shadow stack
pointer is required this could be a separate prctl.
Signed-off-by: Mark Brown
---
include/linux/mm.h | 4
include/uapi/linux/prctl.h | 22
stack marker suitable for use by unwinders should be added
above that.
For arm64 the top of stack marker is all bits 0.
Signed-off-by: Mark Brown
---
arch/x86/include/uapi/asm/mman.h | 3 ---
include/uapi/asm-generic/mman.h | 4
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a
FEAT_GCS introduces a number of new system registers, we require that
access to these registers is not trapped when we identify that the feature
is detected.
Signed-off-by: Mark Brown
---
Documentation/arch/arm64/booting.rst | 22 ++
1 file changed, 22 insertions(+)
diff
Add some documentation of the userspace ABI for Guarded Control Stacks.
Signed-off-by: Mark Brown
---
Documentation/arch/arm64/gcs.rst | 233 +
Documentation/arch/arm64/index.rst | 1 +
2 files changed, 234 insertions(+)
diff --git a/Documentation/arch
FEAT_GCS introduces a number of new system registers. Add the registers
available up to EL2 to sysreg as per DDI0601 2022-12.
Signed-off-by: Mark Brown
---
arch/arm64/tools/sysreg | 55 +
1 file changed, 55 insertions(+)
diff --git a/arch/arm64
The architecture defines a format for guarded control stack caps, used
to mark the top of an unused GCS in order to limit the potential for
exploitation via stack switching. Add definitions associated with these.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/sysreg.h | 20
sufficiently fast paths for this to be a problem.
Note that GCSSTTR is used to store to EL0.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/gcs.h | 51
arch/arm64/include/asm/uaccess.h | 22 +
2 files changed, 73 insertions(+)
diff --git
In order for EL1 to write to an EL0 GCS it must use the GCSSTTR instruction
rather than a normal STTR. Provide a put_user_gcs() which does this.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/uaccess.h | 18 ++
1 file changed, 18 insertions(+)
diff --git a/arch/arm64
Add a cpufeature for GCS, allowing other code to conditionally support it
at runtime.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/cpufeature.h | 6 ++
arch/arm64/kernel/cpufeature.c | 16
arch/arm64/tools/cpucaps| 1 +
3 files changed, 23
to copy.
Since the actual effect is defined using PIE the specific bit pattern used
does not matter to the hardware but we choose two values which differ only
in PTE_WRITE in order to help share code with non-PIE cases.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/pgtable-prot.h | 14
Use VM_HIGH_ARCH_5 for guarded control stack pages.
Signed-off-by: Mark Brown
---
Documentation/filesystems/proc.rst | 2 +-
fs/proc/task_mmu.c | 3 +++
include/linux/mm.h | 12 +++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a
Map pages flagged as being part of a GCS as such rather than using the
full set of generic VM flags.
This is done using a conditional rather than extending the size of
protection_map since that would make for a very sparse array.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/mman.h | 9
GCS introduces a number of system registers for EL1 and EL0, on systems
with GCS we need to context switch them and expose them to VMMs to allow
guests to use GCS. Traps are already disabled.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/kvm_host.h | 12
arch/arm64
There is a control HCRX_EL2.GCSEn which must be set to allow GCS
features to take effect at lower ELs and also fine grained traps for GCS
usage at EL0 and EL1. Configure all these to allow GCS usage by EL0 and
EL1.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/el2_setup.h | 17
Hook up an override for GCS, allowing it to be disabled from the command
line by specifying arm64.nogcs in case there are problems.
Signed-off-by: Mark Brown
---
Documentation/admin-guide/kernel-parameters.txt | 6 ++
arch/arm64/kernel/idreg-override.c | 2 ++
2 files changed
Provide a hwcap to enable userspace to detect support for GCS.
Signed-off-by: Mark Brown
---
Documentation/arch/arm64/elf_hwcaps.rst | 3 +++
arch/arm64/include/asm/hwcap.h | 1 +
arch/arm64/include/uapi/asm/hwcap.h | 1 +
arch/arm64/kernel/cpufeature.c | 3 +++
arch/arm64
ating any GCS
fault as fatal.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/esr.h | 28 +++-
arch/arm64/include/asm/exception.h | 2 ++
arch/arm64/kernel/entry-common.c | 23 +++
arch/arm64/kernel/traps.c | 11 +++
4
it
attempts to do GCS operations outside a GCS.
Signed-off-by: Mark Brown
---
arch/arm64/mm/fault.c | 79 +--
1 file changed, 71 insertions(+), 8 deletions(-)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 460d799e1296
been disabled.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/gcs.h | 24
arch/arm64/include/asm/processor.h | 6
arch/arm64/kernel/process.c| 56 ++
arch/arm64/mm/Makefile | 1 +
arch/arm64/mm/gcs.c
extensively discussed x86
implementation and allocate min(RLIMIT_STACK, 4G). Since the GCS only
stores the call stack and not any variables this should be more than
sufficient for most applications.
GCSs allocated via this mechanism then it will be freed when the thread
exits.
Signed-off-by: Mark Brown
fault reporting.
Since it is not an expected use case and since it presents some
complications in determining what to do with previously initialsed data
on the GCS attempts to reenable GCS after this are rejected. This can
be revisted if a use case arises.
Signed-off-by: Mark Brown
---
arch/arm64
de has not yet been rebased to v6.5-rc1 this includes
the architecture neutral parts of Rick Edgecmbe's "x86/shstk: Introduce
map_shadow_stack syscall".
Signed-off-by: Mark Brown
---
arch/arm64/mm/gcs.c | 61 +
1 file changed, 61 in
;t be interpreted as
a valid token or address.
Signed-off-by: Mark Brown
---
arch/arm64/include/asm/gcs.h | 1 +
arch/arm64/kernel/signal.c | 129 +--
arch/arm64/mm/gcs.c | 1 +
3 files changed, 126 insertions(+), 5 deletions(-)
diff --git a/arch/
, there is a conflict
between specifying GCSPR_EL0 and allocation of a new GCS and this is not
an ancticipated use case. We also enforce GCS configuration locking on
signal return.
Signed-off-by: Mark Brown
---
arch/arm64/include/uapi/asm/sigcontext.h | 9 +++
arch/arm64/kernel/signal.c
Provide a new register type NT_ARM_GCS reporting the current GCS mode
and pointer for EL0. Due to the interactions with allocation and
deallocation of Guarded Control Stacks we do not permit any changes to
the GCS mode via ptrace, only GCSPR_EL0 may be changed.
Signed-off-by: Mark Brown
Provide a Kconfig option allowing the user to select if GCS support is
built into the kernel.
Signed-off-by: Mark Brown
---
arch/arm64/Kconfig | 20
1 file changed, 20 insertions(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7b071a00425d..05cffc0f5786
Add coverage of the GCS hwcap to the hwcap selftest, using a read of
GCSPR_EL0 to generate SIGILL without having to worry about enabling GCS.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/abi/hwcap.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/tools
In preparation for testing GCS related signal handling add it as a feature
we check for in the signal handling support code.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/signal/test_signals.h | 2 ++
tools/testing/selftests/arm64/signal/test_signals_utils.c | 3 +++
2 files
Teach the framework about the GCS signal context, avoiding warnings on
the unknown context.
Signed-off-by: Mark Brown
---
tools/testing/selftests/arm64/signal/testcases/testcases.c | 7 +++
tools/testing/selftests/arm64/signal/testcases/testcases.h | 1 +
2 files changed, 8 insertions
101 - 200 of 886 matches
Mail list logo