[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/ept: fix shattering of special pages


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 29 Jun 2022 18:21:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y70GIlYFuOx1UrbqmbhtVGLcIpzH3WvBuudZ2aIuwc8=; b=VyHWOQpn98V8d5o5tsMPIeVVdOVHyrzENP5d7gY+OhMvyEY1x1MzCWvliJAXloo+wJD8cQVFCrs0AQgZTSq4Gw2R3i2YIakcNIBirorCpRqeJF9C6Y716A/mDLeQRdPx7Y/o0DgDBogid2lBVZFlJhRgfA3WE5Zbn5NqqE9td+KJ9IrSaRY0ZkBwhabEo/ADl+mN+8vQyOV9qujDffC08RjhJDPAo7/2mAxMYaByzXFTWfUjE93vr3rkOd3fi0E5UAggFz2B6XvpJf6RtK+HA3KN2OVLAh7nhOSvKwaTChc7C7K/yt3bC2OL+o0zR5H9ZgnelUCPQgPUpDHwtt9Z4g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mY3deMXYLasuNs3FGu6U9foTwKxncLfPIRPa4QOeHf2+cnbpFWLTWJk+sAtIYLyq9p/md4UngxSbQzeINDD4MaonvV1pMOA73KD3lmgQ3Zo2fqzmSJGGr5dxDQDVhOHTzjemyOsXvtJ8HoNbxE8kFZ1YZDcR4NUUoq7pmxRr/sHgYfskGvS9cnaIGub34h2P0sM6hrQYdqqjWT1oJuLoLdQ1D1HYOvOkxrfUGZSnL1lRPQSv+RDA97mfSOM2nHUGtpZjuQSokm91pUhXEMLxGS1jR+h1LtLFsv27DRhLumgWDK/5Jyix7UhafKIBs8Ss+ICFIzHwjqSkJcLFnA9zlA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 29 Jun 2022 16:21:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.06.2022 12:01, Roger Pau Monne wrote:
> The current logic in epte_get_entry_emt() will split any page marked
> as special with order greater than zero, without checking whether the
> super page is all special.
> 
> Fix this by only splitting the page only if it's not all marked as
> special, in order to prevent unneeded super page shuttering.
> 
> Fixes: ca24b2ffdb ('x86/hvm: set 'ipat' in EPT for special pages')
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
> Cc: Paul Durrant <paul@xxxxxxx>
> ---
> It would seem weird to me to have a super page entry in EPT with
> ranges marked as special and not the full page.  I guess it's better
> to be safe, but I don't see an scenario where we could end up in that
> situation.
> 
> I've been trying to find a clarification in the original patch
> submission about how it's possible to have such super page EPT entry,
> but haven't been able to find any justification.

I think the loop there was added "just in case", whereas in reality
it was only single special pages that would ever be mapped. So ...

> Might be nice to expand the commit message as to why it's possible to
> have such mixed super page entries that would need splitting.

... there may not be anything to add. I don't mind this being re-done,
hence
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Yet I'm not sure I understand what case this actually fixes (and
hence why you did add a Fixes: tag) - are there cases where non-
order-0 special pages are mapped in reality?

As to the Fixes: tag - I think we mean to follow Linux there and
hence want 12-digit hashes to be specified. See also
docs/process/sending-patches.pandoc. (But no need to resend just
for this.)

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.