From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.groups.io with SMTP id smtpd.web12.54035.1585584416897116066 for ; Mon, 30 Mar 2020 09:06:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NrDWBPik; spf=pass (domain: redhat.com, ip: 63.128.21.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585584416; 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=b/x0LIGPkhPlLIIk845+O3JHeTdrKk3yoM1wGtT1hY4=; b=NrDWBPik5rM9a77Egr9K/2+ak15GYzkkYZdF9kGttJpxhwtyEu4jnnmD1NGBm/hlLeo2mQ q3ISNzU4jxHAINYaccsMP1m+dgosRhN9X8/4gHZa5+NP8eQybwcpNrP3Fz43x/ejBYJr3W hkcZDBHmnjbMovUzK7jS3Nwpo678eUU= 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-142-TkyCaFGtN1y4P00rEZ0CEQ-1; Mon, 30 Mar 2020 12:06:51 -0400 X-MC-Unique: TkyCaFGtN1y4P00rEZ0CEQ-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 7F93C1085926; Mon, 30 Mar 2020 16:06:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-191.ams2.redhat.com [10.36.112.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17F6519925; Mon, 30 Mar 2020 16:06:48 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 14/17] OvmfPkg/PvScsiDxe: Introduce DMA communication buffer To: devel@edk2.groups.io, liran.alon@oracle.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org References: <20200328200100.60786-1-liran.alon@oracle.com> <20200328200100.60786-15-liran.alon@oracle.com> From: "Laszlo Ersek" Message-ID: <0a2a628e-8549-338b-b5f3-09cb4342cda5@redhat.com> Date: Mon, 30 Mar 2020 18:06:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200328200100.60786-15-liran.alon@oracle.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/28/20 21:00, Liran Alon wrote: > In case device is constrained by IOMMU or guest is running under AMD SEV, > input/output buffers provided to device (DataBuffer and SenseData) needs > to be explicitly mapped to device by PciIo->Map(). > > To avoid the overhead of mapping/unmapping the DataBuffer and SenseData > to the device for every SCSI requst (and to simplify code), introduce a > single DMA communication buffer that will be mapped to device on > initialization. When a SCSI request needs to be sent to device, the > DataBuffer and SenseData will be copied from/to the DMA communication > buffer as required. This will be done by the following commits. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 > Signed-off-by: Liran Alon > --- > OvmfPkg/PvScsiDxe/PvScsi.c | 60 ++++++++++++++++++++++++++++++-------- > OvmfPkg/PvScsiDxe/PvScsi.h | 20 +++++++++++++ > 2 files changed, 68 insertions(+), 12 deletions(-) Reviewed-by: Laszlo Ersek