[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <125ffb7d-958c-e77a-243b-4cf38f690396@gmail.com>
Date: Sun, 5 Dec 2021 16:48:24 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Juergen Gross <jgross@...e.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 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.
Powered by blists - more mailing lists