Message ID | 20180824025933.24319-11-bauerman@linux.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Secure Virtual Machine Enablement | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | warning | next/apply_patch Patch failed to apply |
snowpatch_ozlabs/apply_patch | fail | Failed to apply to any branch |
On Thu, Aug 23, 2018 at 11:59:32PM -0300, Thiago Jung Bauermann wrote: > From: Anshuman Khandual <khandual@linux.vnet.ibm.com> > > SWIOTLB checks range of incoming CPU addresses to be bounced and see if the > device can access it through it's DMA window without requiring bouncing. In > such cases it just chooses to skip bouncing. But for cases like secure > guests on powerpc platform all addresses need to be bounced into the shared > pool of memory because the host cannot access it otherwise. Hence the need > to do the bouncing is not related to device's DMA window. Hence force the > use of bouncing by setting the swiotlb_force variable on secure guests. > > Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> > Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> > --- > arch/powerpc/kernel/svm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/kernel/svm.c b/arch/powerpc/kernel/svm.c > index 1af5caa955f5..f0576ad65cd0 100644 > --- a/arch/powerpc/kernel/svm.c > +++ b/arch/powerpc/kernel/svm.c > @@ -17,6 +17,7 @@ static int __init init_svm(void) > return 0; > > ppc_swiotlb_enable = 1; > + swiotlb_force = SWIOTLB_FORCE; > swiotlb_update_mem_attributes(); This needs a comment.
Hello Christoph, Thanks for your quick review. Christoph Hellwig <hch@lst.de> writes: > On Thu, Aug 23, 2018 at 11:59:32PM -0300, Thiago Jung Bauermann wrote: >> From: Anshuman Khandual <khandual@linux.vnet.ibm.com> >> >> SWIOTLB checks range of incoming CPU addresses to be bounced and see if the >> device can access it through it's DMA window without requiring bouncing. In >> such cases it just chooses to skip bouncing. But for cases like secure >> guests on powerpc platform all addresses need to be bounced into the shared >> pool of memory because the host cannot access it otherwise. Hence the need >> to do the bouncing is not related to device's DMA window. Hence force the >> use of bouncing by setting the swiotlb_force variable on secure guests. >> >> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> >> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> >> --- >> arch/powerpc/kernel/svm.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/arch/powerpc/kernel/svm.c b/arch/powerpc/kernel/svm.c >> index 1af5caa955f5..f0576ad65cd0 100644 >> --- a/arch/powerpc/kernel/svm.c >> +++ b/arch/powerpc/kernel/svm.c >> @@ -17,6 +17,7 @@ static int __init init_svm(void) >> return 0; >> >> ppc_swiotlb_enable = 1; >> + swiotlb_force = SWIOTLB_FORCE; >> swiotlb_update_mem_attributes(); > > This needs a comment. Good point. Will add one. If in the new scheme of things (with bus_dma_mask?) dma_capable() on a virtio device running in a secure guest returns false, then this patch becomes unnecessary and can be dropped. -- Thiago Jung Bauermann IBM Linux Technology Center
diff --git a/arch/powerpc/kernel/svm.c b/arch/powerpc/kernel/svm.c index 1af5caa955f5..f0576ad65cd0 100644 --- a/arch/powerpc/kernel/svm.c +++ b/arch/powerpc/kernel/svm.c @@ -17,6 +17,7 @@ static int __init init_svm(void) return 0; ppc_swiotlb_enable = 1; + swiotlb_force = SWIOTLB_FORCE; swiotlb_update_mem_attributes(); return 0;