Re: [PATCH 0/2] Fix CMDLINE_EXTEND handling for FDT "bootargs"

2021-03-01 Thread Will Deacon
On Mon, Mar 01, 2021 at 08:19:32AM -0600, Rob Herring wrote: > On Thu, Feb 25, 2021 at 6:59 AM Will Deacon wrote: > > We recently [1] enabled support for CMDLINE_EXTEND on arm64, however > > when I started looking at replacing Android's out-of-tree implementation [2] > &

[GIT PULL] arm64: Fixes for -rc1

2021-02-26 Thread Will Deacon
d() to public interface Shaoying Xu (1): arm64 module: set plt* section addresses to 0x0 Timothy E Baldwin (1): arm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL) Will Deacon (1): arm64: spectre: Prevent lockdep splat on v4 mitigation enable path Zhiyuan Dai (1): arm6

Re: [PATCH] recordmcount: Fix the wrong use of w* in arm64_is_fake_mcount()

2021-02-25 Thread Will Deacon
x b9c2ee7ab43f..cce12e1971d8 100644 > > --- a/scripts/recordmcount.c > > +++ b/scripts/recordmcount.c > > @@ -438,7 +438,7 @@ static int arm_is_fake_mcount(Elf32_Rel const *rp) > > > > static int arm64_is_fake_mcount(Elf64_Rel const *rp) > > { > > - return ELF64_R_TYPE(w(rp->r_info)) != R_AARCH64_CALL26; > > + return ELF64_R_TYPE(w8(rp->r_info)) != R_AARCH64_CALL26; Acked-by: Will Deacon But you know you could avoid these sorts of problems by moving to little endian along with everybody else? ;) Will

Re: [PATCH 1/2] arm64: cpufeatures: Fix handling of CONFIG_CMDLINE for idreg overrides

2021-02-25 Thread Will Deacon
On Thu, Feb 25, 2021 at 01:53:56PM +, Marc Zyngier wrote: > On Thu, 25 Feb 2021 12:59:20 +, > Will Deacon wrote: > > > > The built-in kernel commandline (CONFIG_CMDLINE) can be configured in > > three different ways: > > > > 1. CMDLINE_FORC

Re: [RESEND PATCH 1/2] ARM64: enable GENERIC_FIND_FIRST_BIT

2021-02-25 Thread Will Deacon
OBE > select GENERIC_CPU_VULNERABILITIES > select GENERIC_EARLY_IOREMAP > + select GENERIC_FIND_FIRST_BIT > select GENERIC_IDLE_POLL_SETUP > select GENERIC_IRQ_IPI > select GENERIC_IRQ_MULTI_HANDLER Acked-by: Will Deacon Catalin can pick this up later in the cycle. Will

[PATCH 0/2] Fix CMDLINE_EXTEND handling for FDT "bootargs"

2021-02-25 Thread Will Deacon
urce.com/c/kernel/common/+/841045 --->8 Cc: Max Uvarov Cc: Rob Herring Cc: Ard Biesheuvel Cc: Marc Zyngier Cc: Doug Anderson Cc: Tyler Hicks Cc: Frank Rowand Cc: Arnd Bergmann Cc: Palmer Dabbelt Cc: Greg Kroah-Hartman Cc: Catalin Marinas Cc: Cc: Cc: Will Deacon (2): arm64: cpu

[PATCH 1/2] arm64: cpufeatures: Fix handling of CONFIG_CMDLINE for idreg overrides

2021-02-25 Thread Will Deacon
ction and following the same logic as that used by the EFI stub. Cc: Marc Zyngier Fixes: 33200303553d ("arm64: cpufeature: Add an early command-line cpufeature override facility") Signed-off-by: Will Deacon --- arch/arm64/kernel/idreg-override.c | 44 +- 1 f

[PATCH 2/2] of/fdt: Append bootloader arguments when CMDLINE_EXTEND=y

2021-02-25 Thread Will Deacon
cmdline buffer rather than concatenating it onto the end. Cc: Max Uvarov Cc: Rob Herring Cc: Ard Biesheuvel Cc: Marc Zyngier Cc: Doug Anderson Cc: Tyler Hicks Cc: Frank Rowand Fixes: 34b82026a507 ("fdt: fix extend of cmd line") Signed-off-by: Will Deacon --- drivers/of/

Re: [PATCH] arm64: enable GENERIC_FIND_FIRST_BIT

2021-02-24 Thread Will Deacon
On Tue, Feb 23, 2021 at 09:27:44PM -0800, Yury Norov wrote: > On Tue, Dec 08, 2020 at 10:35:50AM +0000, Will Deacon wrote: > > On Mon, Dec 07, 2020 at 05:59:16PM -0800, Yury Norov wrote: > > > (CC: Alexey Klimov) > > > > > > On Mon, Dec 7, 2020 at 3:25 AM Wi

Re: [PATCH] arm64/mm: Fixed some coding style issues

2021-02-23 Thread Will Deacon
On Mon, 22 Feb 2021 09:43:51 +0800, Zhiyuan Dai wrote: > This patch move the pointer location to fix coding style issues, > improve code reading. Applied to arm64 (for-next/fixes), thanks! [1/1] arm64/mm: Fixed some coding style issues https://git.kernel.org/arm64/c/2e8acca1911b Cheers, --

Re: [PATCH 1/2] arm64: uprobe: Return EOPNOTSUPP for AARCH32 instruction probing

2021-02-23 Thread Will Deacon
On Tue, 23 Feb 2021 16:25:34 +0800, He Zhe wrote: > As stated in linux/errno.h, ENOTSUPP should never be seen by user programs. > When we set up uprobe with 32-bit perf and arm64 kernel, we would see the > following vague error without useful hint. > > The sys_perf_event_open() syscall returned wi

