Re: [PATCH v4 01/18] arm64: stacktrace: Add shared header for common stack unwinding code

2022-07-18 Thread Russell King (Oracle)
On Mon, Jul 18, 2022 at 08:26:14AM -0700, Kalesh Singh wrote: > On Mon, Jul 18, 2022 at 5:52 AM Russell King (Oracle) > wrote: > > > > Hi, > > > > Can you please explain why you are targetting my @oracle.com email > > address with this patch set? > > >

Re: [PATCH v4 01/18] arm64: stacktrace: Add shared header for common stack unwinding code

2022-07-18 Thread Russell King (Oracle)
Hi, Can you please explain why you are targetting my @oracle.com email address with this patch set? This causes me problems as I use Outlook's Web interface for that which doesn't appear to cope with the threading, and most certainly is only capable of top-reply only which is against Linux

Re: [PATCH v6 19/64] KVM: arm64: nv: Trap SPSR_EL1, ELR_EL1 and VBAR_EL1 from virtual EL2

2022-02-01 Thread Russell King (Oracle)
o trap on those register > accesses in EL1. Do not set this bit until the whole nesting support is Maybe: , but will be done in a future patch once nested support is complete. > completed. > > Signed-off-by: Jintack Lim > Signed-off-by: Marc Zyngier Reviewed-by: Rus

Re: [PATCH v6 18/64] KVM: arm64: nv: Trap EL1 VM register accesses in virtual EL2

2022-02-01 Thread Russell King (Oracle)
ped > accesses to these registers. > > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _

Re: [PATCH v6 17/64] KVM: arm64: nv: Emulate PSTATE.M for a guest hypervisor

2022-02-01 Thread Russell King (Oracle)
e the reverse translation as an inline function after the above too, so the two translations are together - but as it's only used (in this patch at least) in switch.c there probably isn't too much point. So: Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/

Re: [PATCH v6 15/64] KVM: arm64: nv: Handle HCR_EL2.E2H specially

2022-02-01 Thread Russell King (Oracle)
te. > > Yes, this is slow. Don't do it. I'd hope this is very unlikely! > > Suggested-by: Alexandru Elisei > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up.

Re: [PATCH v6 14/64] KVM: arm64: nv: Handle SPSR_EL2 specially

2022-02-01 Thread Russell King (Oracle)
n order to make sure that accesses to the virtual > view of SPSR_EL2 is correct. > > To do so, we place an illegal value in SPSR_EL1.M, and patch it > accordingly if required when accessing it. > > Reviewed-by: Alexandru Elisei > Signed-off-by: Marc Zyngier Reviewed-by: Rus

Re: [PATCH v6 13/64] KVM: arm64: nv: Handle virtual EL2 registers in vcpu_read/write_sys_reg()

2022-02-01 Thread Russell King (Oracle)
d-by: Ganapatrao Kulkarni > Reviewed-by: Alexandru Elisei > Co-developed-by: Andre Przywara > Signed-off-by: Andre Przywara > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps

Re: [PATCH v6 12/64] KVM: arm64: nv: Add non-VHE-EL2->EL1 translation helpers

2022-02-01 Thread Russell King (Oracle)
ects non-VHE guest hypervisors, as VHE system registers > are compatible with the EL1 counterparts. > > These helpers will get used in subsequent patches. > > Co-developed-by: Andre Przywara > Signed-off-by: Andre Przywara > Signed-off-by: Marc Zyngier Reviewed-by: Russ

Re: [PATCH v6 07/64] KVM: arm64: nv: Handle HCR_EL2.NV system register traps

2022-02-01 Thread Russell King (Oracle)
Jintack Lim > [maz: EL2_REG() macros] > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) Thanks! -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _

Re: [PATCH v6 01/64] arm64: Add ARM64_HAS_NESTED_VIRT cpufeature

2022-02-01 Thread Russell King (Oracle)
gt; This will be used to support nested virtualization in KVM. > > Signed-off-by: Jintack Lim > Signed-off-by: Andre Przywara > Signed-off-by: Christoffer Dall > [maz: moved the command-line option to kvm-arm.mode] > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (

Re: [PATCH v5 16/69] KVM: arm64: nv: Handle trapped ERET from virtual EL2

2022-01-18 Thread Russell King (Oracle)
urn in software. > > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! __

Re: [PATCH v5 15/69] KVM: arm64: nv: Inject HVC exceptions to the virtual EL2

2022-01-18 Thread Russell King (Oracle)
the virtual EL2) > are supposed to handled in the virtual EL2. > > Forward these to EL2 as required. > > Signed-off-by: Jintack Lim > [maz: add handling of HCR_EL2.HCD] > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/handle_exit.c | 11 +++ Reviewed-by: Russell Kin

