[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220912133935.3bb3e247@jacob-builder>
Date: Mon, 12 Sep 2022 13:39:35 -0700
From: Jacob Pan <jacob.jun.pan@...el.com>
To: Ashok Raj <ashok_raj@...ux.intel.com>
Cc: "Kirill A. Shutemov" <kirill@...temov.name>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
"Peter Zijlstra" <peterz@...radead.org>, <x86@...nel.org>,
Kostya Serebryany <kcc@...gle.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
Andrey Konovalov <andreyknvl@...il.com>,
Alexander Potapenko <glider@...gle.com>,
Taras Madan <tarasmadan@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
"H . J . Lu" <hjl.tools@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
Ashok Raj <ashok.raj@...el.com>, jacob.jun.pan@...el.com
Subject: Re: [PATCHv8 00/11] Linear Address Masking enabling
Hi Ashok,
On Fri, 9 Sep 2022 16:08:02 +0000, Ashok Raj <ashok_raj@...ux.intel.com>
wrote:
> > diff --git a/arch/x86/include/uapi/asm/prctl.h
> > b/arch/x86/include/uapi/asm/prctl.h index a31e27b95b19..e5c04ced36c9
> > 100644 --- a/arch/x86/include/uapi/asm/prctl.h
> > +++ b/arch/x86/include/uapi/asm/prctl.h
> > @@ -23,5 +23,6 @@
> > #define ARCH_GET_UNTAG_MASK 0x4001
> > #define ARCH_ENABLE_TAGGED_ADDR 0x4002
> > #define ARCH_GET_MAX_TAG_BITS 0x4003
> > +#define ARCH_ENABLE_TAGGED_ADDR_FORCED 0x4004
> >
> > #endif /* _ASM_X86_PRCTL_H */
> > diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
> > index 337f80a0862f..7d89a2fd1a55 100644
> > --- a/arch/x86/kernel/process_64.c
> > +++ b/arch/x86/kernel/process_64.c
> > @@ -774,7 +774,8 @@ static bool lam_u48_allowed(void)
> > #define LAM_U48_BITS 15
> > #define LAM_U57_BITS 6
> >
> > -static int prctl_enable_tagged_addr(struct mm_struct *mm, unsigned
> > long nr_bits) +static int prctl_enable_tagged_addr(struct mm_struct
> > *mm, unsigned long nr_bits,
> > + bool forced)
> > {
> > int ret = 0;
> >
> > @@ -793,6 +794,11 @@ static int prctl_enable_tagged_addr(struct
> > mm_struct *mm, unsigned long nr_bits) goto out;
> > }
> >
> > + if (pasid_valid(mm->pasid) && !forced) {
I don't think this works since we have lazy pasid free. for example,
after all the devices did sva_unbind, mm->pasid we'll remain valid until
mmdrop(). LAM should be supported in this case.
Perhaps, we could introduce another prctl flag for SVA, PR_GET_SVA?
Both iommu driver and LAM can set/query the flag. LAM applications may not
be the only ones want to know if share virtual addressing is on.
> > + ret = -EBUSY;
> > + goto out;
> > + }
> > +
Thanks,
Jacob
Powered by blists - more mailing lists