From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.13231.1678686639971147485 for ; Sun, 12 Mar 2023 22:50:40 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=iEUFWXVY; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: jiaxin.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678686639; x=1710222639; h=from:to:cc:subject:date:message-id:references: content-transfer-encoding:mime-version; bh=nHw6MtAl1F3D+HISGdcN1FwOjHtFEvfqmBS5NMABZjM=; b=iEUFWXVYt4oY6K9v8TSVla9b0ysBCP3AeNNIl2LQLpC8aO2o4wZs4Gaw Sok+MRIbLwJNoVeWv9nQsSypJzJ6AKN9SMTIGBvsrKTN+Mxm0hD/Q9ALQ oBRVlIDawfiFrJ9zaNdhJVzwwqUMHUJ0mejBFT6pYw4D9WzN0SckXL3uY oX6pXedBOUZPEsxrF/3SKUm/i/jYwWILXvfvb4r065PwzI/o8jr5ZYmwf 6q+62NZPdeIeIZCqbO5FJkf7IKx7JsV4gvha6cKqGt8rLLSV9JuFbZdq5 4bfRZb9BTLL3U1hlooMfpXxDTHqajcXSuZXdGkcW5T0owKLs0tM8O3Mi6 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="334541636" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="334541636" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2023 22:50:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="821816629" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="821816629" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 12 Mar 2023 22:50:39 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sun, 12 Mar 2023 22:50:38 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Sun, 12 Mar 2023 22:50:38 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Sun, 12 Mar 2023 22:50:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nQkBG7x61I2VmmbpOfAirdd+0toZcfY9hDtOfOKZXUnYpABt2bbijKOlo4V71MWhvkC6CPYK+KsqEhClZk15HNHPSm9FRuAWHSr3GP4ycXle3rNEttHY+SjKyKKfMktANT4f0pRD5EanpBd5zGO+F1DrqYKK9rlP0bSZ9CMTfjYqKxTObuOH50UPAuyPD0gXwWLdlitGbALUvMEYosmh9vPwWv2+ZoR3KZa7bEzUgglNa+sAZlMdvzp6sD7ZQ31EtSVNKdhC4mNF200axWfshARnIwF0BeZHtKfOOiZjN/XgGjDHBIG1cHsLycLbtZCmbGxq1vP/mu7p7XgC4GOJvA== 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=jzbF2XY7YCvGjIAqqMIg6cltISiddJoIlpCl7+bU7ew=; b=L0NGGmyv2MLS35ZUlMRvJyTG5s0O+P7Ncwi+6flknoHydJTN5nkv7OHxOlFVaQcDDCizy8TJmZeFB7qmTtwMnj7pzOmGd/4SRzlzTUnw20DzcSEjZ2gFLn9XhTlaiCaBBbW4oFxvR0lQKSyK1RO/fiZNdJKKggAw2Qno6/H3Yzrh8/zsPCZAJTCnBR4sXUbTzDKkcYfiC1Dmjm8qERxxYKxLoOs6frK36O4XK9BRVVho8T8oynwFcqTUXtIL99fndQCnABl0H0O1jnM+tcWNNEoqNpAaUgZ7RMyygr64uQOAGiokpur7hpLGjJtI3D2GLWsSBrEIy8WmtLI8BLE/3A== 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 MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by PH0PR11MB4983.namprd11.prod.outlook.com (2603:10b6:510:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Mon, 13 Mar 2023 05:50:36 +0000 Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::63ee:208e:c3f4:9d22]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::63ee:208e:c3f4:9d22%7]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 05:50:35 +0000 From: "Wu, Jiaxin" To: "kraxel@redhat.com" CC: "devel@edk2.groups.io" , "Ni, Ray" , "Dong, Eric" , "Zeng, Star" , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH v9 0/6] Simplify SMM Relocation Process Thread-Topic: [edk2-devel] [PATCH v9 0/6] Simplify SMM Relocation Process Thread-Index: AQHZQc5EcXLoCsJN4UeWtoW8JeFW+q7XCm8AgAACvWCAAhHfAIAUlqOAgAAH/1CAABuXgIAGArGwgAAO9ACAAAEDcIAEbrXA Date: Mon, 13 Mar 2023 05:50:35 +0000 Message-ID: References: <17443983D6ED8995.20300@groups.io> <20230221084854.ckcwtl4tt3onq623@sirius.home.kraxel.org> <20230306111315.pmglh65rd42llsue@sirius.home.kraxel.org> <20230306132037.seboq5tdsouqgrs4@sirius.home.kraxel.org> <20230310100120.bfl3wz6qpwh2i5nm@sirius.home.kraxel.org> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR11MB6158:EE_|PH0PR11MB4983:EE_ x-ms-office365-filtering-correlation-id: c939be9d-212f-4eb2-04b7-08db2386dd89 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SH0h51ItsEc98/FHBxZPgeO0ovcPuzmoZY2sRGcHZBnq6yc/ob6sYgzTEzjW6if8lHWEbGvpbhefExbLO3qp3KE1tXX2YDfkGvwV9nFegdSgIiShTc3eBAC5qzsOoYAu8hHHJeGDStdsD095BGsEG8lGElD1L75hHchqX76Om3oNxj843RGIaIUS7zXrrTZ6fdVpqJ7qafT5HpHqc52EgstTbcem0PMr+LPdjadGNuQDPowAXfQ4qeZ21E9rw3mG6jRXjInXX0XHMVXctAjsF/vhE7HUnAoTpTtqh+2oFlKlnd9U8sVTugRrMJsdBlVtWJRXTtz65WT3iUr+okCQFBTDLk1dHG9kPllJDSKDc0WpGcdg7Fs2WvdwqPT1ghnoZDRs9uDZNUmxP1uwW4HhzW7qpVohqbAbvkWix1capW8zzb0M95JSnVOLN2vUVaeDPKHjW1LhDqOWqqrSsFkDkH6nEFfNDLYapk/Ot7x27vt9E4UGvf1/WWUN5VKv6VhhNV6Hwkra2+sU33fjtbLs4ZkfWebkWY++hEv5xlPEU03Ig1JTpBYl56OoN2YZUehDQNVNZtCd5+T5DDunmOhNHWQLLJUcKMyXZQecrPz6hyrGyMNJyrESrFBBXBIG7YEipx0nyuS80uaa7cwcsPg0XtTxOs45pwYCTFOEnUvSu3bPGb+mpcxolg7pOqO1uDUxwBg7hKUHwIl1QM4R1d/NE34jxV43CpTR02v3ptAuVHI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6158.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(366004)(376002)(396003)(136003)(39860400002)(451199018)(107886003)(9686003)(6506007)(26005)(64756008)(7696005)(53546011)(71200400001)(66476007)(54906003)(186003)(316002)(66946007)(76116006)(66446008)(66556008)(8676002)(4326008)(122000001)(8936002)(52536014)(5660300002)(41300700001)(82960400001)(83380400001)(2906002)(6916009)(38100700002)(38070700005)(86362001)(478600001)(55016003)(33656002)(21314003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?I3/pRJsgTyOUPiLxs4p3m6ktJFWOHM94UdRJzZR/HLiHlKUhBRInj1JKF+Ll?= =?us-ascii?Q?cJkRpNEDTP01xsGdT80blZAWsUQ7JES8GJHg7GJTQgDdXFLpUx342gFVJl/k?= =?us-ascii?Q?Sq7DsFZUNQlv1URoF0UWZABlvrz2tFqsbsiz2C64RcPYF5Rwr3PIHs5WLfds?= =?us-ascii?Q?fxlrjomTiuG3QHTjr7SUjBpg/YOllVuKit3BIwJsO6nrtFwBjgSgl8iJc/YC?= =?us-ascii?Q?ZhNIqJiOUy+KISpy32dwoXJKz5QO5yxX6uci9A38WiMcrbF2qfTlxKXBANjr?= =?us-ascii?Q?Pt5Cgljzrg2lLE5rKZOhS5jmdxzP3RmyZbfsIxQ9TFHTMnmcUCHmo3fH+a+t?= =?us-ascii?Q?lYAhNPmOW9oeJ5KDzfYxwCAaO2T5VSrjad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GwvzJBGkHiehTH1kPWt+LFz4Df/AfegakK3Tj8/gR9MJmU+m6WpoF+ev3Hi?= =?us-ascii?Q?RInUo+sMf0RH735M3AiO6zx1EP1yUKGVNWwfhBKbw1xeU1NaQiE8df6424Tw?= =?us-ascii?Q?JkNHSqiPBW7dgXUllDmGY3CfUTbyJB07DadNyMxCoY1GgTE4Im8NulQv/53l?= =?us-ascii?Q?bN5jLczbkdGVYPo0S4cCJ1iRlffXpCK8St7ZXhwciU/72BdGQnaULrNPhFFj?= =?us-ascii?Q?XYEp2nITtnlyfOkDD1HmK+C03+33RCqxxiT6wOmDKpViJl9KYv765STwsIFj?= =?us-ascii?Q?1telE38ze1+0A+TJj+iRDChljfxme5N9ZtjfVXZ3?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c939be9d-212f-4eb2-04b7-08db2386dd89 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2023 05:50:35.2079 (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: yucFK0TiQkGsD1LGgZzkK/KPsyZwB1owxNzI93gpEQUA9uaI1qRd4+/l78ng/Y3Msu7YXm/LALyVHpEASYrnGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4983 Return-Path: jiaxin.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I can reproduce the issue and root cause to below code. GetFirstGuidHob() c= an't be used after exit boot service, that's the reason why I didn't catch = the issue during the S3 test in shell. I will remove those check directly, = and add debug message for the mSmmRelocated value. ASSERT (mSmmRelocated =3D=3D (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid)= !=3D NULL)); if (mSmmRelocated !=3D (BOOLEAN)(GetFirstGuidHob (&gSmmBaseHobGuid) !=3D = NULL)) { DEBUG (( DEBUG_ERROR, "gSmmBaseHobGuid %a produced in normal boot but %a in S3 boot!", mSmmRelocated ? "is" : "is not", mSmmRelocated ? "is not" : "is" )); CpuDeadLoop (); } Thanks, Jiaxin=20 > -----Original Message----- > From: Wu, Jiaxin > Sent: Friday, March 10, 2023 6:18 PM > To: kraxel@redhat.com > Cc: devel@edk2.groups.io; Ni, Ray ; Dong, Eric > ; Zeng, Star ; Laszlo Ersek > ; Kumar, Rahul R > Subject: RE: [edk2-devel] [PATCH v9 0/6] Simplify SMM Relocation Process >=20 > I will have a try with the command. >=20 > For BIOS shell trigger S3, it just needs a simple application to provide = the ACPI > FACS waking vector, then write the power management control address at > offset 4. >=20 > Another way is that shell MM command can achieve the trigger action, for > example like: mm -io (xxx+4) 0x3400 -w 4, but I suppose the system will c= rash > since there is no waking vector. >=20 > Thanks, > Jiaxin >=20 > > -----Original Message----- > > From: kraxel@redhat.com > > Sent: Friday, March 10, 2023 6:01 PM > > To: Wu, Jiaxin > > Cc: devel@edk2.groups.io; Ni, Ray ; Dong, Eric > > ; Zeng, Star ; Laszlo Ersek > > ; Kumar, Rahul R > > Subject: Re: [edk2-devel] [PATCH v9 0/6] Simplify SMM Relocation Proces= s > > > > On Fri, Mar 10, 2023 at 09:19:04AM +0000, Wu, Jiaxin wrote: > > > Is this regression? I remember I tried the S3 on real silicon with th= e patch > > change, don't see the issue in normal boot work flow. The only differen= ce > what > > I did is to trigger S3 in the BIOS shell, but it does covered the SmmRe= storeCpu > > test. > > > > > > Now, I'm trying to reproduce the issue on ovmf, and build the OVMF bo= ot > on > > windows qemu, but I saw below error during boot: > > > SecCoreStartupWithStack(0xFFFCC000, 0x820000) > > > ASSERT [SecMain] > > c:\dev\code\edk2\MdePkg\Library\BasePcdLibNull\PcdLib.c(95): > > ((BOOLEAN)(0=3D=3D1)) > > > > > > Build command is: > > > build -p OvmfPkg\OvmfPkgIa32X64.dsc -a X64 -D SMM_REQUIRE -D > > DEBUG_ON_SERIAL_PORT -D SOURCE_DEBUG_ENABLE > > > > > > Run qemu command is: > > > qemu-system-x86_64 -bios > > C:\Dev\Code\edk2\Build\Ovmf3264\DEBUG_VS2015x86\FV\OVMF.fd -hda > > fat:rw:hda-contents -serial file:log001.log -net none > > > > Mine is this: > > > > qemu-system-x86_64 -enable-kvm -machine q35,smm=3Don -m 4G -net none \ > > -drive > > > if=3Dpflash,format=3Draw,file=3DBuild/Ovmf3264/DEBUG_GCC5/FV/OVMF_CODE.fd= ,r > > eadonly=3Don \ > > -drive > > > if=3Dpflash,format=3Draw,file=3DBuild/Ovmf3264/DEBUG_GCC5/FV/OVMF_VARS.fd= ,s > > napshot=3Don \ > > -chardev vc,id=3Dfw.log -device isa- > > debugcon,iobase=3D0x402,chardev=3Dfw.log \ > > -cdrom /vmdisk/iso/Fedora-Workstation-Live-x86_64-37-1.7.iso \ > > -device virtio-tablet-pci \ > > -display gtk,show-tabs=3Don > > > > > Anything need to be care to build OvmfPkgIa32X64? > > > > It must be started with the correct flash configuration, see above. > > The SMM-enabled builds also require the q35 machine type. > > > > I have both SMM_REQUIRE and SECURE_BOOT enabled, that probably > doesn't > > make a difference though. I'm using the isa-debugcon instead of the > > serial port to get the debug log, that should not matter either. > > > > > BTW, how can I boot linux guest in windows qemu? > > > > Just grab some live iso. The fedora image used above is available from > > getfedora.org, but any live image should work. > > > > How do you trigger suspend from efi shell? There seems to be no > > builtin command for that. > > > > take care, > > Gerd