All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] arm64: Disabling SVE/SME from the command-line
@ 2022-06-27 15:13 Marc Zyngier
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2022-06-27 15:13 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Will Deacon, Catalin Marinas, Mark Rutland, Ard Biesheuvel,
	broonie, danielmentz, saravanak, kernel-team

This very short series reworks the way arm64 CPUs boot (yes, again) in
order to opt out of some features early at boot, on top of the
existing VHE-forced-into-nVHE use case and using the same idreg
override infrastructure.

The main victim here is SVE, because it seems that people have all
sort of broken firmware out there, and that a distribution kernel
cannot boot on that. And since we have a dependency between SVE and
SME, disabling the former also disables the latter.

The only positive aspect about this series is that it unifies the way
the VHE-stuck CPUs boot with way the full-fat CPUs do (everybody takes
a trip to EL1 before coming back to EL2, instead of the stay-at-EL2
approach we currently have). A small victory, which allows us to
control the EL2 setup code more easily.

Note that the SME code is totally untested (I don't have a model with
that), but it looks obviously correct ;-), and that my SVE "platform"
has a working firmware...

Marc Zyngier (6):
  arm64: Rename the VHE switch to "finalise_el2"
  arm64: Save state of HCR_EL2.E2H before switch to EL1
  arm64: Allow sticky E2H when entering EL1
  arm64: Factor out checking of a feature against the override into a
    macro
  arm64: Add the arm64.nosme command line option
  arm64: Add the arm64.nosve command line option

 .../admin-guide/kernel-parameters.txt         |   6 +
 Documentation/virt/kvm/arm/hyp-abi.rst        |   2 +-
 arch/arm64/include/asm/cpufeature.h           |   3 +
 arch/arm64/include/asm/el2_setup.h            |  60 ----------
 arch/arm64/include/asm/virt.h                 |   4 +-
 arch/arm64/kernel/cpufeature.c                |  12 +-
 arch/arm64/kernel/head.S                      |  45 ++++----
 arch/arm64/kernel/hyp-stub.S                  | 105 +++++++++++++-----
 arch/arm64/kernel/idreg-override.c            |  55 ++++++++-
 arch/arm64/kernel/sleep.S                     |   2 +-
 10 files changed, 171 insertions(+), 123 deletions(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/6] arm64: Disabling SVE/SME from the command-line
  2022-06-27 15:30   ` Marc Zyngier
@ 2022-06-27 16:49     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-06-27 16:49 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-arm-kernel, Will Deacon, Catalin Marinas, Mark Rutland,
	Ard Biesheuvel, danielmentz, saravanak, kernel-team


[-- Attachment #1.1: Type: text/plain, Size: 1263 bytes --]

On Mon, Jun 27, 2022 at 04:30:36PM +0100, Marc Zyngier wrote:
> Mark Brown <broonie@kernel.org> wrote:

> > Oh dear, I've not seen any reports of this.  I'm guessing it's TF-A just
> > not enabling the requisite traps, coupled with people using prebuilt
> > kernels that turned off SVE when doing validation?

> Most probably something along these lines. The case I'm aware of
> involves booting a vanilla kernel on a system with a half baked
> firmware. I have little sympathy for these systems, but this looks
> like a reasonable ask to be able to disable a feature from the command
> line in order to pinpoint the issue.

It does, given the number of features that we've got in the pipeline
that require higher EL enablement I was actually wondering if we might
be better off going further and making this more of a standard idiom for
how we add any feature that requires setup at EL2/3 to be functional so
we don't need to go add overrides separately and most likely get them
backported or whatever.  There's the AMU which needs CPTR_EL[23].TAM for
example.

> Will someone ship a system with this baked into the command line? I
> don't believe it for a second (/me ducks).

I simply can't understand what you're saying here, must be something
inconceivable.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/6] arm64: Disabling SVE/SME from the command-line
  2022-06-27 15:18 ` Mark Brown
