mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brendan Shanks <bshanks@codeweavers.com>
To: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>, X86 ML <x86@kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Andreas Rammhold <andi@notmuch.email>,
	"Moger, Babu" <Babu.Moger@amd.com>
Subject: Re: [PATCH v2] x86/umip: Add emulation/spoofing for SLDT and STR instructions
Date: Mon, 8 Jun 2020 15:36:18 -0700	[thread overview]
Message-ID: <5256D924-9BFE-47EF-9A3A-2B5FB7B79946@codeweavers.com> (raw)
In-Reply-To: <20200608215315.GB23567@ranerica-svr.sc.intel.com>


> On Jun 8, 2020, at 2:53 PM, Ricardo Neri <ricardo.neri-calderon@linux.intel.com> wrote:
> 
> On Mon, Jun 08, 2020 at 11:14:54AM -0700, Brendan Shanks wrote:
>> Add emulation/spoofing of SLDT and STR for both 32- and 64-bit
>> processes.
>> 
>> Wine users have found a small number of Windows apps using SLDT that
>> were crashing when run on UMIP-enabled systems.
>> 
>> Reported-by: Andreas Rammhold <andi@notmuch.email>
>> Originally-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
>> Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
>> ---
>> 
>> v2: Return (GDT_ENTRY_LDT * 8) for SLDT when an LDT is set.
>> 
>> arch/x86/kernel/umip.c | 34 +++++++++++++++++++++++++---------
>> 1 file changed, 25 insertions(+), 9 deletions(-)
>> 
>> diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c
>> index 8d5cbe1bbb3b..a85f0b0ec2b9 100644
>> --- a/arch/x86/kernel/umip.c
>> +++ b/arch/x86/kernel/umip.c
>> @@ -64,6 +64,8 @@
>> #define UMIP_DUMMY_GDT_BASE 0xfffffffffffe0000ULL
>> #define UMIP_DUMMY_IDT_BASE 0xffffffffffff0000ULL
>> 
>> +#define UMIP_DUMMY_TASK_REGISTER_SELECTOR 0x40
> 
> One more thing. How was this value selected? Would it be possible to use
> GDT_ENTRY_TSS*8? Linux already uses this value.

I used 0x40 because ‘sldt’ returned that value on every system I tested. GDT_ENTRY_TSS*8 also equals 0x40 (for 64-bit capable kernels), yes I can use that instead.


Thank you,

Brendan Shanks
CodeWeavers

      reply	other threads:[~2020-06-08 22:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 18:14 Brendan Shanks
2020-06-08 21:53 ` Ricardo Neri
2020-06-08 22:36   ` Brendan Shanks [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5256D924-9BFE-47EF-9A3A-2B5FB7B79946@codeweavers.com \
    --to=bshanks@codeweavers.com \
    --cc=Babu.Moger@amd.com \
    --cc=andi@notmuch.email \
    --cc=bp@alien8.de \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ricardo.neri-calderon@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®