From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web09.300.1611361541678661478 for ; Fri, 22 Jan 2021 16:25:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ULNo1BZA; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611361540; 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=6iEIkSVL3B2/LJhWmqTHMO5GZzEbN4jjAItpeyHyz7o=; b=ULNo1BZAcgXvMPAXZhpURF2fHCxXlYzcIHYMHV1rvf57LT4sAv8Lc5hQDI+fiRwtY6TBTU vJan+I2k0lBnHhFh84yDl9d4d7xXv/d+oeZPERLB8SgfXldVo1oQ+CEJFP+NhsdTKRKHT+ sinHNOkH34yNKQAysbp08KCM3xRfwBE= 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-322-RUQuwj8zNguMsFQwbDdjxQ-1; Fri, 22 Jan 2021 19:25:38 -0500 X-MC-Unique: RUQuwj8zNguMsFQwbDdjxQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1157806661; Sat, 23 Jan 2021 00:25:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-81.ams2.redhat.com [10.36.113.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B0EB19C71; Sat, 23 Jan 2021 00:25:36 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Use physical address with SEV-ES To: Tom Lendacky , devel@edk2.groups.io Cc: Brijesh Singh , Jordan Justen , Ard Biesheuvel References: <8bba19920e58813f32889dec522bbcd8de113219.1611338106.git.thomas.lendacky@amd.com> <8d660790-fafd-c0d5-f1eb-1e02830a7fa9@redhat.com> From: "Laszlo Ersek" Message-ID: Date: Sat, 23 Jan 2021 01:25:35 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 01/22/21 23:40, Tom Lendacky wrote: > Can SetVirtualAddressMap() be called more than once? According to the UEFI spec: no, it can't. The call to SetVirtualAddressMap() must be done with the physical mappings. On successful return from this function, the system must then make any future calls with the newly assigned virtual mappings. [...] The SetVirtualAddressMap() and ConvertPointer() services are only callable in physical mode, so they do not need to be converted from physical pointers to virtual pointers. [...] A virtual address map may only be applied one time. Once the runtime system is in virtual mode, calls to this function return EFI_UNSUPPORTED. (I seem to detect a bit of contradiction between quotes #1+#2 and #3 -- the first two quotes seem to explain that a second call is expected to be impossible, whereas the third quote explains how a second or later call should behave. But, anyway, the intent is clear.) Thanks, Laszlo