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.web10.1938.1609790425220333055 for ; Mon, 04 Jan 2021 12:00:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JSKlWaxq; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609790424; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sHX1USRx6PA+W/OP0XemRNAhez1tiiYDlj5exKy2R28=; b=JSKlWaxqMStGB8Ajvcy52RCeqSrecxfQcIR8ilOZKXJmSHAJPkzyHT2q1XxgGf59PdRn6e rEIxvXdr8KqfkfnIr8MTGSiMsWHABGiuQjSPbj+dQpuTZMZbjyr5zHlzS4/QUcwQBrd+8m OmqGp8pvk3KpQaxeiEQbvxybsd9tIm8= 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-373-W4xBKIFQOhWh-vV0gnDtlQ-1; Mon, 04 Jan 2021 15:00:22 -0500 X-MC-Unique: W4xBKIFQOhWh-vV0gnDtlQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C43D801FAE; Mon, 4 Jan 2021 20:00:21 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-80.ams2.redhat.com [10.36.113.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0559D61F2B; Mon, 4 Jan 2021 20:00:19 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 04/12] OvmfPkg/ResetVector: Perform a simple SEV-ES sanity check To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Brijesh Singh , James Bottomley , Jordan Justen , Ard Biesheuvel References: <17a60d57656bd9351f318d325b9bd6ef64026769.1608065471.git.thomas.lendacky@amd.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 4 Jan 2021 21:00:19 +0100 MIME-Version: 1.0 In-Reply-To: <17a60d57656bd9351f318d325b9bd6ef64026769.1608065471.git.thomas.lendacky@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/15/20 21:51, Lendacky, Thomas wrote: > From: Tom Lendacky > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108 > > If a hypervisor incorrectly reports through CPUID that SEV-ES is not > active, ensure that a #VC exception was not taken. If it is found that > a #VC was taken, then the code enters a HLT loop. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Brijesh Singh > Signed-off-by: Tom Lendacky > --- > OvmfPkg/ResetVector/Ia32/PageTables64.asm | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVector/Ia32/PageTables64.asm > index 3cd909df4f09..b08f31157cbf 100644 > --- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm > +++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm > @@ -153,6 +153,21 @@ SevEncBitLowHlt: > jmp SevEncBitLowHlt > > NoSev: > + ; > + ; Perform an SEV-ES sanity check by seeing if a #VC exception occurred. > + ; > + cmp byte[SEV_ES_WORK_AREA], 0 > + jz NoSevPass > + > + ; > + ; A #VC was received, yet CPUID indicates no SEV-ES support, something > + ; isn't right. > + ; > +NoSevEsVcHlt: > + hlt > + jmp NoSevEsVcHlt > + > +NoSevPass: > xor eax, eax > > SevExit: > (Please consider the CLI question for this patch as well.) Reviewed-by: Laszlo Ersek Thanks Laszlo