Re: [PATCH RFC v2 04/29] mm: asi: Add infrastructure for boot-time enablement

2025-03-20 Thread Brendan Jackman
On Wed Mar 19, 2025 at 6:47 PM UTC, Yosry Ahmed wrote: > On Wed, Mar 19, 2025 at 06:29:35PM +0100, Borislav Petkov wrote: > > On Fri, Jan 10, 2025 at 06:40:30PM +, Brendan Jackman wrote: > > > Add a boot time parameter to control the newly added X86_FEATURE_ASI. > > > "asi=on" or "asi=off" can

Re: [PATCH RFC v2 04/29] mm: asi: Add infrastructure for boot-time enablement

2025-03-19 Thread Yosry Ahmed
On Wed, Mar 19, 2025 at 06:29:35PM +0100, Borislav Petkov wrote: > On Fri, Jan 10, 2025 at 06:40:30PM +, Brendan Jackman wrote: > > Add a boot time parameter to control the newly added X86_FEATURE_ASI. > > "asi=on" or "asi=off" can be used in the kernel command line to enable > > or disable ASI

Re: [PATCH RFC v2 04/29] mm: asi: Add infrastructure for boot-time enablement

2025-03-19 Thread Borislav Petkov
On Fri, Jan 10, 2025 at 06:40:30PM +, Brendan Jackman wrote: > Add a boot time parameter to control the newly added X86_FEATURE_ASI. > "asi=on" or "asi=off" can be used in the kernel command line to enable > or disable ASI at boot time. If not specified, ASI enablement depends > on CONFIG_ADDRE

Re: [PATCH RFC v2 02/29] x86: Create CONFIG_MITIGATION_ADDRESS_SPACE_ISOLATION

2025-03-05 Thread Brendan Jackman
On Sat, Mar 01, 2025 at 09:23:51AM +0200, Mike Rapoport wrote: > Hi Brendan, > > On Fri, Jan 10, 2025 at 06:40:28PM +, Brendan Jackman wrote: > > Currently a nop config. Keeping as a separate commit for easy review of > > the boring bits. Later commits will use and enable this new config. > > >

Re: [PATCH RFC v2 02/29] x86: Create CONFIG_MITIGATION_ADDRESS_SPACE_ISOLATION

2025-02-28 Thread Mike Rapoport
Hi Brendan, On Fri, Jan 10, 2025 at 06:40:28PM +, Brendan Jackman wrote: > Currently a nop config. Keeping as a separate commit for easy review of > the boring bits. Later commits will use and enable this new config. > > This config is only added for non-UML x86_64 as other architectures do >

Re: [PATCH RFC v2 25/29] mm: asi: Restricted execution fore bare-metal processes

2025-02-28 Thread Yosry Ahmed
(Trimming the CC list as my email server refuses the number of CCs) On Fri, Jan 10, 2025 at 06:40:51PM +, Brendan Jackman wrote: > Now userspace gets a restricted address space too. The critical section > begins on exit to userspace and ends when it makes a system call. > Other entries from us

Re: [PATCH RFC v2 03/29] mm: asi: Introduce ASI core API

2025-02-27 Thread Borislav Petkov
On Wed, Feb 19, 2025 at 02:53:03PM +0100, Brendan Jackman wrote: > Argh, sorry, GMail switched back to HTML mode somehow. Maybe I have to > get a proper mail client after all. Yap, wouldn't be such a bad idea. And yes, it ain't easy - we have a whole doc about it: Documentation/process/email-clie

Re: [PATCH RFC v2 03/29] mm: asi: Introduce ASI core API

2025-02-19 Thread Brendan Jackman
Argh, sorry, GMail switched back to HTML mode somehow. Maybe I have to get a proper mail client after all. Here's the clean version. On Wed, 19 Feb 2025 at 11:57, Borislav Petkov wrote: > > > + * Runtime usage: > > + * > > + * 1. Call asi_enter() to switch to the restricted address space. This

Re: [PATCH RFC v2 03/29] mm: asi: Introduce ASI core API

2025-02-19 Thread Brendan Jackman
On Wed, 19 Feb 2025 at 11:57, Borislav Petkov wrote: > > + * Runtime usage: > > + * > > + * 1. Call asi_enter() to switch to the restricted address space. This > can't be > > + *from an interrupt or exception handler and preemption must be > disabled. > > + * > > + * 2. Execute untrusted code

Re: [PATCH RFC v2 03/29] mm: asi: Introduce ASI core API

