From patchwork Fri Oct 6 13:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13411447 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 E1FE9E81DF5 for ; Fri, 6 Oct 2023 13:02:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.613595.954220 (Exim 4.92) (envelope-from ) id 1qokSr-0007aC-Fb; Fri, 06 Oct 2023 13:01:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 613595.954220; Fri, 06 Oct 2023 13:01:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qokSr-0007ZY-BZ; Fri, 06 Oct 2023 13:01:57 +0000 Received: by outflank-mailman (input) for mailman id 613595; Fri, 06 Oct 2023 13:01:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qokSp-0007X6-T5 for xen-devel@lists.xenproject.org; Fri, 06 Oct 2023 13:01:55 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 83c65d31-6448-11ee-9b0d-b553b5be7939; Fri, 06 Oct 2023 15:01:52 +0200 (CEST) Received: from mail-bn8nam11lp2169.outbound.protection.outlook.com (HELO NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.169]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 06 Oct 2023 09:01:49 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by BL1PR03MB6024.namprd03.prod.outlook.com (2603:10b6:208:316::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.39; Fri, 6 Oct 2023 13:01:47 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::66ca:3a42:baeb:9ecf]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::66ca:3a42:baeb:9ecf%6]) with mapi id 15.20.6838.030; Fri, 6 Oct 2023 13:01:47 +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: 83c65d31-6448-11ee-9b0d-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1696597312; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=YjeDujQhkCSuotTmusn7paGxFGmyKhPrDHPA33kBIm4=; b=BAe215+o82Di3fEQwSUMDhbsRoz/oYiuGWFo9vEU35BiDMVsgtWTihvx s+mKhXffeTHNQ38ANjtYRc/7OQvRpapI2vmX8jpL4ZvTdFNYPgmBIo0J6 JmAYUhLZM+qCb9ZPA49uNUBuplsFs2qEp9SqZ4DadKO7xd2QD5TCeBx3M g=; X-CSE-ConnectionGUID: Bv6MBkPWTUaSQC83zpI/Xw== X-CSE-MsgGUID: AHSINDi/TGKhUBe7OGi3kw== X-IronPort-RemoteIP: 104.47.58.169 X-IronPort-MID: 125254119 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAY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vAA0WKN+UyEJwTOssJbyK d8Y+xfJbTLfDxHZB/BkWuFL+o= X-Talos-CUID: 9a23:8GjBYmMOc11BFO5Dcjc50WQXIv8ZT3Tm9VyAeF2gKCFZV+jA X-Talos-MUID: 9a23:tltEJg70T3HFeMQHZKaipBrixoxBw5+PLmwM1qkpmMm5HyEvHBic1zeoF9o= X-IronPort-AV: E=Sophos;i="6.03,204,1694750400"; d="scan'208";a="125254119" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YnMzNDRQq8o8TcWWguHw07fZkaPcaLuvv+zoCKL8D+ornZfO6eD9VmXRUUmD0P/2yomvWK1FyItNvvMdM9xINv0QNeLk3aLEEh5z/9jaCsL1I5e0RC2PY11HFqtMvPUR+eojs1F+s0v3v2vR4gIh7wl8wskKlX6K6U0yFwE3GuVaRrbQDzDWkXcyfllhk9gJuaKa9hKOoqu2wW0RSNKBNKtMd8lXDbA8bTkDSM92xAg/Odnn2Qj7pJuW1PqdIWcue3a1/PkZbosJ7fFx/5FTC4jnHdBSB6lBi1S1bMRpfgx4IGNZZo1vMEOF3ixXmvLx43VZZCejZcCSn1a+HFwbCg== 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=thBVzZHE25HD5UvaIrP9q3ANVbkmnqpnKglf4PdZI5g=; b=O/NGxsXNcSyi481lwWl1aPdP4ZZpPK38mbI8SJpVNc7fJzcsZaDRdTfKLPAxS35WYSeRHY684+ubNrrAyJatDIEBuK2PcM5xSy3bgf+hW5u8NvEFJOOk5tUyZBvg0OWJ2L9Geoc32numoBWhRrcsQYYctbLC5Iumm5FbIotdu7EbieNYjjHdfrjeifRAlpF8xhwy6NJUGmXPO1e+7W9Ede517zr2var5p8eF6p6ZPo71QPAJ8egAN6cBzuFUIjdqYkwi3dWw18fkmMlbQSelLyFw6EpWePlJ2Cdouhw2Lp9wXzUjXku6BhCJ+qscqdy2fmEmdfforODYk3V9akbdRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=thBVzZHE25HD5UvaIrP9q3ANVbkmnqpnKglf4PdZI5g=; b=jvTh7cv7p/TSLw/YuO/0kZ+G9yHeS107kBSvNbs5YSq0uu9U+EoQPLefl2KUfV/CssV07blNPdcrUv2PaQ60u8yHW7Q1qJjAzxliHsr8D4LQ+DNOZdZkPh3ku8QKyF4wqoGVncMsYKFbVhoKagWwKc8MIOVQkvYVMS2wwC0kLxw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Henry Wang , Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2 1/2] domain: fix misaligned unmap address in {,un}map_guest_area() Date: Fri, 6 Oct 2023 15:00:58 +0200 Message-ID: <20231006130059.97700-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231006130059.97700-1-roger.pau@citrix.com> References: <20231006130059.97700-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0324.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:197::23) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BL1PR03MB6024:EE_ X-MS-Office365-Filtering-Correlation-Id: 99255386-b674-4109-6966-08dbc66c65d1 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GyqUK8a882Z4hYNiTVVbpqW+6BqtwGKgS5WgBCITGd5shvPy2XalVQLu92H4H1+1KWccteCTwknHZcfuDFkPV2ZCbtE8wMsJh907QutxVQT8TAxdCB/G3Cu3VQfnKjBLiQwOXMlLxH1Yx0UZCiV1HJGrHUykgkr3xStUpmA2Dvb0rnq7R19KQI3NFz1beFB0aLM7xD8OF7r25vXq1ZxpFYd3uINdqoC2FNNEZInpJkGXKg3aBvgMwHVATCfTAiJftGPtbjcKhu6B1r6yLrUOlRYewV++/Yy+LJCL6BX016mNiJqogc7VrXhyBH458lzPVO+LY4HCK0E8bXv0F6b3c/G1hfPaB+Sd452iaEcQin6NM1f+jeJvA2UXzhlc2fDzeajqjrQ5UpbyFvyExHtl5bd5Z+Xfji0+/AHvzuISkxOhT3f68/dW8qCH8PFndypMwJijhqXYZTua/d+I9mLpB+gbgYMTiPW9c1kTt7M7BWeyM1ijrSi2TevCiUyi80Be2V3NTS0bZVf1AhZbEnq1JsDb+OTXtkCjjUKJuCW/bU7dA2qdk/ANV+CWzDju9bDB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(366004)(376002)(136003)(39860400002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(83380400001)(6512007)(6506007)(6666004)(478600001)(6486002)(86362001)(82960400001)(38100700002)(2906002)(1076003)(26005)(2616005)(36756003)(316002)(66556008)(66476007)(54906003)(66946007)(5660300002)(6916009)(41300700001)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SFAs/ASv8I54HUUsXmhghgCa5LQa?= =?utf-8?q?rQ2ZdsTqPWmYsqayoSV+4QUDBtNqbfy/zg7hI8vKRXdkyO4VMwECePkLlV+d3/rHd?= =?utf-8?q?RmFg4Xf2IYFIBCnu+We1cv3m//v/QCnG1xXtT0xCe9OiNMmqUREmHZN9V8DbFK0kt?= =?utf-8?q?Wcy8PDn1xAbLMIBBJTy40HgZf+5aBIXQ2k/3IF4H7PZ64n386VOhYgGAgExSmQ67r?= =?utf-8?q?/jg9x54oLyw6orgp3FcYVdIsGqzRcYziH59KkYf/lQucaaWUCc04KOJKVmqSO7ubg?= =?utf-8?q?bHW/m482JggxJO1nkyuZtDvDmoSUgq1KQvI3ioC0Y1VM/YGDfdhPBfg1+04564GPw?= =?utf-8?q?cQlgr5FJylX1sVJ9+vo9918amdHIC25xy4+1cX6zcHMqlUeoQSKtm3YOYVuhPz9m2?= =?utf-8?q?OCoD03G4olcW5n+5z917WwONe20gyuy5ptSRnQCP6WeWwXBye5kpav5PWOg+sIZ1G?= =?utf-8?q?VVddHju/hAggngev6gNrplghGzpf0IU0kqgyLcZqLz5ywD7i6xbZ0/hFoaHnhw1Ne?= =?utf-8?q?XUPIj9CiIXLzhAnaWxbzcATAjXa2hUsOy9H38YoSW0rVpPmvh7SpJ3w3V6rNpTany?= =?utf-8?q?k7f5VGSXRK/3VNlGGO6uw0ygOVTFvk3M5qi2996wAe4kZ9z8wPrZMaO95dAdRHgkP?= =?utf-8?q?N6EviKEZruiUzduDFFC9FgKYTF4ujkx1vDRYGzYkgBBv+Rb90EKbNZkvGeMVtH3Lz?= =?utf-8?q?8BOINlHHQMY07LGfch0HBuF+Va5/n7ql2T/F2Il7kj2bFG/cqyG5cXvUvPxcq2ZYM?= =?utf-8?q?PheKXbQr6JdgnsukgdeqbmwRqNf/szBj0VJu6V8+b6frTF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LdwyWhlrscgKiApYTjDKKS0O38S6PrhD+/MmxVXDOJYZozH7rSGyNOiFCtz7gPwaLw0wzRIWthENg+xAyMAwTvwZ9pQSgeLAklwEdFEzm/or+eFO/GPkksciecsBv3RkS3391UDu+w6vNesipZiMXEGbNS+vP0mWkBsoRTWUPV/LF2DPHLoWaIKtrZiy6ADwJGTc36QsbFVRXk5fhFgf8vT9bQL3IguRSBIi59bSMUa0Xpc7chjj+XoEjrZ28Ta0VQF/PzJ2wkCbv9jj3QnNY/YjRErD5oPJ1VOk2niLdEU/dWM3OhX57w6RPUhBud9wroj3cp3S6HleyYT/ND82TNJ7SlQFWwOWv86R/gKcywF1xPercGdpx74zt+p/BGm/AW1XQo1f3jTG7oq63qfx2OllXUTAa+qdEQTzu6/jnsrDRkVLLs9DBO87ZlaYlE1KZTY0r9g1OLWBKa6ARXr450fKl1sIPHco+lBmOAMn0xP/Na9fMTTsS0AnU2cHBolVfw11KcASTzEfsEw7hx7tJU5sbcaDHcEtgEGwUM9dTJ+mx9Dec+sQh2BYLgMFHgLb5Qsuvl7tY9pgotLAq/3J/VZUPE+4ZmbZ5OgWNzX9eiMUP2BVBPmHOTxpx7I0fEGzztY5/XGRhsTCgldHG9yrOQD64XL+GJ+Gc219CZ23HzceXAJX+IcbJSiSLWTtd3iO+Ylp9EuVmPU3l6b1Z1yuleteYP9VOskGPZpbshKme36AAIYxfLluxMjPbr9KHh17yRAVcfom+QxAoHto1DB3IaWkECKOVBzUq8L0uJMXwO63BVUiJgR/hGhCpNT X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99255386-b674-4109-6966-08dbc66c65d1 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 13:01:47.2479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MN5H1GtDzUNrxPub1u25HtNOLAMQCQgI8JV1XL4WYX4lTkhH0E1SNLbJ3lsJnTEAsY1nzwo8WsobJiqDwtJPlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6024 unmap_domain_page_global() expects the provided address to be page aligned, or else some of the called functions will trigger assertions, like modify_xen_mappings() on x86 or destroy_xen_mappings() on Arm. The following assert has been reported by osstest arm 32bit tests: (XEN) Assertion 'IS_ALIGNED(s, PAGE_SIZE)' failed at arch/arm/mm.c:1243 (XEN) ----[ Xen-4.18-rc arm32 debug=y Not tainted ]---- (XEN) CPU: 0 (XEN) PC: 00271a38 destroy_xen_mappings+0x50/0x5c [...] (XEN) Xen call trace: (XEN) [<00271a38>] destroy_xen_mappings+0x50/0x5c (PC) (XEN) [<00235aa8>] vunmap+0x30/0x1a0 (LR) (XEN) [<0026ad88>] unmap_domain_page_global+0x10/0x20 (XEN) [<00208e38>] unmap_guest_area+0x90/0xec (XEN) [<00208f98>] domain_kill+0x104/0x180 (XEN) [<00239e3c>] do_domctl+0x8ac/0x14fc (XEN) [<0027ae34>] do_trap_guest_sync+0x570/0x66c (XEN) [<002019f0>] arch/arm/arm32/entry.o#return_from_trap+0/0x4 Fixes: eadc288cbb0d ('domain: map/unmap GADDR based shared guest areas') Signed-off-by: Roger Pau Monné Reviewed-by: Julien Grall --- Changes since v1: - Also page-align the address in map_guest_area(). --- xen/common/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index b8281d7cff9d..1468638ade8b 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1601,7 +1601,7 @@ int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size, unmap: if ( pg ) { - unmap_domain_page_global(map); + unmap_domain_page_global((void *)((unsigned long)map & PAGE_MASK)); put_page_and_type(pg); } @@ -1634,7 +1634,7 @@ void unmap_guest_area(struct vcpu *v, struct guest_area *area) if ( pg ) { - unmap_domain_page_global(map); + unmap_domain_page_global((void *)((unsigned long)map & PAGE_MASK)); put_page_and_type(pg); } } From patchwork Fri Oct 6 13:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13411448 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 0B115E81DF4 for ; Fri, 6 Oct 2023 13:02:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.613596.954235 (Exim 4.92) (envelope-from ) id 1qokT0-00086t-Qe; Fri, 06 Oct 2023 13:02:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 613596.954235; Fri, 06 Oct 2023 13:02:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qokT0-00086m-O1; Fri, 06 Oct 2023 13:02:06 +0000 Received: by outflank-mailman (input) for mailman id 613596; Fri, 06 Oct 2023 13:02:04 +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 1qokSy-00085i-Ja for xen-devel@lists.xenproject.org; Fri, 06 Oct 2023 13:02:04 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 89f0fef1-6448-11ee-98d3-6d05b1d4d9a1; Fri, 06 Oct 2023 15:02:02 +0200 (CEST) Received: from mail-bn8nam11lp2168.outbound.protection.outlook.com (HELO NAM11-BN8-obe.outbound.protection.outlook.com) ([104.47.58.168]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 06 Oct 2023 09:01:59 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by BL1PR03MB6024.namprd03.prod.outlook.com (2603:10b6:208:316::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.39; Fri, 6 Oct 2023 13:01:57 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::66ca:3a42:baeb:9ecf]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::66ca:3a42:baeb:9ecf%6]) with mapi id 15.20.6838.030; Fri, 6 Oct 2023 13:01:57 +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: 89f0fef1-6448-11ee-98d3-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1696597322; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=q9WWfWAkLiKL9bTKZOYna340S9McrAJSBpCBi1mBNvA=; b=EGHNN/PNQZP1EIkTBEySCDlo03g5Fh9FhLhKYk9HF13KF8SRgXjRDvnS jf/oqkYRouxP1erelI4LjVCz89aY9drPCUT2ZJpZoREcLJq4sKO9B6vSY aQZiPLaquJDHH7OOoiiYMb7XoovwQKfN4JkVQsxmTIhoMvNWQ4hRlFGlA E=; X-CSE-ConnectionGUID: zdvHY1jERRuCuGZJFk+JRQ== X-CSE-MsgGUID: GGINF2EgRgmDxN9CXK/EQA== X-IronPort-RemoteIP: 104.47.58.168 X-IronPort-MID: 124080232 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED X-ThreatScanner-Verdict: Negative IronPort-Data: A9a23:e7XWda0w9Tg9/YvWa/bD5Vdwkn2cJEfYwER7XKvMYLTBsI5bpzVWz 2IdD2vTb6rcZWD3eIh3PN/k8ksF7ZLWnd9rTFY6pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliOfQAOK6UbaYUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb83uDgNyo4GlD5wRmO6gS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfE21Q1 c1BKh03VA2oms2E4py4CctWv5F2RCXrFNt3VnBI6xj8VK9ja7aTBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqsy6KklwZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r13LOXzXuhA9h6+LuQ2dFLpnPJ62MpBxg6RX3qismazWOHcocKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZh5MbsY38vA/QzMC3 0WM2djuAFRHu7qQTG+b96uF6za7PyEaIHUqdSICVREC4dTovMc0lB2nZtRpHbOxj9b1MSrt2 D3Mpy87750RkMoK2qOT7V3BxTW2qfDhVRUp7w/aWmak6AJRZ4O/YYGsr1/B4p5oM4KxXlSH+ n8elKCjAPsmCJiMkGmHRrULFbTwvvKdamSC0RhoAoUr8Cmr9zi7Z4dM7TpiJUBvdMEZZTvuZ 0yVsgRUjHNOAEaXgWZMS9rZI6wXIWLIT7wJiti8ggJyX6VM IronPort-HdrOrdr: A9a23:p+rzR6kZNHpblk8cR2G7NAyqSOfpDfLo3DAbv31ZSRFFG/Fw9/ rCoB17726QtN91YhsdcL+7V5VoLUmzyXcX2/hyAV7BZmnbUQKTRekP0WKL+Vbd8kbFh41gPM lbEpSXCLfLfCJHZcSR2njELz73quP3jJxBho3lvghQpRkBUdAF0+/gYDzranGfQmN9dP0EPa vZ3OVrjRy6d08aa8yqb0N1JNQq97Xw5fTbiQdtPW9f1DWz X-Talos-CUID: 9a23:lmLoHmPxBUPtRO5DSiV51H9NGO0fSGD20VjiAWG7SkRTcejA X-Talos-MUID: 9a23:fmOl4wxNm1Z5tL0Ew+rlyVIYLOyaqIuBKWYjy7gJgcaBGTxWahytr3Oae6Zyfw== X-IronPort-AV: E=Sophos;i="6.03,204,1694750400"; d="scan'208";a="124080232" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HatLaQaf9607+FPTCsxftOShzFdcrc1ouuD0TJEZ2iTwAAZKbKI56q2yu3UQG8YFzI+h1sfMfMphVdr3Px8rTAdPBE2r7EoSqShJAolHQabSHz8B+ftuTWIyAAXF0iuBJeqfLhYeOywXb1KYeGlG2jrw+fog8EOtfjCeoeM07hrWNHc7Yccxf8WMCzvIv7N7ukFnI0KaXd1I7HyIiJ5AFP+oC22dKRJ3CDKoMDQsjk9jUpND4RLNWmhLr0d2yY+VdiXGAcWpFmCmSrUYoVt9Hz3EROYa4QotlJWmI+8TgUxTF76FRuZyN15LhYdGC78POg3DLtF1mUmTiLRFRvCHfQ== 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=vbrwg8wsku3XWRoPqMOqqdVQ5jyqnzvdDHhWtg8wd3g=; b=Nroz2+rygCqf8ioxstX+9Yof6InIkVKEHZ3uO43VZvS7sE5p/5Y+T7j6KNvOnTXIz19ILa5QGiFe0Kq8t8R0c0/3Hj6vrf2aBe/E8JxgJSTKanDy0oHM7lZAbYdMgQSQAX5K/m8nojCM/hhrGvxsMTZHvBMDKvb+Rtfbbs/sslhFXbfFW0amw7aKQYllAMo1rZj3aLqYeoSjkaHyL9SIbpH+Al4CEvpjg8kdUdws2DKs9O2grwOPr2ZMFRr5+q6T+c4W45aZ3gFylmH5Tgvu5S+gSNpC9JH7/+51qUhtCYySZBFe9K8NGLqHYlhi+ZQFrVBD6B3c3+sT8thN/rbQCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vbrwg8wsku3XWRoPqMOqqdVQ5jyqnzvdDHhWtg8wd3g=; b=B9XqkiQFnYj3edAP18lcuYImDjLE1w+fpsqMNXGAzY2va9HZowCvumj6bFN56jiXMBzkPN73Rh7K0rpXkV/fnwmIYv/5dHqPQsaLxKaygGs8YdjT9J02yP/aHnvUUV4B8AaYStY01G9WrrTIseP7f9lx7NWQdSf2eIhvIBCZujI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Henry Wang , Roger Pau Monne , Community Manager , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2 2/2] domain: expose newly introduced hypercalls as XENFEAT Date: Fri, 6 Oct 2023 15:00:59 +0200 Message-ID: <20231006130059.97700-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231006130059.97700-1-roger.pau@citrix.com> References: <20231006130059.97700-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P265CA0328.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::28) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|BL1PR03MB6024:EE_ X-MS-Office365-Filtering-Correlation-Id: 2146d73b-e0ed-42cd-12af-08dbc66c6bf9 X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EnCAHMxvhf00WK+y/jtXeMnQMsXXkaAD4mKaVoGRakloD9uZmoCPcM9vu2218yULl7QgHjJrv9dBPt4dkgmeeDFGnM+jikxAegnvEz21WxOpu49FNdBV+IihOAK2n6fLLVq7+0IxgRnD6dDcMB9KgvW/h7MpzmzJxaIS1V/VDitMl7rB/U6h+sif0CgqXG7WK1Z2cU7vOtqtUw7Gr7Y859wpZsFtJjQhcVi+rJ3jsKUFMVPhb54k6Dub2QZ14Y2a7kSSlXxN47f1JWqM/OREexLlQBIIvymcK45wa0vv5iFQZn9KuJMTV2EU+zMWUaYdnyHCZMxdTDzxW6n2uRdV7XGzNRelLvB1EpyzSF9++6h5ONl6AcUEfCjyP/L34tsx4ZDiXF8+kRctVDzqmPPRNv5SooVP1O9mBACjl1l8vZe2ioCYLMjpexv4cmIOW0gpb2OBAgHFWNcl/8YynrV6TcIyWv4uhWJ8OTOHM04LlUV+Y6Jsg2g+gKVRZimjYijQqrNpy5sRSos7IXRm6JXoMBa5omcjYuzByA+9UWJLHIw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(366004)(376002)(136003)(39860400002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(83380400001)(6512007)(6506007)(478600001)(6486002)(86362001)(82960400001)(38100700002)(7416002)(2906002)(1076003)(26005)(2616005)(36756003)(316002)(66556008)(66476007)(54906003)(66946007)(5660300002)(6916009)(41300700001)(4326008)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KVmTwThahe1esXesjRg8PJsIUjox?= =?utf-8?q?B1rarrvvKl2gL6yRDpt+mWWaG1U0OXl4uNuEt38WCFcbbW4AgKPBEyqZUXvVbgUMS?= =?utf-8?q?dzys/GKm9kEXemJhw9+DW26hQSzim/orHL4JhOm9V3LpdiuiXTVbzknCmZUPuCco2?= =?utf-8?q?bTaTC1tdpMc/RFfQepdZtm85vy4iqW8UFkizfni+A/docdaJqyE1ao+HxLQBvGWls?= =?utf-8?q?PR849Q0Sj3vGKtwhzi7GRFw2gHf3qO8dUmyq7WwSXWzhpfWrq3+jI5AWf1oFpXuyw?= =?utf-8?q?q22Br9xvMlFJAfjZoZr2e9nQ76ZZop6DXe9awda4g+QL9bKPzG/WvxG8HC3gaS95N?= =?utf-8?q?C3eOMLIVnqxA2VJQxoEqrNwWP74OGKnigV/ew1NS1MLxAxChvVhJAGaTNwE1R6+ai?= =?utf-8?q?o/XsN9O1S+yEgaXdWWx2eG2TjCDnD24cMMzNpxvGawSBcdygzAZ+B/0Vacn40AhtM?= =?utf-8?q?MObmXUzfVOIKMgQJZ+ycnwfN1Gl0ltMeYdp/9NMLjLBEagysiU2zadD+cUhL1sTTZ?= =?utf-8?q?4jllJI3IArO1d462qFdh19ROnxu04n90Z9rLVTiPERxVwEh8szvWf6EMiZL2X9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txzFvHA5jErKIleKMz5zRlMvxq7HaP1NBO+nByBx4gpQzTVqRaxMf0aFPWpl8PiTMqVKEaP0py4= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2146d73b-e0ed-42cd-12af-08dbc66c6bf9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 13:01:57.4642 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j71tUMVBDrCLpoPzMPcI0apc201kAy1Zh5YBPSFKK1iDUEfM9gUUpfxGecJBjAUB6KrQqOLsWqc7rKrVjemd8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6024 XENFEAT_runstate_phys_area is exposed to all architectures, while XENFEAT_vcpu_time_phys_area is currently only implemented for x86, and hence the feature flag is also only exposed on x86. Additionally add dummy guards with TODOs in the respective hypercall implementations, to signal the intention to control the availability of those hypercalls on a guest-by-guest basis from the toolstack. Signed-off-by: Roger Pau Monné --- Changes since v1: - Adjust comments, and add new one in vcpu.h - Add dummy guard with TDOD in hypercall implementations. --- CHANGELOG.md | 2 ++ xen/arch/x86/domain.c | 4 ++++ xen/common/domain.c | 4 ++++ xen/common/kernel.c | 6 +++++- xen/include/public/features.h | 9 +++++++++ xen/include/public/vcpu.h | 3 +++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e33cf4e1b113..47ea9e275462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Add Intel Hardware P-States (HWP) cpufreq driver. - On Arm, experimental support for dynamic addition/removal of Xen device tree nodes using a device tree overlay binary (.dtbo). + - Introduce two new hypercalls to map the vCPU runstate and time areas by + physical rather than linear/virtual addresses. ### Removed - On x86, the "pku" command line option has been removed. It has never diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 8e0af2278104..8d3d52034a6d 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1580,6 +1580,10 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg) { struct vcpu_register_time_memory_area area; + rc = -ENOSYS; + if ( 0 /* TODO: Dom's XENFEAT_vcpu_time_phys_area setting */ ) + break; + rc = -EFAULT; if ( copy_from_guest(&area.addr.p, arg, 1) ) break; diff --git a/xen/common/domain.c b/xen/common/domain.c index 1468638ade8b..8f9ab01c0cb7 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1998,6 +1998,10 @@ long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg) { struct vcpu_register_runstate_memory_area area; + rc = -ENOSYS; + if ( 0 /* TODO: Dom's XENFEAT_runstate_phys_area setting */ ) + break; + rc = -EFAULT; if ( copy_from_guest(&area.addr.p, arg, 1) ) break; diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 52aa28762782..b6302e44b34e 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -607,7 +607,11 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) switch ( fi.submap_idx ) { case 0: - fi.submap = (1U << XENFEAT_memory_op_vnode_supported); + fi.submap = (1U << XENFEAT_memory_op_vnode_supported) | +#ifdef CONFIG_X86 + (1U << XENFEAT_vcpu_time_phys_area) | +#endif + (1U << XENFEAT_runstate_phys_area); if ( VM_ASSIST(d, pae_extended_cr3) ) fi.submap |= (1U << XENFEAT_pae_pgdir_above_4gb); if ( paging_mode_translate(d) ) diff --git a/xen/include/public/features.h b/xen/include/public/features.h index d2a9175aae67..22713a51b520 100644 --- a/xen/include/public/features.h +++ b/xen/include/public/features.h @@ -111,6 +111,15 @@ #define XENFEAT_not_direct_mapped 16 #define XENFEAT_direct_mapped 17 +/* + * Signal whether the domain is permitted to use the following hypercalls: + * + * VCPUOP_register_runstate_phys_area + * VCPUOP_register_vcpu_time_phys_area + */ +#define XENFEAT_runstate_phys_area 18 +#define XENFEAT_vcpu_time_phys_area 19 + #define XENFEAT_NR_SUBMAPS 1 #endif /* __XEN_PUBLIC_FEATURES_H__ */ diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h index 8fb0bd1b6c03..03b031a3e557 100644 --- a/xen/include/public/vcpu.h +++ b/xen/include/public/vcpu.h @@ -236,6 +236,9 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_register_time_memory_area_t); * Note that the area registered via VCPUOP_register_runstate_memory_area will * be updated in the same manner as the one registered via virtual address PLUS * VMASST_TYPE_runstate_update_flag engaged by the domain. + * + * XENFEAT_{runstate,vcpu_time}_phys_area feature bits signal if the domain is + * permitted the usage of the hypercalls. */ #define VCPUOP_register_runstate_phys_area 14 #define VCPUOP_register_vcpu_time_phys_area 15