linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Rammhold <andi@notmuch.email>
To: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Brendan Shanks <bshanks@codeweavers.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Babu Moger <Babu.Moger@amd.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Jason Yan <yanaijie@huawei.com>,
	linux-kernel@vger.kernel.org
Subject: Re: umip: AMD Ryzen 3900X, pagefault after emulate SLDT/SIDT instruction
Date: Thu, 28 May 2020 13:36:00 +0200	[thread overview]
Message-ID: <20200528113600.napo64uaxxexlgxj@wrt> (raw)
In-Reply-To: <20200526133318.GA3796@ranerica-svr.sc.intel.com>

On 06:33 26.05.20, Ricardo Neri wrote:
> On Sat, May 23, 2020 at 04:17:39AM +0200, Andreas Rammhold wrote:
> > On 12:43 19.05.20, Ricardo Neri wrote:
> > > 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 tried the above patch (in modified/rebased version; hope that didn't
> > kill it [0]). The results are negative, as without the patch.
> 
> Ah. My patch above is based on a rather old kernel. There is a check in
> fixup_umip_exception() for SLDT and STR. I think this causes the
> exception you see. Perhaps you can try by removing such check:
> 
> diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c
> @@ -383,10 +389,6 @@ bool fixup_umip_exception(struct pt_regs *regs)
>  	umip_pr_warn(regs, "%s instruction cannot be used by applications.\n",
>  			umip_insns[umip_inst]);
> 
> -	/* Do not emulate (spoof) SLDT or STR. */
> -	if (umip_inst == UMIP_INST_STR || umip_inst == UMIP_INST_SLDT)
> -		return false;
> -
> 	umip_pr_warn(regs, "For now, expensive software emulation returns the result.\n");
> 
> 	if (emulate_umip_insn(&insn, umip_inst, dummy_data, &dummy_data_size,
> 
> You would still need my old patch.

Thanks, that works for my application.

Regards,

Andi

  reply	other threads:[~2020-05-28 11:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 14:38 umip: AMD Ryzen 3900X, pagefault after emulate SLDT/SIDT instruction Andreas Rammhold
2020-05-19 18:56 ` Brendan Shanks
2020-05-19 19:43   ` Ricardo Neri
2020-05-20  0:54     ` Andy Lutomirski
2020-05-21  0:56       ` Ricardo Neri
2020-05-21  1:16         ` Andy Lutomirski
2020-05-20  1:04     ` andi
2020-05-23  2:17     ` Andreas Rammhold
2020-05-26 13:33       ` Ricardo Neri
2020-05-28 11:36         ` Andreas Rammhold [this message]
2020-05-20  1:08   ` andi
2020-05-23  2:21   ` andi
2020-05-20  0:17 ` H. Peter Anvin

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=20200528113600.napo64uaxxexlgxj@wrt \
    --to=andi@notmuch.email \
    --cc=Babu.Moger@amd.com \
    --cc=bp@alien8.de \
    --cc=bshanks@codeweavers.com \
    --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=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=wangkefeng.wang@huawei.com \
    --cc=x86@kernel.org \
    --cc=yanaijie@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).