From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web11.9.1594829961239162094 for ; Wed, 15 Jul 2020 09:19:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iTjmDO62; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594829960; 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=3daQt0Oem9KqN3726zsoN8k8h3XLVIwaO9BtjJOKHWk=; b=iTjmDO6251fANrAGOTjID3Ot/xrdYTSqxUiZEwJR1VSZdTET96ymJpUpw/1TR7BiITkBUv 7upfvbeUgGGiAv80IEnm9vc2vYemeb/nvF+6CNZZj4iBWdJ5DxrgeWIBO0bKUG7GWIjEwk 3qtndyGF/tjTZOsvbPBaZFGfJwHZ3Wk= 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-45-Hkde3GpVO0iu_nAjdSRrkg-1; Wed, 15 Jul 2020 12:19:07 -0400 X-MC-Unique: Hkde3GpVO0iu_nAjdSRrkg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B86D102C7F1; Wed, 15 Jul 2020 16:19:06 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-3.ams2.redhat.com [10.36.114.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EE1E5FC1A; Wed, 15 Jul 2020 16:19:04 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v10 17/46] OvmfPkg/VmgExitLib: Add support for NPF NAE events (MMIO) To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Brijesh Singh , Ard Biesheuvel , Eric Dong , Jordan Justen , Liming Gao , Michael D Kinney , Ray Ni References: <5d684a30f2d5ab378244521445036e7e2539cfea.1594736896.git.thomas.lendacky@amd.com> From: "Laszlo Ersek" Message-ID: <1e69c400-68d0-ce3b-3e4b-11fe594232fe@redhat.com> Date: Wed, 15 Jul 2020 18:19:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5d684a30f2d5ab378244521445036e7e2539cfea.1594736896.git.thomas.lendacky@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 07/14/20 16:27, Lendacky, Thomas wrote: > From: Tom Lendacky > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 > > Under SEV-ES, a NPF intercept for an NPT entry with a reserved bit set > generates a #VC exception. This condition is assumed to be an MMIO access. > VMGEXIT must be used to allow the hypervisor to handle this intercept. > > Add support to construct the required GHCB values to support a NPF NAE > event for MMIO. Parse the instruction that generated the #VC exception, > setting the required register values in the GHCB and creating the proper > SW_EXIT_INFO1, SW_EXITINFO2 and SW_SCRATCH values in the GHCB. > > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Acked-by: Laszlo Ersek > Signed-off-by: Tom Lendacky > --- > OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 486 ++++++++++++++++++ > 1 file changed, 486 insertions(+) Thanks for the updates: - CopyMem() indentation - Displacement multiplier cast to INT64 (VS warning suppression) - comment style fixes - other indentation fixes My ACK stands. Laszlo