[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200520010418.ippljxawcwrbp6o2@wrt>
Date: Wed, 20 May 2020 03:04:18 +0200
From: andi@...much.email
To: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc: Brendan Shanks <bshanks@...eweavers.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Babu Moger <Babu.Moger@....com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Jason Yan <yanaijie@...wei.com>, linux-kernel@...r.kernel.org
Subject: Re: umip: AMD Ryzen 3900X, pagefault after emulate SLDT/SIDT
instruction
On 12:43 19.05.20, Ricardo Neri wrote:
> > > Running the same executable on the exact same kernel (and userland) but
> > > on a Intel i7-8565U doesn't crash at this point. I am guessing the
> > > emulation is supposed to do something different on AMD CPUs?
>
> I am surprised you don't see it on the Intel processor. Maybe it does
> not have UMIP. Do you see umip when you do
>
> $ grep umip /proc/cpuinfo
Indeed it doesn't ahve the feature. I would have assumed that it is
recent enough. Apparently not.
> > > On the Ryzen the code executes successfully after setting CONFIG_X86_UMIP=n.
> >
> > Hi Andreas,
> >
> > The problem is that the kernel does not emulate/spoof the SLDT instruction, only SGDT, SIDT, and SMSW.
> > SLDT and STR weren't thought to be commonly used, so emulation/spoofing wasn’t added.
> > In the last few months I have seen reports of one or two (32-bit) Windows games that use SLDT though.
> > Can you share more information about the application you’re running?
> >
> > Maybe the best path is to add kernel emulation/spoofing for SLDT and STR on 32 and 64-bit, just to cover all the cases. It should be a pretty simple patch, I’ll start working on it.
>
> I have a patch for this already that I wrote for testing purposes:
>
> https://github.com/ricardon/tip/commit/1692889cb3f8accb523d44b682458e234b93be50
>
> Perhaps it can be used as a starting point? Not sure what the spoofing
> value should be, though. Perhaps 0?
I am not entirely sure what it should return in the general case. My
assumption is that 0 might work. Maybe making it configurable like with
the other UMIP constants that I saw?
I'll give the patch a shot and try to figure out what the authors of the
code have to say about it.
Powered by blists - more mailing lists