From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.47]) by mx.groups.io with SMTP id smtpd.web10.12795.1684400998213995707 for ; Thu, 18 May 2023 02:09:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6T+pBySI; spf=pass (domain: arm.com, ip: 40.107.7.47, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vJ9AsYg1KYgAoguLUfoR6fDHuIMPDYEqPbiZqVlcGsY=; b=6T+pBySI53vIrmZJZ5l2Tbzmnpu1gsPCAe44u2Rhjwrp87RuwSS6Hi9yZUUXhf7Fb5UT4CmOSjAlBsAdBVDFTf34vNmF/D232LVK1S+Wv5+pXxbREqjDvqZt47eyiHdnzhchaOlbh4LWnMT6RLpiyX1EJKO2JTkbKJsGOIj0b+w= Received: from AS9PR05CA0225.eurprd05.prod.outlook.com (2603:10a6:20b:494::16) by DU0PR08MB8324.eurprd08.prod.outlook.com (2603:10a6:10:40b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Thu, 18 May 2023 09:09:54 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:494:cafe::c3) by AS9PR05CA0225.outlook.office365.com (2603:10a6:20b:494::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Thu, 18 May 2023 09:09:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Thu, 18 May 2023 09:09:54 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Thu, 18 May 2023 09:09:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ce35d3fad426a7d3 X-CR-MTA-TID: 64aa7808 Received: from f9fafc150092.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8FB31266-DE84-40B8-AB36-EF2F1570A4B4.1; Thu, 18 May 2023 09:09:42 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f9fafc150092.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 18 May 2023 09:09:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CPxxLflVP6mdXQnCnYhQAgWglq3G7llqdZwIlx8dvTF6Gzxg/t5woqBAyY6VVHuSXE3jJzKdnvvNPKtKgFYUdVrYCqXGerBiOC0OzOU8C1TVXHv75p+E7agOVJvbI1pdzebFOHJ5WzO+9gnUaVDKzZ0eZ66W3A8fckqAaBOUD2hvVSrb3wZJUn4ILsrz8h9R1ZCCb+p//Jospz0n+tt6ocsJ1C138UebtoUd1bJM9eWBbsi2/bBgYuZ1MPmw7hxrrWJvMWtn+DpUzuLiYKYG2/t7HM+Ghu4Feh+fOEP7PTtxFuhsIY5U3jXAwZvsuGDbTX3R4QXAOpW/yRfuKZce5A== 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=vJ9AsYg1KYgAoguLUfoR6fDHuIMPDYEqPbiZqVlcGsY=; b=oaTp6m2AKd5GlKEVkPlN2Uchtj7YdLD8YNr3lzlulTgXtWTDTwx1G8awAvy8xGWItf2zk/PorpNpE/Sxcpv9Yv3P3JmRoLLA6aqo8qeFMkyIRk37K84yi0gDu/dBHtbteMh6pCI1SHQMXK71Uw12jOrRmdKqFiIbu9KZnUat2OAt81B5PIwDNAy9NfeI+sB716sJvEm+8Ge8vf9Vqi/85aGD+E/0A0tfGpNK2mjyqx+Axa56Y249NDb3dIBRb2QkPp9dUhwiXyJWPbUYEToiV9LXaZG9tIE3X9+JX7pMI4fjrn1E1FuBh9riYj8yNqFuZsdqziKNuACrGQh+O9N3mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vJ9AsYg1KYgAoguLUfoR6fDHuIMPDYEqPbiZqVlcGsY=; b=6T+pBySI53vIrmZJZ5l2Tbzmnpu1gsPCAe44u2Rhjwrp87RuwSS6Hi9yZUUXhf7Fb5UT4CmOSjAlBsAdBVDFTf34vNmF/D232LVK1S+Wv5+pXxbREqjDvqZt47eyiHdnzhchaOlbh4LWnMT6RLpiyX1EJKO2JTkbKJsGOIj0b+w= Received: from DB7PR05CA0067.eurprd05.prod.outlook.com (2603:10a6:10:2e::44) by GV1PR08MB7329.eurprd08.prod.outlook.com (2603:10a6:150:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Thu, 18 May 2023 09:09:37 +0000 Received: from DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::e3) by DB7PR05CA0067.outlook.office365.com (2603:10a6:10:2e::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Thu, 18 May 2023 09:09:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT018.mail.protection.outlook.com (100.127.142.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.18 via Frontend Transport; Thu, 18 May 2023 09:09:36 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 18 May 2023 09:09:36 +0000 Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 18 May 2023 09:09:35 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [PATCH v1 0/6] ArmVirtPkg: Add dynamic CFI flash detection for Kvmtool guests Date: Thu, 18 May 2023 10:09:29 +0100 Message-ID: <20230518090935.10984-1-sami.mujawar@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT018:EE_|GV1PR08MB7329:EE_|AM7EUR03FT021:EE_|DU0PR08MB8324:EE_ X-MS-Office365-Filtering-Correlation-Id: 0233ad4d-44c7-4973-03df-08db577fa4e1 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 2icM48gbYVcNXyyhbJfwjG2WxQZRe0NdBx5JBlUs7iyJ69qmKSzbUVuDT9IUEddiBDRDuz8SLfHLCsdGdZeyII5ERvmIolgnYnEpeBUv0gdGL3GZcyPV/eNpUHUA4PiaZqJFs9LhRAoMtnSIgjf1cyunV5qUT3LPbu5hE2gernVzA0hiKh+inXQt3bQvpSAidekFX6wlBHF/3QGV60zh/gRciVWmy4Xv93AgO/IIFCbBbAgGyTkyAQ0IIdmBNgNDtKZujfKTGasRotfLmaUPUyRVHS/DFTdQXVUGINiHrtKNtGmTYMlWy052J7LAiXwcbmbLrhQuODAi6P5xrb+zTPNdYW10HPPzuBaH3XZvikSZ35SfGXYVQ4w4AX+KQ6JewVBSfVRmLgaSvuaDdOQ9lukeuVPKzY26dty0FYiVwOoK5sQdGMUMmZ6Z2t9icv1HiBqr6KkJgef4pYH7OtWpy2GxV/XB16Pmji3TsxIAFIutNiBVwuMZL2/Zd8D+OtV8smmtYlLSwvSd5qB0xuUIGVL1wb3NJtMZg2NOSMbLU+YfrT7/ZRt1c4WyflA3Dx+OQDN0Y68dSpK1kDXX7e/RJeg717+dck2m8ZsNPbnDTTomRtak3ZTgeRIzZrDhiH61dly+zhljxbaSvh2KTbKANxDchCJ8vlDLDC1LpUzZKtmITYiaTopflOx2q93Vj38x8/yTOAhFyqLDzp0nfM9UQiOFrx7t+jTZ9YSyG313JzTewNbzO4U7Bf4JlOTcXdufKYiPjd2V4DAMnZY7NweEjA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(6916009)(70206006)(966005)(478600001)(70586007)(4326008)(54906003)(316002)(86362001)(36756003)(83380400001)(47076005)(1076003)(36860700001)(336012)(2616005)(186003)(26005)(426003)(7696005)(5660300002)(8676002)(2906002)(8936002)(40480700001)(6666004)(82310400005)(44832011)(356005)(82740400003)(81166007)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7329 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ecef65d7-04ac-4cf3-7ed1-08db577f9a8c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7bkRLngy++8pAypnGo2uNjvlnyRoEg8+ebMJtPT/9CqIdYruf6conWucXGyh3/hj5T3DZegYJyIA+4TQgdcN68YL0mY1BS8S6+dBwDQFRt4lSS2M3eDxSU41zFVLgOwmAZI0x8GK04a+lV9BH+F9NDeLR0UXP67jJPwYwrlzSEWyRWeFq6dHxuDX36I4DxjD9KlIVzZLea9FtAsat10onThwLBAzL6SmxGMvsFk3Dct9H6UigTfasiPrLel5ytqGHGA2xCYfJW19Wox/Bgi+n1v1OKfFl2GHTDJew9e1eyEzd3TAKTx9vh4shqqy6v2cR0BP5s9l1HX0I0sZTzN+gagHD21AN2KuzmE/aXLgjtQrlD477OlCbJ2t3X3fX1UHXUFF+9pCRaEOC6A+x1fqgkF3kESuae+em2218rIDryX1t50hzm22kXD0rIwYDgw/xUjNz7AIeYeyTIXRbFqr5WyXK1DaG6bjEK+fCEtZ07r915GR+ff89CbioXJljszp+r9xirg9M8nOX85EWZ5JT2rq830JUvK5bBkNMQcA8ZxcZD2QwREcrqd0XgKkwjTapoZIoh6BicDVqXZ1+D44I/nj9d3PKcUHyd/QE4DaSVinzgZBTVHrwwkmVQw1/asn0mUGzGOqL0xuL5OsUt2z7xJU7MDy9SjVfYDBaq10RD+i8QYbjwpeQGcbScwF+b3orZozgwbMvlvNyOxTQVFhWfS6noRjejTfYFk0nbGhMA0= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(36860700001)(336012)(47076005)(966005)(478600001)(54906003)(7696005)(2616005)(186003)(1076003)(6666004)(426003)(26005)(40460700003)(82310400005)(2906002)(6916009)(44832011)(36756003)(4326008)(70206006)(81166007)(82740400003)(86362001)(41300700001)(8936002)(40480700001)(8676002)(70586007)(316002)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2023 09:09:54.1105 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0233ad4d-44c7-4973-03df-08db577fa4e1 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8324 Content-Type: text/plain Kvmtool allows guest VMs to be launched with or without a CFI flash device. The guest hardware configuration can be seen in the device tree that Kvmtool hands off to the guest firmware. Therefore, add support to dynamically detect if a CFI flash device is present. If CFI is present use the NorFlashDxe driver as the backend for variable services; otherwise use emulated runtime variables. The last 2 patches in this series fix a crash due to stack overflow which is observed when running the UEFI shell command 'dmpstore'. The changes can be seen at: https://github.com/samimujawar/edk2/tree/2646_dynamic_cfi_detection_v1 Sami Mujawar (6): ArmPkg: Configure PcdEmuVariableNvModeEnable as a dynamic PCD ArmVirtPkg: Define variables for emulating runtime variables ArmVirtPkg: Fallback to variable emulation if no CFI is found ArmVirtPkg: Dispatch variable service if variable emulation is enabled ArmVirtPkg: Kvmtool: Increase primary core stack size ArmVirtPkg: ArmVirtQemuKernel: Increase primary core stack size ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 +- ArmVirtPkg/ArmVirtKvmTool.dsc | 13 +++++-- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c | 13 ++++++- ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf | 4 ++- ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c | 38 +++++++++++++++++--- ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 3 +- 7 files changed, 63 insertions(+), 12 deletions(-) -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'