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

Re: [PATCH v2 3/5] x86: don't override INVALID_M2P_ENTRY with SHARED_M2P_ENTRY


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 24 Aug 2020 14:00:51 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 24 Aug 2020 13:01:15 +0000
  • Ironport-sdr: 5ErYUjvnpShH7GHecBO+Rxk80uGHU+smAC9d+tCeda8Yz/bzX4ZunTx9YkAgtC71UJjq0upii3 fd18zwdeHvnlVBNiNaeU8DNDZe/l8HTQHx0FVzu1Y71dGEGbQe3xBCt4pwoszjwRRTzQiGrQqa F/Iq/joLRi9HiJ9F4ozFtgqikRz0+C1zY/gRIDG8ussVlMOXwhciBWfqjuATX0Prsc6P7UtdKx G3iVwewGOnYQWJSNnwQu8xZKnMNDYLAK9hKe4tvRTihSiRDa/CihCJoG9qpVqW4Klb+9555zNT RGQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/08/2020 13:34, Jan Beulich wrote:
> While in most cases code ahead of the invocation of set_gpfn_from_mfn()
> deals with shared pages, at least in set_typed_p2m_entry() I can't spot
> such handling (it's entirely possible there's code missing there). Let's
> try to play safe and add an extra check.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

I agree that this is an improvement.

Therefore, tentatively Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

However, I don't think it is legitimate for set_gpfn_from_mfn() to be
overriding anything.

IMO, we should be asserting something like (pfn == SHARED_M2P_ENTRY) ==
(d == dom_cow).

Any code not passing this properly is almost certainly broken anyway,
and fixing up behind its back like this doesn't feel like a clever idea
(in debug builds at least).

~Andrew



 


Rackspace

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