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

Re: [PATCH 1/5] x86/p2m: paging_write_p2m_entry() is a private function


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 10 Nov 2020 11:27:31 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=6aSv34bPjibLtGTL3U+lwCgf+nz8m/0NbKVn4O3bRa4=; b=h+z8EjG7ck1t0bg55XIFKFEO8zi4jiQJH78Z+l1QR+uDqj0n9KvWxIKorNu73VJvylCdVMwJlh+uJpzypG4U3e8n2lLZyhvuG+ecBg1ILX38AOYs72Hk1Di3QRrSkQzsymK2dox4oGjmL1FvhqtRkXro5TrvrUhGqKCBEdVzB5bXfYoQK4IvGVq8e8wlOyrTOJeIZ/rCu0aWyy/xnvhV3mDBFzx+31c/6AEMBv1OQIje3xFc2bgV+aRO2qhgwGsUQip7LBadN7RjPuIfSXwUMXOnwa/fpJzENA9Vr4Duiq2lE2ofj3/uJFWDBBJVLtgB2l8K/0GqGnw1IcOKCmSfsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZe74/IWbP75wB4tRvOJfPn5kkRfNOVLiOmCz/KNHaD1Uim1+ApXXtt+k4pKQM2891GRbihqiqivO8cOt8xCmcDCiL/eWyPKx4t5xhenbXL7s286K2Bc1SEWDOPn2aZkwgmGwPbZthDAK4vuqQIhnrO67epRjKJW6qCbBa0TXgjyyG9D6w6V/6SryJJK5AXPGiObfqan7MWNUwTHIzH0fb6YL6FH2lShbTiEpW189s5ATZlrwJuC00m+DwKPVmZnhU8VXzKVzWemQ7o+9joTXFNmWKSBvT54oyRfvzClyODZ5NZQ4TeRel3dy7FS0CYZix1GmaGsDNkO8UZmjTIEnw==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>
  • Delivery-date: Tue, 10 Nov 2020 10:27:44 +0000
  • Ironport-sdr: 9CMnBvkB3nS5SERjSiZiM/b1Q1wAAYQivzCwHPaD/ilZJ/TtFY29cufTfBN5xzDNNANptJzSNx VQ90qYdgQCa0IB/wtFjusewtM/857eeJyu+iIiqOUA4zbq7N5ps0V+TsZzNc9NgNamsHXkW5ao lyg0ngomqVwY4Lk7l6HLo06WbYUcHcITgfORCwRW7Ts6wkqGfceS48etpJ4ir/EJrCcFvIvAHt xn4FQsWuGnSgjA3gAT1TXcTdvrHGB0RwmYm+DXIJApAcpHBZeUVK2JVesalstygTHhVQr7/RtZ 9S8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Oct 28, 2020 at 10:22:04AM +0100, Jan Beulich wrote:
> As it gets installed by p2m_pt_init(), it doesn't need to live in
> paging.c. The function working in terms of l1_pgentry_t even further
> indicates its non-paging-generic nature. Move it and drop its
> paging_ prefix, not adding any new one now that it's static.
> 
> This then also makes more obvious that in the EPT case we wouldn't
> risk mistakenly calling through the NULL hook pointer.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> 
> --- a/xen/arch/x86/mm/p2m-pt.c
> +++ b/xen/arch/x86/mm/p2m-pt.c
> @@ -108,6 +108,31 @@ static unsigned long p2m_type_to_flags(c
>      }
>  }
>  
> +/*
> + * Atomically write a P2M entry and update the paging-assistance state
> + * appropriately.
> + * Arguments: the domain in question, the GFN whose mapping is being updated,
> + * a pointer to the entry to be written, the MFN in which the entry resides,
> + * the new contents of the entry, and the level in the p2m tree at which
> + * we are writing.
> + */
> +static int write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
> +                           l1_pgentry_t *p, l1_pgentry_t new,
> +                           unsigned int level)
> +{
> +    struct domain *d = p2m->domain;
> +    struct vcpu *v = current;

I think you could constify both?

Thanks, Roger.



 


Rackspace

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