* [PATCH v2 1/5] cpu/speculation: Add 'mitigations=' cmdline option
From: Josh Poimboeuf @ 2019-04-12 20:39 UTC (permalink / raw)
To: linux-kernel
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Will Deacon,
Steven Price, Linus Torvalds, Catalin Marinas, Waiman Long,
linux-arch, Jon Masters, Jiri Kosina, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, linux-arm-kernel, Phil Auld,
Greg Kroah-Hartman, Randy Dunlap, Tyler Hicks, Martin Schwidefsky,
linuxppc-dev
In-Reply-To: <cover.1555085500.git.jpoimboe@redhat.com>
Keeping track of the number of mitigations for all the CPU speculation
bugs has become overwhelming for many users. It's getting more and more
complicated to decide which mitigations are needed for a given
architecture. Complicating matters is the fact that each arch tends to
have its own custom way to mitigate the same vulnerability.
Most users fall into a few basic categories:
a) they want all mitigations off;
b) they want all reasonable mitigations on, with SMT enabled even if
it's vulnerable; or
c) they want all reasonable mitigations on, with SMT disabled if
vulnerable.
Define a set of curated, arch-independent options, each of which is an
aggregation of existing options:
- mitigations=off: Disable all mitigations.
- mitigations=auto: [default] Enable all the default mitigations, but
leave SMT enabled, even if it's vulnerable.
- mitigations=auto,nosmt: Enable all the default mitigations, disabling
SMT if needed by a mitigation.
Currently, these options are placeholders which don't actually do
anything. They will be fleshed out in upcoming patches.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
.../admin-guide/kernel-parameters.txt | 24 +++++++++++++++++++
include/linux/cpu.h | 24 +++++++++++++++++++
kernel/cpu.c | 15 ++++++++++++
3 files changed, 63 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index faafdc59104a..3ea92e075c64 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2544,6 +2544,30 @@
in the "bleeding edge" mini2440 support kernel at
http://repo.or.cz/w/linux-2.6/mini2440.git
+ mitigations=
+ Control optional mitigations for CPU vulnerabilities.
+ This is a set of curated, arch-independent options, each
+ of which is an aggregation of existing arch-specific
+ options.
+
+ off
+ Disable all optional CPU mitigations. This
+ improves system performance, but it may also
+ expose users to several CPU vulnerabilities.
+
+ auto (default)
+ Mitigate all CPU vulnerabilities, but leave SMT
+ enabled, even if it's vulnerable. This is for
+ users who don't want to be surprised by SMT
+ getting disabled across kernel upgrades, or who
+ have other ways of avoiding SMT-based attacks.
+ This is the default behavior.
+
+ auto,nosmt
+ Mitigate all CPU vulnerabilities, disabling SMT
+ if needed. This is for users who always want to
+ be fully mitigated, even if it means losing SMT.
+
mminit_loglevel=
[KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
parameter allows control of the logging verbosity for
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index ae99dde02320..5350357dfbdb 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -188,4 +188,28 @@ static inline void cpu_smt_disable(bool force) { }
static inline void cpu_smt_check_topology(void) { }
#endif
+/*
+ * These are used for a global "mitigations=" cmdline option for toggling
+ * optional CPU mitigations.
+ */
+enum cpu_mitigations {
+ CPU_MITIGATIONS_OFF,
+ CPU_MITIGATIONS_AUTO,
+ CPU_MITIGATIONS_AUTO_NOSMT,
+};
+
+extern enum cpu_mitigations cpu_mitigations;
+
+/* mitigations=off */
+static inline bool cpu_mitigations_off(void)
+{
+ return cpu_mitigations == CPU_MITIGATIONS_OFF;
+}
+
+/* mitigations=auto,nosmt */
+static inline bool cpu_mitigations_auto_nosmt(void)
+{
+ return cpu_mitigations == CPU_MITIGATIONS_AUTO_NOSMT;
+}
+
#endif /* _LINUX_CPU_H_ */
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 38890f62f9a8..aed9083f8eac 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -2320,3 +2320,18 @@ void __init boot_cpu_hotplug_init(void)
#endif
this_cpu_write(cpuhp_state.state, CPUHP_ONLINE);
}
+
+enum cpu_mitigations cpu_mitigations __ro_after_init = CPU_MITIGATIONS_AUTO;
+
+static int __init mitigations_cmdline(char *arg)
+{
+ if (!strcmp(arg, "off"))
+ cpu_mitigations = CPU_MITIGATIONS_OFF;
+ else if (!strcmp(arg, "auto"))
+ cpu_mitigations = CPU_MITIGATIONS_AUTO;
+ else if (!strcmp(arg, "auto,nosmt"))
+ cpu_mitigations = CPU_MITIGATIONS_AUTO_NOSMT;
+
+ return 0;
+}
+early_param("mitigations", mitigations_cmdline);
--
2.17.2
^ permalink raw reply related
* [PATCH v2 2/5] x86/speculation: Support 'mitigations=' cmdline option
From: Josh Poimboeuf @ 2019-04-12 20:39 UTC (permalink / raw)
To: linux-kernel
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Will Deacon,
Steven Price, Linus Torvalds, Catalin Marinas, Waiman Long,
linux-arch, Jon Masters, Jiri Kosina, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, linux-arm-kernel, Phil Auld,
Greg Kroah-Hartman, Randy Dunlap, Tyler Hicks, Martin Schwidefsky,
linuxppc-dev
In-Reply-To: <cover.1555085500.git.jpoimboe@redhat.com>
Configure x86 runtime CPU speculation bug mitigations in accordance with
the 'mitigations=' cmdline option. This affects Meltdown, Spectre v2,
Speculative Store Bypass, and L1TF.
The default behavior is unchanged.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
Documentation/admin-guide/kernel-parameters.txt | 16 +++++++++++-----
arch/x86/kernel/cpu/bugs.c | 11 +++++++++--
arch/x86/mm/pti.c | 4 +++-
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 3ea92e075c64..3e33bd03441a 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2545,15 +2545,20 @@
http://repo.or.cz/w/linux-2.6/mini2440.git
mitigations=
- Control optional mitigations for CPU vulnerabilities.
- This is a set of curated, arch-independent options, each
- of which is an aggregation of existing arch-specific
- options.
+ [X86] Control optional mitigations for CPU
+ vulnerabilities. This is a set of curated,
+ arch-independent options, each of which is an
+ aggregation of existing arch-specific options.
off
Disable all optional CPU mitigations. This
improves system performance, but it may also
expose users to several CPU vulnerabilities.
+ Equivalent to: nopti [X86]
+ nospectre_v2 [X86]
+ spectre_v2_user=off [X86]
+ spec_store_bypass_disable=off [X86]
+ l1tf=off [X86]
auto (default)
Mitigate all CPU vulnerabilities, but leave SMT
@@ -2561,12 +2566,13 @@
users who don't want to be surprised by SMT
getting disabled across kernel upgrades, or who
have other ways of avoiding SMT-based attacks.
- This is the default behavior.
+ Equivalent to: (default behavior)
auto,nosmt
Mitigate all CPU vulnerabilities, disabling SMT
if needed. This is for users who always want to
be fully mitigated, even if it means losing SMT.
+ Equivalent to: l1tf=flush,nosmt [X86]
mminit_loglevel=
[KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 2da82eff0eb4..8043a21f36be 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -440,7 +440,8 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
char arg[20];
int ret, i;
- if (cmdline_find_option_bool(boot_command_line, "nospectre_v2"))
+ if (cmdline_find_option_bool(boot_command_line, "nospectre_v2") ||
+ cpu_mitigations_off())
return SPECTRE_V2_CMD_NONE;
ret = cmdline_find_option(boot_command_line, "spectre_v2", arg, sizeof(arg));
@@ -672,7 +673,8 @@ static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void)
char arg[20];
int ret, i;
- if (cmdline_find_option_bool(boot_command_line, "nospec_store_bypass_disable")) {
+ if (cmdline_find_option_bool(boot_command_line, "nospec_store_bypass_disable") ||
+ cpu_mitigations_off()) {
return SPEC_STORE_BYPASS_CMD_NONE;
} else {
ret = cmdline_find_option(boot_command_line, "spec_store_bypass_disable",
@@ -1008,6 +1010,11 @@ static void __init l1tf_select_mitigation(void)
if (!boot_cpu_has_bug(X86_BUG_L1TF))
return;
+ if (cpu_mitigations_off())
+ l1tf_mitigation = L1TF_MITIGATION_OFF;
+ else if (cpu_mitigations_auto_nosmt())
+ l1tf_mitigation = L1TF_MITIGATION_FLUSH_NOSMT;
+
override_cache_bits(&boot_cpu_data);
switch (l1tf_mitigation) {
diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
index 5d27172c683f..9c2463bc158f 100644
--- a/arch/x86/mm/pti.c
+++ b/arch/x86/mm/pti.c
@@ -35,6 +35,7 @@
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/uaccess.h>
+#include <linux/cpu.h>
#include <asm/cpufeature.h>
#include <asm/hypervisor.h>
@@ -115,7 +116,8 @@ void __init pti_check_boottime_disable(void)
}
}
- if (cmdline_find_option_bool(boot_command_line, "nopti")) {
+ if (cmdline_find_option_bool(boot_command_line, "nopti") ||
+ cpu_mitigations_off()) {
pti_mode = PTI_FORCE_OFF;
pti_print_if_insecure("disabled on command line.");
return;
--
2.17.2
^ permalink raw reply related
* [PATCH v2 3/5] powerpc/speculation: Support 'mitigations=' cmdline option
From: Josh Poimboeuf @ 2019-04-12 20:39 UTC (permalink / raw)
To: linux-kernel
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Will Deacon,
Steven Price, Linus Torvalds, Catalin Marinas, Waiman Long,
linux-arch, Jon Masters, Jiri Kosina, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, linux-arm-kernel, Phil Auld,
Greg Kroah-Hartman, Randy Dunlap, Tyler Hicks, Martin Schwidefsky,
linuxppc-dev
In-Reply-To: <cover.1555085500.git.jpoimboe@redhat.com>
Configure powerpc CPU runtime speculation bug mitigations in accordance
with the 'mitigations=' cmdline option. This affects Meltdown, Spectre
v1, Spectre v2, and Speculative Store Bypass.
The default behavior is unchanged.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
Documentation/admin-guide/kernel-parameters.txt | 9 +++++----
arch/powerpc/kernel/security.c | 6 +++---
arch/powerpc/kernel/setup_64.c | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 3e33bd03441a..a03ab62b69af 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2545,7 +2545,7 @@
http://repo.or.cz/w/linux-2.6/mini2440.git
mitigations=
- [X86] Control optional mitigations for CPU
+ [X86,PPC] Control optional mitigations for CPU
vulnerabilities. This is a set of curated,
arch-independent options, each of which is an
aggregation of existing arch-specific options.
@@ -2554,10 +2554,11 @@
Disable all optional CPU mitigations. This
improves system performance, but it may also
expose users to several CPU vulnerabilities.
- Equivalent to: nopti [X86]
- nospectre_v2 [X86]
+ Equivalent to: nopti [X86,PPC]
+ nospectre_v1 [PPC]
+ nospectre_v2 [X86,PPC]
spectre_v2_user=off [X86]
- spec_store_bypass_disable=off [X86]
+ spec_store_bypass_disable=off [X86,PPC]
l1tf=off [X86]
auto (default)
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index b33bafb8fcea..70568ccbd9fd 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -57,7 +57,7 @@ void setup_barrier_nospec(void)
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR);
- if (!no_nospec)
+ if (!no_nospec && !cpu_mitigations_off())
enable_barrier_nospec(enable);
}
@@ -116,7 +116,7 @@ static int __init handle_nospectre_v2(char *p)
early_param("nospectre_v2", handle_nospectre_v2);
void setup_spectre_v2(void)
{
- if (no_spectrev2)
+ if (no_spectrev2 || cpu_mitigations_off())
do_btb_flush_fixups();
else
btb_flush_enabled = true;
@@ -300,7 +300,7 @@ void setup_stf_barrier(void)
stf_enabled_flush_types = type;
- if (!no_stf_barrier)
+ if (!no_stf_barrier && !cpu_mitigations_off())
stf_barrier_enable(enable);
}
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index ba404dd9ce1d..4f49e1a3594c 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -932,7 +932,7 @@ void setup_rfi_flush(enum l1d_flush_type types, bool enable)
enabled_flush_types = types;
- if (!no_rfi_flush)
+ if (!no_rfi_flush && !cpu_mitigations_off())
rfi_flush_enable(enable);
}
--
2.17.2
^ permalink raw reply related
* [PATCH v2 4/5] s390/speculation: Support 'mitigations=' cmdline option
From: Josh Poimboeuf @ 2019-04-12 20:39 UTC (permalink / raw)
To: linux-kernel
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Will Deacon,
Steven Price, Linus Torvalds, Catalin Marinas, Waiman Long,
linux-arch, Jon Masters, Jiri Kosina, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, linux-arm-kernel, Phil Auld,
Greg Kroah-Hartman, Randy Dunlap, Tyler Hicks, Martin Schwidefsky,
linuxppc-dev
In-Reply-To: <cover.1555085500.git.jpoimboe@redhat.com>
Configure s390 runtime CPU speculation bug mitigations in accordance
with the 'mitigations=' cmdline option. This affects Spectre v1 and
Spectre v2.
The default behavior is unchanged.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
Documentation/admin-guide/kernel-parameters.txt | 5 +++--
arch/s390/kernel/nospec-branch.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index a03ab62b69af..e84a01d90e92 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2545,7 +2545,7 @@
http://repo.or.cz/w/linux-2.6/mini2440.git
mitigations=
- [X86,PPC] Control optional mitigations for CPU
+ [X86,PPC,S390] Control optional mitigations for CPU
vulnerabilities. This is a set of curated,
arch-independent options, each of which is an
aggregation of existing arch-specific options.
@@ -2556,7 +2556,8 @@
expose users to several CPU vulnerabilities.
Equivalent to: nopti [X86,PPC]
nospectre_v1 [PPC]
- nospectre_v2 [X86,PPC]
+ nobp=0 [S390]
+ nospectre_v2 [X86,PPC,S390]
spectre_v2_user=off [X86]
spec_store_bypass_disable=off [X86,PPC]
l1tf=off [X86]
diff --git a/arch/s390/kernel/nospec-branch.c b/arch/s390/kernel/nospec-branch.c
index bdddaae96559..649135cbedd5 100644
--- a/arch/s390/kernel/nospec-branch.c
+++ b/arch/s390/kernel/nospec-branch.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/module.h>
#include <linux/device.h>
+#include <linux/cpu.h>
#include <asm/nospec-branch.h>
static int __init nobp_setup_early(char *str)
@@ -58,7 +59,7 @@ early_param("nospectre_v2", nospectre_v2_setup_early);
void __init nospec_auto_detect(void)
{
- if (test_facility(156)) {
+ if (test_facility(156) || cpu_mitigations_off()) {
/*
* The machine supports etokens.
* Disable expolines and disable nobp.
--
2.17.2
^ permalink raw reply related
* [PATCH v2 5/5] arm64/speculation: Support 'mitigations=' cmdline option
From: Josh Poimboeuf @ 2019-04-12 20:39 UTC (permalink / raw)
To: linux-kernel
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Will Deacon,
Steven Price, Linus Torvalds, Catalin Marinas, Waiman Long,
linux-arch, Jon Masters, Jiri Kosina, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, linux-arm-kernel, Phil Auld,
Greg Kroah-Hartman, Randy Dunlap, Tyler Hicks, Martin Schwidefsky,
linuxppc-dev
In-Reply-To: <cover.1555085500.git.jpoimboe@redhat.com>
Configure arm64 runtime CPU speculation bug mitigations in accordance
with the 'mitigations=' cmdline option. This affects Meltdown, Spectre
v2, and Speculative Store Bypass.
The default behavior is unchanged.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
NOTE: This is based on top of Jeremy Linton's patches:
https://lkml.kernel.org/r/20190410231237.52506-1-jeremy.linton@arm.com
Documentation/admin-guide/kernel-parameters.txt | 8 +++++---
arch/arm64/kernel/cpu_errata.c | 6 +++++-
arch/arm64/kernel/cpufeature.c | 8 +++++++-
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index e84a01d90e92..79bfc755defe 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2545,8 +2545,8 @@
http://repo.or.cz/w/linux-2.6/mini2440.git
mitigations=
- [X86,PPC,S390] Control optional mitigations for CPU
- vulnerabilities. This is a set of curated,
+ [X86,PPC,S390,ARM64] Control optional mitigations for
+ CPU vulnerabilities. This is a set of curated,
arch-independent options, each of which is an
aggregation of existing arch-specific options.
@@ -2555,11 +2555,13 @@
improves system performance, but it may also
expose users to several CPU vulnerabilities.
Equivalent to: nopti [X86,PPC]
+ kpti=0 [ARM64]
nospectre_v1 [PPC]
nobp=0 [S390]
- nospectre_v2 [X86,PPC,S390]
+ nospectre_v2 [X86,PPC,S390,ARM64]
spectre_v2_user=off [X86]
spec_store_bypass_disable=off [X86,PPC]
+ ssbd=force-off [ARM64]
l1tf=off [X86]
auto (default)
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index a1f3188c7be0..65bcd7f0cca1 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -19,6 +19,7 @@
#include <linux/arm-smccc.h>
#include <linux/psci.h>
#include <linux/types.h>
+#include <linux/cpu.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
#include <asm/cpufeature.h>
@@ -405,6 +406,9 @@ static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,
this_cpu_safe = true;
}
+ if (cpu_mitigations_off())
+ ssbd_state = ARM64_SSBD_FORCE_DISABLE;
+
if (psci_ops.smccc_version == SMCCC_VERSION_1_0) {
ssbd_state = ARM64_SSBD_UNKNOWN;
if (!this_cpu_safe)
@@ -599,7 +603,7 @@ check_branch_predictor(const struct arm64_cpu_capabilities *entry, int scope)
}
/* forced off */
- if (__nospectre_v2) {
+ if (__nospectre_v2 || cpu_mitigations_off()) {
pr_info_once("spectrev2 mitigation disabled by command line option\n");
__hardenbp_enab = false;
return false;
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 6b7e1556460a..d826b17f7820 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -25,6 +25,7 @@
#include <linux/stop_machine.h>
#include <linux/types.h>
#include <linux/mm.h>
+#include <linux/cpu.h>
#include <asm/cpu.h>
#include <asm/cpufeature.h>
#include <asm/cpu_ops.h>
@@ -966,7 +967,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
MIDR_ALL_VERSIONS(MIDR_HISI_TSV110),
{ /* sentinel */ }
};
- char const *str = "command line option";
+ char const *str = "kpti command line option";
bool meltdown_safe;
meltdown_safe = is_midr_in_range_list(read_cpuid_id(), kpti_safe_list);
@@ -988,6 +989,11 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
__kpti_forced = -1;
}
+ if (cpu_mitigations_off() && !__kpti_forced) {
+ str = "mitigations=off";
+ __kpti_forced = -1;
+ }
+
/* Useful for KASLR robustness */
if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && kaslr_offset() > 0) {
if (!__kpti_forced) {
--
2.17.2
^ permalink raw reply related
* Re: [PATCH v2 5/5] arm64/speculation: Support 'mitigations=' cmdline option
From: Randy Dunlap @ 2019-04-12 23:34 UTC (permalink / raw)
To: Josh Poimboeuf, linux-kernel
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, x86, Will Deacon,
Steven Price, Linus Torvalds, Catalin Marinas, Waiman Long,
linux-arch, Jon Masters, Jiri Kosina, Borislav Petkov,
Andy Lutomirski, Thomas Gleixner, linux-arm-kernel, Phil Auld,
Greg Kroah-Hartman, Tyler Hicks, Martin Schwidefsky, linuxppc-dev
In-Reply-To: <24039e1370ed57e8075730c0b88c505afd9e0ab7.1555085500.git.jpoimboe@redhat.com>
On 4/12/19 1:39 PM, Josh Poimboeuf wrote:
> Configure arm64 runtime CPU speculation bug mitigations in accordance
> with the 'mitigations=' cmdline option. This affects Meltdown, Spectre
> v2, and Speculative Store Bypass.
>
> The default behavior is unchanged.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
> NOTE: This is based on top of Jeremy Linton's patches:
> https://lkml.kernel.org/r/20190410231237.52506-1-jeremy.linton@arm.com
>
> Documentation/admin-guide/kernel-parameters.txt | 8 +++++---
> arch/arm64/kernel/cpu_errata.c | 6 +++++-
> arch/arm64/kernel/cpufeature.c | 8 +++++++-
> 3 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index e84a01d90e92..79bfc755defe 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -2545,8 +2545,8 @@
> http://repo.or.cz/w/linux-2.6/mini2440.git
>
> mitigations=
> - [X86,PPC,S390] Control optional mitigations for CPU
> - vulnerabilities. This is a set of curated,
> + [X86,PPC,S390,ARM64] Control optional mitigations for
> + CPU vulnerabilities. This is a set of curated,
> arch-independent options, each of which is an
> aggregation of existing arch-specific options.
>
> @@ -2555,11 +2555,13 @@
> improves system performance, but it may also
> expose users to several CPU vulnerabilities.
> Equivalent to: nopti [X86,PPC]
> + kpti=0 [ARM64]
> nospectre_v1 [PPC]
> nobp=0 [S390]
> - nospectre_v2 [X86,PPC,S390]
> + nospectre_v2 [X86,PPC,S390,ARM64]
> spectre_v2_user=off [X86]
> spec_store_bypass_disable=off [X86,PPC]
> + ssbd=force-off [ARM64]
> l1tf=off [X86]
>
> auto (default)
Hi,
Do we need to add "ARM64" to Documentation/admin-guide/kernel-parameters.rst?
--
~Randy
^ permalink raw reply
* Re: [PATCH v2 00/21] Convert hwmon documentation to ReST
From: Mauro Carvalho Chehab @ 2019-04-13 0:25 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-hwmon, Jean Delvare, linux-aspeed, Linux Doc Mailing List,
Andrew Jeffery, Jonathan Corbet, Liviu Dudau, linux-kernel,
Mauro Carvalho Chehab, Lorenzo Pieralisi, Paul Mackerras,
Joel Stanley, linuxppc-dev, Sudeep Holla, linux-arm-kernel
In-Reply-To: <8514ff97-3167-3c89-3468-e247d14c5086@roeck-us.net>
Em Fri, 12 Apr 2019 09:12:52 -0700
Guenter Roeck <linux@roeck-us.net> escreveu:
> On 4/12/19 9:04 AM, Jonathan Corbet wrote:
> > On Thu, 11 Apr 2019 14:07:31 -0700
> > Guenter Roeck <linux@roeck-us.net> wrote:
> >
> >>> While nobody does such split, IMHO, the best would be to keep the
> >>> information outside Documentation/admin-guide. But hey! You're
> >>> the Doc maintainer. If you prefer to move, I'm perfectly fine
> >>> with that.
> >>>
> >>
> >> Same here, but please don't move the files which are kernel facing only.
> >
> > Well, let's step back and think about this. Who is the audience for
> > these documents? That will tell us a lot about where they should really
> > be.
> >
>
> Most of them are for users, some of them are for driver developers. A few
> are for both, though that is generally not the intention (and one may argue
> that driver internal documentation should be moved into the respective
> driver source).
The big issue is really those files that contain both kernel internals
and userspace stuff.
This is a common pattern. I just finishing converting a lot more
documents to ReST and I found the same thing on almost all document
directories I touched.
> > What I would prefer to avoid is the status quo where *everything* is in
> > the top-level directory, and where documents are organized for the
> > convenience of their maintainers rather than of their readers. But
> > sometimes I feel like I'm alone in that desire...:)
> >
> I am fine with separating user pointing from kernel API/driver developer
> guides, and I agree that it would make a lot of sense. As I said, please
> just make sure that kernel facing files don't end up in the wrong directory.
I like the idea of splitting user faced documents from the rest, but
this is not an easy task. On several cases, there are just a couple
of paragraphs with things like sysfs entries in the middle of a big
file with Kernel internals.
Thanks,
Mauro
^ permalink raw reply
* Re: [PATCH v2 00/21] Convert hwmon documentation to ReST
From: Guenter Roeck @ 2019-04-13 0:52 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: linux-hwmon, Jean Delvare, linux-aspeed, Linux Doc Mailing List,
Andrew Jeffery, Jonathan Corbet, Liviu Dudau, linux-kernel,
Mauro Carvalho Chehab, Lorenzo Pieralisi, Paul Mackerras,
Joel Stanley, linuxppc-dev, Sudeep Holla, linux-arm-kernel
In-Reply-To: <20190412212541.0cde9452@coco.lan>
On 4/12/19 5:25 PM, Mauro Carvalho Chehab wrote:
> Em Fri, 12 Apr 2019 09:12:52 -0700
> Guenter Roeck <linux@roeck-us.net> escreveu:
>
>> On 4/12/19 9:04 AM, Jonathan Corbet wrote:
>>> On Thu, 11 Apr 2019 14:07:31 -0700
>>> Guenter Roeck <linux@roeck-us.net> wrote:
>>>
>>>>> While nobody does such split, IMHO, the best would be to keep the
>>>>> information outside Documentation/admin-guide. But hey! You're
>>>>> the Doc maintainer. If you prefer to move, I'm perfectly fine
>>>>> with that.
>>>>>
>>>>
>>>> Same here, but please don't move the files which are kernel facing only.
>>>
>>> Well, let's step back and think about this. Who is the audience for
>>> these documents? That will tell us a lot about where they should really
>>> be.
>>>
>>
>> Most of them are for users, some of them are for driver developers. A few
>> are for both, though that is generally not the intention (and one may argue
>> that driver internal documentation should be moved into the respective
>> driver source).
>
> The big issue is really those files that contain both kernel internals
> and userspace stuff.
>
> This is a common pattern. I just finishing converting a lot more
> documents to ReST and I found the same thing on almost all document
> directories I touched.
>
>>> What I would prefer to avoid is the status quo where *everything* is in
>>> the top-level directory, and where documents are organized for the
>>> convenience of their maintainers rather than of their readers. But
>>> sometimes I feel like I'm alone in that desire...:)
>>>
>> I am fine with separating user pointing from kernel API/driver developer
>> guides, and I agree that it would make a lot of sense. As I said, please
>> just make sure that kernel facing files don't end up in the wrong directory.
>
> I like the idea of splitting user faced documents from the rest, but
> this is not an easy task. On several cases, there are just a couple
> of paragraphs with things like sysfs entries in the middle of a big
> file with Kernel internals.
>
Yes, I know. I don't think that cleanup is going to happen anytime soon.
Guenter
^ permalink raw reply
* [RFC PATCH] powerpc/64/ftrace: mprofile-kernel patch out mflr
From: Nicholas Piggin @ 2019-04-13 1:59 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
The new mprofile-kernel mcount sequence is
mflr r0
bl _mcount
Dynamic ftrace patches the branch instruction with a noop, but leaves
the mflr. mflr is executed by the branch unit that can only execute one
per cycle on POWER9 and shared with branches, so it would be nice to
avoid it where possible.
This patch is a hacky proof of concept to nop out the mflr. Can we do
this or are there races or other issues with it?
---
arch/powerpc/kernel/trace/ftrace.c | 77 +++++++++++++++++++++++++++++-
1 file changed, 75 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
index 52ee24fd353f..ecc75baef23e 100644
--- a/arch/powerpc/kernel/trace/ftrace.c
+++ b/arch/powerpc/kernel/trace/ftrace.c
@@ -172,6 +172,19 @@ __ftrace_make_nop(struct module *mod,
pr_err("Unexpected instruction %08x around bl _mcount\n", op);
return -EINVAL;
}
+
+ if (patch_instruction((unsigned int *)ip, pop)) {
+ pr_err("Patching NOP failed.\n");
+ return -EPERM;
+ }
+
+ if (op == PPC_INST_MFLR) {
+ if (patch_instruction((unsigned int *)(ip - 4), pop)) {
+ pr_err("Patching NOP failed.\n");
+ return -EPERM;
+ }
+ }
+
#else
/*
* Our original call site looks like:
@@ -202,13 +215,14 @@ __ftrace_make_nop(struct module *mod,
pr_err("Expected %08x found %08x\n", PPC_INST_LD_TOC, op);
return -EINVAL;
}
-#endif /* CONFIG_MPROFILE_KERNEL */
if (patch_instruction((unsigned int *)ip, pop)) {
pr_err("Patching NOP failed.\n");
return -EPERM;
}
+#endif /* CONFIG_MPROFILE_KERNEL */
+
return 0;
}
@@ -421,6 +435,20 @@ static int __ftrace_make_nop_kernel(struct dyn_ftrace *rec, unsigned long addr)
return -EPERM;
}
+#ifdef CONFIG_MPROFILE_KERNEL
+ if (probe_kernel_read(&op, (void *)(ip - 4), 4)) {
+ pr_err("Fetching instruction at %lx failed.\n", ip - 4);
+ return -EFAULT;
+ }
+
+ if (op == PPC_INST_MFLR) {
+ if (patch_instruction((unsigned int *)(ip - 4), PPC_INST_NOP)) {
+ pr_err("Patching NOP failed.\n");
+ return -EPERM;
+ }
+ }
+#endif
+
return 0;
}
@@ -437,9 +465,20 @@ int ftrace_make_nop(struct module *mod,
*/
if (test_24bit_addr(ip, addr)) {
/* within range */
+ int rc;
+
old = ftrace_call_replace(ip, addr, 1);
new = PPC_INST_NOP;
- return ftrace_modify_code(ip, old, new);
+ rc = ftrace_modify_code(ip, old, new);
+ if (rc)
+ return rc;
+#ifdef CONFIG_MPROFILE_KERNEL
+ old = PPC_INST_MFLR;
+ new = PPC_INST_NOP;
+ ftrace_modify_code(ip - 4, old, new);
+ /* old mprofile kernel will error because no mflr */
+#endif
+ return rc;
} else if (core_kernel_text(ip))
return __ftrace_make_nop_kernel(rec, addr);
@@ -562,6 +601,20 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
return -EINVAL;
}
+#ifdef CONFIG_MPROFILE_KERNEL
+ if (probe_kernel_read(op, (ip - 4), 4)) {
+ pr_err("Fetching instruction at %lx failed.\n", (unsigned long)(ip - 4));
+ return -EFAULT;
+ }
+
+ if (op[0] == PPC_INST_NOP) {
+ if (patch_instruction((ip - 4), PPC_INST_MFLR)) {
+ pr_err("Patching mflr failed.\n");
+ return -EINVAL;
+ }
+ }
+#endif
+
if (patch_branch(ip, tramp, BRANCH_SET_LINK)) {
pr_err("REL24 out of range!\n");
return -EINVAL;
@@ -650,6 +703,20 @@ static int __ftrace_make_call_kernel(struct dyn_ftrace *rec, unsigned long addr)
return -EINVAL;
}
+#ifdef CONFIG_MPROFILE_KERNEL
+ if (probe_kernel_read(&op, (ip - 4), 4)) {
+ pr_err("Fetching instruction at %lx failed.\n", (unsigned long)(ip - 4));
+ return -EFAULT;
+ }
+
+ if (op == PPC_INST_NOP) {
+ if (patch_instruction((ip - 4), PPC_INST_MFLR)) {
+ pr_err("Patching mflr failed.\n");
+ return -EINVAL;
+ }
+ }
+#endif
+
if (patch_branch(ip, tramp, BRANCH_SET_LINK)) {
pr_err("Error patching branch to ftrace tramp!\n");
return -EINVAL;
@@ -670,6 +737,12 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
*/
if (test_24bit_addr(ip, addr)) {
/* within range */
+#ifdef CONFIG_MPROFILE_KERNEL
+ old = PPC_INST_NOP;
+ new = PPC_INST_MFLR;
+ ftrace_modify_code(ip - 4, old, new);
+ /* old mprofile-kernel sequence will error because no nop */
+#endif
old = PPC_INST_NOP;
new = ftrace_call_replace(ip, addr, 1);
return ftrace_modify_code(ip, old, new);
--
2.20.1
^ permalink raw reply related
* Re: [PATCH v9 2/2] powerpc/64s: KVM update for reimplement book3s idle code in C
From: kbuild test robot @ 2019-04-13 2:51 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Gautham R . Shenoy, linuxppc-dev, kbuild-all, kvm-ppc,
Nicholas Piggin
In-Reply-To: <20190412143053.18567-2-npiggin@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]
Hi Nicholas,
I love your patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.1-rc4 next-20190412]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-64s-reimplement-book3s-idle-code-in-C/20190413-002437
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
powerpc64-linux-gnu-ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'.
arch/powerpc/platforms/powernv/idle.o: In function `.pnv_cpu_offline':
>> (.text+0x1900): undefined reference to `.idle_kvm_start_guest'
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24091 bytes --]
^ permalink raw reply
* Re: [PATCH v2 00/21] Convert hwmon documentation to ReST
From: Guenter Roeck @ 2019-04-13 3:09 UTC (permalink / raw)
To: Jonathan Corbet
Cc: linux-hwmon, Jean Delvare, linux-aspeed, Linux Doc Mailing List,
Andrew Jeffery, Sudeep Holla, Liviu Dudau, linux-kernel,
Mauro Carvalho Chehab, Lorenzo Pieralisi, Paul Mackerras,
Joel Stanley, Mauro Carvalho Chehab, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <20190412100451.6fe49de7@lwn.net>
On 4/12/19 9:04 AM, Jonathan Corbet wrote:
> On Thu, 11 Apr 2019 14:07:31 -0700
> Guenter Roeck <linux@roeck-us.net> wrote:
>
>>> While nobody does such split, IMHO, the best would be to keep the
>>> information outside Documentation/admin-guide. But hey! You're
>>> the Doc maintainer. If you prefer to move, I'm perfectly fine
>>> with that.
>>>
>>
>> Same here, but please don't move the files which are kernel facing only.
>
> Well, let's step back and think about this. Who is the audience for
> these documents? That will tell us a lot about where they should really
> be.
>
> What I would prefer to avoid is the status quo where *everything* is in
> the top-level directory, and where documents are organized for the
> convenience of their maintainers rather than of their readers. But
> sometimes I feel like I'm alone in that desire...:)
>
The big real-world question is: Is the series good enough for you to accept,
or do you expect some level of user/kernel separation ?
Guenter
^ permalink raw reply
* Re: powerpc/64s/radix: Fix radix segment exception handling
From: Michael Ellerman @ 2019-04-13 3:39 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev, Michael Ellerman
Cc: Aneesh Kumar K . V, Anton Blanchard
In-Reply-To: <1555040097.sqg9j51don.astroid@bobo.none>
Nicholas Piggin <npiggin@gmail.com> writes:
> Michael Ellerman's on April 11, 2019 12:49 am:
>> On Fri, 2019-03-29 at 07:42:57 UTC, Nicholas Piggin wrote:
>>> Commit 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C")
>>> broke the radix-mode segment exception handler. In radix mode, this is
>>> exception is not an SLB miss, rather it signals that the EA is outside
>>> the range translated by any page table.
>>>
>>> The commit lost the radix feature alternate code patch, which can
>>> cause faults to some EAs to kernel BUG at arch/powerpc/mm/slb.c:639!
>>>
>>> The original radix code would send faults to slb_miss_large_addr,
>>> which would end up faulting due to slb_addr_limit being 0. This patch
>>> sends radix directly to do_bad_slb_fault, which is a bit clearer.
>>>
>>> Fixes: 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C")
>>> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>>> Reported-by: Anton Blanchard <anton@samba.org>
>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>>
>> Applied to powerpc fixes, thanks.
>>
>> https://git.kernel.org/powerpc/c/7100e8704b61247649c50551b965e71d
>
> I sent a v2 with a selftests that triggers the crash if you want it.
> Code was unchanged to no big deal there.
Yeah I checked the kernel part was unchanged so stuck with v1.
I also sent a self test, which is similar but slightly different to
yours, though yours is better in general. I'll try and merge them into
one test.
cheers
^ permalink raw reply
* Re: [PATCH] crypto: vmx - fix copy-paste error in CTR mode
From: Michael Ellerman @ 2019-04-13 3:41 UTC (permalink / raw)
To: Nayna, Daniel Axtens, Eric Biggers
Cc: leo.barbosa, Herbert Xu, Stephan Mueller, nayna, omosnacek,
marcelo.cerri, pfsmorigo, linux-crypto, leitao, George Wilson,
linuxppc-dev
In-Reply-To: <2c8b042f-c7df-cb8b-3fcd-15d6bb274d08@linux.vnet.ibm.com>
Nayna <nayna@linux.vnet.ibm.com> writes:
> On 04/11/2019 10:47 AM, Daniel Axtens wrote:
>> Eric Biggers <ebiggers@kernel.org> writes:
>>
>>> Are you still planning to fix the remaining bug? I booted a ppc64le VM, and I
>>> see the same test failure (I think) you were referring to:
>>>
>>> alg: skcipher: p8_aes_ctr encryption test failed (wrong result) on test vector 3, cfg="uneven misaligned splits, may sleep"
>>>
>> Yes, that's the one I saw. I don't have time to follow it up at the
>> moment, but Nayna is aware of it.
>>
>
> Yes Eric, we identified this as a separate issue of misalignment and
> plan to post a separate patch to address it.
I also wrote it down in my write-only TODO list here:
https://github.com/linuxppc/issues/issues/238
cheers
^ permalink raw reply
* [PATCH] Documentation: Add ARM64 to kernel-parameters.rst
From: Josh Poimboeuf @ 2019-04-13 3:56 UTC (permalink / raw)
To: Randy Dunlap
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, Jonathan Corbet, x86,
Will Deacon, Steven Price, Linus Torvalds, Catalin Marinas,
Waiman Long, linux-arch, Jon Masters, Jiri Kosina,
Borislav Petkov, Andy Lutomirski, Thomas Gleixner,
linux-arm-kernel, Phil Auld, Greg Kroah-Hartman, linux-kernel,
Tyler Hicks, Martin Schwidefsky, linuxppc-dev
In-Reply-To: <25174c3c-0e39-0562-7d02-bb7d51cd2b43@infradead.org>
Add ARM64 to the legend of architectures. It's already used in several
places in kernel-parameters.txt.
Suggested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
Documentation/admin-guide/kernel-parameters.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst
index b8d0bc07ed0a..0124980dca2d 100644
--- a/Documentation/admin-guide/kernel-parameters.rst
+++ b/Documentation/admin-guide/kernel-parameters.rst
@@ -88,6 +88,7 @@ parameter is applicable::
APIC APIC support is enabled.
APM Advanced Power Management support is enabled.
ARM ARM architecture is enabled.
+ ARM64 ARM64 architecture is enabled.
AX25 Appropriate AX.25 support is enabled.
CLK Common clock infrastructure is enabled.
CMA Contiguous Memory Area support is enabled.
--
2.17.2
^ permalink raw reply related
* [GIT PULL] Please pull powerpc/linux.git powerpc-5.1-5 tag
From: Michael Ellerman @ 2019-04-13 4:03 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, linux-kernel, npiggin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Linus,
Please pull some more powerpc fixes for 5.1:
The following changes since commit 6f845ebec2706841d15831fab3ffffcfd9e676fa:
powerpc/pseries/mce: Fix misleading print for TLB mutlihit (2019-03-29 16:59:19 +1100)
are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.1-5
for you to fetch changes up to cf7cf6977f531acd5dfe55250d0ee8cbbb6f1ae8:
powerpc/mm: Define MAX_PHYSMEM_BITS for all 64-bit configs (2019-04-10 14:45:57 +1000)
- ------------------------------------------------------------------
powerpc fixes for 5.1 #5
A minor build fix for 64-bit FLATMEM configs.
A fix for a boot failure on 32-bit powermacs.
My commit to fix CLOCK_MONOTONIC across Y2038 broke the 32-bit VDSO on 64-bit
kernels, ie. compat mode, which is only used on big endian.
The rewrite of the SLB code we merged in 4.20 missed the fact that the 0x380
exception is also used with the Radix MMU to report out of range accesses. This
could lead to an oops if userspace tried to read from addresses outside the user
or kernel range.
Thanks to:
Aneesh Kumar K.V, Christophe Leroy, Larry Finger, Nicholas Piggin.
- ------------------------------------------------------------------
Christophe Leroy (2):
powerpc/32: Fix early boot failure with RTAS built-in
powerpc/vdso32: fix CLOCK_MONOTONIC on PPC64
Michael Ellerman (1):
powerpc/mm: Define MAX_PHYSMEM_BITS for all 64-bit configs
Nicholas Piggin (1):
powerpc/64s/radix: Fix radix segment exception handling
arch/powerpc/include/asm/mmu.h | 2 +-
arch/powerpc/kernel/exceptions-64s.S | 12 ++++++++++++
arch/powerpc/kernel/head_32.S | 8 --------
arch/powerpc/kernel/vdso32/gettimeofday.S | 2 +-
4 files changed, 14 insertions(+), 10 deletions(-)
-----BEGIN PGP SIGNATURE-----
iQIcBAEBAgAGBQJcsV9SAAoJEFHr6jzI4aWAhi8P/RB37+hOMXUP4CzX4VSKuorG
pIDo8rfAL8pmw+6gGooG4VNTfjoaENKdLygYIG+jFhh/xJx3lIUkfL970dWHv+la
bCUpofJvCwW00ZQRbjBDn8GihhZUQMITPlFSrnj1bz/hmFmMFjANFSPAOuGL7AY5
OIWQ2kzBkxFTkx7H60UPWPBQ0N+KI7DiFEX14Eg8UlEl5rWS/SBmnAL/1B+vYoLs
A8z71OXL0QD1mg0zTfevNzY7p5enOaGrZqau9Rs3QuKPb95XjiSL15jq5XwrggDy
4fvDTxrHHZOo383H9UZo4ZdY+mxgRnqhpyWgnBvxBc7JJgE/pCg5LOIE7aq/0DbY
4XaQ66BOr7d5Qw41KTs/XOHsmFTdYgfN91KwY/3UgB0740xdAhMPLn+fLxrs4iBL
xAmDS4luqk2+i8WLvUZsXh9L9b/ul41rN1q8xH0O2/ARTaTFarGo0KOsqNv2DGmW
oAiHpTA/mKkzN/I8iNBM057r8WTuunScyvjviNW9sKY36lbdvKbxndBmT5Ew9a1I
5L7c+xKPJNCjxX6iFtXaEQBYM47k+bwP+VxA8SAamvZmo+UXME01zoYeHzSRgmdX
oaYjMv1BEeWAf9eWsitV7rShZTDoJR7glMuBG4rHU3pzO0kMQTIAGM1wsVAs5XK6
z8EX5UlhVxwjFGvCDsKq
=3Jqz
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH] Documentation: Add ARM64 to kernel-parameters.rst
From: Randy Dunlap @ 2019-04-13 4:47 UTC (permalink / raw)
To: Josh Poimboeuf
Cc: Peter Zijlstra, Heiko Carstens, Paul Mackerras, H . Peter Anvin,
Ingo Molnar, Andrea Arcangeli, linux-s390, Jonathan Corbet, x86,
Will Deacon, Steven Price, Linus Torvalds, Catalin Marinas,
Waiman Long, linux-arch, Jon Masters, Jiri Kosina,
Borislav Petkov, Andy Lutomirski, Thomas Gleixner,
linux-arm-kernel, Phil Auld, Greg Kroah-Hartman, linux-kernel,
Tyler Hicks, Martin Schwidefsky, linuxppc-dev
In-Reply-To: <20190413035621.tohihjksatqushwf@treble>
On 4/12/19 8:56 PM, Josh Poimboeuf wrote:
> Add ARM64 to the legend of architectures. It's already used in several
> places in kernel-parameters.txt.
>
> Suggested-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
> Documentation/admin-guide/kernel-parameters.rst | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst
> index b8d0bc07ed0a..0124980dca2d 100644
> --- a/Documentation/admin-guide/kernel-parameters.rst
> +++ b/Documentation/admin-guide/kernel-parameters.rst
> @@ -88,6 +88,7 @@ parameter is applicable::
> APIC APIC support is enabled.
> APM Advanced Power Management support is enabled.
> ARM ARM architecture is enabled.
> + ARM64 ARM64 architecture is enabled.
> AX25 Appropriate AX.25 support is enabled.
> CLK Common clock infrastructure is enabled.
> CMA Contiguous Memory Area support is enabled.
>
Thanks.
--
~Randy
^ permalink raw reply
* [PATCH] crypto: powerpc - convert to use crypto_simd_usable()
From: Eric Biggers @ 2019-04-13 5:33 UTC (permalink / raw)
To: linux-crypto, Herbert Xu; +Cc: Nayna, linuxppc-dev, Daniel Axtens
From: Eric Biggers <ebiggers@google.com>
Replace all calls to in_interrupt() in the PowerPC crypto code with
!crypto_simd_usable(). This causes the crypto self-tests to test the
no-SIMD code paths when CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y.
The p8_ghash algorithm is currently failing and needs to be fixed, as it
produces the wrong digest when no-SIMD updates are mixed with SIMD ones.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
arch/powerpc/crypto/crc32c-vpmsum_glue.c | 4 +++-
arch/powerpc/crypto/crct10dif-vpmsum_glue.c | 4 +++-
arch/powerpc/include/asm/Kbuild | 1 +
drivers/crypto/vmx/aes.c | 7 ++++---
drivers/crypto/vmx/aes_cbc.c | 7 ++++---
drivers/crypto/vmx/aes_ctr.c | 5 +++--
drivers/crypto/vmx/aes_xts.c | 5 +++--
drivers/crypto/vmx/ghash.c | 9 ++++-----
8 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/crypto/crc32c-vpmsum_glue.c b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
index fd1d6c83f0c02..c4fa242dd652d 100644
--- a/arch/powerpc/crypto/crc32c-vpmsum_glue.c
+++ b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
@@ -1,10 +1,12 @@
#include <linux/crc32.h>
#include <crypto/internal/hash.h>
+#include <crypto/internal/simd.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/cpufeature.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#define CHKSUM_BLOCK_SIZE 1
@@ -22,7 +24,7 @@ static u32 crc32c_vpmsum(u32 crc, unsigned char const *p, size_t len)
unsigned int prealign;
unsigned int tail;
- if (len < (VECTOR_BREAKPOINT + VMX_ALIGN) || in_interrupt())
+ if (len < (VECTOR_BREAKPOINT + VMX_ALIGN) || !crypto_simd_usable())
return __crc32c_le(crc, p, len);
if ((unsigned long)p & VMX_ALIGN_MASK) {
diff --git a/arch/powerpc/crypto/crct10dif-vpmsum_glue.c b/arch/powerpc/crypto/crct10dif-vpmsum_glue.c
index 02ea277863d15..e27ff16573b5b 100644
--- a/arch/powerpc/crypto/crct10dif-vpmsum_glue.c
+++ b/arch/powerpc/crypto/crct10dif-vpmsum_glue.c
@@ -12,11 +12,13 @@
#include <linux/crc-t10dif.h>
#include <crypto/internal/hash.h>
+#include <crypto/internal/simd.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/cpufeature.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#define VMX_ALIGN 16
@@ -32,7 +34,7 @@ static u16 crct10dif_vpmsum(u16 crci, unsigned char const *p, size_t len)
unsigned int tail;
u32 crc = crci;
- if (len < (VECTOR_BREAKPOINT + VMX_ALIGN) || in_interrupt())
+ if (len < (VECTOR_BREAKPOINT + VMX_ALIGN) || !crypto_simd_usable())
return crc_t10dif_generic(crc, p, len);
if ((unsigned long)p & VMX_ALIGN_MASK) {
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index a0c132bedfae8..5ac3dead69523 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -11,3 +11,4 @@ generic-y += preempt.h
generic-y += rwsem.h
generic-y += vtime.h
generic-y += msi.h
+generic-y += simd.h
diff --git a/drivers/crypto/vmx/aes.c b/drivers/crypto/vmx/aes.c
index b00d6947e02f4..603a620819941 100644
--- a/drivers/crypto/vmx/aes.c
+++ b/drivers/crypto/vmx/aes.c
@@ -23,9 +23,10 @@
#include <linux/err.h>
#include <linux/crypto.h>
#include <linux/delay.h>
-#include <linux/hardirq.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#include <crypto/aes.h>
+#include <crypto/internal/simd.h>
#include "aesp8-ppc.h"
@@ -92,7 +93,7 @@ static void p8_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
- if (in_interrupt()) {
+ if (!crypto_simd_usable()) {
crypto_cipher_encrypt_one(ctx->fallback, dst, src);
} else {
preempt_disable();
@@ -109,7 +110,7 @@ static void p8_aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{
struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
- if (in_interrupt()) {
+ if (!crypto_simd_usable()) {
crypto_cipher_decrypt_one(ctx->fallback, dst, src);
} else {
preempt_disable();
diff --git a/drivers/crypto/vmx/aes_cbc.c b/drivers/crypto/vmx/aes_cbc.c
index fbe882ef1bc5d..a1a9a6f0d42cf 100644
--- a/drivers/crypto/vmx/aes_cbc.c
+++ b/drivers/crypto/vmx/aes_cbc.c
@@ -23,9 +23,10 @@
#include <linux/err.h>
#include <linux/crypto.h>
#include <linux/delay.h>
-#include <linux/hardirq.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#include <crypto/aes.h>
+#include <crypto/internal/simd.h>
#include <crypto/scatterwalk.h>
#include <crypto/skcipher.h>
@@ -100,7 +101,7 @@ static int p8_aes_cbc_encrypt(struct blkcipher_desc *desc,
struct p8_aes_cbc_ctx *ctx =
crypto_tfm_ctx(crypto_blkcipher_tfm(desc->tfm));
- if (in_interrupt()) {
+ if (!crypto_simd_usable()) {
SYNC_SKCIPHER_REQUEST_ON_STACK(req, ctx->fallback);
skcipher_request_set_sync_tfm(req, ctx->fallback);
skcipher_request_set_callback(req, desc->flags, NULL, NULL);
@@ -139,7 +140,7 @@ static int p8_aes_cbc_decrypt(struct blkcipher_desc *desc,
struct p8_aes_cbc_ctx *ctx =
crypto_tfm_ctx(crypto_blkcipher_tfm(desc->tfm));
- if (in_interrupt()) {
+ if (!crypto_simd_usable()) {
SYNC_SKCIPHER_REQUEST_ON_STACK(req, ctx->fallback);
skcipher_request_set_sync_tfm(req, ctx->fallback);
skcipher_request_set_callback(req, desc->flags, NULL, NULL);
diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c
index 214c69db9ebdf..192a53512f5e8 100644
--- a/drivers/crypto/vmx/aes_ctr.c
+++ b/drivers/crypto/vmx/aes_ctr.c
@@ -23,9 +23,10 @@
#include <linux/err.h>
#include <linux/crypto.h>
#include <linux/delay.h>
-#include <linux/hardirq.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#include <crypto/aes.h>
+#include <crypto/internal/simd.h>
#include <crypto/scatterwalk.h>
#include <crypto/skcipher.h>
@@ -119,7 +120,7 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,
struct p8_aes_ctr_ctx *ctx =
crypto_tfm_ctx(crypto_blkcipher_tfm(desc->tfm));
- if (in_interrupt()) {
+ if (!crypto_simd_usable()) {
SYNC_SKCIPHER_REQUEST_ON_STACK(req, ctx->fallback);
skcipher_request_set_sync_tfm(req, ctx->fallback);
skcipher_request_set_callback(req, desc->flags, NULL, NULL);
diff --git a/drivers/crypto/vmx/aes_xts.c b/drivers/crypto/vmx/aes_xts.c
index 5bf4c38566502..00d412d811ae6 100644
--- a/drivers/crypto/vmx/aes_xts.c
+++ b/drivers/crypto/vmx/aes_xts.c
@@ -23,9 +23,10 @@
#include <linux/err.h>
#include <linux/crypto.h>
#include <linux/delay.h>
-#include <linux/hardirq.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#include <crypto/aes.h>
+#include <crypto/internal/simd.h>
#include <crypto/scatterwalk.h>
#include <crypto/xts.h>
#include <crypto/skcipher.h>
@@ -109,7 +110,7 @@ static int p8_aes_xts_crypt(struct blkcipher_desc *desc,
struct p8_aes_xts_ctx *ctx =
crypto_tfm_ctx(crypto_blkcipher_tfm(desc->tfm));
- if (in_interrupt()) {
+ if (!crypto_simd_usable()) {
SYNC_SKCIPHER_REQUEST_ON_STACK(req, ctx->fallback);
skcipher_request_set_sync_tfm(req, ctx->fallback);
skcipher_request_set_callback(req, desc->flags, NULL, NULL);
diff --git a/drivers/crypto/vmx/ghash.c b/drivers/crypto/vmx/ghash.c
index dd8b8716467a2..611ff591410ea 100644
--- a/drivers/crypto/vmx/ghash.c
+++ b/drivers/crypto/vmx/ghash.c
@@ -23,16 +23,15 @@
#include <linux/err.h>
#include <linux/crypto.h>
#include <linux/delay.h>
-#include <linux/hardirq.h>
+#include <asm/simd.h>
#include <asm/switch_to.h>
#include <crypto/aes.h>
#include <crypto/ghash.h>
#include <crypto/scatterwalk.h>
#include <crypto/internal/hash.h>
+#include <crypto/internal/simd.h>
#include <crypto/b128ops.h>
-#define IN_INTERRUPT in_interrupt()
-
void gcm_init_p8(u128 htable[16], const u64 Xi[2]);
void gcm_gmult_p8(u64 Xi[2], const u128 htable[16]);
void gcm_ghash_p8(u64 Xi[2], const u128 htable[16],
@@ -131,7 +130,7 @@ static int p8_ghash_update(struct shash_desc *desc,
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm));
struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc);
- if (IN_INTERRUPT) {
+ if (!crypto_simd_usable()) {
return crypto_shash_update(&dctx->fallback_desc, src,
srclen);
} else {
@@ -182,7 +181,7 @@ static int p8_ghash_final(struct shash_desc *desc, u8 *out)
struct p8_ghash_ctx *ctx = crypto_tfm_ctx(crypto_shash_tfm(desc->tfm));
struct p8_ghash_desc_ctx *dctx = shash_desc_ctx(desc);
- if (IN_INTERRUPT) {
+ if (!crypto_simd_usable()) {
return crypto_shash_final(&dctx->fallback_desc, out);
} else {
if (dctx->bytes) {
--
2.21.0
^ permalink raw reply related
* Re: powerpc/64s/radix: Fix radix segment exception handling
From: Nicholas Piggin @ 2019-04-13 5:59 UTC (permalink / raw)
To: linuxppc-dev, Michael Ellerman, Michael Ellerman
Cc: Aneesh Kumar K . V, Anton Blanchard
In-Reply-To: <875zrivaip.fsf@concordia.ellerman.id.au>
Michael Ellerman's on April 13, 2019 1:39 pm:
> Nicholas Piggin <npiggin@gmail.com> writes:
>> Michael Ellerman's on April 11, 2019 12:49 am:
>>> On Fri, 2019-03-29 at 07:42:57 UTC, Nicholas Piggin wrote:
>>>> Commit 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C")
>>>> broke the radix-mode segment exception handler. In radix mode, this is
>>>> exception is not an SLB miss, rather it signals that the EA is outside
>>>> the range translated by any page table.
>>>>
>>>> The commit lost the radix feature alternate code patch, which can
>>>> cause faults to some EAs to kernel BUG at arch/powerpc/mm/slb.c:639!
>>>>
>>>> The original radix code would send faults to slb_miss_large_addr,
>>>> which would end up faulting due to slb_addr_limit being 0. This patch
>>>> sends radix directly to do_bad_slb_fault, which is a bit clearer.
>>>>
>>>> Fixes: 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C")
>>>> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>>>> Reported-by: Anton Blanchard <anton@samba.org>
>>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>>> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>>>
>>> Applied to powerpc fixes, thanks.
>>>
>>> https://git.kernel.org/powerpc/c/7100e8704b61247649c50551b965e71d
>>
>> I sent a v2 with a selftests that triggers the crash if you want it.
>> Code was unchanged to no big deal there.
>
> Yeah I checked the kernel part was unchanged so stuck with v1.
>
> I also sent a self test, which is similar but slightly different to
> yours, though yours is better in general. I'll try and merge them into
> one test.
If you don't mind that would be good. The siglongjmp handler is
cleaner though, and should make it simpler to test ifetch accesses.
We just need to get the sig info into yours, and an array of
interesting addresses.
Thanks,
Nick
^ permalink raw reply
* Re: [PATCH v9 2/2] powerpc/64s: KVM update for reimplement book3s idle code in C
From: Nicholas Piggin @ 2019-04-13 6:01 UTC (permalink / raw)
To: kbuild test robot; +Cc: Gautham R . Shenoy, linuxppc-dev, kbuild-all, kvm-ppc
In-Reply-To: <201904131032.tgFf8rgW%lkp@intel.com>
kbuild test robot's on April 13, 2019 12:51 pm:
> Hi Nicholas,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on powerpc/next]
> [also build test ERROR on v5.1-rc4 next-20190412]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/powerpc-64s-reimplement-book3s-idle-code-in-C/20190413-002437
> base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> config: powerpc-defconfig (attached as .config)
> compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.2.0 make.cross ARCH=powerpc
>
> All errors (new ones prefixed by >>):
>
> powerpc64-linux-gnu-ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'.
> arch/powerpc/platforms/powernv/idle.o: In function `.pnv_cpu_offline':
>>> (.text+0x1900): undefined reference to `.idle_kvm_start_guest'
Argh, it took me longer than I'd like to admit to work this out. I'm
ELFv1-illiterate. Replacing .globl with _GLOBAL seems to fix it. I'll
roll that into the next patch.
Thanks,
Nick
^ permalink raw reply
* Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.1-5 tag
From: pr-tracker-bot @ 2019-04-13 17:40 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Linus Torvalds, linux-kernel, npiggin
In-Reply-To: <87zhoutuuw.fsf@concordia.ellerman.id.au>
The pull request you sent on Sat, 13 Apr 2019 14:03:19 +1000:
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.1-5
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/cf60528f8ab805ba03e21ce4ce6ab11647cede9b
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker
^ permalink raw reply
* [PATCH v5 2/5] powerpc: Replace CONFIG_DEBUG_KERNEL with CONFIG_DEBUG_MISC
From: Sinan Kaya @ 2019-04-13 22:44 UTC (permalink / raw)
To: linux-kernel
Cc: keescook, Sinan Kaya, josh, Paul Mackerras,
open list:LINUX FOR POWERPC 32-BIT AND 64-BIT
In-Reply-To: <20190413224438.10802-1-okaya@kernel.org>
CONFIG_DEBUG_KERNEL should not impact code generation. Use the newly
defined CONFIG_DEBUG_MISC instead to keep the current code.
Signed-off-by: Sinan Kaya <okaya@kernel.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
arch/powerpc/kernel/sysfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index e8e93c2c7d03..7a1708875d27 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -610,7 +610,7 @@ SYSFS_PMCSETUP(pa6t_pmc2, SPRN_PA6T_PMC2);
SYSFS_PMCSETUP(pa6t_pmc3, SPRN_PA6T_PMC3);
SYSFS_PMCSETUP(pa6t_pmc4, SPRN_PA6T_PMC4);
SYSFS_PMCSETUP(pa6t_pmc5, SPRN_PA6T_PMC5);
-#ifdef CONFIG_DEBUG_KERNEL
+#ifdef CONFIG_DEBUG_MISC
SYSFS_SPRSETUP(hid0, SPRN_HID0);
SYSFS_SPRSETUP(hid1, SPRN_HID1);
SYSFS_SPRSETUP(hid4, SPRN_HID4);
@@ -639,7 +639,7 @@ SYSFS_SPRSETUP(tsr0, SPRN_PA6T_TSR0);
SYSFS_SPRSETUP(tsr1, SPRN_PA6T_TSR1);
SYSFS_SPRSETUP(tsr2, SPRN_PA6T_TSR2);
SYSFS_SPRSETUP(tsr3, SPRN_PA6T_TSR3);
-#endif /* CONFIG_DEBUG_KERNEL */
+#endif /* CONFIG_DEBUG_MISC */
#endif /* HAS_PPC_PMC_PA6T */
#ifdef HAS_PPC_PMC_IBM
@@ -680,7 +680,7 @@ static struct device_attribute pa6t_attrs[] = {
__ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3),
__ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4),
__ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5),
-#ifdef CONFIG_DEBUG_KERNEL
+#ifdef CONFIG_DEBUG_MISC
__ATTR(hid0, 0600, show_hid0, store_hid0),
__ATTR(hid1, 0600, show_hid1, store_hid1),
__ATTR(hid4, 0600, show_hid4, store_hid4),
@@ -709,7 +709,7 @@ static struct device_attribute pa6t_attrs[] = {
__ATTR(tsr1, 0600, show_tsr1, store_tsr1),
__ATTR(tsr2, 0600, show_tsr2, store_tsr2),
__ATTR(tsr3, 0600, show_tsr3, store_tsr3),
-#endif /* CONFIG_DEBUG_KERNEL */
+#endif /* CONFIG_DEBUG_MISC */
};
#endif /* HAS_PPC_PMC_PA6T */
#endif /* HAS_PPC_PMC_CLASSIC */
--
2.21.0
^ permalink raw reply related
* Re: [PATCH 03/12] PowerPC-83xx: add missing of_node_put after of_device_is_available
From: Markus Elfring @ 2019-04-14 15:25 UTC (permalink / raw)
To: Julia Lawall, Mukesh Ojha, Scott Wood, linuxppc-dev
Cc: kernel-janitors, linux-kernel, Paul Mackerras
In-Reply-To: <1550928043-14889-4-git-send-email-Julia.Lawall@lip6.fr>
> @@ -221,8 +221,10 @@ int mpc837x_usb_cfg(void)
> int ret = 0;
>
> np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
> - if (!np || !of_device_is_available(np))
> + if (!np || !of_device_is_available(np)) {
> + of_node_put(np);
> return -ENODEV;
> + }
> prop = of_get_property(np, "phy_type", NULL);
>
> if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
How do you think about to adjust the exception handling in this function
implementation a bit more according to the Linux coding style?
Regards,
Markus
^ permalink raw reply
* [PATCH 0/2] Fix invalid license IDS
From: Andra Danciu @ 2019-04-14 19:14 UTC (permalink / raw)
To: timur, nicoleotsuka, Xiubo.Lee, festevam, lgirdwood, broonie,
perex, tiwai, shawnguo, s.hauer, kernel, linux-imx, alsa-devel,
linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: tglx, daniel.baluta
This series of patches solves two issues reported by Thomas Gleixner
Andra Danciu (2):
ASoC: mpc5200_dma: Fix invalid license ID
ASoC: mpc5200_psc_i2s: Fix invalid license ID
sound/soc/fsl/mpc5200_dma.c | 2 +-
sound/soc/fsl/mpc5200_psc_i2s.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.11.0
^ permalink raw reply
* [PATCH 1/2] ASoC: mpc5200_dma: Fix invalid license ID
From: Andra Danciu @ 2019-04-14 19:14 UTC (permalink / raw)
To: timur, nicoleotsuka, Xiubo.Lee, festevam, lgirdwood, broonie,
perex, tiwai, shawnguo, s.hauer, kernel, linux-imx, alsa-devel,
linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: tglx, daniel.baluta
In-Reply-To: <20190414191450.18377-1-andradanciu1997@gmail.com>
As the file had no other license notice/reference, it falls under the
project license and therefore the proper SPDX id is: GPL-2.0-only
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Fixes: 1edfc2485d8dc ("ASoC: mpc5200_dma: Switch to SPDX identifier")
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andra Danciu <andradanciu1997@gmail.com>
---
sound/soc/fsl/mpc5200_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index 4396442c2fdd..ccf9301889fe 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL
+// SPDX-License-Identifier: GPL-2.0-only
//
// Freescale MPC5200 PSC DMA
// ALSA SoC Platform driver
--
2.11.0
^ permalink raw reply related
* [PATCH 2/2] ASoC: mpc5200_psc_i2s: Fix invalid license ID
From: Andra Danciu @ 2019-04-14 19:14 UTC (permalink / raw)
To: timur, nicoleotsuka, Xiubo.Lee, festevam, lgirdwood, broonie,
perex, tiwai, shawnguo, s.hauer, kernel, linux-imx, alsa-devel,
linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: tglx, daniel.baluta
In-Reply-To: <20190414191450.18377-1-andradanciu1997@gmail.com>
As the file had no other license notice/reference, it falls under the
project license and therefore the proper SPDX id is: GPL-2.0-only
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Fixes: 864a8472c4412 ("ASoC: mpc5200_psc_i2s: Switch to SPDX identifier")
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andra Danciu <andradanciu1997@gmail.com>
---
sound/soc/fsl/mpc5200_psc_i2s.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c
index 6de97461ba25..9bc01f374b39 100644
--- a/sound/soc/fsl/mpc5200_psc_i2s.c
+++ b/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL
+// SPDX-License-Identifier: GPL-2.0-only
//
// Freescale MPC5200 PSC in I2S mode
// ALSA SoC Digital Audio Interface (DAI) driver
--
2.11.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox