Re: [PATCH v5 18/21] arm64: Move "nokaslr" over to the early cpufeature infrastructure

2021-01-25 Thread Ard Biesheuvel
On Mon, 25 Jan 2021 at 15:28, Marc Zyngier wrote: > > On 2021-01-25 14:19, Ard Biesheuvel wrote: > > On Mon, 25 Jan 2021 at 14:54, Marc Zyngier wrote: > >> > >> On 2021-01-25 12:54, Ard Biesheuvel wrote: > > [...] > > >> > This struct

Re: [PATCH v5 18/21] arm64: Move "nokaslr" over to the early cpufeature infrastructure

2021-01-25 Thread Ard Biesheuvel
On Mon, 25 Jan 2021 at 14:54, Marc Zyngier wrote: > > On 2021-01-25 12:54, Ard Biesheuvel wrote: > > On Mon, 25 Jan 2021 at 11:53, Marc Zyngier wrote: > >> > >> Given that the early cpufeature infrastructure has borrowed quite > >> a lot of code from the

Re: [PATCH v5 18/21] arm64: Move "nokaslr" over to the early cpufeature infrastructure

2021-01-25 Thread Ard Biesheuvel
On Mon, 25 Jan 2021 at 11:53, Marc Zyngier wrote: > > Given that the early cpufeature infrastructure has borrowed quite > a lot of code from the kaslr implementation, let's reimplement > the matching of the "nokaslr" option with it. > > Signed-off-by: Marc Zyngier > Acked-by: Catalin Marinas >

Re: [PATCH v2 2/2] KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibility

2021-01-15 Thread Ard Biesheuvel
On Fri, 15 Jan 2021 at 15:03, Marc Zyngier wrote: > > It looks like we have broken firmware out there that wrongly advertises > a GICv2 compatibility interface, despite the CPUs not being able to deal > with it. > > To work around this, check that the CPU initialising KVM is actually able > to

