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

Re: [PATCH] x86/mm: account for PGT_pae_xen_l2 in recently added assertion


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 10 Jun 2022 10:17:33 +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=UWs5CcmZE/ScatItp1kjPlVfsqlRjmbQZrNRltuxlfY=; b=hph0N8V5Ulk0EwcNsH5boRws3lljvm1uikCWhbhcKxCdBLbd2iJiMXG/JKacQDI15w3RA8nxUu2WVtQioesEipv2QbzcSeJlmxCGsQS2btP3qC9Bks5kAxDLmm/iHh2iQLsMcxvdLzCqfzqDPh9DWvYMPXte31Hb9RuMGA7P6yINl/myV5XfvWOKOohdJHmopcZeR0jTyrEbqnml1v3ozGFQ7jJA8dRXe77bLxuVh0Vqi4uAnksEGkU9EApGZS3oqNYqryMjgxP2bx4/pSHqbEMDBCwXER+5UEqQ9s/wtKH1OoukCJkt3O+vVytiMVHh/2WhTlr4EC/msnI0/TtxGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7pYIyrGUSBe2WS/TwnhAp5z/nX/BP+YNvTM28mtaYCYLnl6SjiwtfIqEeCX1WIFt9pA1azXFm+xhsvbVyOw3xD2coLaf9rZuqkiGNH9BPtKJKLVi4KE8E4NvnEMiWnnAJeQt4wQTCZa+CoqA17mj0b53PaPTEMtUz872g3RQzGVXU+hHYZDOWIYqEVd2DcH5tPZyGRCKZ5Efjz1Y80+iNpOAvh5NUZBCovWAT2bBvUpZW4WI99yKwfFrBujSHJkoBJs7ny3sqpTEihIKm6G92MuavItcu4NtsXMFdISQzezq8xKsZ/vX1M/IkafUKzkGFuNjlIJlJYOfWQ3VN5yJA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 10 Jun 2022 08:17:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.06.2022 10:12, Andrew Cooper wrote:
> On 10/06/2022 08:26, Jan Beulich wrote:
>> While PGT_pae_xen_l2 will be zapped once the type refcount of an L2 page
>> reaches zero, it'll be retained as long as the type refcount is non-
>> zero. Hence any checking against the requested type needs to either zap
>> the bit from the type or include it in the used mask.
>>
>> Fixes: 9186e96b199e ("x86/pv: Clean up _get_page_type()")
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> pae_xen_l2 being outside of the typemask is deeply confusing to work
> with.  It also renders all of the comments trying to explain the
> structure of this logic wrong.
> 
> I'm a little concerned with type usage in the non-coherent path too. 
> It's safe, but is (along side the IOMMU path) a misleading example to
> surrounding code.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks.

> I can't think of anything better to do in the short term.
> 
>> ---
>> The check around the TLB flush which was moved for XSA-401 also looks to
>> needlessly trigger a flush when "type" has the bit set (while "x"
>> wouldn't). That's no different from original behavior, but still looks
>> inefficient.
> 
> It's not the only inefficiency here.  Still plenty of improvements to be
> had in _get_page_type().

You did say you have some follow-up changes pending. It wasn't clear to
me whether this particular aspect was among them. If not, I can make
a(nother) patch ...

Jan



 


Rackspace

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