From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbeEVQaW (ORCPT ); Tue, 22 May 2018 12:30:22 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41386 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751020AbeEVQaU (ORCPT ); Tue, 22 May 2018 12:30:20 -0400 Date: Tue, 22 May 2018 17:30:07 +0100 Message-ID: <86h8mzbqls.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Dominik Brodowski Cc: , , , Will Deacon , Catalin Marinas , Thomas Gleixner , Andy Lutomirski , Kees Cook , Greg Kroah-Hartman , Christoffer Dall Subject: Re: [PATCH 10/14] arm64: ssbd: Add prctl interface for per-thread mitigation In-Reply-To: <20180522154842.pjml5lagtpyvwwqo@isilmar-4.linta.de> References: <20180522150648.28297-1-marc.zyngier@arm.com> <20180522150648.28297-11-marc.zyngier@arm.com> <20180522154842.pjml5lagtpyvwwqo@isilmar-4.linta.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 May 2018 16:48:42 +0100, Dominik Brodowski wrote: > > > On Tue, May 22, 2018 at 04:06:44PM +0100, Marc Zyngier wrote: > > If running on a system that performs dynamic SSBD mitigation, allow > > userspace to request the mitigation for itself. This is implemented > > as a prctl call, allowing the mitigation to be enabled or disabled at > > will for this particular thread. > > > > Signed-off-by: Marc Zyngier > > --- > > arch/arm64/kernel/Makefile | 1 + > > arch/arm64/kernel/ssbd.c | 107 +++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 108 insertions(+) > > create mode 100644 arch/arm64/kernel/ssbd.c > > > > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > > index bf825f38d206..0025f8691046 100644 > > --- a/arch/arm64/kernel/Makefile > > +++ b/arch/arm64/kernel/Makefile > > @@ -54,6 +54,7 @@ arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o > > arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o > > arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o > > arm64-obj-$(CONFIG_ARM_SDE_INTERFACE) += sdei.o > > +arm64-obj-$(CONFIG_ARM64_SSBD) += ssbd.o > > > > obj-y += $(arm64-obj-y) vdso/ probes/ > > obj-m += $(arm64-obj-m) > > diff --git a/arch/arm64/kernel/ssbd.c b/arch/arm64/kernel/ssbd.c > > new file mode 100644 > > index 000000000000..34e3c430176b > > --- /dev/null > > +++ b/arch/arm64/kernel/ssbd.c > > @@ -0,0 +1,107 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (C) 2018 ARM Ltd, All Rights Reserved. > > + */ > > + > > +#include > > +#include > > + > > +#include > > + > > +/* > > + * prctl interface for SSBD > > + * FIXME: Drop the below ifdefery once the common interface has been merged. > > + */ > > +#ifdef PR_SPEC_STORE_BYPASS > > That FIXME wants to be looked at. It is what allowed the series to compile with mainline until last night. Once I rebase on top of -rc7, I'll remove it. Thanks, M. -- Jazz is not dead, it just smell funny. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH 10/14] arm64: ssbd: Add prctl interface for per-thread mitigation Date: Tue, 22 May 2018 17:30:07 +0100 Message-ID: <86h8mzbqls.wl-marc.zyngier@arm.com> References: <20180522150648.28297-1-marc.zyngier@arm.com> <20180522150648.28297-11-marc.zyngier@arm.com> <20180522154842.pjml5lagtpyvwwqo@isilmar-4.linta.de> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20180522154842.pjml5lagtpyvwwqo@isilmar-4.linta.de> Sender: linux-kernel-owner@vger.kernel.org To: Dominik Brodowski Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Will Deacon , Catalin Marinas , Thomas Gleixner , Andy Lutomirski , Kees Cook , Greg Kroah-Hartman , Christoffer Dall List-Id: kvmarm@lists.cs.columbia.edu On Tue, 22 May 2018 16:48:42 +0100, Dominik Brodowski wrote: > > > On Tue, May 22, 2018 at 04:06:44PM +0100, Marc Zyngier wrote: > > If running on a system that performs dynamic SSBD mitigation, allow > > userspace to request the mitigation for itself. This is implemented > > as a prctl call, allowing the mitigation to be enabled or disabled at > > will for this particular thread. > > > > Signed-off-by: Marc Zyngier > > --- > > arch/arm64/kernel/Makefile | 1 + > > arch/arm64/kernel/ssbd.c | 107 +++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 108 insertions(+) > > create mode 100644 arch/arm64/kernel/ssbd.c > > > > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > > index bf825f38d206..0025f8691046 100644 > > --- a/arch/arm64/kernel/Makefile > > +++ b/arch/arm64/kernel/Makefile > > @@ -54,6 +54,7 @@ arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o > > arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o > > arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o > > arm64-obj-$(CONFIG_ARM_SDE_INTERFACE) += sdei.o > > +arm64-obj-$(CONFIG_ARM64_SSBD) += ssbd.o > > > > obj-y += $(arm64-obj-y) vdso/ probes/ > > obj-m += $(arm64-obj-m) > > diff --git a/arch/arm64/kernel/ssbd.c b/arch/arm64/kernel/ssbd.c > > new file mode 100644 > > index 000000000000..34e3c430176b > > --- /dev/null > > +++ b/arch/arm64/kernel/ssbd.c > > @@ -0,0 +1,107 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (C) 2018 ARM Ltd, All Rights Reserved. > > + */ > > + > > +#include > > +#include > > + > > +#include > > + > > +/* > > + * prctl interface for SSBD > > + * FIXME: Drop the below ifdefery once the common interface has been merged. > > + */ > > +#ifdef PR_SPEC_STORE_BYPASS > > That FIXME wants to be looked at. It is what allowed the series to compile with mainline until last night. Once I rebase on top of -rc7, I'll remove it. Thanks, M. -- Jazz is not dead, it just smell funny. From mboxrd@z Thu Jan 1 00:00:00 1970 From: marc.zyngier@arm.com (Marc Zyngier) Date: Tue, 22 May 2018 17:30:07 +0100 Subject: [PATCH 10/14] arm64: ssbd: Add prctl interface for per-thread mitigation In-Reply-To: <20180522154842.pjml5lagtpyvwwqo@isilmar-4.linta.de> References: <20180522150648.28297-1-marc.zyngier@arm.com> <20180522150648.28297-11-marc.zyngier@arm.com> <20180522154842.pjml5lagtpyvwwqo@isilmar-4.linta.de> Message-ID: <86h8mzbqls.wl-marc.zyngier@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 22 May 2018 16:48:42 +0100, Dominik Brodowski wrote: > > > On Tue, May 22, 2018 at 04:06:44PM +0100, Marc Zyngier wrote: > > If running on a system that performs dynamic SSBD mitigation, allow > > userspace to request the mitigation for itself. This is implemented > > as a prctl call, allowing the mitigation to be enabled or disabled at > > will for this particular thread. > > > > Signed-off-by: Marc Zyngier > > --- > > arch/arm64/kernel/Makefile | 1 + > > arch/arm64/kernel/ssbd.c | 107 +++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 108 insertions(+) > > create mode 100644 arch/arm64/kernel/ssbd.c > > > > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > > index bf825f38d206..0025f8691046 100644 > > --- a/arch/arm64/kernel/Makefile > > +++ b/arch/arm64/kernel/Makefile > > @@ -54,6 +54,7 @@ arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o > > arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o > > arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o > > arm64-obj-$(CONFIG_ARM_SDE_INTERFACE) += sdei.o > > +arm64-obj-$(CONFIG_ARM64_SSBD) += ssbd.o > > > > obj-y += $(arm64-obj-y) vdso/ probes/ > > obj-m += $(arm64-obj-m) > > diff --git a/arch/arm64/kernel/ssbd.c b/arch/arm64/kernel/ssbd.c > > new file mode 100644 > > index 000000000000..34e3c430176b > > --- /dev/null > > +++ b/arch/arm64/kernel/ssbd.c > > @@ -0,0 +1,107 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (C) 2018 ARM Ltd, All Rights Reserved. > > + */ > > + > > +#include > > +#include > > + > > +#include > > + > > +/* > > + * prctl interface for SSBD > > + * FIXME: Drop the below ifdefery once the common interface has been merged. > > + */ > > +#ifdef PR_SPEC_STORE_BYPASS > > That FIXME wants to be looked at. It is what allowed the series to compile with mainline until last night. Once I rebase on top of -rc7, I'll remove it. Thanks, M. -- Jazz is not dead, it just smell funny.