Re: [PATCH v4 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-12 Thread Ard Biesheuvel
On Wed, 12 May 2021 at 09:34, Mike Rapoport wrote: > > On Wed, May 12, 2021 at 09:00:02AM +0200, Ard Biesheuvel wrote: > > On Tue, 11 May 2021 at 12:05, Mike Rapoport wrote: > > > > > > From: Mike Rapoport > > > > > > Hi, > > &g

Re: [PATCH v4 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-12 Thread Ard Biesheuvel
On Tue, 11 May 2021 at 12:05, Mike Rapoport wrote: > > From: Mike Rapoport > > Hi, > > These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire > pfn_valid_within() to 1. > > The idea is to mark NOMAP pages as reserved in the memory map and restore > the intended semantics of

Re: [PATCH v4 2/4] memblock: update initialization of reserved pages

2021-05-11 Thread Ard Biesheuvel
; Split out initialization of the reserved pages to a function with a > meaningful name and treat the MEMBLOCK_NOMAP regions the same way as the > reserved regions and mark struct pages for the NOMAP regions as > PageReserved. > > Signed-off-by: Mike Rapoport > Reviewed-by: David H

Re: [PATCH v4 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-05-11 Thread Ard Biesheuvel
; > While here also update style of pfn_valid() so that both pfn_valid() and > pfn_is_map_memory() declarations will be consistent. > > Signed-off-by: Mike Rapoport > Acked-by: David Hildenbrand Acked-by: Ard Biesheuvel > --- > arch/arm64/include/asm/memory.h | 2 +- &

Re: [PATCH v4 1/4] include/linux/mmzone.h: add documentation for pfn_valid()

2021-05-11 Thread Ard Biesheuvel
human Khandual > Signed-off-by: Mike Rapoport > Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel > --- > include/linux/mmzone.h | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c3

Re: [PATCH v4 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-11 Thread Ard Biesheuvel
fn_valid() can be slightly simplified by replacing > memblock_is_map_memory() with memblock_is_memory(). > > Signed-off-by: Mike Rapoport > Acked-by: David Hildenbrand Acked-by: Ard Biesheuvel ... and many thanks for cleaning this up. > --- > arch/arm64/Kconfig | 3 --- > arch/arm64

Re: [PATCH v7 00/23] arm64: Early CPU feature override, and applications to VHE, BTI and PAuth

2021-02-08 Thread Ard Biesheuvel
On Mon, 8 Feb 2021 at 15:32, Will Deacon wrote: > > Hi Marc, > > On Mon, Feb 08, 2021 at 09:57:09AM +, Marc Zyngier wrote: > > It recently came to light that there is a need to be able to override > > some CPU features very early on, before the kernel is fully up and > > running. The reasons

Re: [PATCH v6 0/5] ARM: arm64: Add SMCCC TRNG entropy service

2021-01-20 Thread Ard Biesheuvel
On Wed, 20 Jan 2021 at 14:01, Will Deacon wrote: > > On Wed, 6 Jan 2021 10:34:48 +, Andre Przywara wrote: > > a fix to v5, now *really* fixing the wrong priority of SMCCC vs. RNDR > > in arch_get_random_seed_long_early(). Apologies for messing this up > > in v5 and thanks to broonie for being

[PATCH] arm64: kvm: handle 52-bit VA regions correctly under nVHE

2021-03-30 Thread Ard Biesheuvel
m64: mm: extend linear region for 52-bit VA configurations") Signed-off-by: Ard Biesheuvel --- Documentation/arm64/booting.rst | 6 +++--- arch/arm64/kvm/va_layout.c | 18 ++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Documentation/arm64/booting.rst b

Re: [PATCH] arm64: kvm: handle 52-bit VA regions correctly under nVHE

2021-03-30 Thread Ard Biesheuvel
On Tue, 30 Mar 2021 at 15:04, Marc Zyngier wrote: > > On Tue, 30 Mar 2021 13:49:18 +0100, > Ard Biesheuvel wrote: > > > > On Tue, 30 Mar 2021 at 14:44, Marc Zyngier wrote: > > > > > > On Tue, 30 Mar 2021 12:21:26 +0100, > > > Ard Biesheuvel

Re: [PATCH] arm64: kvm: handle 52-bit VA regions correctly under nVHE

2021-03-30 Thread Ard Biesheuvel
On Tue, 30 Mar 2021 at 14:44, Marc Zyngier wrote: > > On Tue, 30 Mar 2021 12:21:26 +0100, > Ard Biesheuvel wrote: > > > > Commit f4693c2716b35d08 ("arm64: mm: extend linear region for 52-bit VA > > configurations") introduced a new layout for the 52-b

Re: [PATCH] arm64: kvm: handle 52-bit VA regions correctly under nVHE

2021-03-30 Thread Ard Biesheuvel
On Tue, 30 Mar 2021 at 15:56, Marc Zyngier wrote: > > On Tue, 30 Mar 2021 14:15:19 +0100, > Ard Biesheuvel wrote: > > > > On Tue, 30 Mar 2021 at 15:04, Marc Zyngier wrote: > > > > > > On Tue, 30 Mar 2021 13:49:18 +0100, > > > Ard Biesheuvel wro

Re: [PATCH v6 3/5] ARM: implement support for SMCCC TRNG entropy source

2021-03-15 Thread Ard Biesheuvel
On Wed, 6 Jan 2021 at 11:35, Andre Przywara wrote: > > From: Ard Biesheuvel > > Implement arch_get_random_seed_*() for ARM based on the firmware > or hypervisor provided entropy source described in ARM DEN0098. > > This will make the kernel's random number generator consu

Re: [PATCH] KVM: arm64: Disable LTO in hyp

2021-03-05 Thread Ard Biesheuvel
On Fri, 5 Mar 2021 at 12:38, Marc Zyngier wrote: > > On Fri, 05 Mar 2021 02:38:17 +, > Sami Tolvanen wrote: > > > > On Thu, Mar 4, 2021 at 2:34 PM Sami Tolvanen > > wrote: > > > > > > On Thu, Mar 4, 2021 at 2:17 PM Marc Zyngier wrote: > > > > > > > > On Thu, 04 Mar 2021 21:25:41 +, >

Re: [RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-14 Thread Ard Biesheuvel
On Wed, 14 Apr 2021 at 17:14, David Hildenbrand wrote: > > On 07.04.21 19:26, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The struct pages representing a reserved memory region are initialized > > using reserve_bootmem_range() function. This function is called for each > > reserved

Re: [PATCH] Documentation, dt, numa: Add note to empty NUMA node

2021-09-22 Thread Ard Biesheuvel
On Tue, 21 Sept 2021 at 21:45, Rob Herring wrote: > > On Sun, Sep 5, 2021 at 11:16 PM Gavin Shan wrote: > > > > The empty memory nodes, where no memory resides in, are allowed. > > For these empty memory nodes, the 'len' of 'reg' property is zero. > > The NUMA node IDs are still valid and

Re: [kbuild-all] Re: [PATCH v2 6/9] KVM: arm64: Detect and handle hypervisor stack overflows

2022-02-25 Thread Ard Biesheuvel
On Fri, 25 Feb 2022 at 03:12, Chen, Rong A wrote: > > > > Hi Marc, Ard, > > We have ignored the warning related to asmlinkage according to the below > advice: > > https://lore.kernel.org/lkml/CAMj1kXHrRYagSVniSetHdG15rkQS+fm4zVOtN=zda3w0qae...@mail.gmail.com/ > Excellent! Thanks for

Re: [kbuild-all] Re: [PATCH v2 6/9] KVM: arm64: Detect and handle hypervisor stack overflows

2022-02-23 Thread Ard Biesheuvel
On Wed, 23 Feb 2022 at 13:54, Marc Zyngier wrote: > > On 2022-02-23 12:34, Philip Li wrote: > > On Wed, Feb 23, 2022 at 09:16:59AM +, Marc Zyngier wrote: > >> On Wed, 23 Feb 2022 09:05:18 +, > >> kernel test robot wrote: > >> > > >> > Hi Kalesh, > >> > > >> > Thank you for the patch!

Re: [PATCH][kvmtool] virtio/pci: Signal INTx interrupts as level instead of edge

2022-01-31 Thread Ard Biesheuvel
rspace (only > KVM will have a bit more work tracking the EOI), but at least > this is correct. > > Reported-by: Pierre Gondois > Signed-off-by: Marc Zyngier > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Cc: Will Deacon Acked-by: Ard Biesheuvel > --- > pci.c

Re: [PATCH] KVM: arm64: vgic-v3: Restrict SEIS workaround to known broken systems

2022-01-22 Thread Ard Biesheuvel
; an obviously broken way. > > So instead of imposing the M1 workaround on an innocent bystander, > let's limit it to the two known broken Apple implementations. > > Fixes: df652bcf1136 ("KVM: arm64: vgic-v3: Work around GICv3 locally > generated SErrors") > Reported-by

[RFC PATCH 04/12] arm64: mm: remap PGD pages r/o in the linear region after allocation

2022-01-26 Thread Ard Biesheuvel
As the first step in restricting write access to all page tables via the linear mapping, remap the page at the root PGD level of a user space page table hierarchy read-only after allocation, so that it can only be manipulated using the dedicated fixmap based API. Signed-off-by: Ard Biesheuvel

[RFC PATCH 03/12] arm64: mm: use a fixmap slot for user page table modifications

2022-01-26 Thread Ard Biesheuvel
their kernel mapping in .bss, so there is no special exception required to avoid circular logic here. Signed-off-by: Ard Biesheuvel --- arch/arm64/Kconfig | 11 +++ arch/arm64/include/asm/fixmap.h | 1 + arch/arm64/include/asm/pgalloc.h | 28 +- arch/arm64/include/asm

[RFC PATCH 05/12] arm64: mm: remap PUD pages r/o in linear region

2022-01-26 Thread Ard Biesheuvel
Implement the arch specific PUD alloc/free helpers by wrapping the generic code, and remapping the page read-only on allocation and read-write on free. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/pgalloc.h | 5 + arch/arm64/include/asm/tlb.h | 2 ++ arch/arm64/mm/mmu.c

[RFC PATCH 00/12] arm64: implement read-only page tables

2022-01-26 Thread Ard Biesheuvel
changes will be posted as a followup series. Cc: Will Deacon Cc: Marc Zyngier Cc: Fuad Tabba Cc: Quentin Perret Cc: Mark Rutland Cc: James Morse Cc: Catalin Marinas Ard Biesheuvel (12): asm-generic/pgalloc: allow arch to override PMD alloc/free routines arm64: mm: add helpers to remap page

[RFC PATCH 01/12] asm-generic/pgalloc: allow arch to override PMD alloc/free routines

2022-01-26 Thread Ard Biesheuvel
Extend the existing CPP macro based hooks that allow architectures to specialize the code that allocates and frees pages to be used as page tables. Signed-off-by: Ard Biesheuvel --- include/asm-generic/pgalloc.h | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git

[RFC PATCH 02/12] arm64: mm: add helpers to remap page tables read-only/read-write

2022-01-26 Thread Ard Biesheuvel
-by: Ard Biesheuvel --- arch/arm64/include/asm/pgtable.h | 3 +++ arch/arm64/mm/pageattr.c | 14 ++ 2 files changed, 17 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index c4ba047a82d2..8d3806c68687 100644 --- a/arch/arm64/include

[RFC PATCH 11/12] arm64: efi: use set_pte_at() not set_pte() in order to pass mm pointer

2022-01-26 Thread Ard Biesheuvel
The set_pte() helper does not carry the struct mm pointer, which makes it difficult for the implementation to reason about the context in which the set_pte() call is taking place. So switch to set_pte_at() instead. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 2 +- 1 file changed

[RFC PATCH 10/12] mm: add default definition of p4d_index()

2022-01-26 Thread Ard Biesheuvel
Implement a default version of p4d_index() similar to how pud/pmd_index are defined. Signed-off-by: Ard Biesheuvel --- include/linux/pgtable.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index bc8713a76e03..e8aacf6ea207 100644

[RFC PATCH 06/12] arm64: mm: remap PMD pages r/o in linear region

2022-01-26 Thread Ard Biesheuvel
PMD modifications all go through the fixmap update routine, so there is no longer a need to keep it mapped read/write in the linear region. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/pgalloc.h | 5 + arch/arm64/include/asm/tlb.h | 2 ++ arch/arm64/mm/mmu.c

[RFC PATCH 07/12] arm64: mm: remap PTE level user page tables r/o in the linear region

2022-01-26 Thread Ard Biesheuvel
Now that all PTE manipulations for user space tables go via the fixmap, we can remap these tables read-only in the linear region so they cannot be corrupted inadvertently. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/pgalloc.h | 5 + arch/arm64/include/asm/tlb.h | 2

[RFC PATCH 08/12] arm64: mm: remap kernel PTE level page tables r/o in the linear region

2022-01-26 Thread Ard Biesheuvel
Now that all kernel page table manipulations are routed through the fixmap API if r/o page tables are enabled, we can remove write access from the linear mapping of those pages. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/pgalloc.h | 6 + arch/arm64/mm/mmu.c | 24

[RFC PATCH 09/12] arm64: mm: remap kernel page tables read-only at end of init

2022-01-26 Thread Ard Biesheuvel
Now that all the handling is in place to deal with read-only page tables at runtime, do a pass over the kernel page tables at boot to remap all the page table pages read-only that were allocated early. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/mmu.c | 20 1 file

[RFC PATCH 12/12] arm64: hugetlb: use set_pte_at() not set_pte() to provide mm pointer

2022-01-26 Thread Ard Biesheuvel
Switch to set_pte_at() so we can provide the mm pointer to the code that performs the page table update. Signed-off-by: Ard Biesheuvel --- arch/arm64/mm/hugetlbpage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm

[PATCH] arm64: kvm: avoid unnecessary absolute addressing via literals

2022-04-28 Thread Ard Biesheuvel
references, but this is no longer the case, so we can simply use relative addressing instead. This removes a couple of RELA entries pointing into the .text segment. Signed-off-by: Ard Biesheuvel --- arch/arm64/kvm/hyp/nvhe/host.S | 8 +++- 1 file changed, 3 insertions(+), 5 deletions

Re: [PATCH 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2022-12-22 Thread Ard Biesheuvel
nd-up > with two back-to-back faults (page being evicted and faulted back). > I don't think this is a case worth optimising for. > > Fixes: c4ad98e4b72c ("KVM: arm64: Assume write fault on S1PTW permission > fault on instruction fetch") > Signed-off-by: Marc Zyngier &

Re: [PATCH 1/3] KVM: arm64: Fix S1PTW handling on RO memslots

2022-12-24 Thread Ard Biesheuvel
On Sat, 24 Dec 2022 at 13:19, Marc Zyngier wrote: > > On Thu, 22 Dec 2022 13:01:55 +0000, > Ard Biesheuvel wrote: > > > > On Tue, 20 Dec 2022 at 21:09, Marc Zyngier wrote: > > > > > > A recent development on the EFI front has resulted in gues

<    1   2   3