From nobody Fri Nov 22 06:05:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1718961757; cv=pass; d=zohomail.com; s=zohoarc; b=AeFJNUTYNL/GFWfbiEpRojGFVpAzt8pw4IygnbyAMtfRyh7kNqPYU+pctIcKdDjbJleQgakkUvGghv8fi/b9JDkhENIZl3AsCbh5C7LkdOGcLwNAIShMwJ82YbWAS8BLwOdIBGFxVHARXDXtp2b7qeX8Re9DOfxVwf52BKEcl/E= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718961757; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FraBI1i4Bnal+sGdEA8zJKnwWAqHj5QXtcKpWhWQ7Yw=; b=MncHcqMDPQJ+xKwbuU3JgOSxZiKkAj4FnnOdzzgevQze+wNQqtQ15ladXfm4uxHLEPuqdsSsOwNHh9y25SDQKdSOgQ+sn/G2J1eR1sDscEFbxKzrZS5pny/4UtKeYO9qbQLDxVD9f8zrDVTbjm9EP0a05YV7u7XR6MFi2D+/fds= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1718961757459310.30729231340354; Fri, 21 Jun 2024 02:22:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.745156.1152309 (Exim 4.92) (envelope-from ) id 1sKaTK-0004oh-1c; Fri, 21 Jun 2024 09:22:18 +0000 Received: by outflank-mailman (output) from mailman id 745156.1152309; Fri, 21 Jun 2024 09:22:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKaTJ-0004oa-VB; Fri, 21 Jun 2024 09:22:17 +0000 Received: by outflank-mailman (input) for mailman id 745156; Fri, 21 Jun 2024 09:22:16 +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 1sKaTI-0004oU-HR for xen-devel@lists.xenproject.org; Fri, 21 Jun 2024 09:22:16 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2062f.outbound.protection.outlook.com [2a01:111:f400:7e88::62f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bed154dc-2faf-11ef-90a3-e314d9c70b13; Fri, 21 Jun 2024 11:22:15 +0200 (CEST) Received: from DM6PR18CA0006.namprd18.prod.outlook.com (2603:10b6:5:15b::19) by LV3PR12MB9330.namprd12.prod.outlook.com (2603:10b6:408:217::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Fri, 21 Jun 2024 09:22:10 +0000 Received: from CY4PEPF0000EDD5.namprd03.prod.outlook.com (2603:10b6:5:15b:cafe::d3) by DM6PR18CA0006.outlook.office365.com (2603:10b6:5:15b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.36 via Frontend Transport; Fri, 21 Jun 2024 09:22:10 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by CY4PEPF0000EDD5.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Fri, 21 Jun 2024 09:22:09 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 21 Jun 2024 04:22:08 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 21 Jun 2024 04:22:07 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: bed154dc-2faf-11ef-90a3-e314d9c70b13 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekI0HVci+7RptkZlYVNA+nv2QV3OfB5sIst+1hcYvJxJOlD+v2CF65ZeSA7/fLNb8EVlukXYJdK+M0rvRhFfSp0aA+cLJDwBltiEk8G2B1fIZFkmFX7VenMyA1Zgl5XpFQsOoWNWLWbKOMHmlaFuAIaVXHBjSQsXcDjaogXZq9NJH0cx7L+dlfAihO2Sy1i+vEDKx2f0Jf1mMxUeMSJbF1crJpbWco07onNNxHfAJnOjuzgjYTgi9CopW6lF5RPtiSD6Jf0NPkW0oeZZ5PvydPd1DBUChDewn6TGx9cdkZbGhEIvXFe12kMj8mf9Ha/LyWeUkKK8sem7kTx3b5nIkA== 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=FraBI1i4Bnal+sGdEA8zJKnwWAqHj5QXtcKpWhWQ7Yw=; b=MJDFT+Nj6arwkKaQqIfuYbToBjLJ0CBhFuRdehxoBe3nxFuqfPuUjaAFjixUkg9puLfy9ZNYNC0e+TxiuMg9G9WELfl+3Bg7zGUZe1puxFxFgn0ZuL4ui5ZwEU9nuZUhPP50csmhQn6mJFQcvaNSNSCsv+yaktuoFVsBP7HRsIIi+aTIul6SITNLFVMFZV0iBmt5yqhVrKQVmPt1keUJfHpDjA4B/Kr6UMafBiMv/mfNne2lQF7MHr1t6hEXB3Dbr7pipmwblF4CvXG6D6NxMDDPOVKvp9/75hNJbyq4+bv+fRWqVrjNsbGxVUyLsGqgQd54DR4iyvczSgRLIJKjmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FraBI1i4Bnal+sGdEA8zJKnwWAqHj5QXtcKpWhWQ7Yw=; b=il/dM67VQu7FDe6WZH93MSrDJApQqcZafMvO5W8JkJcsNoxXagmqJmw6pxe0uamFstGUUjOHX5Rii+YMCqqkVExW2moxemuAArr5LwXA713mRw1sGWuTKfWBKLHnOy/7bbCzRDYq2WgXQPeYFcQyyUcXybfS0+TBsveNjQoX5fs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C From: Michal Orzel To: CC: Michal Orzel , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Subject: [PATCH for-4.19] xen/arm: static-shmem: request host address to be specified for 1:1 domains Date: Fri, 21 Jun 2024 11:22:05 +0200 Message-ID: <20240621092205.30602-1-michal.orzel@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD5:EE_|LV3PR12MB9330:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bde3ba6-5869-4b26-8169-08dc91d3a08c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|36860700010|376011|1800799021|82310400023; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Sw22mpammKbOO9Kl9Pjopt3v5xbFhrSX0hmHweGI99FbiE8JTYI7ZAceJDQ5?= =?us-ascii?Q?jS2LXSBJqwDowDHGMFk4uoLzqPou40Zk6sDbvgSzUMrkD64YQksLfGMq7zMW?= =?us-ascii?Q?R1lit1pAkiEt8kaOJFUpasCbbO0oKzFHViiNphla8LX5/BFzVQTitOIWTzOj?= =?us-ascii?Q?/scY+3ucsSHICQztYaEyiK2bSaPpPYWd8b7ML+um295D7gmRPrWA0p4VC4QP?= =?us-ascii?Q?+JzfpbatQr1svz2udZqk6+Kd9POZ4/20n7YOtzYicR28xyShOG0tBgiqAFw0?= =?us-ascii?Q?NzYXrkxDsjIFAyyTYbBIh2h/LvSq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EGn+jmr0rahSTs8Uw3y9viAZ8FuDCH04lc1YEGGJ8ovu6jvYCNqvj?= =?us-ascii?Q?fFXqAavoRU8oKYjL1e8cUNBNSH7IPU0B/0pZ+SCxXCfiHDHrMKFl88b86NLh?= =?us-ascii?Q?qyZBp9496ZZeZk5LXLfScn0/jjlxtMEbqA7txm/Q3Jn/egKVdpnd69C5k7jq?= =?us-ascii?Q?WtyzGh4RyFfM7nh+VlntKaomLsEWe0stJG6fKSgXK9CPB7sr0Q=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230037)(36860700010)(376011)(1800799021)(82310400023);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2024 09:22:09.6207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bde3ba6-5869-4b26-8169-08dc91d3a08c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9330 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1718961757997100001 Content-Type: text/plain; charset="utf-8" As a follow up to commit cb1ddafdc573 ("xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains") add a check to request that both host and guest physical address must be supplied for direct mapped domains. Otherwise return an error to prevent unwanted behavior. Signed-off-by: Michal Orzel Reviewed-by: Julien Grall --- Reasoning for 4.19: this is hardening the code to prevent a feature misuse and unwanted behavio= r. --- xen/arch/arm/static-shmem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c index cd48d2896b7e..aa80756c3ca5 100644 --- a/xen/arch/arm/static-shmem.c +++ b/xen/arch/arm/static-shmem.c @@ -378,6 +378,13 @@ int __init process_shm(struct domain *d, struct kernel= _info *kinfo, const struct membank *alloc_bank =3D find_shm_bank_by_id(get_shmem_heap_banks(), shm_id); =20 + if ( is_domain_direct_mapped(d) ) + { + printk("%pd: host and guest physical address must be suppl= ied for direct-mapped domains\n", + d); + return -EINVAL; + } + /* guest phys address is right at the beginning */ gbase =3D dt_read_paddr(cells, addr_cells); =20 --=20 2.25.1