[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed9aa3d5-9ac8-2195-e617-85599ffd7864@suse.com>
Date: Sun, 5 Dec 2021 11:31:45 +0100
From: Juergen Gross <jgross@...e.com>
To: Tianyu Lan <ltykernel@...il.com>, kys@...rosoft.com,
haiyangz@...rosoft.com, sthemmin@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, sstabellini@...nel.org, boris.ostrovsky@...cle.com,
joro@...tes.org, will@...nel.org, davem@...emloft.net,
kuba@...nel.org, jejb@...ux.ibm.com, martin.petersen@...cle.com,
arnd@...db.de, hch@...radead.org, m.szyprowski@...sung.com,
robin.murphy@....com, thomas.lendacky@....com,
Tianyu.Lan@...rosoft.com, xen-devel@...ts.xenproject.org,
michael.h.kelley@...rosoft.com
Cc: iommu@...ts.linux-foundation.org, linux-arch@...r.kernel.org,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org, netdev@...r.kernel.org,
vkuznets@...hat.com, brijesh.singh@....com, konrad.wilk@...cle.com,
hch@....de, parri.andrea@...il.com, dave.hansen@...el.com
Subject: Re: [PATCH V4 3/5] hyperv/IOMMU: Enable swiotlb bounce buffer for
Isolation VM
On 05.12.21 09:48, Tianyu Lan wrote:
>
>
> On 12/5/2021 4:34 PM, Juergen Gross wrote:
>> On 05.12.21 09:18, Tianyu Lan wrote:
>>> From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>>>
>>> hyperv Isolation VM requires bounce buffer support to copy
>>> data from/to encrypted memory and so enable swiotlb force
>>> mode to use swiotlb bounce buffer for DMA transaction.
>>>
>>> In Isolation VM with AMD SEV, the bounce buffer needs to be
>>> accessed via extra address space which is above shared_gpa_boundary
>>> (E.G 39 bit address line) reported by Hyper-V CPUID ISOLATION_CONFIG.
>>> The access physical address will be original physical address +
>>> shared_gpa_boundary. The shared_gpa_boundary in the AMD SEV SNP
>>> spec is called virtual top of memory(vTOM). Memory addresses below
>>> vTOM are automatically treated as private while memory above
>>> vTOM is treated as shared.
>>>
>>> Hyper-V initalizes swiotlb bounce buffer and default swiotlb
>>> needs to be disabled. pci_swiotlb_detect_override() and
>>> pci_swiotlb_detect_4gb() enable the default one. To override
>>> the setting, hyperv_swiotlb_detect() needs to run before
>>> these detect functions which depends on the pci_xen_swiotlb_
>>> init(). Make pci_xen_swiotlb_init() depends on the hyperv_swiotlb
>>> _detect() to keep the order.
>>
>> Why? Does Hyper-V plan to support Xen PV guests? If not, I don't see
>> the need for adding this change.
>>
>
> This is to keep detect function calling order that Hyper-V detect
> callback needs to call before pci_swiotlb_detect_override() and
> pci_swiotlb_detect_4gb(). This is the same for why
> pci_swiotlb_detect_override() needs to depend on the
> pci_xen_swiotlb_detect(). Hyper-V also has such request and so make xen
> detect callback depends on Hyper-V one.
And does this even work without CONFIG_SWIOTLB_XEN, i.e. without
pci_xen_swiotlb_detect() being in the system?
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3092 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists