From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.8478.1635228719461249065 for ; Mon, 25 Oct 2021 23:12:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AH3fwQNG; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635228718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=04PQLH83Eg81t/SPhfeI9GZhGD56S85PcJJqIwgL3Q4=; b=AH3fwQNGGzF71oJlYQ9/xViu9/A0kqIxCrfZKLZjEm9c2t5TBTxx4IoFVoyYLI3XpKo6f/ PU5oZ/WKQX5IqY1mlV67XhC7P1x15F/ADnfNfmMQg8MWA6YXi4WW/VHnp6b07ihV84D3Iv 7QeHRYRvbIdpmwjZ3etHqsj7+3WqyUM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-581-GB6iX7-kN7abax_sZWOlLg-1; Tue, 26 Oct 2021 02:11:52 -0400 X-MC-Unique: GB6iX7-kN7abax_sZWOlLg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3E9410B3940; Tue, 26 Oct 2021 06:11:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40DDD610A6; Tue, 26 Oct 2021 06:11:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7907718007A6; Tue, 26 Oct 2021 08:11:48 +0200 (CEST) Date: Tue, 26 Oct 2021 08:11:48 +0200 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: "devel@edk2.groups.io" , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , Tom Lendacky , "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul1" Subject: Re: [edk2-devel] [PATCH V2 12/28] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception Message-ID: <20211026061148.omqerrswnpgs3jin@sirius.home.kraxel.org> References: <24d3a351f21bff1a4b20490313d039e403b1453c.1633401643.git.min.m.xu@intel.com> <20211012102716.wr6bao42f5hviz5z@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 26, 2021 at 05:06:21AM +0000, Xu, Min M wrote: > On October 12, 2021 6:27 PM, Gerd Hoffmann wrote: > > > + if (ExceptionType == VE_EXCEPTION) { > > > + EFI_STATUS Status; > > > + // > > > + // #VE needs to be handled immediately upon enabling exception handling > > > + // and therefore can't use the RegisterCpuInterruptHandler() interface. > > > > Can please you explain in more detail why this is the case? > > > VE Exception may happen before a component registers exception. > > So it has to be implemented inside the exception lib. Well, no, you can also change the code to avoid triggering an exception. Adding a new lib for the exception means the lib must be added into each and every *.dsc file (either the tdx impl or the null variant), not only in the tianocore core itself but also all projects depending on tianocore. So IMHO it is worth checking out how much effort it would be to avoid early (before component registration) exceptions. Which early exception do actually happen? take care, Gerd