2025-02-19 Thread Borislav Petkov
On Fri, Jan 10, 2025 at 06:40:29PM +, Brendan Jackman wrote: > Subject: Re: [PATCH RFC v2 03/29] mm: asi: Introduce ASI core API x86/asi: ... > Introduce core API for Address Space Isolation (ASI). Kernel address > space isolation provides the ability to run some kernel >

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-02-06 Thread J . Neuschäfer
On Wed, Jan 29, 2025 at 06:01:04PM -0500, Frank Li wrote: > On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > > Convert the Freescale localbus controller bindings from text form to > > YAML. The list of compatible strings reflects current usage. > > > > Changes compared to the txt ve

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-02-06 Thread J . Neuschäfer
On Sun, Jan 26, 2025 at 10:23:21PM -0600, Rob Herring wrote: > On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > > Convert the Freescale localbus controller bindings from text form to > > YAML. The list of compatible strings reflects current usage. > > > > Changes compared to the tx

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-02-06 Thread J . Neuschäfer
On Mon, Jan 27, 2025 at 09:37:32AM +0100, Krzysztof Kozlowski wrote: > On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > > Convert the Freescale localbus controller bindings from text form to > > YAML. The list of compatible strings reflects current usage. > > simple-bus and 20 othe

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-01-29 Thread Frank Li
On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > Convert the Freescale localbus controller bindings from text form to > YAML. The list of compatible strings reflects current usage. > > Changes compared to the txt version: > - removed the board-control (fsl,mpc8272ads-bcsr) node bec

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-01-27 Thread Krzysztof Kozlowski
On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > Convert the Freescale localbus controller bindings from text form to > YAML. The list of compatible strings reflects current usage. simple-bus and 20 other compatibles you used were not present in the original binding. Does above "li

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-01-26 Thread Rob Herring
On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > Convert the Freescale localbus controller bindings from text form to > YAML. The list of compatible strings reflects current usage. > > Changes compared to the txt version: > - removed the board-control (fsl,mpc8272ads-bcsr) node be

[PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-01-26 Thread J . Neuschäfer via B4 Relay
From: "J. Neuschäfer" Convert the Freescale localbus controller bindings from text form to YAML. The list of compatible strings reflects current usage. Changes compared to the txt version: - removed the board-control (fsl,mpc8272ads-bcsr) node because it only appears in this example and nowh

Re: [PATCH RFC v2 16/29] mm: asi: Map kernel text and static data as nonsensitive

2025-01-17 Thread Brendan Jackman
On Fri, 10 Jan 2025 at 19:41, Brendan Jackman wrote: > + asi_clone_pgd(asi_global_nonsensitive_pgd, init_mm.pgd, > VMEMMAP_START); > + asi_clone_pgd(asi_global_nonsensitive_pgd, init_mm.pgd, > + VMEMMAP_START + (1UL << PGDIR_SHIFT)); There's a bug here that Yosry

Re: [PATCH RFC v2 02/29] x86: Create CONFIG_MITIGATION_ADDRESS_SPACE_ISOLATION

2025-01-16 Thread Borislav Petkov
On Fri, Jan 10, 2025 at 06:40:28PM +, Brendan Jackman wrote: > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index > 7b9a7e8f39acc8e9aeb7d4213e87d71047865f5c..5a50582eb210e9d1309856a737d32b76fa1bfc85 > 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -2519,6 +2519,20 @@ conf

Re: [PATCH RFC v2 01/29] mm: asi: Make some utility functions noinstr compatible

2025-01-16 Thread Borislav Petkov
On Thu, Jan 16, 2025 at 02:22:42PM +0100, Brendan Jackman wrote: > Sure. I'm actually not even sure that for a [PATCH]-quality thing this > cross-cutting commit even makes sense - once we've decided on the > general way to solve this problem, perhaps the changes should just be > part of the commit

Re: [PATCH RFC v2 01/29] mm: asi: Make some utility functions noinstr compatible

2025-01-16 Thread Brendan Jackman
On Thu, 16 Jan 2025 at 01:21, Borislav Petkov wrote: > > Unfortunately Thomas pointed out this will prevent the function from > > being inlined at call sites in .text. > > > > So far I haven't been able[1] to find a formulation that lets us : > > 1. avoid calls from .noinstr.text -> .text, > > 2.

Re: [PATCH RFC v2 01/29] mm: asi: Make some utility functions noinstr compatible

2025-01-16 Thread Borislav Petkov
On Thu, Jan 16, 2025 at 01:18:58AM +0100, Borislav Petkov wrote: > Long story short, lemme try to poke around tomorrow to try to figure out what > actually happens. It could be caused by the part of Rik's patches and this one > inlining things. We'll see... Looks transient... The very similar gues

Re: [PATCH RFC v2 01/29] mm: asi: Make some utility functions noinstr compatible

2025-01-15 Thread Borislav Petkov
On Fri, Jan 10, 2025 at 06:40:27PM +, Brendan Jackman wrote: > Subject: Re: [PATCH RFC v2 01/29] mm: asi: Make some utility functions > noinstr compatible The tip tree preferred format for patch subject prefixes is 'subsys/component:', e.g. 'x86/apic:', &#

[PATCH RFC v2 27/29] mm: asi: Add some mitigations on address space transitions

2025-01-10 Thread Brendan Jackman
Here we ASI actually starts becoming a real exploit mitigation, On CPUs with L1TF, flush L1D when the ASI data taints say so. On all CPUs, do some general branch predictor clearing whenever the control taints say so. This policy is very much just a starting point for discussion. Primarily it's a

[PATCH RFC v2 29/29] mm: asi: Stop ignoring asi=on cmdline flag

2025-01-10 Thread Brendan Jackman
At this point the minimum requirements are in place for the kernel to operate correctly with ASI enabled. Signed-off-by: Brendan Jackman --- arch/x86/mm/asi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/asi.c b/arch/x86/mm/asi.c index f10f6614b26148e5ba42

[PATCH RFC v2 28/29] x86/pti: Disable PTI when ASI is on

2025-01-10 Thread Brendan Jackman
Now that ASI has support for sandboxing userspace, although userspace now has much more mapped than it would under KPTI, in theory none of that data is important to protect. Note that one particular impact of this is it makes locally defeating KASLR easier. I don't think this is a great loss given

[PATCH RFC v2 19/29] mm: asi: Stabilize CR3 in switch_mm_irqs_off()

2025-01-10 Thread Brendan Jackman
An ASI-restricted CR3 is unstable as interrupts can cause ASI-exits. Although we already unconditionally ASI-exit during context-switch, and before returning from the VM-run path, it's still possible to reach switch_mm_irqs_off() in a restricted context, because KVM code updates static keys, which

[PATCH RFC v2 26/29] x86: Create library for flushing L1D for L1TF

2025-01-10 Thread Brendan Jackman
ASI will need to use this L1D flushing logic so put it in a library where it can be used independently of KVM. Since we're creating this library, it starts to look messy if we don't also use it in the double-opt-in (both kernel cmdline and prctl) mm-switching flush logic which is there for mitigat

[PATCH RFC v2 25/29] mm: asi: Restricted execution fore bare-metal processes

2025-01-10 Thread Brendan Jackman
Now userspace gets a restricted address space too. The critical section begins on exit to userspace and ends when it makes a system call. Other entries from userspace just interrupt the critical section via asi_intr_enter(). The reason why system calls have to actually asi_relax() (i.e. fully term

[PATCH RFC v2 24/29] mm: asi: Add infrastructure for mapping userspace addresses

2025-01-10 Thread Brendan Jackman
In preparation for sandboxing bare-metal processes, teach ASI to map userspace addresses into the restricted address space. Add a new policy helper to determine based on the class whether to do this. If the helper returns true, mirror userspace mappings into the ASI pagetables. Later, it will be

[PATCH RFC v2 23/29] mm: asi: exit ASI before suspend-like operations

2025-01-10 Thread Brendan Jackman
From: Yosry Ahmed During suspend-like operations (suspend, hibernate, kexec w/ preserve_context), the processor state (including CR3) is usually saved and restored later. In the kexec case, this only happens when KEXEC_PRESERVE_CONTEXT is used to jump back to the original kernel. In relocate_ker

[PATCH RFC v2 22/29] mm: asi: exit ASI before accessing CR3 from C code where appropriate

2025-01-10 Thread Brendan Jackman
Because asi_exit()s can be triggered by NMIs, CR3 is unstable when in the ASI restricted address space. (Exception: code in the ASI critical section can treat it as stable, because if an asi_exit() occurs during an exception it will be undone before the critical section resumes). Code that accesse

[PATCH RFC v2 21/29] KVM: x86: asi: Restricted address space for VM execution

2025-01-10 Thread Brendan Jackman
An ASI restricted address space is added for KVM. This protects the userspace from attack by the guest, and the guest from attack by other processes. It doesn't attempt to prevent the guest from attack by the current process. This change incorporates an extra asi_exit at the end of vcpu_run. We ex

[PATCH RFC v2 20/29] mm: asi: Make TLB flushing correct under ASI

2025-01-10 Thread Brendan Jackman
This is the absolute minimum change for TLB flushing to be correct under ASI. There are two arguably orthogonal changes in here but they feel small enough for a single commit. .:: CR3 stabilization As noted in the comment ASI can destabilize CR3, but we can stabilize it again by calling asi_exit,

[PATCH RFC v2 18/29] mm: asi: Map dynamic percpu memory as nonsensitive

2025-01-10 Thread Brendan Jackman
From: Reiji Watanabe Currently, all dynamic percpu memory is implicitly (and unintentionally) treated as sensitive memory. Unconditionally map pages for dynamically allocated percpu memory as global nonsensitive memory, other than pages that are allocated for pcpu_{first,reserved}_chunk during e

[PATCH RFC v2 17/29] mm: asi: Map vmalloc/vmap data as nonsensitive

2025-01-10 Thread Brendan Jackman
We add new VM flags for sensitive and global-nonsensitive, parallel to the corresponding GFP flags. __get_vm_area_node and friends will default to creating global-nonsensitive VM areas, and vmap then calls asi_map as necessary. __vmalloc_node_range has additional logic to check and set defaults f

[PATCH RFC v2 16/29] mm: asi: Map kernel text and static data as nonsensitive

2025-01-10 Thread Brendan Jackman
Basically we need to map the kernel code and all its static variables. Per-CPU variables need to be treated specially as described in the comments. The cpu_entry_area is similar - this needs to be nonsensitive so that the CPU can access the GDT etc when handling a page fault. Under 5-level paging,

[PATCH RFC v2 14/29] mm: asi: Map non-user buddy allocations as nonsensitive

2025-01-10 Thread Brendan Jackman
This is just simplest possible page_alloc patch I could come up with to demonstrate ASI working in a "denylist" mode: we map the direct map into the restricted address space, except pages allocated with GFP_USER. Pages must be asi_unmap()'d before they can be re-allocated. This requires a TLB flus

[PATCH RFC v2 13/29] mm: Add __PAGEFLAG_FALSE

2025-01-10 Thread Brendan Jackman
__PAGEFLAG_FALSE is a non-atomic equivalent of PAGEFLAG_FALSE. Checkpatch-args: --ignore=COMPLEX_MACRO Signed-off-by: Brendan Jackman --- include/linux/page-flags.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index cc839e436

[PATCH RFC v2 12/29] mm: asi: Add basic infrastructure for global non-sensitive mappings

2025-01-10 Thread Brendan Jackman
From: Junaid Shahid A pseudo-PGD is added to store global non-sensitive ASI mappings. Actual ASI PGDs copy entries from this pseudo-PGD during asi_init(). Memory can be mapped as globally non-sensitive by calling asi_map() with ASI_GLOBAL_NONSENSITIVE. Page tables allocated for global non-sensi

[PATCH RFC v2 11/29] mm: asi: Functions to map/unmap a memory range into ASI page tables

2025-01-10 Thread Brendan Jackman
From: Junaid Shahid Two functions, asi_map() and asi_map_gfp(), are added to allow mapping memory into ASI page tables. The mapping will be identical to the one for the same virtual address in the unrestricted page tables. This is necessary to allow switching between the page tables at any arbitr

[PATCH RFC v2 09/29] mm: asi: ASI page table allocation functions

2025-01-10 Thread Brendan Jackman
From: Junaid Shahid This adds custom allocation and free functions for ASI page tables. The alloc functions support allocating memory using different GFP reclaim flags, in order to be able to support non-sensitive allocations from both standard and atomic contexts. They also install the page tab

[PATCH RFC v2 10/29] mm: asi: asi_exit() on PF, skip handling if address is accessible

2025-01-10 Thread Brendan Jackman
From: Ofir Weisse On a page-fault - do asi_exit(). Then check if now after the exit the address is accessible. We do this by refactoring spurious_kernel_fault() into two parts: 1. Verify that the error code value is something that could arise from a lazy TLB update. 2. Walk the page table and ve

[PATCH RFC v2 08/29] mm: asi: Avoid warning from NMI userspace accesses in ASI context

2025-01-10 Thread Brendan Jackman
nmi_uaccess_okay() emits a warning if current CR3 != mm->pgd. Limit the warning to only when ASI is not active. Co-developed-by: Junaid Shahid Signed-off-by: Junaid Shahid Co-developed-by: Yosry Ahmed Signed-off-by: Yosry Ahmed Signed-off-by: Brendan Jackman --- arch/x86/mm/tlb.c | 26 ++

[PATCH RFC v2 07/29] mm: asi: Make __get_current_cr3_fast() ASI-aware

2025-01-10 Thread Brendan Jackman
From: Junaid Shahid When ASI is active, __get_current_cr3_fast() adjusts the returned CR3 value accordingly to reflect the actual ASI CR3. Signed-off-by: Junaid Shahid Signed-off-by: Brendan Jackman --- arch/x86/mm/tlb.c | 37 +++-- 1 file changed, 31 insertion

[PATCH RFC v2 06/29] mm: asi: Use separate PCIDs for restricted address spaces

2025-01-10 Thread Brendan Jackman
From: Yosry Ahmed Each restricted address space is assigned a separate PCID. Since currently only one ASI instance per-class exists for a given process, the PCID is just derived from the class index. This commit only sets the appropriate PCID when switching CR3, but does not actually use the NOF

[PATCH RFC v2 00/29] Address Space Isolation (ASI)

2025-01-10 Thread Brendan Jackman
ASI is a technique to mitigate a broad class of CPU vulnerabilities by unmapping sensitive data from the kernel address space. If no data is mapped that needs protecting, this class of exploits cannot leak that data and so the kernel can skip expensive mitigation actions. For a more detailed overvi

[PATCH RFC v2 05/29] mm: asi: ASI support in interrupts/exceptions

2025-01-10 Thread Brendan Jackman
Add support for potentially switching address spaces from within interrupts/exceptions/NMIs etc. An interrupt does not automatically switch to the unrestricted address space. It can switch if needed to access some memory not available in the restricted address space, using the normal asi_exit call.

[PATCH RFC v2 03/29] mm: asi: Introduce ASI core API

2025-01-10 Thread Brendan Jackman
Introduce core API for Address Space Isolation (ASI). Kernel address space isolation provides the ability to run some kernel code with a restricted kernel address space. There can be multiple classes of such restricted kernel address spaces (e.g. KPTI, KVM-PTI etc.). Each ASI class is identified

[PATCH RFC v2 01/29] mm: asi: Make some utility functions noinstr compatible

2025-01-10 Thread Brendan Jackman
Some existing utility functions would need to be called from a noinstr context in the later patches. So mark these as either noinstr or __always_inline. An earlier version of this by Junaid had a macro that was intended to tell the compiler "either inline this function, or call it in the noinstr s

[PATCH RFC v2 04/29] mm: asi: Add infrastructure for boot-time enablement

2025-01-10 Thread Brendan Jackman
Add a boot time parameter to control the newly added X86_FEATURE_ASI. "asi=on" or "asi=off" can be used in the kernel command line to enable or disable ASI at boot time. If not specified, ASI enablement depends on CONFIG_ADDRESS_SPACE_ISOLATION_DEFAULT_ON, which is off by default. asi_check_boottim

[PATCH RFC v2 02/29] x86: Create CONFIG_MITIGATION_ADDRESS_SPACE_ISOLATION

2025-01-10 Thread Brendan Jackman
Currently a nop config. Keeping as a separate commit for easy review of the boring bits. Later commits will use and enable this new config. This config is only added for non-UML x86_64 as other architectures do not yet have pending implementations. It also has somewhat artificial dependencies on !

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-10-24 Thread Steven Price
On 23/10/2024 19:10, Liam R. Howlett wrote: > * Steven Price [241023 05:31]: * Box64 seems to have a custom allocator based on reading /proc/self/maps to allocate a block of VA space with a low enough address [1] * PHP has code reading /proc/self/maps - I thi

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-10-23 Thread Liam R. Howlett
* Steven Price [241023 05:31]: > >> * Box64 seems to have a custom allocator based on reading > >> /proc/self/maps to allocate a block of VA space with a low enough > >> address [1] > >> > >> * PHP has code reading /proc/self/maps - I think this is to find a > >> segment which i

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-10-23 Thread Steven Price
Hi Liam, On 21/10/2024 20:48, Liam R. Howlett wrote: > * Steven Price [241021 09:23]: >> On 09/09/2024 10:46, Kirill A. Shutemov wrote: >>> On Thu, Sep 05, 2024 at 10:26:52AM -0700, Charlie Jenkins wrote: On Thu, Sep 05, 2024 at 09:47:47AM +0300, Kirill A. Shutemov wrote: > On Thu, Aug 2

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-10-21 Thread Steven Price
On 09/09/2024 10:46, Kirill A. Shutemov wrote: > On Thu, Sep 05, 2024 at 10:26:52AM -0700, Charlie Jenkins wrote: >> On Thu, Sep 05, 2024 at 09:47:47AM +0300, Kirill A. Shutemov wrote: >>> On Thu, Aug 29, 2024 at 12:15:57AM -0700, Charlie Jenkins wrote: Some applications rely on placing data i

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-10-21 Thread Liam R. Howlett
* Steven Price [241021 09:23]: > On 09/09/2024 10:46, Kirill A. Shutemov wrote: > > On Thu, Sep 05, 2024 at 10:26:52AM -0700, Charlie Jenkins wrote: > >> On Thu, Sep 05, 2024 at 09:47:47AM +0300, Kirill A. Shutemov wrote: > >>> On Thu, Aug 29, 2024 at 12:15:57AM -0700, Charlie Jenkins wrote: > >>>

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-10-02 Thread Palmer Dabbelt
On Fri, 13 Sep 2024 14:04:06 PDT (-0700), Charlie Jenkins wrote: > On Fri, Sep 13, 2024 at 08:41:34AM +0100, Lorenzo Stoakes wrote: >> On Wed, Sep 11, 2024 at 11:18:12PM GMT, Charlie Jenkins wrote: >> > On Wed, Sep 11, 2024 at 07:21:27PM +0100, Catalin Marinas wrote: >> > > On Tue, Sep 10, 2024 at

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-19 Thread Michael Ellerman
Charlie Jenkins writes: > On Wed, Sep 11, 2024 at 11:38:55PM +1000, Michael Ellerman wrote: >> Geert Uytterhoeven writes: >> > Hi Christophe, >> > >> > On Tue, Sep 10, 2024 at 11:21 AM Christophe Leroy >> > wrote: >> >> >>> diff --git a/include/uapi/linux/personality.h >> >> >>> b/include/uapi/

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-13 Thread Charlie Jenkins
On Fri, Sep 13, 2024 at 08:41:34AM +0100, Lorenzo Stoakes wrote: > On Wed, Sep 11, 2024 at 11:18:12PM GMT, Charlie Jenkins wrote: > > On Wed, Sep 11, 2024 at 07:21:27PM +0100, Catalin Marinas wrote: > > > On Tue, Sep 10, 2024 at 05:45:07PM -0700, Charlie Jenkins wrote: > > > > On Tue, Sep 10, 2024

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-13 Thread Charlie Jenkins
On Fri, Sep 13, 2024 at 11:08:23AM +0100, Catalin Marinas wrote: > On Thu, Sep 12, 2024 at 02:15:59PM -0700, Charlie Jenkins wrote: > > On Thu, Sep 12, 2024 at 11:53:49AM +0100, Catalin Marinas wrote: > > > On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > > > > Opting-in to the hi

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-13 Thread Catalin Marinas
On Fri, Sep 13, 2024 at 11:08:23AM +0100, Catalin Marinas wrote: > On Thu, Sep 12, 2024 at 02:15:59PM -0700, Charlie Jenkins wrote: > > On Thu, Sep 12, 2024 at 11:53:49AM +0100, Catalin Marinas wrote: > > > On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > > > > Opting-in to the hi

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-13 Thread Catalin Marinas
On Thu, Sep 12, 2024 at 02:15:59PM -0700, Charlie Jenkins wrote: > On Thu, Sep 12, 2024 at 11:53:49AM +0100, Catalin Marinas wrote: > > On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > > > Opting-in to the higher address space is reasonable. However, it is not > > > my preference,

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-13 Thread Lorenzo Stoakes
On Wed, Sep 11, 2024 at 11:18:12PM GMT, Charlie Jenkins wrote: > On Wed, Sep 11, 2024 at 07:21:27PM +0100, Catalin Marinas wrote: > > On Tue, Sep 10, 2024 at 05:45:07PM -0700, Charlie Jenkins wrote: > > > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > > > > * Catalin Marinas [2

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-12 Thread Charlie Jenkins
On Thu, Sep 12, 2024 at 11:53:49AM +0100, Catalin Marinas wrote: > On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > > Opting-in to the higher address space is reasonable. However, it is not > > my preference, because the purpose of this flag is to ensure that > > allocations do no

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-12 Thread Catalin Marinas
On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > Opting-in to the higher address space is reasonable. However, it is not > my preference, because the purpose of this flag is to ensure that > allocations do not exceed 47-bits, so it is a clearer ABI to have the > applications that

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Charlie Jenkins
On Wed, Sep 11, 2024 at 11:38:55PM +1000, Michael Ellerman wrote: > Geert Uytterhoeven writes: > > Hi Christophe, > > > > On Tue, Sep 10, 2024 at 11:21 AM Christophe Leroy > > wrote: > >> >>> diff --git a/include/uapi/linux/personality.h > >> >>> b/include/uapi/linux/personality.h > >> >>> index

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Charlie Jenkins
On Wed, Sep 11, 2024 at 07:21:27PM +0100, Catalin Marinas wrote: > On Tue, Sep 10, 2024 at 05:45:07PM -0700, Charlie Jenkins wrote: > > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > > > * Catalin Marinas [240906 07:44]: > > > > On Fri, Sep 06, 2024 at 09:55:42AM +, Arnd Be

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Charlie Jenkins
On Wed, Sep 11, 2024 at 07:25:08AM +, Arnd Bergmann wrote: > On Wed, Sep 11, 2024, at 00:45, Charlie Jenkins wrote: > > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > > > > I responded to Arnd in the other thread, but I am still not convinced > > that the solution that x86 a

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Catalin Marinas
On Tue, Sep 10, 2024 at 05:45:07PM -0700, Charlie Jenkins wrote: > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > > * Catalin Marinas [240906 07:44]: > > > On Fri, Sep 06, 2024 at 09:55:42AM +, Arnd Bergmann wrote: > > > > On Fri, Sep 6, 2024, at 09:14, Guo Ren wrote: > > >

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Michael Ellerman
"Arnd Bergmann" writes: > On Mon, Sep 9, 2024, at 23:22, Charlie Jenkins wrote: >> On Fri, Sep 06, 2024 at 10:52:34AM +0100, Lorenzo Stoakes wrote: >>> On Fri, Sep 06, 2024 at 09:14:08AM GMT, Arnd Bergmann wrote: >>> The intent is to optionally be able to run a process that keeps higher bits >>> f

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Michael Ellerman
Geert Uytterhoeven writes: > Hi Christophe, > > On Tue, Sep 10, 2024 at 11:21 AM Christophe Leroy > wrote: >> >>> diff --git a/include/uapi/linux/personality.h >> >>> b/include/uapi/linux/personality.h >> >>> index 49796b7756af..cd3b8c154d9b 100644 >> >>> --- a/include/uapi/linux/personality.h >

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Michael Ellerman
Charlie Jenkins writes: > On Fri, Sep 06, 2024 at 04:59:40PM +1000, Michael Ellerman wrote: >> Charlie Jenkins writes: >> > Create a personality flag ADDR_LIMIT_47BIT to support applications >> > that wish to transition from running in environments that support at >> > most 47-bit VAs to environm

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-11 Thread Arnd Bergmann
On Wed, Sep 11, 2024, at 00:45, Charlie Jenkins wrote: > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > > I responded to Arnd in the other thread, but I am still not convinced > that the solution that x86 and arm64 have selected is the best solution. > The solution of defaulting

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-10 Thread Charlie Jenkins
On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > * Catalin Marinas [240906 07:44]: > > On Fri, Sep 06, 2024 at 09:55:42AM +, Arnd Bergmann wrote: > > > On Fri, Sep 6, 2024, at 09:14, Guo Ren wrote: > > > > On Fri, Sep 6, 2024 at 3:18 PM Arnd Bergmann wrote: > > > >> It's als

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-10 Thread Charlie Jenkins
On Tue, Sep 10, 2024 at 09:13:33AM +, Arnd Bergmann wrote: > On Mon, Sep 9, 2024, at 23:22, Charlie Jenkins wrote: > > On Fri, Sep 06, 2024 at 10:52:34AM +0100, Lorenzo Stoakes wrote: > >> On Fri, Sep 06, 2024 at 09:14:08AM GMT, Arnd Bergmann wrote: > >> The intent is to optionally be able to r

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-10 Thread Liam R. Howlett
* Catalin Marinas [240906 07:44]: > On Fri, Sep 06, 2024 at 09:55:42AM +, Arnd Bergmann wrote: > > On Fri, Sep 6, 2024, at 09:14, Guo Ren wrote: > > > On Fri, Sep 6, 2024 at 3:18 PM Arnd Bergmann wrote: > > >> It's also unclear to me how we want this flag to interact with > > >> the existing

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-10 Thread Geert Uytterhoeven
Hi Christophe, On Tue, Sep 10, 2024 at 11:21 AM Christophe Leroy wrote: > >>> diff --git a/include/uapi/linux/personality.h > >>> b/include/uapi/linux/personality.h > >>> index 49796b7756af..cd3b8c154d9b 100644 > >>> --- a/include/uapi/linux/personality.h > >>> +++ b/include/uapi/linux/personali

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-10 Thread Christophe Leroy
diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h index 49796b7756af..cd3b8c154d9b 100644 --- a/include/uapi/linux/personality.h +++ b/include/uapi/linux/personality.h @@ -22,6 +22,7 @@ enum { WHOLE_SECONDS = 0x200, STICKY_TIMEOUTS =

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-10 Thread Arnd Bergmann
On Mon, Sep 9, 2024, at 23:22, Charlie Jenkins wrote: > On Fri, Sep 06, 2024 at 10:52:34AM +0100, Lorenzo Stoakes wrote: >> On Fri, Sep 06, 2024 at 09:14:08AM GMT, Arnd Bergmann wrote: >> The intent is to optionally be able to run a process that keeps higher bits >> free for tagging and to be sure

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-09 Thread Charlie Jenkins
On Fri, Sep 06, 2024 at 10:52:34AM +0100, Lorenzo Stoakes wrote: > (Sorry having issues with my IPv6 setup that duplicated the original email... > > On Fri, Sep 06, 2024 at 09:14:08AM GMT, Arnd Bergmann wrote: > > On Fri, Sep 6, 2024, at 08:14, Lorenzo Stoakes wrote: > > > On Fri, Sep 06, 2024 at

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-09 Thread Charlie Jenkins
On Fri, Sep 06, 2024 at 04:59:40PM +1000, Michael Ellerman wrote: > Charlie Jenkins writes: > > Create a personality flag ADDR_LIMIT_47BIT to support applications > > that wish to transition from running in environments that support at > > most 47-bit VAs to environments that support larger VAs. T

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-09-09 Thread Kirill A. Shutemov
On Thu, Sep 05, 2024 at 10:26:52AM -0700, Charlie Jenkins wrote: > On Thu, Sep 05, 2024 at 09:47:47AM +0300, Kirill A. Shutemov wrote: > > On Thu, Aug 29, 2024 at 12:15:57AM -0700, Charlie Jenkins wrote: > > > Some applications rely on placing data in free bits addresses allocated > > > by mmap. Va

Re: [PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-08 Thread Jiaxun Yang
在2024年9月5日九月 下午10:15,Charlie Jenkins写道: > Some applications rely on placing data in free bits addresses allocated > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > address returned by mmap to be less than the 48-bit address space, > unless the hint address uses more than

Re: [PATCH] [RFC] crash: Lock-free crash hotplug support reporting

2024-09-08 Thread Baoquan He
On 09/07/24 at 10:30am, Sourabh Jain wrote: > Hello Baoquan, > > Do you think this patch would help reduce lock contention when > CPU/Memory resources are removed in bulk from a system? .snip... -- > > include/linux/kexec.h | 11 --- > > kernel/crash_core.c | 27 +-

Re: [PATCH] [RFC] crash: Lock-free crash hotplug support reporting

2024-09-06 Thread Sourabh Jain
Hello Baoquan, Do you think this patch would help reduce lock contention when CPU/Memory resources are removed in bulk from a system? Thanks, Sourabh Jain On 23/08/24 17:22, Sourabh Jain wrote: On a CPU/Memory hotplug event, the kexec lock is taken to update the kdump image. At the same time

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Catalin Marinas
On Fri, Sep 06, 2024 at 09:55:42AM +, Arnd Bergmann wrote: > On Fri, Sep 6, 2024, at 09:14, Guo Ren wrote: > > On Fri, Sep 6, 2024 at 3:18 PM Arnd Bergmann wrote: > >> It's also unclear to me how we want this flag to interact with > >> the existing logic in arch_get_mmap_end(), which attempts

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Arnd Bergmann
On Fri, Sep 6, 2024, at 09:14, Guo Ren wrote: > On Fri, Sep 6, 2024 at 3:18 PM Arnd Bergmann wrote: >> >> It's also unclear to me how we want this flag to interact with >> the existing logic in arch_get_mmap_end(), which attempts to >> limit the default mapping to a 47-bit address space already. >

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Lorenzo Stoakes
(Sorry having issues with my IPv6 setup that duplicated the original email... On Fri, Sep 06, 2024 at 09:14:08AM GMT, Arnd Bergmann wrote: > On Fri, Sep 6, 2024, at 08:14, Lorenzo Stoakes wrote: > > On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote: > >> On Thu, Sep 5, 2024, at 21:15, Ch

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Guo Ren
On Fri, Sep 6, 2024 at 3:18 PM Arnd Bergmann wrote: > > On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote: > > Create a personality flag ADDR_LIMIT_47BIT to support applications > > that wish to transition from running in environments that support at > > most 47-bit VAs to environments that sup

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Arnd Bergmann
On Fri, Sep 6, 2024, at 08:14, Lorenzo Stoakes wrote: > On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote: >> On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote: >> > Create a personality flag ADDR_LIMIT_47BIT to support applications >> > that wish to transition from running in environm

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Lorenzo Stoakes
On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote: > On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote: > > Create a personality flag ADDR_LIMIT_47BIT to support applications > > that wish to transition from running in environments that support at > > most 47-bit VAs to environments th

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Lorenzo Stoakes
On Fri, Sep 06, 2024 at 07:17:44AM GMT, Arnd Bergmann wrote: > On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote: > > Create a personality flag ADDR_LIMIT_47BIT to support applications > > that wish to transition from running in environments that support at > > most 47-bit VAs to environments th

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Arnd Bergmann
On Thu, Sep 5, 2024, at 21:15, Charlie Jenkins wrote: > Create a personality flag ADDR_LIMIT_47BIT to support applications > that wish to transition from running in environments that support at > most 47-bit VAs to environments that support larger VAs. This > personality can be set to cause all all

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-05 Thread Michael Ellerman
Charlie Jenkins writes: > Create a personality flag ADDR_LIMIT_47BIT to support applications > that wish to transition from running in environments that support at > most 47-bit VAs to environments that support larger VAs. This > personality can be set to cause all allocations to be below the 47-b

Re: [PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread John Paul Adrian Glaubitz
Hi Charlie, On Thu, 2024-09-05 at 14:15 -0700, Charlie Jenkins wrote: > Some applications rely on placing data in free bits addresses allocated > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > address returned by mmap to be less than the 48-bit address space, > unless the

Re: [PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread Guo Ren
On Fri, Sep 6, 2024 at 5:16 AM Charlie Jenkins wrote: > > Some applications rely on placing data in free bits addresses allocated > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > address returned by mmap to be less than the 48-bit address space, > unless the hint address u

[PATCH RFC v3 2/2] selftests/mm: Create ADDR_LIMIT_47BIT test

2024-09-05 Thread Charlie Jenkins
Add a selftest for the ADDR_LIMIT_47BIT personality flag that mmaps until it runs out of space and ensures no addresses are allocated above 47 bits. Signed-off-by: Charlie Jenkins --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile|

[PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-05 Thread Charlie Jenkins
Create a personality flag ADDR_LIMIT_47BIT to support applications that wish to transition from running in environments that support at most 47-bit VAs to environments that support larger VAs. This personality can be set to cause all allocations to be below the 47-bit boundary. Using MAP_FIXED with

[PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread Charlie Jenkins
Some applications rely on placing data in free bits addresses allocated by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the address returned by mmap to be less than the 48-bit address space, unless the hint address uses more than 47 bits (the 48th bit is reserved for the kernel ad

  1   2   3   4   5   6   7   8   9   10   >