From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.8689.1637655845603640249 for ; Tue, 23 Nov 2021 00:24:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=aNQqMyC8; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="233701134" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="233701134" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 00:24:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="740422708" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga006.fm.intel.com with ESMTP; 23 Nov 2021 00:24:04 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 23 Nov 2021 00:24:04 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 23 Nov 2021 00:24:03 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 23 Nov 2021 00:24:03 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.174) 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.2242.12; Tue, 23 Nov 2021 00:24:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fCn9ZOpAVfO/24TjsbWR0XyfKO7YDrtQCxkbyReVHYLeBBZ+GWrgF94LqrCza4a4Lbc/IBhoY2xacvuP+KL317qbRs32z1VX09X3xMh0Td43u5prBPP6als2dYwSXz0iXZumUNVT7rvESuooZBCcoZ1u5oK01iF2/Qlq6ZrpnoyOG0W2ToEvhZ7abjzuiIaS6kcBoJ2SxU8GXEHD9zqcCaOZBUyqMPeD6Na9i7BzElLLsNoLLQrmOBB9FOh8WDjNnRkQo4tzMezsHwp/y9e2uDl85r9qI1pahEHnVhw2IJ6O148IAPkSSML704lZwnNWQViBpCakfrUtD4bzN00IKg== 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=TunzNWs8iOhRvQyW7R7Gkm6lgrgAU78ORKUIcQRM0NE=; b=moeTaYoI7pu65H29oGODExI3FptxBOj/F3bJT2L5oG316zBtFUcfy+CBc7NruXBJso9YqlM4nj/wvn+7lv9GbSdmCFB3jFkIL5jy3xK/QI9itLIEfZxY2hnscFLG6Z3nebsVLlBG9g8PPXgj92PZExJVO9FSRl0arSF+HfYz/KFGDoCuhnsAw9DUmC/W2Mxh+CzlNX93MmL7/Q1Fw7xT71Uk4hKU9hUyTTqXy0s3gI0Ksg+KSjE8SyzrIJfmezFRtU9Fanppj1dA1V/6h6EopowmMTKhNjh9rEOwqIQgznwCKV/9CnmfJJmaGPR8qAgbPVhF9wSMLbiT2slzZDZmtQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TunzNWs8iOhRvQyW7R7Gkm6lgrgAU78ORKUIcQRM0NE=; b=aNQqMyC8wkbnEjEJudSGF3J+5PSk1MKy57QBjQebaJx+jDnnJktMiydU3ZU12hZsDz2HcYCCc+3LUqQ4sSLDFlQ44SzH40XV7My0y2Mkh5Ne+0cT5G9eLg+TP5IlwjmdTy/g+RlYK2ZOiB3VsY/QZnF7THKPI+9cpP+MJAlL5lQ= Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB5125.namprd11.prod.outlook.com (2603:10b6:510:3e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Tue, 23 Nov 2021 08:24:01 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::fd42:b334:5030:af8d]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::fd42:b334:5030:af8d%5]) with mapi id 15.20.4713.024; Tue, 23 Nov 2021 08:24:01 +0000 From: "Min Xu" To: "Ni, Ray" , "devel@edk2.groups.io" , Gerd Hoffmann , Rebecca Cran , Peter Grehan , Tom Lendacky , Anthony Perard CC: "Yao, Jiewen" , "Dong, Eric" Subject: Re: [PATCH V3 3/3] OvmfPkg: Move LocalApicTimerDxe to UefiCpuPkg Thread-Topic: [PATCH V3 3/3] OvmfPkg: Move LocalApicTimerDxe to UefiCpuPkg Thread-Index: AQHX1GcSnX5kxdbVE0W2mw5aVRapPqwO8paAgAACppA= Date: Tue, 23 Nov 2021 08:24:01 +0000 Message-ID: References: <69c2eeac1fb327acc92626886477755b6b12e044.1636350203.git.min.m.xu@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 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: 8160b964-ef22-4d7f-f33b-08d9ae5a9ae5 x-ms-traffictypediagnostic: PH0PR11MB5125: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /BPHfjvwzV/Guxw98iMgakw0kCvUiPLdxfyIOhx+C9tAMYmR00j6ZLENNxT11w6vGqeK0zMvLiMgIKl5wMkWHFGuYopYROXKLjRFSeElUk+pinWO/xJi4BCPqgE3J7JDfF2eN8dCyy1hvOIZRybEaQDHNgkWWXsDyFZhXs/qelNhTLBGL8jw9w+dix7oyVjBSGjLGxjMYNWNKWAYYt/8gPJqyKZTg0eU8gU03Z2Ty04tLMREWNzpmpnO64+aul7++NhwMlfse5GnKJ8DV48yNaZEI3FJJRZYUOX93AsMUubifdy6ICvcyUL0X/39lUbhs+oiHCkkEmpq8xRzGS/pkLrdWmfIjgplnSmdJeHDmm/GWNX7mdm6RNmpxkZ3h3Hay7XRJSg/Hb6awp8By4SYqVHZnNRqt16J3ubHdf8qsQI93eLic1u07yaisPAw/sp5YDAEVaFJlNsiUu5eLrVTTjk9tifJ+HxGbgTR94mPU1RHuRWGMx36KF1OODFJgh1W19m8ylk7Ak+7i1mJW+ZkDJJ8/ZjR8h7bhhnCoGEvFgr4pK3ulu22p6rV4D9uUIZzIwyAvZHhEEp2v9D001ShM5EqExqR5lRSXA0PjjheaXirK4XjJ0mPpJF6hSn46DWd58zgiDzoZFJ9qXmtHXQl6jnZ0X3aQ+M4qxMuky8yFM7oszdx/BJgJ/LyIASnblWl2hvsK2es4QHk3I/Zc5Ud1+5LpO+wECKizpImqyVYxk5eV2dbaTdmCriUWZo5vYvkRCUM1GKPfttgQ0bvb0Nk/HgbRJ/+DGQkFbXa6X2gyFH7EUWPM32wGYAY4RfnjzEgFMiG6k2fBLmnDuoM2Fb9kA== 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:(366004)(8676002)(66946007)(66446008)(64756008)(66476007)(9686003)(110136005)(316002)(186003)(55016003)(86362001)(76116006)(508600001)(54906003)(2906002)(33656002)(8936002)(66556008)(966005)(83380400001)(5660300002)(4326008)(71200400001)(38070700005)(52536014)(6506007)(82960400001)(122000001)(7696005)(107886003)(26005)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ObTh35uOCFDF3V+fvQ//hsbeekruoMUiB0MrSK3FeaeX2Pj+QMea8IRoB9dz?= =?us-ascii?Q?yk78Z2CfYJm/GLB/seZlxGFpFuWLLbUMNUc6d3AYJPuRsm0q2m3dsFXLK/rw?= =?us-ascii?Q?+W82nAM1BmgW380eGLxX8JTJPxbuTU13R3Tjn6+0PmtL/Ae7Wq0fmVKPEZ1t?= =?us-ascii?Q?gG+O7n324wbSrlorG9BvynWJUauUiK2LXrBe0ucCKlHSeLvfmsF1v25uYEdO?= =?us-ascii?Q?7dUZL9cjJiZCHvvk7WZZeIeoAZurzAIoWne05bXDZldxPwg2cew7IGmjSiLk?= =?us-ascii?Q?xX6zIKMBSIv/f8q0gP3rx/fScyKNUo7MTcT5VsG/Ef2tfudLSe0fuL3qhbPd?= =?us-ascii?Q?WrjiDfu7JspdI+m4mg4gZJIJSExPjvBrCB1JowHMeRi2Ry655eHOA21sAzz3?= =?us-ascii?Q?7Sain0kwhJGcHqB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Jnt?= =?us-ascii?Q?hxa/Im69aIDtG+HFufCaNFkHUTcRcRSgDoRux1j9k8tFzu+Wwhckonce4P/U?= =?us-ascii?Q?J6r8nLmU1QG1ypyLWq4yi//QqDBNdpMcmR6lFkWlHMHyUU9k1poyQcNAFGmJ?= =?us-ascii?Q?Qi0vD91J90fyXAdTztFNep4vH7e2u2iTvE+Ij53/p2WnIdZgcd192SlCk7QV?= =?us-ascii?Q?5tMerldOAuDJz19c0vFygjSUY/jPcFeFSZMQTcmyF3G75W91dVJ1kOoqW4po?= =?us-ascii?Q?kS67zlmNzJ+gdVpDKJpqMDKgrIAI7Hh3k+psdJJCY44KzyxNbMBExXsuya1M?= =?us-ascii?Q?3Q=3D=3D?= 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: 8160b964-ef22-4d7f-f33b-08d9ae5a9ae5 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2021 08:24:01.7711 (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: j/yUqxFlJ2m1YKT6uSY2f2HWOhDzmR9ovSjoUYqQu4HaL0UrxD8hmACpwpDzO6srBYuzjMx+ORHzHXpxZ20EeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5125 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 November 22, 2021 11:05 AM, Ni Ray wrote: > Min, > What's the reason of moving this driver to UefiCpuPkg? Please refer to the discussion in https://edk2.groups.io/g/devel/topic/8673= 5078#83126 Because localApicTimerDxe is hardware feature. There is no specific OVMF or= QEMU related thing there. It does not make sense to keep it to OvmfPkg. >=20 > When the LocalApicTimerDxe is in OvmfPkg, it's clear that this driver is = only > used by OVMF/QEMU platform. > Now since the patch moves the driver to UefiCpuPkg, it's possible that ot= her > platforms may choose this driver as the timer driver in DXE phase. >=20 > So, we need to make sure the quality of this driver is good enough for a > broad scope of platforms. >=20 > 1. What's the issue when this driver still stays in OvmfPkg? If it's a mu= st that > this driver stays in UefiCpuPkg, please help to address following questio= ns: >=20 > 2. Can SourceLevelDebug (rely on Local APIC timer) work if this driver is > chosen as DXE timer driver? After checking the code and running the PoC (enable SourceLevelDebug and Lo= calApicTimerDxe), I find this driver doesn't work anymore.=20 Actually it asserts in https://github.com/mxu9/edk2/blob/ovmf_lapic_timer.v= 3/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c#L334 For TDVF we assume SourceLevelDebug is not supported. So LocalApicTimerDxe = is still working for TDVF. For other VM guests in OvmfPkg, can we assume SourceLevelDebug is NOT suppo= rted after LocalApicTimer is used (the older timer is 8254)? @Gerd Hoffmann (OvmfPkg) @ Rebecca Cran, @ Peter Grehan (Bhyve) @ Tom Lendacky, @Brijesh Singh (Sev) @ Anthony Perard , Julien Grall (Xen)=20 This limitation will be documented in LocalApicTimerDxe.inf so that the use= r of this timer driver is aware of it. > 3. Can detailed comments be added for " @bug : This does not handle > missed timer interrupts" in TimerInterruptHandler()? Sure. More comments will be added. > 4. Can detailed comments be added for " DisableInterrupts ();" in > TimerInterruptHandler()? Sure. More comments will be added. > 5. In general what kinds of platforms are capable of using this driver as= Timer > driver? Platforms that support local Apic are capable of using this driver. >=20 Thanks Min