From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: speck@linutronix.de
Subject: [MODERATED] Re: [patch 04/11] [PATCH v2 04/10] Linux Patch #4
Date: Fri, 20 Apr 2018 13:17:36 -0400 [thread overview]
Message-ID: <20180420171730.GA5333@localhost.localdomain> (raw)
In-Reply-To: <20180420170331.GL13977@pd.tnic>
On Fri, Apr 20, 2018 at 07:03:31PM +0200, speck for Borislav Petkov wrote:
> On Fri, Apr 20, 2018 at 12:39:40PM -0400, speck for Konrad Rzeszutek Wilk wrote:
> > Wouldn't we leak our MD state to the guest? That is the guest
> > may have cleared everything (svm->spec_ctrl is zero when we VMEXIT),
> > and now we would be running it with MD bit set?
>
> No, you pass the requested bits:
>
> x86_enable_ibrs(svm->spec_ctrl);
I was thinking of the conditional:
if (svm->spec_ctrl) <=== HERE
x86_enable_ibrs(svm->spec_ctrl);
Which meant that if the guest had set SPEC_CTRL to zero we would
never enter the x86_enable_ibrs function at all and VMENTER in the
guest with SPEC_CTRL MDD bit enabled (as we never restored
the guest SPEC_CTRL which is zero). Aka, leaking our state in it.
Hence thinking to ditch the conditional at all and just have those
two accessory functions.
>
> and that function then picks apart which bits the host supports and sets
> them accordingly and filters out the reserved bits. You might call the
> function then:
>
> x86_set_spec_ctrl();
>
> and its counterpart
>
> x86_restore_spec_ctrl();
Right. I am going to assume it would have an 'u64' as parameter.
>
> or whatever. The restore side would simply clear the IBRS bit as we
> don't enable it on the host. It will restore the MD setting for the host
> too.
>
> --
> Regards/Gruss,
> Boris.
>
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
> --
next prev parent reply other threads:[~2018-04-20 17:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-20 2:25 [MODERATED] [patch 04/11] [PATCH v2 04/10] Linux Patch #4 konrad.wilk
2018-04-20 16:15 ` [MODERATED] " Borislav Petkov
2018-04-20 16:39 ` Konrad Rzeszutek Wilk
2018-04-20 17:03 ` Borislav Petkov
2018-04-20 17:17 ` Konrad Rzeszutek Wilk [this message]
2018-04-22 5:57 ` Jon Masters
2018-04-20 17:06 ` Jon Masters
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=20180420171730.GA5333@localhost.localdomain \
--to=konrad.wilk@oracle.com \
--cc=speck@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.