[RFC PATCH 10/11] powerpc/svm: Force the use of bounce buffers

2018-08-23 Thread Thiago Jung Bauermann
-by: Thiago Jung Bauermann --- 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

[RFC PATCH 05/11] powerpc/svm: Don't release SWIOTLB buffers on secure guests

2018-08-23 Thread Thiago Jung Bauermann
bounce buffering purpose. Hence retain the allocated buffer by setting ppc_swiotlb_enable variable for secure guests on Ultravisor platforms. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/svm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch

[RFC PATCH 02/11] powerpc/svm: Select CONFIG_DMA_DIRECT_OPS and CONFIG_SWIOTLB

2018-08-23 Thread Thiago Jung Bauermann
platforms with secure guest support. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index f786c962edf0..90f73d15f58a 100644 --- a/arch/powerpc/Kconfig

[RFC PATCH 09/11] powerpc/svm: Use shared memory for LPPACA structures

2018-08-23 Thread Thiago Jung Bauermann
here. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 1edf8695019d

[RFC PATCH 00/11] Secure Virtual Machine Enablement

2018-08-23 Thread Thiago Jung Bauermann
A API for all virtio devices powerpc/svm: Use shared memory for Debug Trace Log (DTL) powerpc/svm: Use shared memory for LPPACA structures powerpc/svm: Force the use of bounce buffers powerpc/svm: Increase SWIOTLB buffer size Thiago Jung Bauermann (1): powerpc: Add and use LPPACA_SIZE con

[RFC PATCH 04/11] powerpc/svm: Convert SWIOTLB buffers to shared memory

2018-08-23 Thread Thiago Jung Bauermann
From: Anshuman Khandual Hook the shared memory conversion functions into the ARCH_HAS_MEM_ENCRYPT framework and call swiotlb_update_mem_attributes() to convert SWIOTLB's buffers to shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig

[RFC PATCH 07/11] powerpc/svm: Use shared memory for Debug Trace Log (DTL)

2018-08-23 Thread Thiago Jung Bauermann
From: Anshuman Khandual On Ultravisor platform kmem_cache for DTL buffers must use a constructor function which converts the underlying buddy allocated SLUB cache pages into shared memory so that they are accessible to the hypervisor. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung

[RFC PATCH 03/11] powerpc/svm: Add memory conversion (shared/secure) helper functions

2018-08-23 Thread Thiago Jung Bauermann
, unsigned long npages) Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 3 +++ arch/powerpc/kernel/Makefile | 1 + arch/powerpc/kernel/svm.c | 33 + 3 files changed, 37 insertions(+) diff --git

[RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-23 Thread Thiago Jung Bauermann
/0x4a0 [virtio_blk] [c007d2a273d0] [c06b5d68] blk_mq_dispatch_rq_list+0x1f8/0x6d0 .. Increase the SWIOTLB size to 1GB on Ultravisor based secure guests. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 5 + kernel

[RFC PATCH 08/11] powerpc: Add and use LPPACA_SIZE constant

2018-08-23 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index

[RFC PATCH 01/11] powerpc/svm: Detect Secure Virtual Machine (SVM) platform

2018-08-23 Thread Thiago Jung Bauermann
Signed-off-by: Ram Pai Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 11 +++ arch/powerpc/include/asm/reg.h | 3 +++ arch/powerpc/include/asm/svm.h | 22 ++ 3 files changed, 36 insertions(+) diff --git a/arch

[RFC PATCH 06/11] powerpc/svm: Use SWIOTLB DMA API for all virtio devices

2018-08-23 Thread Thiago Jung Bauermann
Jung Bauermann --- arch/powerpc/platforms/pseries/iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 5773bc7eb4bd..56b894d65dba 100644 --- a/arch/powerpc/platforms/pseries/iommu.c

[RFC PATCH 00/11] Secure Virtual Machine Enablement

2018-08-24 Thread Thiago Jung Bauermann
erpc/svm: Use shared memory for LPPACA structures powerpc/svm: Force the use of bounce buffers powerpc/svm: Increase SWIOTLB buffer size Thiago Jung Bauermann (1): powerpc: Add and use LPPACA_SIZE constant arch/powerpc/Kconfig | 22 arch/powerpc/include/as

[RFC PATCH 03/11] powerpc/svm: Add memory conversion (shared/secure) helper functions

2018-08-24 Thread Thiago Jung Bauermann
, unsigned long npages) Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 3 +++ arch/powerpc/kernel/Makefile | 1 + arch/powerpc/kernel/svm.c | 33 + 3 files changed, 37 insertions(+) diff --git

