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

Re: [PATCH 14/22] x86/domain_page: remove the fast paths when mfn is not in the directmap


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 11 Jan 2023 15:11:11 +0100
  • 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=samdL1jok7HXUArxo1y7qppuzAQBeGFzLeWWO6WNryw=; b=YeRUFxWIM8T3f8f898L0IfCTpTz0xbl1CKjrS8RJ0vWunLnsXXmFud4QM3dWMYRtSAkDAR1BSshenZI6fqxthVtDqkWLB25EwVAmlxnsAox6bR6uuzBNUZ3Af1Qjk+HAF861VNvybk80m9Sd1rxXdQqjXKcEyHKfOe1iIDtRuz6vFCph6gbWxaBklrM0nQojPS9oG3M5LcXvW75gt0sT9DqK0raYlLCiATcApufCFodgSUMWePax8IQwbfHcQr1/+OwhHeAYzMC2Ae5ouFQBufhhnrZOH3cN4nRR/16SS8S2e12hDHNJuRrzu1pbw079fp1ZddaNoYLUDJRyilydCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dpR0656fUdv6dGf4ZoB6GU9xbwXNK2jko6PvMOU43awudUlJYNAbAUhwBQp6JVcumw3vUrl/P3aOib8aMaXcKcT1sH+xcSQZiO+aggu+8dZtchBZ8FxUXoRcudvWC1YwYKaDqNKTRFI6pZA/hirXt0futXBfmuBsyLqvXwFQagiuhQ4cW17YDD237ZhyBIWfEzLPlyZGf9X93PvSAE8YUACm/ACcA36RMCSoyR2sAEmpCaA7ALIMmfW71FpEsx59aqz1xmvor1Cdy0V4amF8uXHEWXbZ0CUi968OIDnL8Tw6a4ssXP+9pEWM7IOFQTFbm3LHxLn8VD6hLor6lsXKpw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Hongyan Xia <hongyxia@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 11 Jan 2023 14:11:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.12.2022 12:48, Julien Grall wrote:
> From: Hongyan Xia <hongyxia@xxxxxxxxxx>
> 
> When mfn is not in direct map, never use mfn_to_virt for any mappings.
> 
> We replace mfn_x(mfn) <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) with
> arch_mfns_in_direct_map(mfn, 1) because these two are equivalent. The
> extra comparison in arch_mfns_in_direct_map() looks different but because
> DIRECTMAP_VIRT_END is always higher, it does not make any difference.
> 
> Lastly, domain_page_map_to_mfn() needs to gain to a special case for
> the PMAP.
> 
> Signed-off-by: Hongyan Xia <hongyxia@xxxxxxxxxx>
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

This looks plausible, but cannot really be fully judged upon before the
mapcache_current_vcpu() aspects pointed out earlier have been sorted.
As to using pmap - assuming you've done an audit and the number of
simultaneous mappings that can be in use can be proven to not exceed
the number of slots available, can you please say so in the description?
I have to admit though that I'm wary - this isn't a per-CPU number of
slots aiui, but a global one. But then you also have a BUG_ON() there
restricting the use to early boot. The reasoning for this is also
missing (and might address my concern).

Jan



 


Rackspace

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