[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMe9rOq_WT-dxS3xthGtagn=aHruHyUJDR_=RDvMi9vX5PCmnA@mail.gmail.com>
Date: Fri, 17 Jun 2022 07:22:57 -0700
From: "H.J. Lu" <hjl.tools@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"Lutomirski, Andy" <luto@...nel.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"kcc@...gle.com" <kcc@...gle.com>,
"andreyknvl@...il.com" <andreyknvl@...il.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"dvyukov@...gle.com" <dvyukov@...gle.com>,
"x86@...nel.org" <x86@...nel.org>,
"ryabinin.a.a@...il.com" <ryabinin.a.a@...il.com>,
"glider@...gle.com" <glider@...gle.com>
Subject: Re: [PATCHv3 5/8] x86/uaccess: Provide untagged_addr() and remove
tags before address check
On Fri, Jun 17, 2022 at 4:36 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Thu, Jun 16, 2022 at 07:44:40PM +0300, Kirill A. Shutemov wrote:
> > Any objection against this variant (was posted in the thread):
> >
> > #define untagged_addr(mm, addr) ({ \
> > u64 __addr = (__force u64)(addr); \
> > s64 sign = (s64)__addr >> 63; \
> > __addr &= (mm)->context.untag_mask | sign; \
> > (__force __typeof__(addr))__addr; \
> > })
> >
> > ?
>
> Yeah, I suppose that should work fine.
Won't the sign bit be put at the wrong place?
--
H.J.
Powered by blists - more mailing lists