[RFC PATCH 04/11] powerpc/svm: Convert SWIOTLB buffers to shared memory

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual Hook the shared memory conversion functions into the ARCH_HAS_MEM_ENCRYPT framework and call swiotlb_update_mem_attributes() to convert SWIOTLB's buffers to shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig

[RFC PATCH 02/11] powerpc/svm: Select CONFIG_DMA_DIRECT_OPS and CONFIG_SWIOTLB

2018-08-24 Thread Thiago Jung Bauermann
platforms with secure guest support. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index f786c962edf0..90f73d15f58a 100644 --- a/arch/powerpc/Kconfig

[RFC PATCH 01/11] powerpc/svm: Detect Secure Virtual Machine (SVM) platform

2018-08-24 Thread Thiago Jung Bauermann
Signed-off-by: Ram Pai Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 11 +++ arch/powerpc/include/asm/reg.h | 3 +++ arch/powerpc/include/asm/svm.h | 22 ++ 3 files changed, 36 insertions(+) diff --git a/arch

[RFC PATCH 05/11] powerpc/svm: Don't release SWIOTLB buffers on secure guests

2018-08-24 Thread Thiago Jung Bauermann
bounce buffering purpose. Hence retain the allocated buffer by setting ppc_swiotlb_enable variable for secure guests on Ultravisor platforms. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/svm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch

[RFC PATCH 09/11] powerpc/svm: Use shared memory for LPPACA structures

2018-08-24 Thread Thiago Jung Bauermann
here. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 1edf8695019d

[RFC PATCH 08/11] powerpc: Add and use LPPACA_SIZE constant

2018-08-24 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index

[RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-24 Thread Thiago Jung Bauermann
/0x4a0 [virtio_blk] [c007d2a273d0] [c06b5d68] blk_mq_dispatch_rq_list+0x1f8/0x6d0 .. Increase the SWIOTLB size to 1GB on Ultravisor based secure guests. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 5 + kernel

[RFC PATCH 10/11] powerpc/svm: Force the use of bounce buffers

2018-08-24 Thread Thiago Jung Bauermann
-by: Thiago Jung Bauermann --- 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

[RFC PATCH 06/11] powerpc/svm: Use SWIOTLB DMA API for all virtio devices

2018-08-24 Thread Thiago Jung Bauermann
Jung Bauermann --- arch/powerpc/platforms/pseries/iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 5773bc7eb4bd..56b894d65dba 100644 --- a/arch/powerpc/platforms/pseries/iommu.c

Re: [RFC PATCH 10/11] powerpc/svm: Force the use of bounce buffers

2018-08-24 Thread Thiago Jung Bauermann
Hello Christoph, Thanks for your quick review. Christoph Hellwig writes: > On Thu, Aug 23, 2018 at 11:59:32PM -0300, Thiago Jung Bauermann wrote: >> From: Anshuman Khandual >> >> SWIOTLB checks range of incoming CPU addresses to be bounced and see if the >> device

Re: [RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-24 Thread Thiago Jung Bauermann
Hello Randy, Thanks for your quick review. Randy Dunlap writes: > On 08/24/2018 09:25 AM, Thiago Jung Bauermann wrote: >> From: Anshuman Khandual >> >> SWIOTLB buffer default size (64MB) is not enough for large sequential write >> operations which eventually lead

Re: [PATCH 1/2] dma-direct: set_memory_{en, de}crypted() take number of pages

2019-01-22 Thread Thiago Jung Bauermann
Lendacky, Thomas writes: > On 1/22/19 3:17 PM, Thiago Jung Bauermann wrote: >> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c >> index 355d16acee6d..bc78c37220ba 100644 >> --- a/kernel/dma/direct.c >> +++ b/kernel/dma/direct.c >> @@ -166,7 +166,7 @@ vo

[PATCH 2/2] x86/kvmclock: set_memory_decrypted() takes number of pages

2019-01-22 Thread Thiago Jung Bauermann
: 6a1cac56f41f ("x86/kvm: Use __bss_decrypted attribute in shared variables") Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/x86/kernel/kvmclock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Note: Found by code inspection. I don't have a way to test.

[PATCH 1/2] dma-direct: set_memory_{en, de}crypted() take number of pages

2019-01-22 Thread Thiago Jung Bauermann
: Slightly reworded commit message and added Fixes: tag. ] Fixes: d7b417fa08d1 ("x86/mm: Add DMA support for SEV memory encryption") Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- kernel/dma/direct.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-02-21 Thread Thiago Jung Bauermann
I can see that while there have been some >> > developments most of the code has been stable for quite a while now. >> > >> > So what I am trying to do right about now, is making a small module that >> > loads early and pokes at the IOMMU sufficiently to get t

Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-02-21 Thread Thiago Jung Bauermann
ugs regarding whether the end address is inclusive or exclusive. I tend to prefer expressing memory ranges by specifying a start address and a length, which eliminates ambiguity. -- Thiago Jung Bauermann IBM Linux Technology Center ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-03-20 Thread Thiago Jung Bauermann
Hello Michael, Sorry for the delay in responding. We had some internal discussions on this. Michael S. Tsirkin writes: > On Mon, Feb 04, 2019 at 04:14:20PM -0200, Thiago Jung Bauermann wrote: >> >> Hello Michael, >> >> Michael S. Tsirkin writes: >> >&g

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-03-21 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Mar 20, 2019 at 01:13:41PM -0300, Thiago Jung Bauermann wrote: >> >> Another way of looking at this issue which also explains our reluctance >> >> is that the only difference between a secure guest and a regular guest >&

[RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-01-29 Thread Thiago Jung Bauermann
is used) can be made in powerpc-specific code. Of course, I also have patches (soon to be posted as RFC) which hook up to the powerpc secure guest support code. What do you think? >From d0629a36a75c678b4a72b853f8f7f8c17eedd6b3 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Thu, 24

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-01-29 Thread Thiago Jung Bauermann
Fixing address of powerpc mailing list. Thiago Jung Bauermann writes: > Hello, > > With Christoph's rework of the DMA API that recently landed, the patch > below is the only change needed in virtio to make it work in a POWER > secure guest under the ultravisor. > > The

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-02-04 Thread Thiago Jung Bauermann
Hello Michael, Michael S. Tsirkin writes: > On Tue, Jan 29, 2019 at 03:42:44PM -0200, Thiago Jung Bauermann wrote: >> >> Fixing address of powerpc mailing list. >> >> Thiago Jung Bauermann writes: >> >> > Hello, >> > >> > With Chris

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-02-04 Thread Thiago Jung Bauermann
s that it? Therefore it should be set because it's the sane thing to do? -- Thiago Jung Bauermann IBM Linux Technology Center ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-17 Thread Thiago Jung Bauermann
David Gibson writes: > On Sat, Mar 23, 2019 at 05:01:35PM -0400, Michael S. Tsirkin wrote: >> On Thu, Mar 21, 2019 at 09:05:04PM -0300, Thiago Jung Bauermann wrote: >> > Michael S. Tsirkin writes: > [snip] >> > >> > Is there any justification to doing th

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-17 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Thu, Mar 21, 2019 at 09:05:04PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Wed, Mar 20, 2019 at 01:13:41PM -0300, Thiago Jung Bauermann wrote: >> >> >From what I understan

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-06-03 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> I rephrased it in terms of address translation. What do you think of >> this version? The flag name is slightly different too: >> >> >> VIRTIO_F_ACCESS_PLA

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-26 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 24, 2019 at 10:01:56PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Michael S. Tsi

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-06-27 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Mon, Jun 03, 2019 at 10:13:59PM -0300, Thiago Jung Bauermann wrote: >> >> >> Michael S. Tsirkin writes: >> >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> I rephrased it in

[PATCH 1/3] x86/Kconfig: Move ARCH_HAS_MEM_ENCRYPT to arch/Kconfig

2019-07-11 Thread Thiago Jung Bauermann
powerpc and s390 are going to use this feature as well, so put it in a generic location. Signed-off-by: Thiago Jung Bauermann --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index c47b328eada0

[PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-11 Thread Thiago Jung Bauermann
, other architectures will have different names so this gets unwieldy quickly. Signed-off-by: Thiago Jung Bauermann --- arch/x86/Kconfig | 1 + arch/x86/include/asm/dma-mapping.h | 7 +++ arch/x86/include/asm/mem_encrypt.h | 10 ++ include/linux/mem_encrypt.h

[PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-11 Thread Thiago Jung Bauermann
the generic weak implementation. To do that, it's necessary to make read_from_oldmem() public so that it can be used outside of vmcore.c. Signed-off-by: Thiago Jung Bauermann --- arch/x86/kernel/crash_dump_64.c | 5 + fs/proc/vmcore.c| 8 include/linux/crash_dump.h

[PATCH 0/3] Remove x86-specific code from generic headers

2019-07-11 Thread Thiago Jung Bauermann
Linus' master branch; Commit e67a5ed1f86f ("dma-direct: Force unencrypted DMA under SME for certain DMA masks"), which is in dma-mapping/for-next and comes from this patch: https://lore.kernel.org/linux-iommu/10b83d9ff31bca88e94da2ff34e30619eb396078.1562785123.git.thomas.lenda...@amd.com/ Th

Re: [PATCH 1/3] x86/Kconfig: Move ARCH_HAS_MEM_ENCRYPT to arch/Kconfig

2019-07-12 Thread Thiago Jung Bauermann
Hello Thomas, Thanks for quickly reviewing the patches. Thomas Gleixner writes: > On Fri, 12 Jul 2019, Thiago Jung Bauermann wrote: > >> powerpc and s390 are going to use this feature as well, so put it in a >> generic location. >> >> Signed-off-by: Thiag

Re: [PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-12 Thread Thiago Jung Bauermann
[ Cc'ing Tom Lendacky which I forgot to do earlier. Sorry about that. ] Hello Halil, Thanks for the quick review. Halil Pasic writes: > On Fri, 12 Jul 2019 02:36:31 -0300 > Thiago Jung Bauermann wrote: > >> Secure Encrypted Virtualization is an x86-specific feature,

[PATCH 1/3] x86,s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig

2019-07-12 Thread Thiago Jung Bauermann
powerpc is also going to use this feature, so put it in a generic location. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Thomas Gleixner --- arch/Kconfig | 3 +++ arch/s390/Kconfig | 3 --- arch/x86/Kconfig | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH 0/3] Remove x86-specific code from generic headers

2019-07-12 Thread Thiago Jung Bauermann
//lore.kernel.org/linuxppc-dev/20190521044912.1375-12-bauer...@linux.ibm.com/ ² https://lore.kernel.org/kvm/20190612111236.99538-2-pa...@linux.ibm.com/ Thiago Jung Bauermann (3): x86,s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig DMA mapping: Move SME handling to x86-specific f

[PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-12 Thread Thiago Jung Bauermann
the generic weak implementation. To do that, it's necessary to make read_from_oldmem() public so that it can be used outside of vmcore.c. Signed-off-by: Thiago Jung Bauermann --- arch/x86/kernel/crash_dump_64.c | 5 + fs/proc/vmcore.c| 8 include/linux/crash_dump.h

Re: [PATCH 0/3] Remove x86-specific code from generic headers

2019-07-12 Thread Thiago Jung Bauermann
I forgot to mark this series as v2 when generating the patches. Sorry for the confusion. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-12 Thread Thiago Jung Bauermann
eason why there is a requirement for a large DMA > mask. Makes sense. I'll submit a v2 which just removes this code. -- Thiago Jung Bauermann IBM Linux Technology Center

[PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-12 Thread Thiago Jung Bauermann
mask.", so we just remove dma_check_mask(). In SWIOTLB code, there's no need to mention which memory encryption feature is active, so just use a more generic warning. Besides, other architectures will have different names for similar technology. Signed-off-by: Thiago Jung Bauermann --- arch/s3

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-07-13 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Thu, Jun 27, 2019 at 10:58:40PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Mon, Jun 03, 2019 at 10:13:59PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> >> >&

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-24 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Thu, Mar 21, 2019 at 09:05:04PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Michael S. Tsi

Re: [PATCH v4 1/6] x86, s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig

2019-09-03 Thread Thiago Jung Bauermann
Michael Ellerman writes: > On Tue, 2019-08-06 at 04:49:14 UTC, Thiago Jung Bauermann wrote: >> powerpc is also going to use this feature, so put it in a generic location. >> >> Signed-off-by: Thiago Jung Bauermann >> Reviewed-by: Thomas Gleixner >> Reviewed-

Re: [PATCH v4 0/6] Remove x86-specific code from generic headers

2019-08-09 Thread Thiago Jung Bauermann
m...@ellerman.id.au writes: > Thiago Jung Bauermann writes: >> Hello, >> >> This version has only a small change in the last patch as requested by >> Christoph and Halil, and collects Reviewed-by's. >> >> These patches are applied on top of v5.3-rc2. &g

[PATCH v4 0/6] Remove x86-specific code from generic headers

2019-08-05 Thread Thiago Jung Bauermann
. - Reworded patch title and message a little bit. - Patch "DMA mapping: Move SME handling to x86-specific files" - Adapt s390's as well. - Remove dma_check_mask() from kernel/dma/mapping.c. Suggested by Christoph Hellwig. Thiago Jung Bauermann (6): x86,s390: Mov

[PATCH v4 1/6] x86,s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig

2019-08-05 Thread Thiago Jung Bauermann
powerpc is also going to use this feature, so put it in a generic location. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Thomas Gleixner Reviewed-by: Christoph Hellwig --- arch/Kconfig | 3 +++ arch/s390/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- 3 files changed, 5 insertions

[PATCH v4 3/6] dma-mapping: Remove dma_check_mask()

2019-08-05 Thread Thiago Jung Bauermann
check_mask(). Signed-off-by: Thiago Jung Bauermann Reviewed-by: Christoph Hellwig Reviewed-by: Tom Lendacky --- kernel/dma/mapping.c | 8 1 file changed, 8 deletions(-) diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 1f628e7ac709..61eeefbfcb36 100644 --- a/kernel/dma/mappi

[PATCH v4 6/6] s390/mm: Remove sev_active() function

2019-08-05 Thread Thiago Jung Bauermann
All references to sev_active() were moved to arch/x86 so we don't need to define it for s390 anymore. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Christoph Hellwig Reviewed-by: Halil Pasic --- arch/s390/include/asm/mem_encrypt.h | 1 - arch/s390/mm/init.c | 7 +-- 2

[PATCH v4 4/6] x86,s390/mm: Move sme_active() and sme_me_mask to x86-specific header

2019-08-05 Thread Thiago Jung Bauermann
be built as a module so its export needs to stay. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Christoph Hellwig Reviewed-by: Tom Lendacky --- arch/s390/include/asm/mem_encrypt.h | 4 +--- arch/x86/include/asm/mem_encrypt.h | 10 ++ arch/x86/mm/mem_encrypt.c | 1

[PATCH v4 2/6] swiotlb: Remove call to sme_active()

2019-08-05 Thread Thiago Jung Bauermann
Jung Bauermann Reviewed-by: Christoph Hellwig Reviewed-by: Tom Lendacky --- kernel/dma/swiotlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 9de232229063..f29caad71e13 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma

[PATCH v4 5/6] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-08-05 Thread Thiago Jung Bauermann
the generic weak implementation. To do that, it's necessary to make read_from_oldmem() public so that it can be used outside of vmcore.c. Also, remove the export for sev_active() since it's only used in files that won't be built as modules. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Christoph

[PATCH v3 1/6] x86, s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig

2019-07-17 Thread Thiago Jung Bauermann
powerpc is also going to use this feature, so put it in a generic location. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Thomas Gleixner Reviewed-by: Christoph Hellwig --- arch/Kconfig | 3 +++ arch/s390/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- 3 files changed, 5 insertions

[PATCH v3 3/6] dma-mapping: Remove dma_check_mask()

2019-07-17 Thread Thiago Jung Bauermann
check_mask(). Signed-off-by: Thiago Jung Bauermann --- kernel/dma/mapping.c | 8 1 file changed, 8 deletions(-) diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 1f628e7ac709..61eeefbfcb36 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -291,12 +291

[PATCH v3 4/6] x86, s390/mm: Move sme_active() and sme_me_mask to x86-specific header

2019-07-17 Thread Thiago Jung Bauermann
be built as a module so its export needs to stay. Signed-off-by: Thiago Jung Bauermann --- arch/s390/include/asm/mem_encrypt.h | 4 +--- arch/x86/include/asm/mem_encrypt.h | 10 ++ arch/x86/mm/mem_encrypt.c | 1 - include/linux/mem_encrypt.h | 14 +- 4

[PATCH v3 6/6] s390/mm: Remove sev_active() function

2019-07-17 Thread Thiago Jung Bauermann
All references to sev_active() were moved to arch/x86 so we don't need to define it for s390 anymore. Signed-off-by: Thiago Jung Bauermann --- arch/s390/include/asm/mem_encrypt.h | 1 - arch/s390/mm/init.c | 8 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git

[PATCH v3 2/6] swiotlb: Remove call to sme_active()

2019-07-17 Thread Thiago Jung Bauermann
Jung Bauermann --- kernel/dma/swiotlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 62fa5a82a065..e52401f94e91 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -459,8 +459,7 @@ phys_addr_t

[PATCH v3 5/6] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-17 Thread Thiago Jung Bauermann
the generic weak implementation. To do that, it's necessary to make read_from_oldmem() public so that it can be used outside of vmcore.c. Also, remove the export for sev_active() since it's only used in files that won't be built as modules. Signed-off-by: Thiago Jung Bauermann --- arch/x86/kernel

[PATCH v3 0/6] Remove x86-specific code from generic headers

2019-07-17 Thread Thiago Jung Bauermann
H_HAS_MEM_ENCRYPT from s390/Kconfig as well. - Reworded patch title and message a little bit. - Patch "DMA mapping: Move SME handling to x86-specific files" - Adapt s390's as well. - Remove dma_check_mask() from kernel/dma/mapping.c. Suggested by Christoph Hellwig. Thiago Ju

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-07-17 Thread Thiago Jung Bauermann
Hello, Just going back to this question which I wasn't able to answer. Thiago Jung Bauermann writes: > Michael S. Tsirkin writes: > >> So far so good, but now a question: >> >> how are we handling guest address width limitations? >> Is VIRTIO_F_ACCESS_PLA

Re: [PATCH v3 6/6] s390/mm: Remove sev_active() function

2019-07-18 Thread Thiago Jung Bauermann
e(); >> +return is_prot_virt_guest(); >> } > > Do we want to keep the comment for force_dma_unencrypted? > > Otherwise looks good: > > Reviewed-by: Christoph Hellwig Thank you for your review on al these patches. -- Thiago Jung Bauermann IBM Linux Technol

Re: [PATCH v3 6/6] s390/mm: Remove sev_active() function

2019-07-18 Thread Thiago Jung Bauermann
transferred: > > Reviewed-by: Halil Pasic Thanks for your review. Here is the new version. Should I send a new patch series with this patch and the Reviewed-by on the other ones? -- Thiago Jung Bauermann IBM Linux Technology Center >From 1726205c73fb9e29feaa3d8909c5a1b0f2054c04 Mon

Re: [PATCH v3 0/6] Remove x86-specific code from generic headers

2019-07-18 Thread Thiago Jung Bauermann
Lendacky, Thomas writes: > On 7/17/19 10:28 PM, Thiago Jung Bauermann wrote: >> Hello, >> >> This version is mostly about splitting up patch 2/3 into three separate >> patches, as suggested by Christoph Hellwig. Two other changes are a fix in >&g

Re: [PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-18 Thread Thiago Jung Bauermann
Thomas Gleixner writes: > On Fri, 12 Jul 2019, Thiago Jung Bauermann wrote: >> diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h >> index b310a9c18113..f2e399fb626b 100644 >> --- a/include/linux/mem_encrypt.h >> +++ b/include/linux/mem_en

Re: [PATCH v3 0/6] Remove x86-specific code from generic headers

2019-07-19 Thread Thiago Jung Bauermann
Lendacky, Thomas writes: > On 7/18/19 2:44 PM, Thiago Jung Bauermann wrote: >> >> Lendacky, Thomas writes: >> >>> On 7/17/19 10:28 PM, Thiago Jung Bauermann wrote: >>>> Hello, >>>> >>>> This version is mostly about spl

Re: [PATCH v3 5/6] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-19 Thread Thiago Jung Bauermann
Hello Lianbo, lijiang writes: > 在 2019年07月19日 01:47, Lendacky, Thomas 写道: >> On 7/17/19 10:28 PM, Thiago Jung Bauermann wrote: >>> Secure Encrypted Virtualization is an x86-specific feature, so it shouldn't >>> appear in generic kernel code because it forces non-x86

Re: [PATCH 2/3] DMA mapping: Move SME handling to x86-specific files

2019-07-19 Thread Thiago Jung Bauermann
rove the system] > > url: > https://github.com/0day-ci/linux/commits/Thiago-Jung-Bauermann/Remove-x86-specific-code-from-generic-headers/20190715-063006 > config: s390-allnoconfig (attached as .config) > compiler: s390-linux-gcc (GCC) 7.4.0 > reproduce: > wget > h

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-07-15 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Mon, Jul 15, 2019 at 05:29:06PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Sun, Jul 14, 2019 at 02:51:18AM -0300, Thiago Jung Bauermann wrote: >> >> >> >> >> &g

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-07-15 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Mon, Jul 15, 2019 at 07:03:03PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Mon, Jul 15, 2019 at 05:29:06PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Michael

Re: [PATCH 1/3] x86, s390: Move ARCH_HAS_MEM_ENCRYPT definition to arch/Kconfig

2019-07-15 Thread Thiago Jung Bauermann
Hello Janani, Thanks for reviewing the patch. janani writes: > On 2019-07-12 23:45, Thiago Jung Bauermann wrote: >> powerpc is also going to use this feature, so put it in a generic location. >> >> Signed-off-by: Thiago Jung Bauermann >> Reviewed-by: Thomas Gleixn

Re: [PATCH 3/3] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-15 Thread Thiago Jung Bauermann
dma-mapping fix to Linus, > it might make sense to either rebase Thiagos series on top of the > dma-mapping for-next branch, or wait a few days before reposting. I'll rebase on top of dma-mapping/for-next and do the break up of patch 2 that you mentioned as well. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-07-15 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Sun, Jul 14, 2019 at 02:51:18AM -0300, Thiago Jung Bauermann wrote: >> >> >> Michael S. Tsirkin writes: >> >> > So this is what I would call this option: >> > >> > VIRTIO_F_ACCESS_PLATFORM_IDENTITY_ADDRE

[PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-17 Thread Thiago Jung Bauermann
of memblock_alloc_low(). We also need to add swiotlb_set_no_iotlb_memory() in order to set the no_iotlb_memory flag if initialization fails. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 4 arch/powerpc/mm/mem.c| 6 +- arch/powerpc/platforms

Re: [PATCH] swiotlb: Allow allocating buffer anywhere in memory

2020-08-17 Thread Thiago Jung Bauermann
Hello Christoph, Christoph Hellwig writes: > On Sat, Aug 15, 2020 at 05:45:36PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >

[PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
of memblock_alloc_low(). Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 4 arch/powerpc/mm/mem.c| 6 +- arch/powerpc/platforms/pseries/svm.c | 26 ++ 3 files changed, 35 insertions(+), 1 deletion(-) Changes from v2

Re: [PATCH v2] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-18 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Mon, Aug 17, 2020 at 06:46:58PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't ne

Re: [PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-19 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Tue, Aug 18, 2020 at 07:11:26PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't ne

Re: [PATCH v3] powerpc/pseries/svm: Allocate SWIOTLB buffer anywhere in memory

2020-08-19 Thread Thiago Jung Bauermann
Konrad Rzeszutek Wilk writes: > On Tue, Aug 18, 2020 at 07:11:26PM -0300, Thiago Jung Bauermann wrote: >> POWER secure guests (i.e., guests which use the Protection Execution >> Facility) need to use SWIOTLB to be able to do I/O with the hypervisor, but >> they don't ne

[PATCH] swiotlb: Allow allocating buffer anywhere in memory

2020-08-15 Thread Thiago Jung Bauermann
initialization problem we are seeing in secure guests with 128 GB of RAM: they are configured with 4 GB of crashkernel reserved memory, which leaves no space for SWIOTLB in low addresses. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/mm/mem.c | 7 ++- include/linux/swiotlb.h | 8