Re: [PATCH v13 4/7] arm64: mte: Enable TCO in functions that can read beyond buffer limits

2021-02-23 Thread Will Deacon
On Tue, Feb 23, 2021 at 12:05:32PM +, Catalin Marinas wrote: > On Tue, Feb 23, 2021 at 10:56:46AM +, Vincenzo Frascino wrote: > > On 2/22/21 5:58 PM, Catalin Marinas wrote: > > > We'll still have an issue with dynamically switching the async/sync mode > > > at run-time. Luckily kasan doesn'

Re: [PATCH v4] ARM: Implement SLS mitigation

2021-02-23 Thread Will Deacon
On Mon, Feb 22, 2021 at 01:50:06PM -0800, Jian Cai wrote: > Please see my comments inlined below. > > Thanks, > Jian > > On Mon, Feb 22, 2021 at 3:58 AM Will Deacon wrote: > > > > On Fri, Feb 19, 2021 at 03:08:13PM -0800, Jian Cai wrote: > > > This patch

Re: [PATCH v2] kexec: move machine_kexec_post_load() to public interface

2021-02-23 Thread Will Deacon
On Mon, Feb 22, 2021 at 11:16:38PM -0600, Eric W. Biederman wrote: > Will Deacon writes: > > > On Fri, 19 Feb 2021 14:51:42 -0500, Pavel Tatashin wrote: > >> machine_kexec_post_load() is called after kexec load is finished. It must > >> declared in public

Re: [PATCH v2] kexec: move machine_kexec_post_load() to public interface

2021-02-22 Thread Will Deacon
On Fri, 19 Feb 2021 14:51:42 -0500, Pavel Tatashin wrote: > machine_kexec_post_load() is called after kexec load is finished. It must > declared in public header not in kexec_internal.h > > Fixes the following compiler warning: > > arch/arm64/kernel/machine_kexec.c:62:5: warning: no previous prot

Re: [PATCH v3 1/1] arm64: mm: correct the inside linear map range during hotplug check

2021-02-22 Thread Will Deacon
On Fri, Feb 19, 2021 at 02:44:49PM -0500, Pavel Tatashin wrote: > On Fri, Feb 19, 2021 at 2:18 PM Will Deacon wrote: > > > > On Tue, Feb 16, 2021 at 10:03:51AM -0500, Pavel Tatashin wrote: > > > Memory hotplug may fail on systems with CONFIG_RANDOMIZE_BASE because the &

Re: [PATCH v4] ARM: Implement SLS mitigation

2021-02-22 Thread Will Deacon
> Suggested-by: Nathan Chancellor > Suggested-by: David Laight > Suggested-by: Will Deacon > Reviewed-by: Nathan Chancellor > Signed-off-by: Jian Cai > --- Please can you reply to my previous questions? https://lore.kernel.org/linux-arm-kernel/20210217094859.GA3706@willi

Re: [PATCH v3 1/1] arm64: mm: correct the inside linear map range during hotplug check

2021-02-19 Thread Will Deacon
On Tue, Feb 16, 2021 at 10:03:51AM -0500, Pavel Tatashin wrote: > Memory hotplug may fail on systems with CONFIG_RANDOMIZE_BASE because the > linear map range is not checked correctly. > > The start physical address that linear map covers can be actually at the > end of the range because of random

Re: [PATCH] arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails

2021-02-19 Thread Will Deacon
On Thu, 18 Feb 2021 20:59:00 +0800, qiuguorui1 wrote: > in function create_dtb(), if fdt_open_into() fails, we need to vfree > buf before return. Applied to arm64 (for-next/fixes), thanks! [1/1] arm64: kexec_file: fix memory leakage in create_dtb() when fdt_open_into() fails https://git.ke

Re: [PATCH] arm64 module: set plt* section addresses to 0x0

2021-02-19 Thread Will Deacon
On Tue, 16 Feb 2021 18:32:34 +, Shaoying Xu wrote: > These plt* and .text.ftrace_trampoline sections specified for arm64 have > non-zero addressses. Non-zero section addresses in a relocatable ELF would > confuse GDB when it tries to compute the section offsets and it ends up > printing wrong s

Re: [PATCH 1/1] kexec: move machine_kexec_post_load() to public interface

2021-02-19 Thread Will Deacon
On Fri, Feb 19, 2021 at 02:06:31PM -0500, Pavel Tatashin wrote: > On Fri, Feb 19, 2021 at 12:53 PM Will Deacon wrote: > > > > On Mon, Feb 15, 2021 at 01:59:08PM -0500, Pavel Tatashin wrote: > > > machine_kexec_post_load() is called after kexec load is finished. It must >

Re: [PATCH 1/1] kexec: move machine_kexec_post_load() to public interface

2021-02-19 Thread Will Deacon
On Mon, Feb 15, 2021 at 01:59:08PM -0500, Pavel Tatashin wrote: > machine_kexec_post_load() is called after kexec load is finished. It must > be declared in public header not in kexec_internal.h Could you provide a log of what goes wrong without this patch, please? > Reported-by: kernel test robo

Re: [PATCH] arm64: Add part number for Arm Cortex-A78

2021-02-19 Thread Will Deacon
On Wed, Feb 17, 2021 at 11:37:04PM +0530, Neeraj Upadhyay wrote: > > > On 2/17/2021 10:36 PM, Will Deacon wrote: > > On Wed, Feb 17, 2021 at 10:14:11PM +0530, Neeraj Upadhyay wrote: > > > Add the MIDR part number info for the Arm Cortex-A78. > > > >