Re: [PATCH v5 14/69] KVM: arm64: nv: Support virtual EL2 exceptions

2022-01-18 Thread Russell King (Oracle)
On Mon, Nov 29, 2021 at 08:00:55PM +, Marc Zyngier wrote: > From: Jintack Lim > > Support injecting exceptions and performing exception returns to and > from virtual EL2. This must be done entirely in software except when > taking an exception from vEL0 to vEL2 when the virtual

Re: [PATCH v5 13/69] KVM: arm64: nv: Reset VMPIDR_EL2 and VPIDR_EL2 to sane values

2022-01-18 Thread Russell King (Oracle)
> > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ___ kv

Re: [PATCH v5 12/69] KVM: arm64: nv: Handle HCR_EL2.NV system register traps

2022-01-18 Thread Russell King (Oracle)
On Mon, Nov 29, 2021 at 08:00:53PM +, Marc Zyngier wrote: > From: Jintack Lim > > ARM v8.3 introduces a new bit in the HCR_EL2, which is the NV bit. When > this bit is set, accessing EL2 registers in EL1 traps to EL2. In > addition, executing the following instructions in EL1 will trap to

Re: [PATCH v5 11/69] KVM: arm64: nv: Add nested virt VCPU primitives for vEL2 VCPU state

2022-01-18 Thread Russell King (Oracle)
convenient primitives for this. > > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps u

Re: [PATCH v5 10/69] KVM: arm64: nv: Add EL2 system registers to vcpu context

2022-01-17 Thread Russell King (Oracle)
On Mon, Nov 29, 2021 at 08:00:51PM +, Marc Zyngier wrote: > Add the minimal set of EL2 system registers to the vcpu context. > Nothing uses them just yet. > > Reviewed-by: Andre Przywara > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patc

Re: [PATCH v5 09/69] KVM: arm64: nv: Allow userspace to set PSR_MODE_EL2x

2022-01-17 Thread Russell King (Oracle)
-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ___ kvmarm mailing list kvma

Re: [PATCH v5 08/69] KVM: arm64: nv: Reset VCPU to EL2 registers if VCPU nested virt is set

2022-01-17 Thread Russell King (Oracle)
empty data structures] > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) However, a couple of comments below. > --- > arch/arm64/kvm/reset.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kvm/reset.c b/arch

Re: [PATCH v5 07/69] KVM: arm64: nv: Introduce nested virtualization VCPU feature

2022-01-17 Thread Russell King (Oracle)
ems without nested virt enabled > should have neglgible overhead. > > We don't yet allow userspace to actually set this feature. > > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.arm

Re: [PATCH v5 05/69] KVM: arm64: Allow preservation of the S2 SW bits

2022-01-17 Thread Russell King (Oracle)
encoding). > > Propagate the SW bits specified by the caller, and store them into > the corresponding entry. > > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps

Re: [PATCH v5 04/69] KVM: arm64: Rework kvm_pgtable initialisation

2022-01-17 Thread Russell King (Oracle)
rao Kulkarni > Reviewed-by: Ganapatrao Kulkarni > Signed-off-by: Marc Zyngier Looks fairly simple. Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! __

Re: [PATCH v5 03/69] KVM: arm64: Add minimal handling for the ARMv8.7 PMU

2022-01-17 Thread Russell King (Oracle)
. > > Reviewed-by: Alexandru Elisei > Tested-by: Alexandru Elisei > Signed-off-by: Marc Zyngier > Link: https://lore.kernel.org/r/20211126115533.217903-1-...@kernel.org Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FT

Re: [PATCH v5 01/69] KVM: arm64: Save PSTATE early on exit

2022-01-17 Thread Russell King (Oracle)
ewed-by: Fuad Tabba > Signed-off-by: Marc Zyngier Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ___ kvmarm mailing lis

Re: [PATCH v5 02/69] KVM: arm64: Move pkvm's special 32bit handling into a generic infrastructure

2022-01-17 Thread Russell King (Oracle)
On Mon, Nov 29, 2021 at 08:00:43PM +, Marc Zyngier wrote: > diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c > b/arch/arm64/kvm/hyp/nvhe/switch.c > index c0e3fed26d93..d13115a12434 100644 > --- a/arch/arm64/kvm/hyp/nvhe/switch.c > +++ b/arch/arm64/kvm/hyp/nvhe/switch.c > @@ -233,7 +233,7 @@

Re: REGRESSION: Upgrading host kernel from 5.11 to 5.13 breaks QEMU guests - perf/fw_devlink/kvm