@ 2022-06-27 15:30   ` Marc Zyngier
  2022-06-27 16:49     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2022-06-27 15:30 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-kernel, Will Deacon, Catalin Marinas, Mark Rutland,
	Ard Biesheuvel, danielmentz, saravanak, kernel-team

On Mon, 27 Jun 2022 16:18:36 +0100,
Mark Brown <broonie@kernel.org> wrote:
> 
> On Mon, Jun 27, 2022 at 04:14:06PM +0100, Marc Zyngier wrote:
> 
> > The main victim here is SVE, because it seems that people have all
> > sort of broken firmware out there, and that a distribution kernel
> > cannot boot on that. And since we have a dependency between SVE and
> > SME, disabling the former also disables the latter.
> 
> Oh dear, I've not seen any reports of this.  I'm guessing it's TF-A just
> not enabling the requisite traps, coupled with people using prebuilt
> kernels that turned off SVE when doing validation?

Most probably something along these lines. The case I'm aware of
involves booting a vanilla kernel on a system with a half baked
firmware. I have little sympathy for these systems, but this looks
like a reasonable ask to be able to disable a feature from the command
line in order to pinpoint the issue.

Will someone ship a system with this baked into the command line? I
don't believe it for a second (/me ducks).

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/6] arm64: Disabling SVE/SME from the command-line
  2022-06-27 15:14 Marc Zyngier
@ 2022-06-27 15:18 ` Mark Brown
  2022-06-27 15:30   ` Marc Zyngier
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-06-27 15:18 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-arm-kernel, Will Deacon, Catalin Marinas, Mark Rutland,
	Ard Biesheuvel, danielmentz, saravanak, kernel-team


[-- Attachment #1.1: Type: text/plain, Size: 518 bytes --]

On Mon, Jun 27, 2022 at 04:14:06PM +0100, Marc Zyngier wrote:

> The main victim here is SVE, because it seems that people have all
> sort of broken firmware out there, and that a distribution kernel
> cannot boot on that. And since we have a dependency between SVE and
> SME, disabling the former also disables the latter.

Oh dear, I've not seen any reports of this.  I'm guessing it's TF-A just
not enabling the requisite traps, coupled with people using prebuilt
kernels that turned off SVE when doing validation?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 0/6] arm64: Disabling SVE/SME from the command-line
@ 2022-06-27 15:14 Marc Zyngier
  2022-06-27 15:18 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2022-06-27 15:14 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Will Deacon, Catalin Marinas, Mark Rutland, Ard Biesheuvel,
	broonie, danielmentz, saravanak, kernel-team

This very short series reworks the way arm64 CPUs boot (yes, again) in
order to opt out of some features early at boot, on top of the
existing VHE-forced-into-nVHE use case and using the same idreg
override infrastructure.

The main victim here is SVE, because it seems that people have all
sort of broken firmware out there, and that a distribution kernel
cannot boot on that. And since we have a dependency between SVE and
SME, disabling the former also disables the latter.

The only positive aspect about this series is that it unifies the way
the VHE-stuck CPUs boot with way the full-fat CPUs do (everybody takes
a trip to EL1 before coming back to EL2, instead of the stay-at-EL2
approach we currently have). A small victory, which allows us to
control the EL2 setup code more easily.

Note that the SME code is totally untested (I don't have a model with
that), but it looks obviously correct ;-), and that my SVE "platform"
has a working firmware...

Marc Zyngier (6):
  arm64: Rename the VHE switch to "finalise_el2"
  arm64: Save state of HCR_EL2.E2H before switch to EL1
  arm64: Allow sticky E2H when entering EL1
  arm64: Factor out checking of a feature against the override into a
    macro
  arm64: Add the arm64.nosme command line option
  arm64: Add the arm64.nosve command line option

 .../admin-guide/kernel-parameters.txt         |   6 +
 Documentation/virt/kvm/arm/hyp-abi.rst        |   2 +-
 arch/arm64/include/asm/cpufeature.h           |   3 +
 arch/arm64/include/asm/el2_setup.h            |  60 ----------
 arch/arm64/include/asm/virt.h                 |   4 +-
 arch/arm64/kernel/cpufeature.c                |  12 +-
 arch/arm64/kernel/head.S                      |  45 ++++----
 arch/arm64/kernel/hyp-stub.S                  | 105 +++++++++++++-----
 arch/arm64/kernel/idreg-override.c            |  55 ++++++++-
 arch/arm64/kernel/sleep.S                     |   2 +-
 10 files changed, 171 insertions(+), 123 deletions(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-27 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 15:13 [PATCH 0/6] arm64: Disabling SVE/SME from the command-line Marc Zyngier
2022-06-27 15:14 Marc Zyngier
2022-06-27 15:18 ` Mark Brown
2022-06-27 15:30   ` Marc Zyngier
2022-06-27 16:49     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.