Re: [PATCH] iommu/amd: Fix sleeping in atomic in increase_address_space()

2021-02-17 Thread Will Deacon
rame+0x44/0xa9 > > Fix this by moving get_zeroed_page() out of spin_lock/unlock section. > > Fixes: 754265bcab ("iommu/amd: Fix race in increase_address_space()") > Signed-off-by: Andrey Ryabinin > Cc: > --- > drivers/iommu/amd/iommu.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH] arm64: Add part number for Arm Cortex-A78

2021-02-17 Thread Will Deacon
On Wed, Feb 17, 2021 at 10:14:11PM +0530, Neeraj Upadhyay wrote: > Add the MIDR part number info for the Arm Cortex-A78. > > Signed-off-by: Neeraj Upadhyay > --- > arch/arm64/include/asm/cputype.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/include/asm/cputype.h > b/a

Re: [PATCH v2] ARM: Implement Clang's SLS mitigation

2021-02-17 Thread Will Deacon
On Fri, Feb 12, 2021 at 11:52:53AM -0800, Jian Cai wrote: > This patch adds CONFIG_HARDEN_SLS_ALL that can be used to turn on > -mharden-sls=all, which mitigates the straight-line speculation > vulnerability, speculative execution of the instruction following some > unconditional jumps. Notice -mha

Re: [PATCH] RTIC: selinux: ARM64: Move selinux_state to a separate page

2021-02-17 Thread Will Deacon
[Please include arm64 and kvm folks for threads involving the stage-2 MMU] On Tue, Feb 16, 2021 at 03:47:52PM +0530, Preeti Nagar wrote: > The changes introduce a new security feature, RunTime Integrity Check > (RTIC), designed to protect Linux Kernel at runtime. The motivation > behind these chan

[GIT PULL] arm64 updates for 5.12

2021-02-15 Thread Will Deacon
e_policy check arm64: topology: Reorder init_amu_fie() a bit arm64: topology: Make AMUs work with modular cpufreq drivers Wei Li (1): drivers/perf: Add support for ARMv8.3-SPE Will Deacon (23): mm: Allow architectures to request 'old' entries when prefaulting

Re: [PATCH v5 1/5] uapi: Move the aux vector AT_MINSIGSTKSZ define to uapi

2021-02-12 Thread Will Deacon
On Thu, Feb 04, 2021 at 03:55:30PM +, Dave Martin wrote: > On Wed, Feb 03, 2021 at 09:22:38AM -0800, Chang S. Bae wrote: > > Move the AT_MINSIGSTKSZ definition to generic Linux from arm64. It is > > already used as generic ABI in glibc's generic elf.h, and this move will > > prevent future name

Re: [PATCH] drivers/perf: Replace spin_lock_irqsave to spin_lock

2021-02-12 Thread Will Deacon
On Tue, 9 Feb 2021 17:42:22 +0800, Qi Liu wrote: > There is no need to do spin_lock_irqsave in context of hard IRQ, so > replace them with spin_lock. Applied to will (for-next/perf), thanks! [1/1] drivers/perf: Replace spin_lock_irqsave to spin_lock https://git.kernel.org/will/c/8ee37e0f97e

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-11 Thread Will Deacon
On Thu, Feb 11, 2021 at 05:40:35PM +0530, Anshuman Khandual wrote: > On 2/11/21 5:23 PM, Will Deacon wrote: > > On Fri, Feb 05, 2021 at 06:55:53PM +0000, Will Deacon wrote: > >> On Wed, Feb 03, 2021 at 09:20:39AM +0530, Anshuman Khandual wrote: > >>> On 2/2/21 6:

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-11 Thread Will Deacon
On Fri, Feb 05, 2021 at 06:55:53PM +, Will Deacon wrote: > On Wed, Feb 03, 2021 at 09:20:39AM +0530, Anshuman Khandual wrote: > > On 2/2/21 6:26 PM, David Hildenbrand wrote: > > > On 02.02.21 13:51, Will Deacon wrote: > > >> On Tue, Feb 02, 2021 at 01:39:29PM

Re: [PATCH] arm64: Replace lkml.org links with lore

2021-02-11 Thread Will Deacon
On Wed, Feb 10, 2021 at 03:44:38PM -0800, Kees Cook wrote: > As started by commit 05a5f51ca566 ("Documentation: Replace lkml.org > links with lore"), replace lkml.org links with lore to better use a > single source that's more likely to stay available long-term. > > Signed-off-by: Kees Cook > ---

Re: [PATCH v17 03/10] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-10 Thread Will Deacon
_file.c | 180 ++--- > 1 file changed, 8 insertions(+), 172 deletions(-) I mean, of course I'm going to Ack that! Acked-by: Will Deacon Will

Re: [PATCH v3 1/8] mm: Cleanup faultaround and finish_fault() codepaths

2021-02-10 Thread Will Deacon
On Tue, Feb 09, 2021 at 12:24:49PM -0800, Guenter Roeck wrote: > On Thu, Jan 14, 2021 at 05:59:27PM +0000, Will Deacon wrote: > > From: "Kirill A. Shutemov" > > > > alloc_set_pte() has two users with different requirements: in the > > faultaround code, it

Re: [PATCH v2] arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+

2021-02-09 Thread Will Deacon
On Mon, 8 Feb 2021 17:57:20 -0700, Nathan Chancellor wrote: > Similar to commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN > depends on !LD_IS_LLD"), ld.lld prior to 13.0.0 does not properly > support aarch64 big endian, leading to the following build error when > CONFIG_CPU_BIG_ENDIAN is

Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection

