From patchwork Wed Dec 21 13:27:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13078776 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 371EFC4332F for ; Wed, 21 Dec 2022 13:35:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.467916.727000 (Exim 4.92) (envelope-from ) id 1p7zFM-0007eM-BD; Wed, 21 Dec 2022 13:35:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 467916.727000; Wed, 21 Dec 2022 13:35:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p7zFM-0007cz-89; Wed, 21 Dec 2022 13:35:00 +0000 Received: by outflank-mailman (input) for mailman id 467916; Wed, 21 Dec 2022 13:34:58 +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 1p7z8P-0003Di-2s for xen-devel@lists.xenproject.org; Wed, 21 Dec 2022 13:27:49 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2079.outbound.protection.outlook.com [40.107.20.79]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 41eb22e2-8133-11ed-91b6-6bf2151ebd3b; Wed, 21 Dec 2022 14:27:46 +0100 (CET) Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by DU2PR04MB8582.eurprd04.prod.outlook.com (2603:10a6:10:2d9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 13:27:46 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5924.016; Wed, 21 Dec 2022 13:27:46 +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: 41eb22e2-8133-11ed-91b6-6bf2151ebd3b ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SjJmeMp1lzrElVK3f/hVnEarT0JTe5nQ08DWZq9pq4INx0+rKIzPvsWZjU5dbvHfbHd6uDREvUqRkyaVxPHtCyqURUiziX2bJkDCpbKeO0blVlO5JqJ4r4b8zKwSdEDVcluayKo5sVKM3xkf/seCtotM6qBHZuzvSQH8+ZfP7jtuBkN7r7Bz+nNAykdXL6nbtsOXy8D/nOCBPi/KV7Y3UxFoQGVILObvbuUNmVXUZ+p/wdx3ijG3TF92E7NB3j5ZXE97qoPANJrTkvuHTj2rgoX9FbEekf10VdBw8/wAh/81LPUXqgW4y5qpmp5EBgAdQO183EvDXJnAlgh0LM2+Xg== 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=KksW3pwduy9TjDQH+MFwFhDkAzwXMmeF0LkQ/h+RxKI=; b=k96KxKfNglSIJqDeAvnet79qcSSsG/EX/+NPkwWGMSSQ/JLmV9JETYjk8Zsxv4xhD44HcNkf1I1ajG+gw9ma+FADNCDjfsrdo/B2uynJ+oP83OAnTeSmWk043uBqnkpeDkNBCxKN9Gkyv+HGbqRmWV5gYBtSKA2Dk34aS44w7JVL1zQvzP4BA01OFy6Zdtu1Y6URR6F+jMj4l/+H4qJ9nscERO61SY/anCMoao2ww5690Sn77Iyz8aGDh8AMgXJg+3X+SFXC9vWeTp5h+MNthCDQiJ4y4DRYjWfGw3Z0UNdoQ1iqbQ3MT/fOSB4UO4f8lTq2YrS5cbGypwTSKdjDMQ== 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=KksW3pwduy9TjDQH+MFwFhDkAzwXMmeF0LkQ/h+RxKI=; b=0Dx23uasr8RfffKfTyWghgAyGOo2jayIL2l7NcW6STq2OLBsTSybF99frJP99t3PKvB0RkKx6AwZPYSL/UAQ2YlmCvCbbiZb3XFL5vwhrCLJcFcMj5QGjb+iPUzRcD5N07l0s3HE5zurRtrI5ykZrrgZzW9AWDTGooGVkFsD9qOM080Jl2nhMrhEWseltWWqfwx6sX6hUDVQyBkvdS2qJcfGC7gAkhESNui94WOLHnsxIVNhbDmzqHuOKKIXm98m39vAHK9l0JRNd4mq1WpeTIclRTvcSvl1nbS4rcda5kMh1jVOVTk/kBWkS4z8NyIZqjWKjUIxbkFVuQ+nOAF3Gw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Wed, 21 Dec 2022 14:27:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: [PATCH 7/8] x86/shadow: don't open-code copy_domain_page() 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?= , George Dunlap , Tim Deegan References: In-Reply-To: X-ClientProxiedBy: FR2P281CA0106.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9c::18) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|DU2PR04MB8582:EE_ X-MS-Office365-Filtering-Correlation-Id: 77352dcf-f3f6-4ae8-fe1b-08dae35725a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jK/BWdiswM6UZ5WiHbFEXiXH1BoBj8i16ZFm0oL0Kt4I1Gd4Wbf5YnThTxoZP5yuYYl2JVHcpRnLJVFmkI0nL4qjJJ0wwqMmhZ18btHRu8A9MvYy9JeMe/VaZei89xH1w8wKeJhP3i2OWNTxwX1ksbUvmWUiDrmZ64UspiPe0/mlBMn1VFKt2H1vUEbTbMImCtJbj0nNnzF/RY1NBX+8X6ebOjDgv8WqQJV+ZkewTYwbJWxat5SHOAEGGKQhnAgzFnHwTI1yASdPRgGhoF/e/dyytpNyiUpz9O+7R4OrJL/AAjYC9BTn7nsgPsFVu/PkJnSETutIpva9EDrk2AS25v+XrQvMcygPtjGoZ6W6yVaafvjvFpJo8ly+yzHM8XvPAHm/Jd4/9pvduiMIJUk3YY6696VyWLy8Or/y47qwQSRUJtykgbDFzbTzedjPojFupZGk+9Pq7ilUlZfHOryZghbw4HjzzN4xUwFDl1z3N2bE0vKQ6+xc0WrXTJqaPt7NyDZS2YhuxmlKt6NM1vND9dFzKgTqMdkIweZW4cj17AnWsRmQTMegjXzcHa+5nOgc3RNna/A/COAXxlgX3o1e2yOsPcjoPCpdGUfvnJDKBgjp1/Rvabmd9uhGmBYDU0haL/aa5P4ZRSM/rTVFS2lgbYGM/6p3p6RH8R9EfX2rqAXuomDiAjb+mKonseDB2TWBQoxwSNEjXzqSf6/I5oYOvfBmm8R82TliyXhhzAoJp4k= 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)(366004)(39860400002)(376002)(136003)(396003)(346002)(451199015)(86362001)(31696002)(2616005)(38100700002)(36756003)(478600001)(26005)(186003)(6506007)(6486002)(6512007)(66946007)(66476007)(5660300002)(8676002)(4326008)(316002)(6916009)(31686004)(8936002)(66556008)(41300700001)(2906002)(54906003)(4744005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kMdLkX6nhFcOr2Q+enMnTIa25WHn?= =?utf-8?q?X4tfYS4aKtsmV5KIGBuNUhB2PUoWxGXvnn0hpWAzZccskViHB+qoZKSliORFKSiUN?= =?utf-8?q?PrZRua05P/SFeYhoTiMpnUYZXciZVKabK5HiMcj3hx97qToSdQlMNJczrkM4zdYUk?= =?utf-8?q?K+Jsro2LUJH0jTzW4qGOoU+B2Q+1/8MfgAlK/FWDoYiihqJwN6ZMX5O+7KkGDJvkz?= =?utf-8?q?HrpMttmrml0TsAIc5LBgBzqe18X2WHqDV1bZJ3hneUMCM1xl37M3lcDmLz7fVDs0W?= =?utf-8?q?Pn6oONEhaxBe1YsKW8zYAkLUtgcOoxXh7yaPFXvBwCOGZob2otgzjkEKoIGTW5EKn?= =?utf-8?q?yDZtGdkYgMlcKttCFFJIw4m7PJTotea/Rc2I+47wh3vwkc+kTdiQezs+4bpI9WZan?= =?utf-8?q?kSmgNMaJkAkiX7a46VOZG3ACk14H5fh7iJNPCvklFMColdOWEwJnRw94b1XPjYG4b?= =?utf-8?q?urHJi9kanPv2Qw8N5C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ATXCdawr310ciqDTPdTgC/cHhFDndZqm?= =?utf-8?q?bpRSXc0++aNHJ9U7bA1cgMo4AN57CHTn2NbybR/9AzOIKobMLt7raFuywv8VMNVkW?= =?utf-8?q?myJ+FyK4w1PPEiThLQGcp/zrESWZE1Xjxhki9g/j4Ht6Yv3jKYNFMXW0ieuZ3U4To?= =?utf-8?q?Okjk8f3BWTyY?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77352dcf-f3f6-4ae8-fe1b-08dae35725a1 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 13:27:46.1254 (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: wQ3+oFk1U2LX0EMKwU+FqB2zx65c/DxH6NnsCcrJdmx6b5X/dbcjTEHNLm+9esY4toL3YXZ7gcqhOlWpYtKlDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8582 Let's use the library-like function that we have. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -455,7 +455,6 @@ static void _sh_resync(struct vcpu *v, m static void oos_hash_add(struct vcpu *v, mfn_t gmfn) { int i, idx, oidx, swap = 0; - void *gptr, *gsnpptr; mfn_t *oos = v->arch.paging.shadow.oos; mfn_t *oos_snapshot = v->arch.paging.shadow.oos_snapshot; struct oos_fixup *oos_fixup = v->arch.paging.shadow.oos_fixup; @@ -488,11 +487,7 @@ static void oos_hash_add(struct vcpu *v, if ( swap ) SWAP(oos_snapshot[idx], oos_snapshot[oidx]); - gptr = map_domain_page(oos[oidx]); - gsnpptr = map_domain_page(oos_snapshot[oidx]); - memcpy(gsnpptr, gptr, PAGE_SIZE); - unmap_domain_page(gptr); - unmap_domain_page(gsnpptr); + copy_domain_page(oos_snapshot[oidx], oos[oidx]); } /* Remove an MFN from the list of out-of-sync guest pagetables */