From nobody Mon Nov 25 03:39:34 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=1718779660; cv=pass; d=zohomail.com; s=zohoarc; b=CWpbOb/xDBI0s6A07DxwPFi4ndZiSID7YMLkiS6iqVUVT/MrL9RNmMX6JZ6lz6yFPfkRDoF+qQqpHjiNWCZqddumckqjV1iXiwz8bj3SLlkh1Uav7ac8ll+GoSoFoUVZ4SUKeDslUgKtSub2AbOBY8Wtq9NCf2LGAYaqJLjCVRo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718779660; 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=Q8IhlyOSy1QVYCO5JuO87iS9W8d2PIRMLFUhNMPaHD4=; b=nt2gJEOzEts3s83HYlYXCEKa0Idc3r3EL3W/WamNkI40qPUFupBiABQryG8l4rhWHddmful4u7tU5pNfv75ORHFRo76slGe/pzn0PbxL8f31zsNBZ3TkOEf5f8Fcuu/GyQS7Mci5AshN98/v4tIosHNeFUYUjQ2I2cI5LaHr6Pc= 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 1718779659941244.9317521775149; Tue, 18 Jun 2024 23:47:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.743430.1150325 (Exim 4.92) (envelope-from ) id 1sJp63-0004cY-II; Wed, 19 Jun 2024 06:47:07 +0000 Received: by outflank-mailman (output) from mailman id 743430.1150325; Wed, 19 Jun 2024 06:47:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sJp63-0004cR-FR; Wed, 19 Jun 2024 06:47:07 +0000 Received: by outflank-mailman (input) for mailman id 743430; Wed, 19 Jun 2024 06:47:06 +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 1sJp62-0004cL-3e for xen-devel@lists.xenproject.org; Wed, 19 Jun 2024 06:47:06 +0000 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2060e.outbound.protection.outlook.com [2a01:111:f403:2407::60e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bb582e12-2e07-11ef-b4bb-af5377834399; Wed, 19 Jun 2024 08:47:01 +0200 (CEST) Received: from SJ0PR05CA0036.namprd05.prod.outlook.com (2603:10b6:a03:33f::11) by PH0PR12MB8773.namprd12.prod.outlook.com (2603:10b6:510:28d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 06:46:58 +0000 Received: from SJ5PEPF000001EF.namprd05.prod.outlook.com (2603:10b6:a03:33f:cafe::7d) by SJ0PR05CA0036.outlook.office365.com (2603:10b6:a03:33f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.32 via Frontend Transport; Wed, 19 Jun 2024 06:46:58 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001EF.mail.protection.outlook.com (10.167.242.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Wed, 19 Jun 2024 06:46:57 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 19 Jun 2024 01:46:56 -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; Wed, 19 Jun 2024 01:46:55 -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: bb582e12-2e07-11ef-b4bb-af5377834399 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hxAjFhAP3d9qmwaygbniizDeALAi2u9gN/DA7n9+NBD3ymgRn2Z4nfPgQQTS7p1m1lO/xZbX6hfSX2XHAp2LU8cZ6CNs/YvP3l1UzUkLKzb+S7NEia/HIKYb8HL+FEckJeyGLt4vTvbcD3iW/h938Jy+V0VvDC27oz6MM36K1hKa5lzP3da3vV5FLR/eeULfSx4YwaR5UXtmjGfP6BLTObiyKVlaBcmFNfKt47p34zBY8cYyPFYEHh3hfjd0ruTSS8wyAPl9TX7Oe+GyL5WtqPUjgt1Sot0NaGl54HFCgZs1QiiKPvZHCVWLeCtU9t3cwPpXIfHEULPslx6EENcPog== 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=Q8IhlyOSy1QVYCO5JuO87iS9W8d2PIRMLFUhNMPaHD4=; b=IUO5jujTamQ7vYF0SJ1bxqQAPVkEf3v8KHvpHLazcujPmRrYb0FR7m3kgi1GluLYlA9ySX1y/vNS4HXqxf218XARnUGzV1OQcMsgq5U4nJEwpBOaYWBybYvLrUItNQ3uKzxttZt6mCFZ5yIqrFmoT/40PAkhRSJkgnEN+VOEug7I4bmjQQnDzyFwecL2FIEA0KCqLlmczSlgQ653HWzTGVQdT/oHC/08XIRaHQm8FV9fRrvbtun/jE4LGCwR/h4RqetbSFN4jAhuu/uEycUdTGyPTmVC0KDjoUPag7qTwlMK9uzfqCJtkQ4B+dSKZqdV6a+7rmyzVPEeEkWWHaSEOQ== 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=Q8IhlyOSy1QVYCO5JuO87iS9W8d2PIRMLFUhNMPaHD4=; b=PkgSavB6WgzylpGGzT1HUha7XqhyG1ry1PPFo9e6Gdd51pwT/u80X/loljYIMuxgeSzCrZdjZuEKk+u9MNHIgx6RLhIiReQPwowndhrKoDsWDqAKniEwdxmRFdG5ymQ7IARC7ccWEXU9aTfEF/gFbWX0JSrMV1O1HaIMdtEAZhY= 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=SATLEXMB04.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: fix "gbase/pbase used uninitialized" build failure Date: Wed, 19 Jun 2024 08:46:52 +0200 Message-ID: <20240619064652.18266-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 (SATLEXMB04.amd.com: michal.orzel@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EF:EE_|PH0PR12MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d1368dd-9ca9-48c7-ab76-08dc902b9d5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|36860700010|376011|82310400023|1800799021; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WKpw7SppmYYMYRZl098WthIQOorjQ32v7SYsICo+bfAm4ipw5BTb8q6tCYAH?= =?us-ascii?Q?BQQm3zPCTvy7SJ9bKwhWx9F+PKYGw5Uek5AvX6l473kHWUwKTvwPNBCQwhfL?= =?us-ascii?Q?4by55/S1B1XoVokcpPoyTpvsYak7k/AbDQVj5n+QbYRlDPa7ff7SNfxHR0pL?= =?us-ascii?Q?AuBqWlenmPp3VJQulAx3axDoOXVf1pQQjpqa0fvmtCp+AMTkySSXN0LDPLfv?= =?us-ascii?Q?HpT5a0yFq9mJjocnR/hsesRHJw+rV+l0xvleY573QzbDXPP2ArQWRVWzGWbu?= =?us-ascii?Q?fGsdJQqHagZQWbAOInQ4905QW7q1hekVg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4dW9lr5jEKqVg05kmA/VANxqsICHrIlJCx3tb4RjhZvBrr/F1wJs?= =?us-ascii?Q?3+L9bWTJkALNO/pqvJ6kceeViU/GRAH1F5/M6ZpXu3Bruq4Asf3F3AdFoAiz?= =?us-ascii?Q?mtnbsKrNCkIT1Ri/02IxLIFE/4u6FmXmWRPt5mLn7SRSxg=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230037)(36860700010)(376011)(82310400023)(1800799021);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 06:46:57.6647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d1368dd-9ca9-48c7-ab76-08dc902b9d5f 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8773 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1718779661651100001 Content-Type: text/plain; charset="utf-8" Building Xen with CONFIG_STATIC_SHM=3Dy results in a build failure: arch/arm/static-shmem.c: In function 'process_shm': arch/arm/static-shmem.c:327:41: error: 'gbase' may be used uninitialized [-= Werror=3Dmaybe-uninitialized] 327 | if ( is_domain_direct_mapped(d) && (pbase !=3D gbase) ) arch/arm/static-shmem.c:305:17: note: 'gbase' was declared here 305 | paddr_t gbase, pbase, psize; This is because the commit cb1ddafdc573 adds a check referencing gbase/pbase variables which were not yet assigned a value. Fix it. Fixes: cb1ddafdc573 ("xen/arm/static-shmem: Static-shmem should be direct-m= apped for direct-mapped domains") Signed-off-by: Michal Orzel Reviewed-by: Bertrand Marquis --- Rationale for 4.19: this patch fixes a build failure reported by CI: https://gitlab.com/xen-project/xen/-/jobs/7131807878 --- xen/arch/arm/static-shmem.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c index c434b96e6204..cd48d2896b7e 100644 --- a/xen/arch/arm/static-shmem.c +++ b/xen/arch/arm/static-shmem.c @@ -324,12 +324,6 @@ int __init process_shm(struct domain *d, struct kernel= _info *kinfo, printk("%pd: static shared memory bank not found: '%s'", d, sh= m_id); return -ENOENT; } - if ( is_domain_direct_mapped(d) && (pbase !=3D gbase) ) - { - printk("%pd: physical address 0x%"PRIpaddr" and guest address = 0x%"PRIpaddr" are not direct-mapped.\n", - d, pbase, gbase); - return -EINVAL; - } =20 pbase =3D boot_shm_bank->start; psize =3D boot_shm_bank->size; @@ -353,6 +347,13 @@ int __init process_shm(struct domain *d, struct kernel= _info *kinfo, /* guest phys address is after host phys address */ gbase =3D dt_read_paddr(cells + addr_cells, addr_cells); =20 + if ( is_domain_direct_mapped(d) && (pbase !=3D gbase) ) + { + printk("%pd: physical address 0x%"PRIpaddr" and guest addr= ess 0x%"PRIpaddr" are not direct-mapped.\n", + d, pbase, gbase); + return -EINVAL; + } + for ( i =3D 0; i < PFN_DOWN(psize); i++ ) if ( !mfn_valid(mfn_add(maddr_to_mfn(pbase), i)) ) { --=20 2.25.1