2021-09-20 Thread Russell King (Oracle)
ested > it on the M1 (which really doesn't have an architectural PMU) to > verify that it was correctly failing. My test program that derives the number of registers qemu uses now reports 236 registers again and I see: kvm [7]: PMU detected and enabled in the kernel boot log. Tested-by:

REGRESSION: Upgrading host kernel from 5.11 to 5.13 breaks QEMU guests - perf/fw_devlink/kvm

2021-09-18 Thread Russell King (Oracle)
Hi, This morning, I upgraded my VM host from Debian Buster to Debian Bullseye. This host (Armada 8040) runs libvirt. I placed all the VMs into managedsave, which basically means their state is saved out by QEMU ready to be resumed once the upgrade is complete. Initially, I was running 5.11 on

Re: [PATCH v2] memblock: make memblock_find_in_range method private

2021-08-06 Thread Russell King (Oracle)
block_find_in_range() private method of memblock. > > This simplifies the callers, ensures that (unlikely) errors in > memblock_reserve() are handled and improves maintainability of > memblock_find_in_range(). > > Signed-off-by: Mike Rapoport Acked-by: Russell

Re: [PATCH] memblock: make memblock_find_in_range method private

2021-07-30 Thread Russell King (Oracle)
On Fri, Jul 30, 2021 at 01:40:39PM +0300, Mike Rapoport wrote: > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index f97eb2371672..1f8ef9fd5215 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -1012,31 +1012,25 @@ static void __init

Re: [PATCH 1/3] KVM: arm64: Narrow PMU sysreg reset values to architectural requirements

2021-07-13 Thread Russell King (Oracle)
On Tue, Jul 13, 2021 at 04:59:58PM +0100, Marc Zyngier wrote: > On Tue, 13 Jul 2021 15:39:49 +0100, > "Russell King (Oracle)" wrote: > > > > On Tue, Jul 13, 2021 at 02:58:58PM +0100, Marc Zyngier wrote: > > > +static void reset_pmu_reg(struct kvm_vcpu *vcpu

Re: [PATCH 1/3] KVM: arm64: Narrow PMU sysreg reset values to architectural requirements

2021-07-13 Thread Russell King (Oracle)
On Tue, Jul 13, 2021 at 02:58:58PM +0100, Marc Zyngier wrote: > +static void reset_pmu_reg(struct kvm_vcpu *vcpu, const struct sys_reg_desc > *r) > +{ > + u64 n, mask; > + > + /* No PMU available, any PMU reg may UNDEF... */ > + if (!kvm_arm_support_pmu_v3()) > + return; >

Re: [RFC PATCH 4/5] KVM: arm64: Pass hypercalls to userspace

2021-07-01 Thread Russell King (Oracle)
On Tue, Jun 08, 2021 at 05:48:05PM +0200, Jean-Philippe Brucker wrote: > * Untested for AArch32 guests. That really needs testing; you may notice Will Deacon has been posting patches for aarch32 guests over the last few months, and there are other users out there who run aarch32 guests on their

Re: [PATCH] KVM: arm64: Allow PSCI SYSTEM_OFF/RESET to return

2020-12-29 Thread Russell King - ARM Linux admin
On Tue, Dec 29, 2020 at 04:00:59PM +, David Brazdil wrote: > The KVM/arm64 PSCI relay assumes that SYSTEM_OFF and SYSTEM_RESET should > not return, as dictated by the PSCI spec. However, there is firmware out > there which breaks this assumption, leading to a hyp panic. Make KVM > more robust

Re: [PATCH v2 00/13] mm: remove __ARCH_HAS_5LEVEL_HACK

2020-02-16 Thread Russell King - ARM Linux admin
On Sun, Feb 16, 2020 at 10:18:30AM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > These patches convert several architectures to use page table folding and > remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h. > > The changes are mostly about mechanical

Re: [RFC PATCH 0/5] Removing support for 32bit KVM/arm host

2020-02-10 Thread Russell King - ARM Linux admin
On Mon, Feb 10, 2020 at 04:25:23PM +, Russell King - ARM Linux admin wrote: > On Mon, Feb 10, 2020 at 02:13:19PM +, Marc Zyngier wrote: > > KVM/arm was merged just over 7 years ago, and has lived a very quiet > > life so far. It mostly works if you're prepared t

Re: [RFC PATCH 0/5] Removing support for 32bit KVM/arm host

2020-02-10 Thread Russell King - ARM Linux admin
On Mon, Feb 10, 2020 at 02:13:19PM +, Marc Zyngier wrote: > KVM/arm was merged just over 7 years ago, and has lived a very quiet > life so far. It mostly works if you're prepared to deal with its > limitations, it has been a good prototype for the arm64 version, > but it suffers a few

Re: [PATCH v2] arm64: kvm: fix IDMAP overlap with HYP VA

2020-01-19 Thread Russell King - ARM Linux admin
On Sun, Jan 19, 2020 at 05:43:27PM +, Marc Zyngier wrote: > On Sat, 28 Dec 2019 11:57:14 + > Russell King wrote: > > > Booting 5.4 on LX2160A reveals that KVM is non-functional: > > > > kvm: Limiting the IPA size due to kernel Virtual Address limit > >

[PATCH v2] arm64: kvm: fix IDMAP overlap with HYP VA

2019-12-28 Thread Russell King
size due to kernel Virtual Address limit kvm [1]: IPA Size Limit: 43bits kvm [1]: IDMAP page: 81a24000 kvm [1]: HYP VA range: 40:62 ... kvm [1]: Hyp mode initialized successfully Signed-off-by: Russell King --- arch/arm64/kvm/va_layout.c | 44

Re: [PATCH] arm64: kvm: fix IDMAP overlap with HYP VA

2019-12-27 Thread Russell King - ARM Linux admin
On Fri, Dec 27, 2019 at 11:47:35AM +, Russell King wrote: > Booting 5.4 on LX2160A reveals that KVM is non-functional: > > kvm: Limiting the IPA size due to kernel Virtual Address limit > kvm [1]: IPA Size Limit: 43bits > kvm [1]: IDMAP intersecting with HYP VA, unable to co

[PATCH] arm64: kvm: fix IDMAP overlap with HYP VA

2019-12-27 Thread Russell King
size due to kernel Virtual Address limit kvm [1]: IPA Size Limit: 43bits kvm [1]: IDMAP page: 81a24000 kvm [1]: HYP VA range: 40:62 ... kvm [1]: Hyp mode initialized successfully Signed-off-by: Russell King --- arch/arm64/kvm/va_layout.c | 22 +++--- 1 file changed

Re: [PATCH V4 2/15] KVM/MMU: Add tlb flush with range helper function

2018-10-14 Thread Russell King - ARM Linux
On Sun, Oct 14, 2018 at 09:21:23PM +0800, Tianyu Lan wrote: > Sorry to confuse your. I get from CCers from get_maintainer.pl script. Unfortunately you seem to have made a mistake. My email address is 'li...@armlinux.org.uk' not 'li...@armlinux.org'. There is no 'li...@armlinux.org' in

Re: [PATCH V4 2/15] KVM/MMU: Add tlb flush with range helper function

2018-10-14 Thread Russell King - ARM Linux
On Sun, Oct 14, 2018 at 10:27:34AM +0100, Russell King - ARM Linux wrote: > On Sun, Oct 14, 2018 at 10:16:56AM +0200, Thomas Gleixner wrote: > > On Sun, 14 Oct 2018, Liran Alon wrote: > > > > On 13 Oct 2018, at 17:53, lantianyu1...@gmail.com wrote: > > &g

Re: [PATCH V4 2/15] KVM/MMU: Add tlb flush with range helper function

2018-10-14 Thread Russell King - ARM Linux
On Sun, Oct 14, 2018 at 10:16:56AM +0200, Thomas Gleixner wrote: > On Sun, 14 Oct 2018, Liran Alon wrote: > > > On 13 Oct 2018, at 17:53, lantianyu1...@gmail.com wrote: > > > > > > From: Lan Tianyu > > > > > > This patch is to add wrapper functions for tlb_remote_flush_with_range > > >

Re: [PATCH v5 10/15] ARM: spectre-v2: warn about incorrect context switching functions

2018-05-31 Thread Russell King - ARM Linux
On Thu, May 31, 2018 at 11:07:18AM +0100, Marc Zyngier wrote: > > I notice that you haven't replied to some of the patches (7 and 8), > > which makes me think that you have an issue with them - and as tonight > > is likely the last linux-next before the merge window, we're basically > > out of

Re: [PATCH v5 10/15] ARM: spectre-v2: warn about incorrect context switching functions

2018-05-31 Thread Russell King - ARM Linux
On Tue, May 29, 2018 at 06:02:28PM +0100, Marc Zyngier wrote: > On Tue, 29 May 2018 15:55:01 +0100, > Russell King wrote: > > > > Warn at error level if the context switching function is not what we > > are expecting. This can happen with big.Little systems, which we >

Re: [PATCH v5 00/15] ARM Spectre variant 2 fixes

2018-05-29 Thread Russell King - ARM Linux
FFS, yes, there's a build error in this. It's an obvious fix. I won't be re-posting it for a third time today for such a trivial change, but I'll fix up my local version. On Tue, May 29, 2018 at 03:53:21PM +0100, Russell King - ARM Linux wrote: > Sorry for another version so soon af

[PATCH v5 15/15] ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1

2018-05-29 Thread Russell King
Report support for SMCCC_ARCH_WORKAROUND_1 to KVM guests for affected CPUs. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_host.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm

[PATCH v5 12/15] ARM: KVM: invalidate icache on guest exit for Cortex-A15

2018-05-29 Thread Russell King
-by: Marc Zyngier Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_mmu.h | 5 + arch/arm/kvm/hyp/hyp-entry.S | 24 2 files changed, 29 insertions(+) diff --git a/arch/arm/include/asm/kvm_mmu.h b

[PATCH v5 11/15] ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17

2018-05-29 Thread Russell King
this useful. Signed-off-by: Marc Zyngier Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_asm.h | 2 -- arch/arm/include/asm/kvm_mmu.h | 17 +- arch/arm/kvm/hyp/hyp-entry.S | 71

[PATCH v5 10/15] ARM: spectre-v2: warn about incorrect context switching functions

2018-05-29 Thread Russell King
Warn at error level if the context switching function is not what we are expecting. This can happen with big.Little systems, which we currently do not support. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/proc-v7-bugs.c | 15

[PATCH v5 08/15] ARM: spectre-v2: harden user aborts in kernel space

2018-05-29 Thread Russell King
icache. If the IBE bit is not set, then there is little point to enabling the workaround. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/cp15.h| 3 ++ arch/arm/include/asm/system_misc.h | 15 arch/arm/mm/fault.c

[PATCH v5 07/15] ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit

2018-05-29 Thread Russell King
. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/Makefile | 2 +- arch/arm/mm/proc-v7-bugs.c | 36 arch/arm/mm/proc-v7.S | 4 ++-- 3 files changed, 39 insertions

[PATCH v5 06/15] ARM: spectre-v2: harden branch predictor on context switches

2018-05-29 Thread Russell King
R7 and Cortex R8 are also not addressed as we do not enforce memory protection on these cores. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/Kconfig | 19 +++ arch/arm/mm/proc-v7-2level.S | 6 --- arch/arm/mm/proc-v7.S

[PATCH v5 04/15] ARM: bugs: add support for per-processor bug checking

2018-05-29 Thread Russell King
.) This allows processor specific bug checks to validate that workaround bits are properly enabled by firmware via all entry paths to the kernel. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/proc

[PATCH v5 05/15] ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre

2018-05-29 Thread Russell King
Add a Kconfig symbol for CPUs which are vulnerable to the Spectre attacks. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/Kconfig | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mm/Kconfig b

[PATCH v5 03/15] ARM: bugs: hook processor bug checking into SMP and suspend paths

2018-05-29 Thread Russell King
Check for CPU bugs when secondary processors are being brought online, and also when CPUs are resuming from a low power mode. This gives an opportunity to check that processor specific bug workarounds are correctly enabled for all paths that a CPU re-enters the kernel. Signed-off-by: Russell

[PATCH v5 02/15] ARM: bugs: prepare processor bug infrastructure

2018-05-29 Thread Russell King
Prepare the processor bug infrastructure so that it can be expanded to check for per-processor bugs. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/bugs.h | 4 ++-- arch/arm/kernel/Makefile| 1

[PATCH v5 01/15] ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs

2018-05-29 Thread Russell King
Add CPU part numbers for Cortex A53, A57, A72, A73, A75 and the Broadcom Brahma B15 CPU. Signed-off-by: Russell King Acked-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/cputype.h | 8 1 file changed, 8 insertions(+) diff

[PATCH v5 00/15] ARM Spectre variant 2 fixes

2018-05-29 Thread Russell King - ARM Linux
insertions(+), 50 deletions(-) create mode 100644 arch/arm/kernel/bugs.c create mode 100644 arch/arm/mm/proc-v7-bugs.c On Tue, May 29, 2018 at 10:07:57AM +0100, Russell King - ARM Linux wrote: > Fourth version: > - Only warn once per CPU about incorrect IBE bit > (this avoids spamming t

[PATCH v4 14/15] ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling

2018-05-29 Thread Russell King
We want SMCCC_ARCH_WORKAROUND_1 to be fast. As fast as possible. So let's intercept it as early as we can by testing for the function call number as soon as we've identified a HVC call coming from the guest. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren

[PATCH v4 15/15] ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1

2018-05-29 Thread Russell King
Report support for SMCCC_ARCH_WORKAROUND_1 to KVM guests for affected CPUs. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_host.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm

[PATCH v4 12/15] ARM: KVM: invalidate icache on guest exit for Cortex-A15

2018-05-29 Thread Russell King
-by: Marc Zyngier Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_mmu.h | 5 + arch/arm/kvm/hyp/hyp-entry.S | 24 2 files changed, 29 insertions(+) diff --git a/arch/arm/include/asm/kvm_mmu.h b

[PATCH v4 11/15] ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17

2018-05-29 Thread Russell King
this useful. Signed-off-by: Marc Zyngier Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_asm.h | 2 -- arch/arm/include/asm/kvm_mmu.h | 17 +- arch/arm/kvm/hyp/hyp-entry.S | 71

[PATCH v4 13/15] ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15

2018-05-29 Thread Russell King
Include Brahma B15 in the Spectre v2 KVM workarounds. Signed-off-by: Russell King Acked-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/kvm_mmu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch

[PATCH v4 10/15] ARM: spectre-v2: warn about incorrect context switching functions

2018-05-29 Thread Russell King
Warn at error level if the context switching function is not what we are expecting. This can happen with big.Little systems, which we currently do not support. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/proc-v7-bugs.c | 15

[PATCH v4 09/15] ARM: spectre-v2: add firmware based hardening

2018-05-29 Thread Russell King
Add firmware based hardening for cores that require more complex handling in firmware. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/proc-v7-bugs.c | 64 +- arch/arm/mm/proc-v7.S | 21

[PATCH v4 06/15] ARM: spectre-v2: harden branch predictor on context switches

2018-05-29 Thread Russell King
R7 and Cortex R8 are also not addressed as we do not enforce memory protection on these cores. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/Kconfig | 19 +++ arch/arm/mm/proc-v7-2level.S | 6 --- arch/arm/mm/proc-v7.S

[PATCH v4 08/15] ARM: spectre-v2: harden user aborts in kernel space

2018-05-29 Thread Russell King
icache. If the IBE bit is not set, then there is little point to enabling the workaround. Signed-off-by: Russell King Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/cp15.h| 3 ++ arch/arm/include/asm/system_misc.h | 15 arch/arm/mm/fault.c

[PATCH v4 07/15] ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit

2018-05-29 Thread Russell King
. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/Makefile | 2 +- arch/arm/mm/proc-v7-bugs.c | 32 arch/arm/mm/proc-v7.S | 4 ++-- 3 files changed, 35 insertions(+), 3

[PATCH v4 05/15] ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre

2018-05-29 Thread Russell King
Add a Kconfig symbol for CPUs which are vulnerable to the Spectre attacks. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/mm/Kconfig | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mm/Kconfig b

[PATCH v4 04/15] ARM: bugs: add support for per-processor bug checking

2018-05-29 Thread Russell King
.) This allows processor specific bug checks to validate that workaround bits are properly enabled by firmware via all entry paths to the kernel. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/proc

[PATCH v4 03/15] ARM: bugs: hook processor bug checking into SMP and suspend paths

2018-05-29 Thread Russell King
Check for CPU bugs when secondary processors are being brought online, and also when CPUs are resuming from a low power mode. This gives an opportunity to check that processor specific bug workarounds are correctly enabled for all paths that a CPU re-enters the kernel. Signed-off-by: Russell

[PATCH v4 02/15] ARM: bugs: prepare processor bug infrastructure

2018-05-29 Thread Russell King
Prepare the processor bug infrastructure so that it can be expanded to check for per-processor bugs. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/bugs.h | 4 ++-- arch/arm/kernel/Makefile| 1

[PATCH v4 01/15] ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs

2018-05-29 Thread Russell King
Add CPU part numbers for Cortex A53, A57, A72, A73, A75 and the Broadcom Brahma B15 CPU. Signed-off-by: Russell King Acked-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren --- arch/arm/include/asm/cputype.h | 8 1 file changed, 8 insertions(+) diff

[PATCH v4 00/15] ARM Spectre variant 2 fixes

2018-05-29 Thread Russell King - ARM Linux
insertions(+), 50 deletions(-) create mode 100644 arch/arm/kernel/bugs.c create mode 100644 arch/arm/mm/proc-v7-bugs.c On Fri, May 25, 2018 at 02:59:39PM +0100, Russell King - ARM Linux wrote: > Third version: > - Remove "PSCI" from the SMC version of the workaround as well. >

Re: [PATCH v3 08/15] ARM: spectre-v2: harden user aborts in kernel space

2018-05-25 Thread Russell King - ARM Linux
On Fri, May 25, 2018 at 08:47:42AM -0700, Tony Lindgren wrote: > * Russell King <rmk+ker...@armlinux.org.uk> [180525 15:10]: > > +static void cpu_v7_spectre_init(void) > > +{ > > + const char *spectre_v2_method = NULL; > > + int cpu = smp_processo

[PATCH v3 15/15] ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1

2018-05-25 Thread Russell King
Report support for SMCCC_ARCH_WORKAROUND_1 to KVM guests for affected CPUs. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/include/asm/kvm_host.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/kvm_host.h b/ar

[PATCH v3 14/15] ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling

2018-05-25 Thread Russell King
We want SMCCC_ARCH_WORKAROUND_1 to be fast. As fast as possible. So let's intercept it as early as we can by testing for the function call number as soon as we've identified a HVC call coming from the guest. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/kvm/h

[PATCH v3 13/15] ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15

2018-05-25 Thread Russell King
Include Brahma B15 in the Spectre v2 KVM workarounds. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> Acked-by: Florian Fainelli <f.faine...@gmail.com> --- arch/arm/include/asm/kvm_mmu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/include/asm/kvm_mmu.

[PATCH v3 11/15] ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17

2018-05-25 Thread Russell King
e only two ARM cores on which this useful. Signed-off-by: Marc Zyngier <marc.zyng...@arm.com> Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/include/asm/kvm_asm.h | 2 -- arch/arm/include/asm/kvm_mmu.h | 17 +- arch/arm/kvm/hyp/

[PATCH v3 10/15] ARM: spectre-v2: warn about incorrect context switching functions

2018-05-25 Thread Russell King
Warn at error level if the context switching function is not what we are expecting. This can happen with big.Little systems, which we currently do not support. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/mm/proc-v7-bugs.c | 15 +++ 1 file chang

[PATCH v3 08/15] ARM: spectre-v2: harden user aborts in kernel space

2018-05-25 Thread Russell King
icache. If the IBE bit is not set, then there is little point to enabling the workaround. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/include/asm/cp15.h| 3 ++ arch/arm/include/asm/system_misc.h | 15 arch/arm/mm/fault.c| 3 ++ arch/

[PATCH v3 12/15] ARM: KVM: invalidate icache on guest exit for Cortex-A15

2018-05-25 Thread Russell King
vector decoding. Signed-off-by: Marc Zyngier <marc.zyng...@arm.com> Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/include/asm/kvm_mmu.h | 5 + arch/arm/kvm/hyp/hyp-entry.S | 24 2 files changed, 29 insertions(+) diff --git a/ar

[PATCH v3 09/15] ARM: spectre-v2: add firmware based hardening

2018-05-25 Thread Russell King
Add firmware based hardening for cores that require more complex handling in firmware. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/mm/proc-v7-bugs.c | 64 +- arch/arm/mm/proc-v7.S | 21 +++ 2 files chang

[PATCH v3 07/15] ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit

2018-05-25 Thread Russell King
. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- arch/arm/mm/Makefile | 2 +- arch/arm/mm/proc-v7-bugs.c | 29 + arch/arm/mm/proc-v7.S | 4 ++-- 3 files changed, 32 insertions(+),

[PATCH v3 06/15] ARM: spectre-v2: harden branch predictor on context switches

2018-05-25 Thread Russell King
R7 and Cortex R8 are also not addressed as we do not enforce memory protection on these cores. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- arch/arm/mm/Kconfig | 19 +++ arch/arm/mm/proc-v7-2level.S | 6 --- arch/arm/mm/proc-v7.S

[PATCH v3 05/15] ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre

2018-05-25 Thread Russell King
Add a Kconfig symbol for CPUs which are vulnerable to the Spectre attacks. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- arch/arm/mm/Kconfig | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mm/Kconfi

[PATCH v3 03/15] ARM: bugs: hook processor bug checking into SMP and suspend paths

2018-05-25 Thread Russell King
Check for CPU bugs when secondary processors are being brought online, and also when CPUs are resuming from a low power mode. This gives an opportunity to check that processor specific bug workarounds are correctly enabled for all paths that a CPU re-enters the kernel. Signed-off-by: Russell

[PATCH v3 02/15] ARM: bugs: prepare processor bug infrastructure

2018-05-25 Thread Russell King
Prepare the processor bug infrastructure so that it can be expanded to check for per-processor bugs. Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> Reviewed-by: Florian Fainelli <f.faine...@gmail.com> --- arch/arm/include/asm/bugs.h | 4 ++-- arch/arm/kernel/Makefile| 1

[PATCH v3 00/15] ARM Spectre variant 2 fixes

2018-05-25 Thread Russell King - ARM Linux
arm/kernel/bugs.c create mode 100644 arch/arm/mm/proc-v7-bugs.c On Mon, May 21, 2018 at 12:42:38PM +0100, Russell King - ARM Linux wrote: > This is the second posting - the original cover note is below. Comments > from previous series addresesd: > - Drop R7 and R8 changes. >

Re: [PATCH 03/14] ARM: bugs: hook processor bug checking into SMP and suspend paths

2018-05-25 Thread Russell King - ARM Linux
On Fri, May 25, 2018 at 11:03:59AM +0100, Russell King - ARM Linux wrote: > On Thu, May 24, 2018 at 04:30:40PM -0700, Florian Fainelli wrote: > > On 05/21/2018 04:44 AM, Russell King wrote: > > > Check for CPU bugs when secondary processors are being brought online, > &

Re: [PATCH v2 00/14] ARM Spectre variant 2 fixes

2018-05-25 Thread Russell King - ARM Linux
On Thu, May 24, 2018 at 04:18:30PM -0700, Florian Fainelli wrote: > On 05/21/2018 04:42 AM, Russell King - ARM Linux wrote: > > This is the second posting - the original cover note is below. Comments > > from previous series addresesd: > > - Drop R7 and R8 changes. >

Re: [PATCH 09/14] ARM: spectre-v2: add PSCI based hardening

2018-05-24 Thread Russell King - ARM Linux
On Thu, May 24, 2018 at 01:49:51PM +0100, Marc Zyngier wrote: > On 24/05/18 13:30, Russell King - ARM Linux wrote: > > On Thu, May 24, 2018 at 01:03:50PM +0100, Marc Zyngier wrote: > >> On 23/05/18 20:45, Russell King - ARM Linux wrote: > >>> On Tue, May 22, 2018 at

Re: [PATCH 09/14] ARM: spectre-v2: add PSCI based hardening

2018-05-24 Thread Russell King - ARM Linux
On Thu, May 24, 2018 at 01:03:50PM +0100, Marc Zyngier wrote: > On 23/05/18 20:45, Russell King - ARM Linux wrote: > > On Tue, May 22, 2018 at 06:24:13PM +0100, Marc Zyngier wrote: > >> On 21/05/18 12:45, Russell King wrote: > >>> +#ifdef CONFIG_ARM_PSCI >

Re: [PATCH 09/14] ARM: spectre-v2: add PSCI based hardening

2018-05-23 Thread Russell King - ARM Linux
On Tue, May 22, 2018 at 06:24:13PM +0100, Marc Zyngier wrote: > On 21/05/18 12:45, Russell King wrote: > > +#ifdef CONFIG_ARM_PSCI > > + if (psci_ops.smccc_version != SMCCC_VERSION_1_0) { > > + struct arm_smccc_res res; > > + > > +

Re: [PATCH 08/14] ARM: spectre-v2: harden user aborts in kernel space

2018-05-22 Thread Russell King - ARM Linux
On Tue, May 22, 2018 at 06:15:02PM +0100, Marc Zyngier wrote: > On 21/05/18 12:45, Russell King wrote: > > + switch (read_cpuid_part()) { > > + case ARM_CPU_PART_CORTEX_A8: > > + case ARM_CPU_PART_CORTEX_A9: > > + case ARM_CPU_PART_CORTEX_A12: > >

Re: [PATCH 08/14] ARM: spectre-v2: harden user aborts in kernel space

2018-05-22 Thread Russell King - ARM Linux
On Tue, May 22, 2018 at 06:56:03PM +0100, Russell King - ARM Linux wrote: > On Tue, May 22, 2018 at 06:15:02PM +0100, Marc Zyngier wrote: > > On 21/05/18 12:45, Russell King wrote: > > > In order to prevent aliasing attacks on the branch predictor, > > > invalidate t

Re: [PATCH 09/14] ARM: spectre-v2: add PSCI based hardening

2018-05-22 Thread Russell King - ARM Linux
On Tue, May 22, 2018 at 06:24:13PM +0100, Marc Zyngier wrote: > On 21/05/18 12:45, Russell King wrote: > > Add PSCI based hardening for cores that require more complex handling in > > firmware. > > > > Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> >

Re: [PATCH 08/14] ARM: spectre-v2: harden user aborts in kernel space

2018-05-22 Thread Russell King - ARM Linux
On Tue, May 22, 2018 at 06:15:02PM +0100, Marc Zyngier wrote: > On 21/05/18 12:45, Russell King wrote: > > In order to prevent aliasing attacks on the branch predictor, > > invalidate the BTB or instruction cache on CPUs that are known to be > > affected when taking

  1   2   >