From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.29024.1661244046651176805 for ; Tue, 23 Aug 2022 01:40:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aOw6Xzqk; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661244046; x=1692780046; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=pw7fcOXZ/r+gbCc0NKjRiJGGAOgEYZcRiw006jiVlAo=; b=aOw6Xzqkt5lNSB6SnRt7SfWF8j+etrbTINfuzTcYKtyxNZw6QgBfldbE d8VpYod9dm/gizykHzKYv+gpBNWCriIjFXOhUg/aks57u/KrAyLhnpS// qECubMsK+mhKtZIW0t4VdauuUAxvPrZFJrrDM7y4dbS6h4U/bYTCBhDaF sjItpFP9U+yJMXt5Cy+vppno47OHK90M5KL2d1KS9vr1MqiVUUf1hf30t eKEqeLvjCL/bQEFKhZl4nB+KWnPcK2MS//ybfSn8+PxYOzWkQcgz2kOz4 neTpm+P1ZW910AHqVmzYHhCSEDt+Lazn7I+6qhJeqzIo4hc7rDObpDWsQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="293628817" X-IronPort-AV: E=Sophos;i="5.93,257,1654585200"; d="scan'208";a="293628817" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Aug 2022 01:40:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,257,1654585200"; d="scan'208";a="669928716" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 23 Aug 2022 01:40:32 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 23 Aug 2022 01:40:32 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 23 Aug 2022 01:40:32 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 23 Aug 2022 01:40:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P6keXbuE8F24bDU6PTGTU/wU+zPE7MkIZ1x7wppmptazAaH3VW9rgZLNwcPkc2iGD1bvKlV1nzK8ifmFGPwVmvuLai6MNsKlVwNjE9uS1ZijTmIunz26WUZqh6/GcsnmI4R05Lvqx31syo1obX8/A3qF97Hxj1iwPdKOzHKi3u7CA25bthECyULUCgeDMb491VqRgvaH7fNm3XajA1S+s1XjuLEF8Z+zRjL4HU97fpvPdAZcqIXtenaCC7fc0hQip0RndlP4w5EBv2AQSE9r2lM9bfvVv91Bm04FS4cJPfsYu7VSX8biCd63jlnXBwoRkFvg3MemYC9qBzW2nanH9A== 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=XJ9HbwExxzk2nMhmkX2qEod3BwYBU7MXLXa/Qo3a+ow=; b=E16HlYC4097eony4pkeKVmKSsVjx4cuTGw/NoCoAiRsLiuYeKE/BnIuzQcYYctRVKxiiJ5UPB7U5Q+8u7MD3UaLIboRRCHQGnwsqRZd1IGV+EioNgJ5QZEBLUX6eR0nIjno1VjdbB80aZdhWl66w2WLCmdPKPQD1RBNusAF7er6vRkeQZA5LqPwdtQiasN/gE7F9yEhlZ1aPxy1bJpRnJ0Jd4NTobpwdx6GZmHLSv2K0yN7VBIlXGbPf7L0usPTWVrrkgdMAYDPbz610GwxrReCZogIpoqWqFx0L2Y6ilWpLyVfQXcKPVL7fJMPcyveVwZXjpc4vA5iu1MmzgMk7iQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by MW4PR11MB5823.namprd11.prod.outlook.com (2603:10b6:303:186::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Tue, 23 Aug 2022 08:40:30 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::ec3f:8428:41d6:3284]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::ec3f:8428:41d6:3284%4]) with mapi id 15.20.5546.024; Tue, 23 Aug 2022 08:40:30 +0000 From: "Min Xu" To: Gerd Hoffmann , Tom Lendacky CC: "devel@edk2.groups.io" , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" Subject: Re: [PATCH 1/1] OvmfPkg: Reserve the Ovmf work area as RT_DATA Thread-Topic: [PATCH 1/1] OvmfPkg: Reserve the Ovmf work area as RT_DATA Thread-Index: AQHYtc4z5aKi8l6fvU+iczNv26Kj5K26nSEAgAEW23CAAGbwgIAAD9Dg Date: Tue, 23 Aug 2022 08:40:29 +0000 Message-ID: References: <20220822022301.1454-1-min.m.xu@intel.com> <20220822085130.sdmuz3schsia4fxw@sirius.home.kraxel.org> <20220823073759.qwcbpaohiqjnzrrh@sirius.home.kraxel.org> In-Reply-To: <20220823073759.qwcbpaohiqjnzrrh@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d2bf097-3d97-46b6-2164-08da84e322ab x-ms-traffictypediagnostic: MW4PR11MB5823:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UknymmWV55MBgyzkHsfblb1Eqbte6CoyU9VQJG1VuqQkYTkO90WTxlX4TN9xw8gHIz5XWmLJDE372WATBCM1vJZ6MiABBJBpmHuDrNBJxdHExkBS8R5JncwWBXO6ENuS7pZV6fIozwjy+EEYeMVv2hIJCy+FxvRFYIOa23w80qrPj7MB2g07gOIUtXtgTq8GsH9NZ7VJOf5f0g8p3FTpO+A0q7hC9C0N8X4Ab1SuC5uDnkdiPoRubvbypdY5Kkopd2hfT5Y3Va8KdFypNwaR56wTmWpa7etYIBwwoD803BRhtAzTHPaK0K3Sf/mQbx3dhrVFfEYOJw012X9G6cxpsMzo0vfARz3KPqZ3axp8OZSDzkjwwqsBPrZ9OKM7GUY+S3N+LtNQ0nU2+soA65t14/KIbtIF1n/XjiheqP5nIiPOK7YzzXT/x4DMPZmx3VaSsgH1kGrEYXZlTXSCfdHcd2OVcXY5oem8uKELP1UqxRTulSAT+qo2ZbXmtYcDf+8k/Keh67suTa0vZDQnSjrzq28Sbk74sWHpMn9wIDvwxZ4g7itEn7S9Y9+31VDTq1HRfjDC6gBogDas7FAbKi01h2RGjc2ThDFTiouFFruVugiOO57UmfdO9CKXnu+5lySXhlGdv2COD6Jg0DQlzWyDcjolEXZHKxXKhGdTW+YYmxmWvdqJncwlvbCR5pD3hawdolCTAr3u7RRp/EbXhLiqrB1PmNlpEzrs5LucfxNCbtRmDT7MERufG2dMHLfLNaVD7QJXovmPY8eusE+XjaqpDjwCTHuPwvpK1ySAIbHyBuBAZdn+850HwEz3WVKNJhtyQJbytLF8nfw1PNLymxSoyg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(346002)(396003)(39860400002)(376002)(136003)(366004)(83380400001)(55016003)(38100700002)(38070700005)(8676002)(122000001)(64756008)(33656002)(66446008)(4326008)(76116006)(66476007)(66946007)(66556008)(110136005)(8936002)(71200400001)(26005)(966005)(52536014)(6506007)(19627235002)(5660300002)(9686003)(478600001)(316002)(54906003)(41300700001)(82960400001)(7696005)(86362001)(2906002)(186003)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BWB3iUdvP+sasuPKoa/NgPt9VedcUK1nhru9JqTx1tb7j/ppVcv5RJxRtJcu?= =?us-ascii?Q?1uXVWJ/iaRxs1OYVWxk50Nu0UYSz8XA8Mvxhs79/+c59Uv1nufznGNvvSnPN?= =?us-ascii?Q?46cH4ttlNo9+IVwFYEboxx8k9NJrGnd79u4V9rqTR+8oquXGVBzeTDb0OCFp?= =?us-ascii?Q?btkGapYUSzndp4xyeqNGkEaPn52BLIjpd3dvJE8/ZynNZiTRKXrECF5Oo5LL?= =?us-ascii?Q?Lzb1J/i4AWnjlSJkUbdQWCivjALTLJwUy71iMjtPqWgQG6ETHb2EH4QKQJOD?= =?us-ascii?Q?t38d6clAE+yJbAt8aNPkb3cCfISX+G4XSSW9rXjpPXV2HQ3/4/P0OCoePcDQ?= =?us-ascii?Q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w9JkgR64su?= =?us-ascii?Q?3BP7gUD8xBZnFz5XVHz9S5SgN3Icdhxx8iZ6qvHSJkOXGhu2lJnOHZnq8SDn?= =?us-ascii?Q?q8uuPlpabgLsdu1eOdX5N30QzF06vqRwG0tVd9v6uMmbYDseNAWWakVMmP3Q?= =?us-ascii?Q?rYRoQqDwmDb8GA9VQCZlmSoHf5Yl+SEulxMPgnuHg+P23d/FARM1Lw088hip?= =?us-ascii?Q?53+sGwbU8Veff7kUnSG505id85SCBAqvcdyBZt0yAZlIU68bHt4W4W2Jhs09?= =?us-ascii?Q?tk9JDGVi9YaA25Ht7KyvQ3rncAb26CQ2SfpbqADCrtavRLa4ZLaql1v9fRCk?= =?us-ascii?Q?R3NkX0ozuY1Lz2Bj6UVkhIH+vU5NBu6KiLtXRHrq?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2bf097-3d97-46b6-2164-08da84e322ab X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Aug 2022 08:40:30.0117 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: q4qBplFpRmx6y63pIoc+hTvZc8ajaCHSUyhs9x0ftnCDKj/RLkqLaKG03m5rtsUEsIGk2/BZxWFlenIE+WiQvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB5823 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On August 23, 2022 3:38 PM, Gerd Hoffmann wrote: > Hi, >=20 > > Ah, I forget to reserve the work-area as RT_Data in below code: > > BuildMemoryAllocationHob ( > > (EFI_PHYSICAL_ADDRESS)(UINTN)FixedPcdGet32 > (PcdOvmfWorkAreaBase), > > (UINT64)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaSize), > > PlatformInfoHob->S3Supported ? EfiACPIMemoryNVS : > EfiRuntimeServicesData <-- ACPI_NVS is not accessible either in OS-Runti= me. > > ); > > > https://github.com/tianocore/edk2/blob/master/OvmfPkg/Library/Platform > > InitLib/MemDetect.c#L1022-L1026 >=20 > With that changed to use EfiRuntimeServicesData unconditionally the page > fault is gone. >=20 > > Gerd, do you think we can reserve Ovmf WorkArea as RT_Data even when > S3 is supported? >=20 > Hmm, not fully sure how the various memory types are handled when the > VM is suspended. >=20 Tom suggested that the work area should not be kept around. In stead a PCD= should be used. https://edk2.groups.io/g/devel/message/92617 But the dynamic PCD is not thread-safe and it cannot be accessed by APs.=20 Now we have 2 solutions to fix this issue. 1. Reserve the Ovmf work area as RT_DATA. 2. Split the CcProbeLib into 2 instances. See https://edk2.groups.io/g/deve= l/message/91132 Gerd & Tom, what's your thought? Thanks Min