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

[PATCH 11/11] x86/shadow: sh_remove_all_mappings() is HVM-only


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 5 Jan 2023 17:07:44 +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=rkzMWSo4VP4iVpCTjNCVb8H5HyGWrBz+Rgr5MlOxOXI=; b=idd6L6FpiU/2DvabEp8/JucIpXyj+UvQJxZXHrqG/WXbSXT9xPtk7rEb5jzkr195Ly6+1lr8bFzLvTCI1VZ69bb5UHy79RAf183moAqy81GH80ZoDksquItCilhSiaff6AJva41BfQC02vmNgHcgXgTnQs/Ix6YXRAZMblcLBc7ttkVfjOxq2nows5tv38cD0Cd8xbn+yoTjFimuTr2h4ox/Ai35saWHLWVawU9qIG1JQh66TeQNMFtZmW5QebKq8kwJrexAAmq7997yp+Tc9sGIWDyfJGuo3/WhuDRlw2JvHw7F18Y3klQU7YfAZygcEe6sOj5PSwXVAn30LnXNtw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mkvHJGOSyTC+uh7KK9yKtwXtD4wBCxEwOJlMnqQSu0uq0g5kEhJP33TmxQx5ZLAnAeh6eKMBP8hBcNSTnA/eZVd/yyV3iemh/pZwK6bnI2twKpzn7b32ohBawSvYYc4UnmfWnUz27Nzz2BDbcL8G2jDbJaJsJQuPb12RU65DEoGBTi9/CfUPELl7bwhceZIxHT9fU27AE5/kA35CjnzJck9pIgGo3oeYYH54JXjMoweMBO0dHVZ2EFzrWU8fMFJlV44FgMt2Rrbu3UCpLjHjdf0xqXiAY5qraRKvwzLyhOFQzmLKAJWlanwHq4l3qg+nTh72XW5Fall2qvwOn3q7ZA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
  • Delivery-date: Thu, 05 Jan 2023 16:07:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

All callers live in hvm.c. Moving the function there is undesirable, as
hash walking is local to common.c and probably better remains so. Hence
move an #endif, allowing to drop an #ifdef.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1992,7 +1992,6 @@ int sh_remove_write_access(struct domain
     /* We killed at least one writeable mapping, so must flush TLBs. */
     return 1;
 }
-#endif /* CONFIG_HVM */
 
 /**************************************************************************/
 /* Remove all mappings of a guest frame from the shadow tables.
@@ -2004,12 +2003,10 @@ int sh_remove_all_mappings(struct domain
 
     /* Dispatch table for getting per-type functions */
     static const hash_callback_t callbacks[SH_type_unused] = {
-#ifdef CONFIG_HVM
         [SH_type_l1_32_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 
2),
         [SH_type_fl1_32_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 
2),
         [SH_type_l1_pae_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 
3),
         [SH_type_fl1_pae_shadow] = 
SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 3),
-#endif
         [SH_type_l1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 
4),
         [SH_type_fl1_64_shadow] = SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, 
4),
     };
@@ -2064,6 +2061,7 @@ int sh_remove_all_mappings(struct domain
     return 1;
 }
 
+#endif /* CONFIG_HVM */
 
 /**************************************************************************/
 /* Remove all shadows of a guest frame from the shadow tables */




 


Rackspace

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