[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN6PR1101MB21619BD3724574B79211F1FCA85E9@BN6PR1101MB2161.namprd11.prod.outlook.com>
Date: Sat, 8 Oct 2022 05:31:20 +0000
From: "Li, Xin3" <xin3.li@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"hpa@...or.com" <hpa@...or.com>
Subject: RE: [PATCH 6/6] x86/gsseg: use the LKGS instruction if available for
load_gs_index()
> Something like so perhaps?
>
> asm_inline volatile("1:\n"
> ALTERNATIVE("call asm_load_gs_index\n",
> LKGS_DI,
> X86_FEATURE_LKGS)
> _ASM_EXTABLE_TYPE_REG(1b, 1b,
> EX_TYPE_ZERO_REG, %k[sel])
> : ASM_CALL_CONSTRAINT
> : [sel] "D" (sel)
> : "memory", _ASM_AX);
>
>
> (completely untested, not even seen a compiler upclose)
It compiles (after adding "0x3e" to make it 5 bytes to match the size of "call asm_load_gs_index") and passes my fixup test, thanks!
Powered by blists - more mailing lists