2021-02-09 Thread Will Deacon
On Tue, Feb 09, 2021 at 10:00:29AM +, Quentin Perret wrote: > On Thursday 04 Feb 2021 at 10:47:08 (+), Quentin Perret wrote: > > On Wednesday 03 Feb 2021 at 14:37:10 (+0000), Will Deacon wrote: > > > > +static void handle___pkvm_init(struct kvm_c

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

2021-02-08 Thread Will Deacon
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 for this range from specific feature support > (such as using P

Re: [PATCH v6 12/21] arm64: cpufeature: Add an early command-line cpufeature override facility

2021-02-05 Thread Will Deacon
On Mon, Feb 01, 2021 at 11:56:28AM +, Marc Zyngier wrote: > In order to be able to override CPU features at boot time, > let's add a command line parser that matches options of the > form "cpureg.feature=value", and store the corresponding > value into the override val/mask pair. > > No featur

Re: [PATCH v11 2/5] kasan: Add KASAN mode kernel parameter

2021-02-05 Thread Will Deacon
On Fri, Feb 05, 2021 at 04:00:07PM +, Vincenzo Frascino wrote: > > > On 2/5/21 3:49 PM, Andrey Konovalov wrote: > > On Mon, Feb 1, 2021 at 9:04 PM Andrey Konovalov > > wrote: > >> > >> On Sat, Jan 30, 2021 at 5:52 PM Vincenzo Frascino > >> wrote: > >>> > >>> @@ -45,6 +52,9 @@ static enum k

Re: [PATCH v17 1/7] arm/arm64: Probe for the presence of KVM hypervisor

2021-02-05 Thread Will Deacon
On Fri, Feb 05, 2021 at 04:50:27PM +, Marc Zyngier wrote: > On 2021-02-05 11:19, Will Deacon wrote: > > On Fri, Feb 05, 2021 at 09:11:00AM +, Steven Price wrote: > > > On 02/02/2021 14:11, Marc Zyngier wrote: > > > > + for (i = 0; i < 32; ++i) { &

Re: [PATCH v2 2/4] arm64: kasan: abstract _text and _end to KERNEL_START/END

2021-02-05 Thread Will Deacon
On Fri, Feb 05, 2021 at 12:06:10AM +0800, Lecopzer Chen wrote: > I think it would be better to leave this for you since I'm not > familiar with the relationship > between vmemmap() and NUMA_NO_NODE. > > So I would just keep this patch in next version, is this fine with you? Yes, ok. Will

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-05 Thread Will Deacon
On Wed, Feb 03, 2021 at 09:20:39AM +0530, Anshuman Khandual wrote: > On 2/2/21 6:26 PM, David Hildenbrand wrote: > > On 02.02.21 13:51, Will Deacon wrote: > >> On Tue, Feb 02, 2021 at 01:39:29PM +0100, David Hildenbrand wrote: > >>> As I expressed already, long term w

Re: [PATCH v2 1/4] arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC

2021-02-05 Thread Will Deacon
On Fri, Feb 05, 2021 at 06:30:44PM +0100, Andrey Konovalov wrote: > On Fri, Feb 5, 2021 at 6:19 PM Will Deacon wrote: > > > > On Fri, Feb 05, 2021 at 12:37:21AM +0800, Lecopzer Chen wrote: > > > > > > > On Thu, Feb 04, 2021 at 10:46:12PM +0800, Lecopzer Ch

Re: [PATCH] mm/arm64: Correct obsolete comment in do_page_fault()

2021-02-05 Thread Will Deacon
On Fri, 5 Feb 2021 04:09:19 -0500, Miaohe Lin wrote: > commit d8ed45c5dcd4 ("mmap locking API: use coccinelle to convert mmap_sem > rwsem call sites") has convertd down_read_trylock() to mmap_read_trylock(). > But it forgot to update the relevant comment. Applied to arm64 (for-next/cosmetic), than

Re: [PATCH V2 0/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-05 Thread Will Deacon
On Tue, 2 Feb 2021 09:41:52 +0530, Anshuman Khandual wrote: > This series fixes pfn_valid() for ZONE_DEVICE based memory and also improves > its performance for normal hotplug memory. While here, it also reorganizes > pfn_valid() on CONFIG_SPARSEMEM. This series is based on v5.11-rc6. > > Question

Re: [RFC PATCH v2 17/26] KVM: arm64: Elevate Hyp mappings creation at EL2

2021-02-05 Thread Will Deacon
On Thu, Feb 04, 2021 at 11:08:33AM +, Quentin Perret wrote: > On Wednesday 03 Feb 2021 at 15:31:39 (+), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:15PM +, Quentin Perret wrote: > > > @@ -1481,7 +1486,10 @@ static void cpu_set_hyp_vector(void) > > >

Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection

2021-02-05 Thread Will Deacon
On Thu, Feb 04, 2021 at 10:47:08AM +, Quentin Perret wrote: > On Wednesday 03 Feb 2021 at 14:37:10 (+), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:14PM +, Quentin Perret wrote: > > > +static inline unsigned long __hyp_pgtable_max_pages(unsigned lo

Re: [PATCH v2 1/4] arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC

2021-02-05 Thread Will Deacon
On Fri, Feb 05, 2021 at 12:37:21AM +0800, Lecopzer Chen wrote: > > > On Thu, Feb 04, 2021 at 10:46:12PM +0800, Lecopzer Chen wrote: > > > > On Sat, Jan 09, 2021 at 06:32:49PM +0800, Lecopzer Chen wrote: > > > > > Linux support KAsan for VMALLOC since commit 3c5c3cfb9ef4da9 > > > > > ("kasan: suppo

Re: [PATCH v17 1/7] arm/arm64: Probe for the presence of KVM hypervisor

2021-02-05 Thread Will Deacon
On Fri, Feb 05, 2021 at 09:11:00AM +, Steven Price wrote: > On 02/02/2021 14:11, Marc Zyngier wrote: > > diff --git a/drivers/firmware/smccc/kvm_guest.c > > b/drivers/firmware/smccc/kvm_guest.c > > new file mode 100644 > > index ..23ce1ded88b4 > > --- /dev/null > > +++ b/drivers/fi

Re: [RFC PATCH v2 12/26] KVM: arm64: Introduce a Hyp buddy page allocator

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 06:19:36PM +, Quentin Perret wrote: > On Thursday 04 Feb 2021 at 14:31:08 (+), Will Deacon wrote: > > Just feels a bit backwards having __find_buddy() take an order parameter, > > yet then return a page of the wrong order! __hyp_extract_page() always

Re: [RFC PATCH v2 12/26] KVM: arm64: Introduce a Hyp buddy page allocator

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 06:01:12PM +, Quentin Perret wrote: > On Thursday 04 Feb 2021 at 17:48:49 (+), Will Deacon wrote: > > On Thu, Feb 04, 2021 at 02:52:52PM +, Quentin Perret wrote: > > > On Thursday 04 Feb 2021 at 14:31:08 (+), Will Deacon wrote: > >

Re: [PATCH v16 10/12] arm64: Use OF alloc and free functions for FDT

2021-02-04 Thread Will Deacon
DT, and to free the FDT respectively. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Rob Herring > --- > arch/arm64/kernel/machine_kexec_file.c | 37 +++--- > 1 file changed, 10 insertions(+), 27 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH v2 0/4] arm64: kasan: support CONFIG_KASAN_VMALLOC

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 11:53:46PM +0800, Lecopzer Chen wrote: > > On Sat, Jan 09, 2021 at 06:32:48PM +0800, Lecopzer Chen wrote: > > > Linux supports KAsan for VMALLOC since commit 3c5c3cfb9ef4da9 > > > ("kasan: support backing vmalloc space with real shadow memory") > > > > > > Acroding to how x

Re: [RFC PATCH v2 12/26] KVM: arm64: Introduce a Hyp buddy page allocator

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 02:52:52PM +, Quentin Perret wrote: > On Thursday 04 Feb 2021 at 14:31:08 (+), Will Deacon wrote: > > On Wed, Feb 03, 2021 at 06:33:30PM +, Quentin Perret wrote: > > > On Tuesday 02 Feb 2021 at 18:13:08 (+), Will Deacon wrote: > > >

Re: [PATCH v2 2/4] arm64: kasan: abstract _text and _end to KERNEL_START/END

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 10:51:27PM +0800, Lecopzer Chen wrote: > > On Sat, Jan 09, 2021 at 06:32:50PM +0800, Lecopzer Chen wrote: > > > Arm64 provide defined macro for KERNEL_START and KERNEL_END, > > > thus replace them by the abstration instead of using _text and _end. > > > > > > Signed-off-by:

Re: [PATCH v2 1/4] arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 10:46:12PM +0800, Lecopzer Chen wrote: > > On Sat, Jan 09, 2021 at 06:32:49PM +0800, Lecopzer Chen wrote: > > > Linux support KAsan for VMALLOC since commit 3c5c3cfb9ef4da9 > > > ("kasan: support backing vmalloc space with real shadow memory") > > > > > > Like how the MODUL

Re: [PATCH][next][V2] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-04 Thread Will Deacon
region *region; > int prot = IOMMU_WRITE | IOMMU_READ; > > - if (domid < 0) > + if ((int)domid < 0) > return; > curdom = data->plat_data->iova_region + domid; > for (i = 0; i < data->plat_data->iova_region_nr; i++) { Thanks, Colin. Acked-by: Will Deacon Will

Re: [PATCH 3/3] selftest/arm64/ptrace: add tests for PTRACE_O_ARM64_RAW_REGS

2021-02-04 Thread Will Deacon
[+Kees] On Mon, Feb 01, 2021 at 11:40:12AM -0800, Andrei Vagin wrote: > Test output: > TAP version 13 > 1..2 > # selftests: arm64/ptrace: ptrace_syscall_raw_regs_test > # 1..2 > # ok 1 x7: 686920776f726c64 > # ok 2 The child exited with code 0. > # # Totals: pass:2 fail:0 xfail:0 xpass:0 sk

Re: [PATCH 2/3] arm64/ptrace: introduce PTRACE_O_ARM64_RAW_REGS

2021-02-04 Thread Will Deacon
On Mon, Feb 01, 2021 at 11:40:11AM -0800, Andrei Vagin wrote: > We have some ABI weirdness in the way that we handle syscall > exit stops because we indicate whether or not the stop has been > signalled from syscall entry or syscall exit by clobbering a general > purpose register (ip/r12 for AArch3

Re: [PATCH 1/3] arm64/ptrace: don't clobber task registers on syscall entry/exit traps

2021-02-04 Thread Will Deacon
On Mon, Feb 01, 2021 at 11:40:10AM -0800, Andrei Vagin wrote: > ip/r12 for AArch32 and x7 for AArch64 is used to indicate whether or not > the stop has been signalled from syscall entry or syscall exit. This > means that: > > - Any writes by the tracer to this register during the stop are > igno

Re: [PATCH 0/3 v2] arm64/ptrace: allow to get all registers on syscall traps

2021-02-04 Thread Will Deacon
Hi Andrei, On Mon, Feb 01, 2021 at 11:40:09AM -0800, Andrei Vagin wrote: > Right now, ip/r12 for AArch32 and x7 for AArch64 is used to indicate > whether or not the stop has been signalled from syscall entry or syscall > exit. This means that: > > - Any writes by the tracer to this register durin

Re: [RFC PATCH v2 26/26] KVM: arm64: Wrap the host with a stage 2

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 02:26:35PM +, Quentin Perret wrote: > On Wednesday 03 Feb 2021 at 16:11:47 (+), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:24PM +, Quentin Perret wrote: > > > When KVM runs in protected nVHE mode, make use of a stage 2 page-table

Re: [RFC PATCH v2 24/26] KVM: arm64: Make memcache anonymous in pgtable allocator

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 02:24:44PM +, Quentin Perret wrote: > On Wednesday 03 Feb 2021 at 15:59:44 (+), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:22PM +, Quentin Perret wrote: > > > The current stage2 page-table allocator uses a memcache to get > > &g

Re: [RFC PATCH v2 12/26] KVM: arm64: Introduce a Hyp buddy page allocator

2021-02-04 Thread Will Deacon
On Wed, Feb 03, 2021 at 06:33:30PM +, Quentin Perret wrote: > On Tuesday 02 Feb 2021 at 18:13:08 (+), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:10PM +, Quentin Perret wrote: > > > + * __find_buddy(pool, page 0, order 0) => page 1 > > > +

Re: [PATCH] drivers/perf: convert sysfs sprintf/snprintf family to sysfs_emit

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 11:32:51AM +0800, Jiapeng Chong wrote: > Fix the following coccicheck warning: > > ./drivers/perf/arm-cci.c:708:8-16: WARNING: use scnprintf or sprintf. > ./drivers/perf/arm-cci.c:699:8-16: WARNING: use scnprintf or sprintf. > ./drivers/perf/arm-cci.c:528:8-16: WARNING: use

Re: [PATCH v2 0/4] arm64: kasan: support CONFIG_KASAN_VMALLOC

2021-02-04 Thread Will Deacon
On Sat, Jan 09, 2021 at 06:32:48PM +0800, Lecopzer Chen wrote: > Linux supports KAsan for VMALLOC since commit 3c5c3cfb9ef4da9 > ("kasan: support backing vmalloc space with real shadow memory") > > Acroding to how x86 ported it [1], they early allocated p4d and pgd, > but in arm64 I just simulate

Re: [PATCH v2 2/4] arm64: kasan: abstract _text and _end to KERNEL_START/END

2021-02-04 Thread Will Deacon
On Sat, Jan 09, 2021 at 06:32:50PM +0800, Lecopzer Chen wrote: > Arm64 provide defined macro for KERNEL_START and KERNEL_END, > thus replace them by the abstration instead of using _text and _end. > > Signed-off-by: Lecopzer Chen > --- > arch/arm64/mm/kasan_init.c | 6 +++--- > 1 file changed, 3

Re: [PATCH v2 1/4] arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC

2021-02-04 Thread Will Deacon
On Sat, Jan 09, 2021 at 06:32:49PM +0800, Lecopzer Chen wrote: > Linux support KAsan for VMALLOC since commit 3c5c3cfb9ef4da9 > ("kasan: support backing vmalloc space with real shadow memory") > > Like how the MODULES_VADDR does now, just not to early populate > the VMALLOC_START between VMALLOC_E

Re: [PATCH v6 06/21] arm64: Move VHE-specific SPE setup to mutate_to_vhe()

2021-02-04 Thread Will Deacon
On Thu, Feb 04, 2021 at 09:30:08AM +, Marc Zyngier wrote: > Hi Will, > > On 2021-02-03 21:13, Will Deacon wrote: > > Hi Marc, > > > > On Mon, Feb 01, 2021 at 11:56:22AM +, Marc Zyngier wrote: > > > There isn't much that a VHE kernel needs on top

Re: [PATCH][next] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-04 Thread Will Deacon
On Wed, Feb 03, 2021 at 01:59:36PM +, Colin King wrote: > From: Colin Ian King > > Currently the check for domid < 0 is always false because domid > is unsigned. Fix this by making it signed. > > Addresses-CoverityL ("Unsigned comparison against 0") Typo here ('L' instead of ':') > Fixes:

Re: [PATCH 2/3] iommu/io-pgtable-arm: Add IOMMU_LLC page protection flag

2021-02-03 Thread Will Deacon
On Tue, Feb 02, 2021 at 11:56:27AM +0530, Sai Prakash Ranjan wrote: > On 2021-02-01 23:50, Jordan Crouse wrote: > > On Mon, Feb 01, 2021 at 08:20:44AM -0800, Rob Clark wrote: > > > On Mon, Feb 1, 2021 at 3:16 AM Will Deacon wrote: > > > > On Fri, Jan 29, 2021 at

Re: [PATCH v2 0/2] Add support for ARM Cortex-A78 PMU

2021-02-03 Thread Will Deacon
On Wed, 3 Feb 2021 13:53:46 +0800, Seiya Wang wrote: > Add support for ARM Cortex-A78 PMU since it will be used in > new Mediatek SoC. > > Based on v5.11-rc6 > > Change in v2: > Remove change-id in commit message > > [...] Applied to will (for-next/perf), thanks! [1/2] arm64: perf: add support

Re: [PATCH v6 06/21] arm64: Move VHE-specific SPE setup to mutate_to_vhe()

2021-02-03 Thread Will Deacon
Hi Marc, On Mon, Feb 01, 2021 at 11:56:22AM +, Marc Zyngier wrote: > There isn't much that a VHE kernel needs on top of whatever has > been done for nVHE, so let's move the little we need to the > VHE stub (the SPE setup), and drop the init_el2_state macro. > > No expected functional change.

Re: [RFC PATCH v2 20/26] KVM: arm64: Set host stage 2 using kvm_nvhe_init_params

2021-02-03 Thread Will Deacon
e/asm/kvm_asm.h | 3 +++ > arch/arm64/kernel/asm-offsets.c| 3 +++ > arch/arm64/kvm/arm.c | 5 + > arch/arm64/kvm/hyp/nvhe/hyp-init.S | 9 + > arch/arm64/kvm/hyp/nvhe/switch.c | 5 + > 5 files changed, 21 insertions(+), 4 deletions(-) Acked-by: Will Deacon Will

Re: [RFC PATCH v2 26/26] KVM: arm64: Wrap the host with a stage 2

2021-02-03 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:24PM +, Quentin Perret wrote: > When KVM runs in protected nVHE mode, make use of a stage 2 page-table > to give the hypervisor some control over the host memory accesses. At > the moment all memory aborts from the host will be instantly idmapped > RWX at stage 2 i

Re: [RFC PATCH v2 24/26] KVM: arm64: Make memcache anonymous in pgtable allocator

2021-02-03 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:22PM +, Quentin Perret wrote: > The current stage2 page-table allocator uses a memcache to get > pre-allocated pages when it needs any. To allow re-using this code at > EL2 which uses a concept of memory pools, make the memcache argument to > kvm_pgtable_stage2_map

Re: [RFC PATCH v2 23/26] KVM: arm64: Refactor __populate_fault_info()

2021-02-03 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:21PM +, Quentin Perret wrote: > Refactor __populate_fault_info() to introduce __get_fault_info() which > will be used once the host is wrapped in a stage 2. > > Signed-off-by: Quentin Perret > --- > arch/arm64/kvm/hyp/include/hyp/switch.h | 36 +++---

Re: [RFC PATCH v2 22/26] KVM: arm64: Refactor __load_guest_stage2()

2021-02-03 Thread Will Deacon
t; 1 file changed, 7 insertions(+), 2 deletions(-) Acked-by: Will Deacon Will

Re: [RFC PATCH v2 21/26] KVM: arm64: Refactor kvm_arm_setup_stage2()

2021-02-03 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:19PM +, Quentin Perret wrote: > In order to re-use some of the stage 2 setup at EL2, factor parts of > kvm_arm_setup_stage2() out into static inline functions. > > No functional change intended. > > Signed-off-by: Quentin Perret > --- > arch/arm64/include/asm/k

Re: [RFC PATCH v2 19/26] KVM: arm64: Use kvm_arch in kvm_s2_mmu

2021-02-03 Thread Will Deacon
off-by: Quentin Perret > --- > arch/arm64/include/asm/kvm_host.h | 2 +- > arch/arm64/include/asm/kvm_mmu.h | 7 ++- > arch/arm64/kvm/mmu.c | 8 > 3 files changed, 11 insertions(+), 6 deletions(-) Acked-by: Will Deacon Will

Re: [RFC PATCH v2 18/26] KVM: arm64: Use kvm_arch for stage 2 pgtable

2021-02-03 Thread Will Deacon
--- > arch/arm64/include/asm/kvm_pgtable.h | 5 +++-- > arch/arm64/kvm/hyp/pgtable.c | 6 +++--- > arch/arm64/kvm/mmu.c | 2 +- > 3 files changed, 7 insertions(+), 6 deletions(-) Acked-by: Will Deacon Will

Re: [RFC PATCH v2 17/26] KVM: arm64: Elevate Hyp mappings creation at EL2

2021-02-03 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:15PM +, Quentin Perret wrote: > Previous commits have introduced infrastructure at EL2 to enable the Hyp > code to manage its own memory, and more specifically its stage 1 page > tables. However, this was preliminary work, and none of it is currently > in use. > >

Re: [PATCH 1/2] asm-generic: export: Stub EXPORT_SYMBOL with __DISABLE_EXPORTS

2021-02-03 Thread Will Deacon
2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Will Deacon Will

Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection

2021-02-03 Thread Will Deacon
ecessary host kernel changes. > > Credits to Will for __pkvm_init_switch_pgd. > > Co-authored-by: Will Deacon > Signed-off-by: Will Deacon > Signed-off-by: Quentin Perret [...] > diff --git a/arch/arm64/include/asm/kvm_hyp.h > b/arch/arm64/include/asm/kvm_hyp.h > index c04508

Re: [RFC 01/20] mm/tlb: fix fullmm semantics

2021-02-03 Thread Will Deacon
On Tue, Feb 02, 2021 at 01:35:38PM -0800, Nadav Amit wrote: > > On Feb 2, 2021, at 3:00 AM, Peter Zijlstra wrote: > > > > On Tue, Feb 02, 2021 at 01:32:36AM -0800, Nadav Amit wrote: > >>> On Feb 1, 2021, at 3:36 AM, Peter Zijlstra wrote: > >>> > >>> > >>> https://lkml.kernel.org/r/202101272353

Re: [PATCH] drivers/perf: Prevent forced unbinding of ARM_DMC620_PMU drivers

2021-02-02 Thread Will Deacon
On Tue, 2 Feb 2021 15:58:06 +0800, Qi Liu wrote: > Set "suppress_bind_attrs" to true, so that bind/unbind can be > disabled via sysfs and prevent unbinding ARM_DMC620_PMU drivers > during perf sampling. Applied to will (for-next/perf), thanks! [1/1] drivers/perf: Prevent forced unbinding of ARM_D

Re: [PATCH] arm64/ptdump:display the Linear Mapping start marker

2021-02-02 Thread Will Deacon
On Tue, 2 Feb 2021 23:07:49 +0800, Hailong Liu wrote: > The current /sys/kernel/debug/kernel_page_tables does not display the > *Linear Mapping start* marker on arm64, which I think should be paired > with the *Linear Mapping start* marker. > > Since *Linear Mapping start* is the first marker, use

Re: [RFC PATCH v2 14/26] KVM: arm64: Factor out vector address calculation

2021-02-02 Thread Will Deacon
off-by: Quentin Perret > --- > arch/arm64/include/asm/kvm_mmu.h | 8 > arch/arm64/kvm/arm.c | 9 + > 2 files changed, 9 insertions(+), 8 deletions(-) Acked-by: Will Deacon Will

Re: [RFC PATCH v2 12/26] KVM: arm64: Introduce a Hyp buddy page allocator

2021-02-02 Thread Will Deacon
Hi Quentin, Sorry for the delay, this one took me a while to grok. On Fri, Jan 08, 2021 at 12:15:10PM +, Quentin Perret wrote: > When memory protection is enabled, the hyp code will require a basic > form of memory management in order to allocate and free memory pages at > EL2. This is needed

Re: [PATCH] iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping

2021-02-02 Thread Will Deacon
us testing on this. I saw a report of the > warning and the fix seemed obvious so I'm shooting it out. > > drivers/iommu/iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Will Deacon Joerg -- please can you apply this one on top of the pull request I sent yesterday? Cheers, Will

Re: [GIT PULL] iommu/arm-smmu: Updates for 5.12

2021-02-02 Thread Will Deacon
On Tue, Feb 02, 2021 at 02:34:56PM +0100, Joerg Roedel wrote: > On Mon, Feb 01, 2021 at 03:46:33PM +0000, Will Deacon wrote: > > git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git > > tags/arm-smmu-updates > > Pulled, thanks Will. Cheers, Joerg. Doug spotted a

Re: [PATCH v6 00/33] MT8192 IOMMU support

2021-02-02 Thread Will Deacon
On Tue, Feb 02, 2021 at 10:03:45AM +0800, Yong Wu wrote: > On Mon, 2021-02-01 at 14:54 +0000, Will Deacon wrote: > > On Mon, Jan 11, 2021 at 07:18:41PM +0800, Yong Wu wrote: > > > This patch mainly adds support for mt8192 Multimedia IOMMU and SMI. > > > > > >

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-02 Thread Will Deacon
On Tue, Feb 02, 2021 at 01:39:29PM +0100, David Hildenbrand wrote: > On 02.02.21 13:35, Will Deacon wrote: > > On Tue, Feb 02, 2021 at 12:32:15PM +0000, Will Deacon wrote: > > > On Tue, Feb 02, 2021 at 09:41:53AM +0530, Anshuman Khandual wrote: > > > > pfn_valid() va

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-02 Thread Will Deacon
On Tue, Feb 02, 2021 at 12:32:15PM +, Will Deacon wrote: > On Tue, Feb 02, 2021 at 09:41:53AM +0530, Anshuman Khandual wrote: > > pfn_valid() validates a pfn but basically it checks for a valid struct page > > backing for that pfn. It should always return positive for memory ra

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-02-02 Thread Will Deacon
On Tue, Feb 02, 2021 at 09:41:53AM +0530, Anshuman Khandual wrote: > pfn_valid() validates a pfn but basically it checks for a valid struct page > backing for that pfn. It should always return positive for memory ranges > backed with struct page mapping. But currently pfn_valid() fails for all > ZO

Re: [PATCH 12/12] arm64: kasan: export MTE symbols for KASAN tests

2021-02-02 Thread Will Deacon
On Mon, Feb 01, 2021 at 08:43:36PM +0100, Andrey Konovalov wrote: > Export mte_enable_kernel() and mte_set_report_once() to fix: > > ERROR: modpost: "mte_enable_kernel" [lib/test_kasan.ko] undefined! > ERROR: modpost: "mte_set_report_once" [lib/test_kasan.ko] undefined! > > Signed-off-by: Andrey

Re: [RFC PATCH v2 11/26] KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp

2021-02-02 Thread Will Deacon
On Tue, Feb 02, 2021 at 09:57:36AM +, Quentin Perret wrote: > On Monday 01 Feb 2021 at 19:06:20 (+), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:09PM +, Quentin Perret wrote: > > > In order to use the kernel list library at EL2, introduce stubs for the >

Re: [RFC PATCH v2 11/26] KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp

2021-02-01 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:09PM +, Quentin Perret wrote: > In order to use the kernel list library at EL2, introduce stubs for the > CONFIG_DEBUG_LIST out-of-lines calls. > > Signed-off-by: Quentin Perret > --- > arch/arm64/kvm/hyp/nvhe/Makefile | 2 +- > arch/arm64/kvm/hyp/nvhe/stub.c

Re: [RFC PATCH v2 10/26] KVM: arm64: Introduce an early Hyp page allocator

2021-02-01 Thread Will Deacon
On Fri, Jan 08, 2021 at 12:15:08PM +, Quentin Perret wrote: > diff --git a/arch/arm64/kvm/hyp/nvhe/early_alloc.c > b/arch/arm64/kvm/hyp/nvhe/early_alloc.c > new file mode 100644 > index ..de4c45662970 > --- /dev/null > +++ b/arch/arm64/kvm/hyp/nvhe/early_alloc.c > @@ -0,0 +1,60 @@

<    1   2   3   4   5   6   7   8   9   10   >