From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2B31F94163C for ; Tue, 16 Jan 2024 10:03:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4KMw9NhlzOm5v1rfq800iSSRQf7V9SlLe/KmAxFcH44=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705399378; v=1; b=Tqa+9aEibFHqwVOLx2jhH+eeiELKGWDCz3sIegprr5azyiH7WpIXqRQxFQoMFFluDuqksTDr clcc052dAXwL4E9QkNSCf+opusoASiVKXQdatLONjVjlr+I7QZrJKSYL2DLX2JGgVbeDST5Gwdh ieFrjY6hK7ZQ+8zJWmBGN/xc= X-Received: by 127.0.0.2 with SMTP id 3AcjYY7687511x6mUA6FlrET; Tue, 16 Jan 2024 02:02:58 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.9883.1705399378185418659 for ; Tue, 16 Jan 2024 02:02:58 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-uaV2HjfmPHaVaeTODnrcYQ-1; Tue, 16 Jan 2024 05:02:53 -0500 X-MC-Unique: uaV2HjfmPHaVaeTODnrcYQ-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 269111005055; Tue, 16 Jan 2024 10:02:53 +0000 (UTC) X-Received: from [10.39.194.248] (unknown [10.39.194.248]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 105992166B32; Tue, 16 Jan 2024 10:02:51 +0000 (UTC) Message-ID: <9e829262-3771-694c-b2a4-e4e267ecc3d5@redhat.com> Date: Tue, 16 Jan 2024 11:02:50 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 1/6] UefiCpuPkg/LocalApicTimerDxe: Duplicate OvmfPkg/LocalApicTimerDxe driver To: "Kinney, Michael D" , Pedro Falcato , "devel@edk2.groups.io" , "Ni, Ray" Cc: "Desimone, Nathaniel L" , "Kumar, Rahul R" , Gerd Hoffmann References: <20240115080325.147-1-ray.ni@intel.com> <20240115080325.147-2-ray.ni@intel.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2YN3Ae1aoTv9a5BCo6tEtLAOx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Tqa+9aEi; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/15/24 19:10, Kinney, Michael D wrote: > Hi Ray, > > I think nesting may be possible in physical platforms, but very hard > to induce. > > One option is to consolidate to a single LocalApicTimerDxe > implementation in the UefiCpuPkg, but allow the platform DSC to either > specify a Null NestedInterruptTplLib for physical platforms or the > full one from the OvmfPkg for VM use cases. > > The other changes could be included for OvmfPkg use cases. If the VM > does not support the CPUID leafs, then the PCD value should be used. All of this sounds great! (And I do think that *some* nesting should not be a problem, on either physical or virtual platforms, as (IIRC) the interrupt handler stack can accommodate a certain level of reentrancy. It's the "storm" that is a problem, but that should never occur on physical machines, I reckon.) Assuming a v2 is coming up, my advance request would be for Ray to re-review the math in patch #4, before posting v2, focusing on integer overflows, and SafeIntLib (if needed). I've not looked at the patch in detail yet, but I reviewed something similar not so long ago [1]. The latter frequency calculation code had been quite commonly used in edk2, and I needed hours to review just that one patch. Plus, the review turned up a number of issues to fix. So, preferably such a patch should not only prevent any integer overflows, but also clarify, in comments, why overflows are impossible, and/or how they are prevented. [1] https://edk2.groups.io/g/devel/message/111613 http://mid.mail-archive.com/2e42db7c-a927-f47b-7d80-632895b11e1b@redhat= .com Thanks! Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113884): https://edk2.groups.io/g/devel/message/113884 Mute This Topic: https://groups.io/mt/103734961/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-