Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-07-12 Thread Tianyu Lan
Hi Christoph and Robin: I introduced new interface set_memory_decrypted_map() to hide all the hypervisor code behind it in the latest version. In current generic code, only swiotlb bounce buffer needs to be decrypted and remapped in the same time and so keep set_memory_decrypted(). If there

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-15 Thread Tianyu Lan
On 6/14/2021 11:32 PM, Christoph Hellwig wrote: On Mon, Jun 14, 2021 at 02:49:51PM +0100, Robin Murphy wrote: FWIW, I think a better generalisation for this would be allowing set_memory_decrypted() to return an address rather than implicitly operating in-place, and hide all the various

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-14 Thread Christoph Hellwig
On Mon, Jun 14, 2021 at 02:49:51PM +0100, Robin Murphy wrote: > FWIW, I think a better generalisation for this would be allowing > set_memory_decrypted() to return an address rather than implicitly > operating in-place, and hide all the various hypervisor hooks behind that. Yes, something like

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-14 Thread Robin Murphy
On 2021-06-07 07:43, Christoph Hellwig wrote: On Sun, May 30, 2021 at 11:06:25AM -0400, Tianyu Lan wrote: From: Tianyu Lan For Hyper-V isolation VM with AMD SEV SNP, the bounce buffer(shared memory) needs to be accessed via extra address space(e.g address above bit39). Hyper-V code may remap

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-14 Thread Tianyu Lan
On 6/14/2021 9:37 PM, Tianyu Lan wrote: On 6/14/2021 3:12 PM, Christoph Hellwig wrote: On Mon, Jun 07, 2021 at 10:56:47PM +0800, Tianyu Lan wrote: These addresses in extra address space works as system memory mirror. The shared memory with host in Isolation VM needs to be accessed via extra

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-14 Thread Tianyu Lan
On 6/14/2021 3:12 PM, Christoph Hellwig wrote: On Mon, Jun 07, 2021 at 10:56:47PM +0800, Tianyu Lan wrote: These addresses in extra address space works as system memory mirror. The shared memory with host in Isolation VM needs to be accessed via extra address space which is above shared gpa

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-14 Thread Tom Lendacky via iommu
On 6/14/21 2:12 AM, Christoph Hellwig wrote: > On Mon, Jun 07, 2021 at 10:56:47PM +0800, Tianyu Lan wrote: >> These addresses in extra address space works as system memory mirror. The >> shared memory with host in Isolation VM needs to be accessed via extra >> address space which is above shared

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-14 Thread Christoph Hellwig
On Mon, Jun 07, 2021 at 10:56:47PM +0800, Tianyu Lan wrote: > These addresses in extra address space works as system memory mirror. The > shared memory with host in Isolation VM needs to be accessed via extra > address space which is above shared gpa boundary. Why?

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-10 Thread Tianyu Lan
On 6/7/2021 10:56 PM, Tianyu Lan wrote: On 6/7/2021 2:43 PM, Christoph Hellwig wrote: On Sun, May 30, 2021 at 11:06:25AM -0400, Tianyu Lan wrote: From: Tianyu Lan For Hyper-V isolation VM with AMD SEV SNP, the bounce buffer(shared memory) needs to be accessed via extra address

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-07 Thread Tianyu Lan
On 6/7/2021 2:43 PM, Christoph Hellwig wrote: On Sun, May 30, 2021 at 11:06:25AM -0400, Tianyu Lan wrote: From: Tianyu Lan For Hyper-V isolation VM with AMD SEV SNP, the bounce buffer(shared memory) needs to be accessed via extra address space(e.g address above bit39). Hyper-V code may

Re: [RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-06-07 Thread Christoph Hellwig
On Sun, May 30, 2021 at 11:06:25AM -0400, Tianyu Lan wrote: > From: Tianyu Lan > > For Hyper-V isolation VM with AMD SEV SNP, the bounce buffer(shared memory) > needs to be accessed via extra address space(e.g address above bit39). > Hyper-V code may remap extra address space outside of swiotlb.

[RFC PATCH V3 08/11] swiotlb: Add bounce buffer remap address setting function

2021-05-30 Thread Tianyu Lan
From: Tianyu Lan For Hyper-V isolation VM with AMD SEV SNP, the bounce buffer(shared memory) needs to be accessed via extra address space(e.g address above bit39). Hyper-V code may remap extra address space outside of swiotlb. swiotlb_ bounce() needs to use remap virtual address to copy data