From patchwork Wed Jan 11 13:53:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13096703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D365C5479D for ; Wed, 11 Jan 2023 13:53:44 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.475344.737008 (Exim 4.92) (envelope-from ) id 1pFbXr-0005IV-6M; Wed, 11 Jan 2023 13:53:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 475344.737008; Wed, 11 Jan 2023 13:53:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFbXr-0005II-2H; Wed, 11 Jan 2023 13:53:35 +0000 Received: by outflank-mailman (input) for mailman id 475344; Wed, 11 Jan 2023 13:53:33 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFbXp-00047w-ET for xen-devel@lists.xenproject.org; Wed, 11 Jan 2023 13:53:33 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2048.outbound.protection.outlook.com [40.107.13.48]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 55891915-91b7-11ed-91b6-6bf2151ebd3b; Wed, 11 Jan 2023 14:53:32 +0100 (CET) Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by DU2PR04MB8551.eurprd04.prod.outlook.com (2603:10a6:10:2d6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 13:53:30 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2991:58a4:e308:4389]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2991:58a4:e308:4389%7]) with mapi id 15.20.6002.012; Wed, 11 Jan 2023 13:53:30 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 55891915-91b7-11ed-91b6-6bf2151ebd3b ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=URIUJvBUnhD4gku6qib2sVtrZYoKIBmoNUghFiwwgyeCoScB/mUwsrbzK8K5W4tyzqxwCr7zhRYfIpyZ8wMjLAjydK0/g42FepxwPItjpLnwUxtlHE5B8zWKCQSe1rl+StcCTQ2ryrmWj4K1nibMoXRGtdXpcRhlFYWvjSntKPo0gr/iFVEjLXj6o0XCP2NYW7o1YF+LhZ3DIc7wdbvBHCtMygtMAUo0bLZB9kmYbhCrLqpW65Tjigt6uQny5XOLok3DNLR3aCscbI8T/ylM5XWRxjMwbuotsWwjcR9Mqs41iCKajdhRCaelFc96sKMnDHZjTqa89u+iEyh6y332zw== 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=zfV7FH4PlbLPIPiG+PzMORtLnBIDSYzDeJCNwEUQtis=; b=Ow+4oszuWC7+szzZOqmusakF1TkHARoostoEZWy7tldhwsEl6s3oM/wYm8fxzaUljzfMcDTC3MsJuoFlmbvzWUeRpmfdB/k+w51kAf4CsAWCi7WkjYzpMPAImpqx8hNwm9Qr5odM7Y5vv7TGUVqeeY/ULR/wKW5aN8god6ck7GQv46oeqzlVP+QUbooE1XVIhAbkm4GsJMbcnoUABlJtUGzxP+oXcBS6La2nlT3DMbrX6oFQuM4OynXvqO5t9az6MlVcL6yX0NXI1CVBNn0+5VGB7C41FNcBaUvP40rMlz+C2YSQebaW3saoDDuVZ2FQ/xJzDUokzqlqNIW551Dgag== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zfV7FH4PlbLPIPiG+PzMORtLnBIDSYzDeJCNwEUQtis=; b=bIS/MneUtTtRjQmNLzGJJdMBFWtz09BScvbX22KDROsyUmACdCZLYqsDabtUbLqaXt1rZlVpwtbXq0OK5TOzEyHLI0dfwpngM6eMsWqQQeAyk0YgGIniXBikGDzPDr7UfTFPdLml9TovrdhahCyBhx3IC+NZMhBNErmIg/GXxux1axKJJYJFd1EP3IreZc+CWZ1SauoCHQ/RiWl7VORU/JyQAzH0cEQVdoFV6ZvXhNO6lrJP5vEp3JX71aRPxiHcP5Q+zHpjs005pyMK3uOLfYnkOgiPcLpmDExMsIBZ/VL3L/zffCyt+fURzlqkIfsxoW2Ripa7FmJqw3p4BvKC4g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Wed, 11 Jan 2023 14:53:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: [PATCH v2 3/9] x86/shadow: rename hash_domain_foreach() Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Tim Deegan , George Dunlap References: In-Reply-To: X-ClientProxiedBy: FR2P281CA0181.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9f::17) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|DU2PR04MB8551:EE_ X-MS-Office365-Filtering-Correlation-Id: c4b00fea-09ab-4c99-1dbb-08daf3db38fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yBVUELvVhxkKF3Wuker5LK7J1dyVEsyW9Q4c9eq63mJ2ZH1TnGw4BFsN1AVle+6wVMvk7SGA19QkRtSD2Sv0//rRMDp7P5BAirODYFkmyebvRJ/kbuRTkU9OXNhog7Bbmm3EC3oMjPRvL8I0J/shA2AcOoSt5HLdqY55x2IZTMlX/Bll6TBCEg+6WyWx7VHs5dR9HBDWLRQtviiUYoXYmXqxGVLhZrYC6Ex7x8gTYEXcWUh/7iI+s+LIkARol2eDFvrMZr0dkSEMUtLqMFoSiq4W4rKwm3tQaTxyi649bQOQO1WiAkKhPisQxCsTLCcfgWb8hiwC0H1s/MaRZkMWvAhOPuU7Xg0wCbs8wi7HiIpbWSEy9TAteJzhDcRz3G1cgjMounCr5GEW5Z3RajbpA8bIHRSJvPmI13QorIopYNiOii0oDSkInNAZ1B3OAnPpyGbTW0BBTcweogFkkhQv8x16Gu2sHVXWkCju70XkvdRKcxVEoiP6XOok876JTkwiPt7OESPuQUCb3LJ0ewXDvrBU8a+EFQveFIfwbIB3Fo9coxUeupWWYdhv3qWYOuax6xmrzk8TLPWymSZex0S/APoN9nGBrTPz54J8wjtPu+zeT6nwKrVrk7KODxnwk0zPeVW8aXEr7VNWL3FDiQedMJdmpU2zcvSMVHsLhvlqpNWxBF9rGJf/onHqtLlpFG5FW6W9m7kax+tyKjMuF2O6DB5ythyxloNmrkn1Esr9cbs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(39860400002)(366004)(376002)(136003)(396003)(451199015)(8936002)(2906002)(5660300002)(41300700001)(316002)(4326008)(66556008)(8676002)(6916009)(66476007)(66946007)(54906003)(26005)(6512007)(38100700002)(2616005)(31686004)(86362001)(186003)(31696002)(83380400001)(36756003)(6506007)(478600001)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Guhg3kXnmv05cKyxXUyrtmMjyRnf?= =?utf-8?q?Yy/UIWO7A1l7tLqQo9F7MWmBxDHOmxjIIPMs2RFpuEqPQ7JkWOzljcqhFTdRHxT0T?= =?utf-8?q?X/PWstXcEOQM1t3FX1er6PnSU/KloUKyIKiIBdq8N/DWRMzDkqF0hINnrqVTpgCfv?= =?utf-8?q?CjOs+cf3x95F9+4lQTDn1tCdzgI+gK9EF4Z6mAwRrqJHtr+zLMg7xZ3FqUakJ523G?= =?utf-8?q?OaOXIF19gJxnjuYlpYlUhkk82aLoAj3Qz+f6UYBTKnSe6GF4c6xVj4ufBWTNq11eq?= =?utf-8?q?m52+GzCrRG0XKkNip/GVLBGXQKcRWzA2Mb52RuoukNzAu4aFi680jf1UDO5ei/YDc?= =?utf-8?q?ANiY7qalZSLpFjKXOOEYDBjwQnPdubk9Zr77kGfKkVwzngiyW4ybHxA9hcp5b7oR4?= =?utf-8?q?1/saatrcY9MDTZkGE2mZPWYg68r/soKy0sbrudzq9znw7LkdVZYBZcs1K+C9iqOYd?= =?utf-8?q?pNyrjPkm2TAqJ64tbqhobeFeqoY86z45FNhyrKqvJs8Uwn2Du5JqqqvlMZJhJxVUP?= =?utf-8?q?/d9CumUZM5XbK73J7cu8YLDJkGPltfJfZk449HEhyKNzUG7zWHRouGm8AE2o0uJQl?= =?utf-8?q?17AOMj7lFAAI+D1XIVM3RxSc1+djVskt5yQhGdvFW4aeIM3iI0dCdCFgwAMX989in?= =?utf-8?q?p/ylR/t5O9Qjr3lofsSCrQ1B0kMIGYfsuTCHb1bWhXMXisPP2s8dBiK41w69FWQOM?= =?utf-8?q?qgf4qh5Gvlv/QjPNDK0GtT4OEqkQOgXMTB45/opDd7ximdCKHdPn7T6kOUz2qNaDP?= =?utf-8?q?AckohlZt5rCfHGWf9DPhsMj43msKLql92X9od4X3f8eGv3s0tuyPa7KQP0NKq3NLb?= =?utf-8?q?vsypzTA2WzX83L01FKW5befZUizwrBFtA4PVeSzNADICPW3F2QHWQOCBE9/6uPbjU?= =?utf-8?q?i0pUaRXlLAQJh6F+sY2dNXuaDsFuGtsooQtLot0g/6B1pmipVXjPR/OJ80AvmttGt?= =?utf-8?q?mc3Vjbfhl433XApaEn6R4gdCnAH8qSKyUkCEwgH6ArkmrPPBbv+Koco29LmqPx3l4?= =?utf-8?q?7o7yYqL3ECoEt36nci8sPosc76FEFYI5W2Use0MuoX7vQJs2VVy5LllmW95E9eSms?= =?utf-8?q?XghVdmYac1hCueUlFsBfXYyGXaV/5qAFJ1wzwQvTbbvJ88+XSLzJpI0aAAsupslUs?= =?utf-8?q?13YuUHHN+/jlPMTCyl5hUYB5XKKflVq7p/Huhio2byiAsEBJRQdXhqNT8erlqWFOt?= =?utf-8?q?pamsmUdp0HcqHjR4nX4uPiAtgqbxwSZELFa/vWPsHlRto8OgcGBvSMoRpkBwkXgVK?= =?utf-8?q?PD2hXtujpWp1BfYDaQ1WL2ahspfuJFewkaXARCzt0bgYKwCsLLmo9lBltealEz5co?= =?utf-8?q?2SQJFFRCNmJVYYiExPyTvUlHidVnnQjwyAg56clmanxmf8icx9zNGZCxX3mrceoDq?= =?utf-8?q?h3nAyvBKTemqcs6p63kForfOIFHKjhwOLyeG1ccyiY5zGMfHvyqf7lPM2iUqtv8Fh?= =?utf-8?q?0PaUdVzv10Ss7IeJbDOvFg6jV2Tl8iXGb0Tc1HoYPCWwCgcK/rOn0jl1o2m0kv+2T?= =?utf-8?q?pFP5dz5Yx7CQ?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4b00fea-09ab-4c99-1dbb-08daf3db38fc X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 13:53:30.6874 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2tjwHUZPplVPns/+4HE8dfFY4HNDs2WIGua3tH8rxVltNrEzsV+Q6b/lnKvCSeZ2tvlqx2kXoT2cSzZs5DH/eQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8551 The "domain" in there has become meaningless; drop it. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -1640,15 +1640,15 @@ bool shadow_hash_delete(struct domain *d return true; } -typedef int (*hash_domain_callback_t)(struct domain *d, mfn_t smfn, mfn_t other_mfn); +typedef int (*hash_callback_t)(struct domain *d, mfn_t smfn, mfn_t other_mfn); #define HASH_CALLBACKS_CHECK(mask) \ BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1) -static void hash_domain_foreach(struct domain *d, - unsigned int callback_mask, - const hash_domain_callback_t callbacks[], - mfn_t callback_mfn) +static void hash_foreach(struct domain *d, + unsigned int callback_mask, + const hash_callback_t callbacks[], + mfn_t callback_mfn) /* Walk the hash table looking at the types of the entries and * calling the appropriate callback function for each entry. * The mask determines which shadow types we call back for, and the array @@ -1784,7 +1784,7 @@ int sh_remove_write_access(struct domain unsigned long fault_addr) { /* Dispatch table for getting per-type functions */ - static const hash_domain_callback_t callbacks[SH_type_unused] = { + static const hash_callback_t callbacks[SH_type_unused] = { #ifdef CONFIG_HVM [SH_type_l1_32_shadow] = SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 2), [SH_type_fl1_32_shadow] = SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, 2), @@ -1969,7 +1969,7 @@ int sh_remove_write_access(struct domain else perfc_incr(shadow_writeable_bf); HASH_CALLBACKS_CHECK(SHF_L1_ANY | SHF_FL1_ANY); - hash_domain_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn); + hash_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn); /* If that didn't catch the mapping, then there's some non-pagetable * mapping -- ioreq page, grant mapping, &c. */ @@ -1997,7 +1997,7 @@ int sh_remove_all_mappings(struct domain struct page_info *page = mfn_to_page(gmfn); /* Dispatch table for getting per-type functions */ - static const hash_domain_callback_t callbacks[SH_type_unused] = { + static const hash_callback_t callbacks[SH_type_unused] = { [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), @@ -2021,7 +2021,7 @@ int sh_remove_all_mappings(struct domain /* Brute-force search of all the shadows, by walking the hash */ perfc_incr(shadow_mappings_bf); HASH_CALLBACKS_CHECK(SHF_L1_ANY | SHF_FL1_ANY); - hash_domain_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn); + hash_foreach(d, SHF_L1_ANY | SHF_FL1_ANY, callbacks, gmfn); /* If that didn't catch the mapping, something is very wrong */ if ( !sh_check_page_has_no_refs(page) ) @@ -2128,7 +2128,7 @@ void sh_remove_shadows(struct domain *d, /* Dispatch table for getting per-type functions: each level must * be called with the function to remove a lower-level shadow. */ - static const hash_domain_callback_t callbacks[SH_type_unused] = { + static const hash_callback_t callbacks[SH_type_unused] = { #ifdef CONFIG_HVM [SH_type_l2_32_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 2), [SH_type_l2_pae_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 3), @@ -2173,9 +2173,9 @@ void sh_remove_shadows(struct domain *d, /* * Lower-level shadows need to be excised from upper-level shadows. This - * call to hash_domain_foreach() looks dangerous but is in fact OK: each - * call will remove at most one shadow, and terminate immediately when - * it does remove it, so we never walk the hash after doing a deletion. + * call to hash_foreach() looks dangerous but is in fact OK: each call + * will remove at most one shadow, and terminate immediately when it does + * remove it, so we never walk the hash after doing a deletion. */ #define DO_UNSHADOW(_type) do { \ t = (_type); \ @@ -2199,7 +2199,7 @@ void sh_remove_shadows(struct domain *d, (pg->shadow_flags & (1 << t)) ) \ { \ HASH_CALLBACKS_CHECK(SHF_page_type_mask); \ - hash_domain_foreach(d, masks[t], callbacks, smfn); \ + hash_foreach(d, masks[t], callbacks, smfn); \ } \ } while (0) @@ -3163,7 +3163,7 @@ int shadow_domctl(struct domain *d, void shadow_audit_tables(struct vcpu *v) { /* Dispatch table for getting per-type functions */ - static const hash_domain_callback_t callbacks[SH_type_unused] = { + static const hash_callback_t callbacks[SH_type_unused] = { #if SHADOW_AUDIT & (SHADOW_AUDIT_ENTRIES | SHADOW_AUDIT_ENTRIES_FULL) # ifdef CONFIG_HVM [SH_type_l1_32_shadow] = SHADOW_INTERNAL_NAME(sh_audit_l1_table, 2), @@ -3210,7 +3210,7 @@ void shadow_audit_tables(struct vcpu *v) HASH_CALLBACKS_CHECK(SHADOW_AUDIT & (SHADOW_AUDIT_ENTRIES | SHADOW_AUDIT_ENTRIES_FULL) ? SHF_page_type_mask : 0); - hash_domain_foreach(v->domain, mask, callbacks, INVALID_MFN); + hash_foreach(v->domain, mask, callbacks, INVALID_MFN); } #ifdef CONFIG_PV