xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>
Subject: Re: [PATCH 1/2][4.15?] x86/shadow: suppress "fast fault path" optimization when running virtualized
Date: Mon, 8 Mar 2021 13:47:45 +0000	[thread overview]
Message-ID: <96c83adb-9e81-8398-c905-f4f0730ba240@citrix.com> (raw)
In-Reply-To: <YEXtnkYzNSXasTw1@deinos.phlegethon.org>

On 08/03/2021 09:25, Tim Deegan wrote:
> At 16:37 +0100 on 05 Mar (1614962224), Jan Beulich wrote:
>> We can't make correctness of our own behavior dependent upon a
>> hypervisor underneath us correctly telling us the true physical address
>> with hardware uses. Without knowing this, we can't be certain reserved
>> bit faults can actually be observed. Therefore, besides evaluating the
>> number of address bits when deciding whether to use the optimization,
>> also check whether we're running virtualized ourselves.
>>
>> Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Acked-by: Tim Deegan <tim@xen.org>
>
> I would consider this to be a bug in the underlying hypervisor, but I
> agree than in practice it won't be safe to rely on it being correct.

I'd argue against this being a hypervisor bug.  If anything, it is a
weakness in how x86 virtualisation works.

For booting on a single host, then yes - vMAXPHYSADDR really ought to be
the same as MAXPHYSADDR, and is what happens in the common case.

For booting in a heterogeneous pool, the only safe value is the min of
MAXPHYSADDR across the resource pool.  Anything higher, and the VM will
malfunction (get #PF[rsvd] for apparently-legal PTEs) on the smallest
pool member(s).

Address widths vary greatly between generations and SKUs, so blocking
migrate on a MAXPHYSADDR mismatch isn't a viable option.  VM migration
works in practice because native kernels don't tend to use reserved bit
optimisations in the first place.

The fault lies with Xen.  We're using a property of reserved bit
behaviour which was always going to change eventually, and can't be
levelled in common heterogeneous scenarios.

~Andrew



  parent reply	other threads:[~2021-03-08 13:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 15:36 [PATCH 0/2][4.15?] x86/shadow: further refinements to "fast fault path" suppression Jan Beulich
2021-03-05 15:37 ` [PATCH 1/2][4.15?] x86/shadow: suppress "fast fault path" optimization when running virtualized Jan Beulich
2021-03-05 15:47   ` Andrew Cooper
2021-03-05 16:32     ` Jan Beulich
2021-03-05 16:40     ` Ian Jackson
2021-03-05 16:47       ` Andrew Cooper
2021-03-05 16:58         ` Ian Jackson
2021-03-08  9:25   ` Tim Deegan
2021-03-08  9:40     ` Jan Beulich
2021-03-08 13:47     ` Andrew Cooper [this message]
2021-03-08 13:51       ` Jan Beulich
2021-03-08 13:59         ` Andrew Cooper
2021-03-08 14:29           ` Jan Beulich
2021-03-08 14:47             ` Andrew Cooper
2021-03-05 15:37 ` [PATCH 2/2][4.15?] x86/shadow: encode full GFN in magic MMIO entries Jan Beulich
2021-03-05 16:32   ` Andrew Cooper
2021-03-08 12:42     ` Jan Beulich
2021-03-08  9:39   ` Tim Deegan
2021-03-08 12:05     ` Jan Beulich

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=96c83adb-9e81-8398-c905-f4f0730ba240@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).