Re: [PATCH v5 2/2] powerpc/pseries/iommu: Use dma_iommu_ops for Secure VM.

2019-12-10 Thread Thiago Jung Bauermann
27d66 100644 > --- a/arch/powerpc/platforms/pseries/iommu.c > +++ b/arch/powerpc/platforms/pseries/iommu.c > @@ -36,7 +36,6 @@ > #include > #include > #include > -#include > #include > > #include "pseries.h" You still need to keep , otherwise there

Re: [PATCH v6 3/9] powerpc: add support to initialize ima policy rules

2019-10-01 Thread Thiago Jung Bauermann
Hi Nayna, Nayna writes: > On 09/30/2019 09:04 PM, Thiago Jung Bauermann wrote: >>> diff --git a/arch/powerpc/kernel/ima_arch.c b/arch/powerpc/kernel/ima_arch.c >>> new file mode 100644 >>> index ..39401b67f19e >>> --- /dev/null >>>

Re: [PATCH v6 3/9] powerpc: add support to initialize ima policy rules

2019-09-30 Thread Thiago Jung Bauermann
s are enforced by the module subsystem then IMA will verify the signature a second time since there's no sharing of signature verification results between the module subsystem and IMA (this was observed by Mimi). IMHO this is a minor issue, since module loading isn't a hot path and the duplicate work shouldn't impact anything. But it could be avoided by having a NULL entry in arch_rules, which arch_get_ima_policy() would dynamically update with the "appraise func=MODULE_CHECK" rule if is_module_sig_enforced() is true. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH] powerpc/prom_init: Undo relocation before entering secure mode

2019-09-27 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: > Thiago Jung Bauermann writes: > >> The ultravisor will do an integrity check of the kernel image but we >> relocated it so the check will fail. Restore the original image by >> relocating it back to the kernel virtual base address.

Re: [PATCH] powerpc/prom_init: Undo relocation before entering secure mode

2019-09-11 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: > The ultravisor will do an integrity check of the kernel image but we > relocated it so the check will fail. Restore the original image by > relocating it back to the kernel virtual base address. > > This works because during build vmlinux is

[PATCH] powerpc/prom_init: Undo relocation before entering secure mode

2019-09-11 Thread Thiago Jung Bauermann
. Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init") Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/elf.h | 3 +++ arch/powerpc/kernel/prom_init.c| 11 +++ arch/powerpc/kernel/prom_init_check.sh | 3 ++- 3 files c

Re: [PATCH v5 0/7] kexec: add generic support for elf kernel images

2019-09-06 Thread Thiago Jung Bauermann
Helge Deller writes: > On 06.09.19 23:47, Thiago Jung Bauermann wrote: >> Helge Deller writes: >>> This kexec patch series is the groundwork for kexec on the parisc >>> architecture. >>> Since we want kexec on parisc, I've applied it to my for-next-ke

Re: [PATCH v5 0/7] kexec: add generic support for elf kernel images

2019-09-06 Thread Thiago Jung Bauermann
lf_64.c| 545 +- >> include/linux/kexec.h | 23 + >> kernel/Makefile | 1 + >> .../kexec_elf_64.c => kernel/kexec_elf.c | 394 +++-- >> 6 files changed, 115 insertions(+), 852 deletions(-) >> copy arch/powerpc/kernel/kexec_elf_64.c => kernel/kexec_elf.c (50%) -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v4 02/16] powerpc/pseries: Introduce option to build secure virtual machines

2019-09-05 Thread Thiago Jung Bauermann
Hi Michael, Michael Ellerman writes: > Thiago Jung Bauermann writes: >> Michael Ellerman writes: >>> On Tue, 2019-08-20 at 02:13:12 UTC, Thiago Jung Bauermann wrote: >>>> Introduce CONFIG_PPC_SVM to control support for secure guests and include >>>

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 02/16] powerpc/pseries: Introduce option to build secure virtual machines

2019-09-03 Thread Thiago Jung Bauermann
Michael Ellerman writes: > On Tue, 2019-08-20 at 02:13:12 UTC, Thiago Jung Bauermann wrote: >> Introduce CONFIG_PPC_SVM to control support for secure guests and include >> Ultravisor-related helpers when it is selected >> >> Signed-off-by: Thiago Jung Bauermann >

Re: [PATCH v1] sefltest/ima: support appended signatures (modsig)

2019-08-28 Thread Thiago Jung Bauermann
el image signed with an > appended signature and updates the existing test messages > appropriately. > > Reviewed-by: Petr Vorel > Signed-off-by: Mimi Zohar Thanks for doing this! Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v12 00/11] Appended signatures support for IMA appraisal

2019-08-26 Thread Thiago Jung Bauermann
Hello Jordan, Jordan Hand writes: > On 6/27/19 7:19 PM, Thiago Jung Bauermann wrote: >> On the OpenPOWER platform, secure boot and trusted boot are being >> implemented using IMA for taking measurements and verifying signatures. >> Since the kernel image on Power ser

Re: [PATCH v4 1/7] kexec: add KEXEC_ELF

2019-08-21 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: >> diff --git a/arch/powerpc/kernel/kexec_elf_64.c b/kernel/kexec_elf.c >> similarity index 71% >> copy from arch/powerpc/kernel/kexec_elf_64.c >> copy to kernel/kexec_elf.c >> index ba4f18a43ee8..6e9f52171ede 100644 >> ---

Re: [PATCH v4 4/7] kexec_elf: remove PURGATORY_STACK_SIZE

2019-08-20 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: > Sven Schnelle writes: > >> It's not used anywhere so just drop it. >> >> Signed-off-by: Sven Schnelle >> --- >> kernel/kexec_elf.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/ke

Re: [PATCH v4 0/7] kexec: add generic support for elf kernel images

2019-08-20 Thread Thiago Jung Bauermann
nels, and also in ppc64 kexecing to both big-endian and little-endian kernels so: Tested-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v4 1/7] kexec: add KEXEC_ELF

2019-08-20 Thread Thiago Jung Bauermann
Hello Sven, Just a few small comments below. Regardless of them: Reviewed-by: Thiago Jung Bauermann Sven Schnelle writes: > Right now powerpc provides an implementation to read elf files > with the kexec_file() syscall. Make that available as a public Nit: the syscall is kexec_fil

Re: [PATCH v4 7/7] kexec_elf: support 32 bit ELF files

2019-08-20 Thread Thiago Jung Bauermann
Sven Schnelle writes: > The powerpc version only supported 64 bit. Add some > code to switch decoding of fields during runtime so > we can kexec a 32 bit kernel from a 64 bit kernel and > vice versa. > > Signed-off-by: Sven Schnelle Reviewed-by: Thiago Jung Bauermann

Re: [PATCH v4 6/7] kexec_elf: remove unused variable in kexec_elf_load()

2019-08-20 Thread Thiago Jung Bauermann
fer(kbuf); > if (ret) > goto out; > @@ -382,9 +382,6 @@ int kexec_elf_load(struct kimage *image, struct elfhdr > *ehdr, > lowest_addr = load_addr; > } > > - /* Update entry point to reflect new load address.

Re: [PATCH v4 5/7] kexec_elf: remove Elf_Rel macro

2019-08-20 Thread Thiago Jung Bauermann
- > static inline bool elf_is_elf_file(const struct elfhdr *ehdr) > { > return memcmp(ehdr->e_ident, ELFMAG, SELFMAG) == 0; Could you remove this one from the file in arch/powerpc as well? Perhaps this and the previous patch could be placed before patch 1, so that this change can be done

Re: [PATCH v4 4/7] kexec_elf: remove PURGATORY_STACK_SIZE

2019-08-20 Thread Thiago Jung Bauermann
00644 > --- a/kernel/kexec_elf.c > +++ b/kernel/kexec_elf.c > @@ -8,8 +8,6 @@ > #include > #include > > -#define PURGATORY_STACK_SIZE (16 * 1024) > - > #define elf_addr_to_cpu elf64_to_cpu > > #ifndef Elf_Rel Can you remove it from the file in arch

Re: [PATCH v4 3/7] kexec_elf: remove parsing of section headers

2019-08-20 Thread Thiago Jung Bauermann
Sven Schnelle writes: > We're not using them, so we can drop the parsing. > > Signed-off-by: Sven Schnelle Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v4 2/7] kexec_elf: change order of elf_*_to_cpu() functions

2019-08-20 Thread Thiago Jung Bauermann
Sven Schnelle writes: > Change the order to have a 64/32/16 order, no functional change. > > Signed-off-by: Sven Schnelle Reviewed-by: Thiago Jung Bauermann -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v6 1/7] kvmppc: Driver to manage pages of secure guest

2019-08-19 Thread Thiago Jung Bauermann
; + const __be32 *prop; > + u64 size = 0; > + > + np = of_find_node_by_path("/ibm,ultravisor/ibm,uv-firmware"); > + if (!np) > + goto out; I believe that in general we try to avoid hard-coding the path when a node is accessed and searched instead v

[PATCH v4 16/16] powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs

2019-08-19 Thread Thiago Jung Bauermann
From: Ryan Grimm Enables running as a secure guest in platforms with an Ultravisor. Signed-off-by: Ryan Grimm Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/ppc64_defconfig | 1 + arch/powerpc/configs/pseries_defconfig | 1 + 2 files changed, 2

[PATCH v4 15/16] Documentation/powerpc: Ultravisor API

2019-08-19 Thread Thiago Jung Bauermann
-by: Claudio Carvalho Signed-off-by: Thiago Jung Bauermann --- Documentation/powerpc/ultravisor.rst | 1055 ++ 1 file changed, 1055 insertions(+) diff --git a/Documentation/powerpc/ultravisor.rst b/Documentation/powerpc/ultravisor.rst new file mode 100644 index

[PATCH v4 14/16] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-08-19 Thread Thiago Jung Bauermann
o the ARCH_HAS_MEM_ENCRYPT hooks and call swiotlb_update_mem_attributes() to convert SWIOTLB's memory pool to shared memory. Signed-off-by: Anshuman Khandual [ bauerman: Use ARCH_HAS_MEM_ENCRYPT hooks to share swiotlb memory pool. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/mem_encr

[PATCH v4 13/16] powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests

2019-08-19 Thread Thiago Jung Bauermann
Secure guest memory is inacessible to devices so regular DMA isn't possible. In that case set devices' dma_map_ops to NULL so that the generic DMA code path will use SWIOTLB to bounce buffers for DMA. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/io

[PATCH v4 12/16] powerpc/pseries/svm: Disable doorbells in SVM guests

2019-08-19 Thread Thiago Jung Bauermann
, Ram Pai and Michael Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c

[RFC PATCH v4 11/16] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-08-19 Thread Thiago Jung Bauermann
ned-off-by: Ryan Grimm Signed-off-by: Thiago Jung Bauermann --- .../ABI/testing/sysfs-devices-system-cpu | 10 ++ arch/powerpc/kernel/sysfs.c | 20 +++ 2 files changed, 30 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-devices-sys

[PATCH v4 10/16] powerpc/pseries/svm: Unshare all pages before kexecing a new kernel

2019-08-19 Thread Thiago Jung Bauermann
, unsharing of pages is skipped. NOTE: While testing crashkernel, make sure at least 256M is reserved for crashkernel. Otherwise SWIOTLB allocation will fail and crash kernel will fail to boot. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor

[PATCH v4 09/16] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)

2019-08-19 Thread Thiago Jung Bauermann
From: Anshuman Khandual Secure guests need to share the DTL buffers with the hypervisor. To that end, use a kmem_cache constructor which converts the underlying buddy allocated SLUB cache pages into shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch

[PATCH v4 08/16] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-08-19 Thread Thiago Jung Bauermann
here. Introduce helper is_svm_platform() which uses the S bit of the MSR to tell whether we're running as a secure guest. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 26 arch/powerpc/kernel/paca.c

[PATCH v4 07/16] powerpc/pseries: Add and use LPPACA_SIZE constant

2019-08-19 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch

[PATCH v4 06/16] powerpc: Introduce the MSR_S bit

2019-08-19 Thread Thiago Jung Bauermann
| +---+---+---+---+ | 0 | 1 | 1 | Problem (HV) | +---+---+---+---+ Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai [ cclaudio: Update the commit message ] Signed-off-by: Claudio Carvalho Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/reg.h

[PATCH v4 05/16] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE

2019-08-19 Thread Thiago Jung Bauermann
From: Ram Pai These functions are used when the guest wants to grant the hypervisor access to certain pages. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor-api.h | 2 ++ arch/powerpc/include/asm/ultravisor.h | 24

[PATCH v4 04/16] powerpc/prom_init: Add the ESM call to prom_init

2019-08-19 Thread Thiago Jung Bauermann
itching to secure mode. Signed-off-by: Ram Pai [ andmike: Generate an RTAS os-term hcall when the ESM ucall fails. ] Signed-off-by: Michael Anderson [ bauerman: Cleaned up the code a bit. ] Signed-off-by: Thiago Jung Bauermann --- .../admin-guide/kernel-parameters.txt | 5 + arch/power

[PATCH v4 03/16] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-08-19 Thread Thiago Jung Bauermann
e comments. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/boot/main.c | 41 ++ arch/powerpc/boot/ops.h| 2 ++ arch/powerpc/boot/wrapper | 24 +--- arch/powerpc/boot/zImage.lds.S | 8 +++ 4 files changed, 72 insert

[PATCH v4 02/16] powerpc/pseries: Introduce option to build secure virtual machines

2019-08-19 Thread Thiago Jung Bauermann
Introduce CONFIG_PPC_SVM to control support for secure guests and include Ultravisor-related helpers when it is selected Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/asm-prototypes.h | 2 +- arch/powerpc/kernel/Makefile | 4 +++- arch/powerpc/platforms

[PATCH v4 00/16] Secure Virtual Machine Enablement

2019-08-19 Thread Thiago Jung Bauermann
and UV_UNSHARE_PAGE powerpc/pseries/svm: Unshare all pages before kexecing a new kernel Ryan Grimm (2): powerpc/pseries/svm: Export guest SVM status to user space via sysfs powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs Sukadev Bhattiprolu (3): powerpc:

[PATCH v4 01/16] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-19 Thread Thiago Jung Bauermann
that reason, the ucall.S file is placed under arch/powerpc/kernel. If ultravisor is not enabled, the ucalls will be redirected to the hypervisor which must handle/fail the call. Thanks to inputs from Ram Pai and Michael Anderson. Signed-off-by: Claudio Carvalho Signed-off-by: Thiago Jung

Re: [PATCH v3 08/16] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-08-15 Thread Thiago Jung Bauermann
Michael Ellerman writes: > Thiago Jung Bauermann writes: >> Michael Ellerman writes: >>> Thiago Jung Bauermann writes: >>>> From: Anshuman Khandual >>>> >>>> LPPACA structures need to be shared with the host. Hence they need to be i

Re: [PATCH v3 11/16] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-08-15 Thread Thiago Jung Bauermann
Michael Ellerman writes: > Thiago Jung Bauermann writes: >> Michael Ellerman writes: >>> Thiago Jung Bauermann writes: >>>> From: Ryan Grimm >>>> User space might want to know it's running in a secure VM. It can't do >>>>

Re: [PATCH v3 11/16] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-08-12 Thread Thiago Jung Bauermann
Michael Ellerman writes: > Thiago Jung Bauermann writes: >> From: Ryan Grimm >> >> User space might want to know it's running in a secure VM. It can't do >> a mfmsr because mfmsr is a privileged instruction. >> >> The solution here is to crea

Re: [PATCH v3 08/16] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-08-12 Thread Thiago Jung Bauermann
Michael Ellerman writes: > Thiago Jung Bauermann writes: >> From: Anshuman Khandual >> >> LPPACA structures need to be shared with the host. Hence they need to be in >> shared memory. Instead of allocating individual chunks of memory for a >> given structure

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-rc

Re: [PATCH v3 13/16] powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests

2019-08-06 Thread Thiago Jung Bauermann
Hello Christoph, Thanks for your review. Christoph Hellwig writes: > On Tue, Aug 06, 2019 at 02:22:34AM -0300, Thiago Jung Bauermann wrote: >> @@ -1318,7 +1319,10 @@ void iommu_init_early_pSeries(void) >> of_reconfig_notifier_register(&am

[PATCH v3 16/16] powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs

2019-08-05 Thread Thiago Jung Bauermann
From: Ryan Grimm Enables running as a secure guest in platforms with an Ultravisor. Signed-off-by: Ryan Grimm Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/ppc64_defconfig | 1 + arch/powerpc/configs/pseries_defconfig | 1 + 2 files changed, 2

[PATCH v3 15/16] Documentation/powerpc: Ultravisor API

2019-08-05 Thread Thiago Jung Bauermann
-by: Claudio Carvalho Signed-off-by: Thiago Jung Bauermann --- Documentation/powerpc/ultravisor.rst | 1048 ++ 1 file changed, 1048 insertions(+) diff --git a/Documentation/powerpc/ultravisor.rst b/Documentation/powerpc/ultravisor.rst new file mode 100644 index

[PATCH v3 14/16] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-08-05 Thread Thiago Jung Bauermann
o the ARCH_HAS_MEM_ENCRYPT hooks and call swiotlb_update_mem_attributes() to convert SWIOTLB's memory pool to shared memory. Signed-off-by: Anshuman Khandual [ bauerman: Use ARCH_HAS_MEM_ENCRYPT hooks to share swiotlb memory pool. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/mem_encr

[PATCH v3 13/16] powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests

2019-08-05 Thread Thiago Jung Bauermann
Secure guest memory is inacessible to devices so regular DMA isn't possible. In that case set devices' dma_map_ops to NULL so that the generic DMA code path will use SWIOTLB and DMA to bounce buffers. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/iommu.c | 6

[PATCH v3 12/16] powerpc/pseries/svm: Disable doorbells in SVM guests

2019-08-05 Thread Thiago Jung Bauermann
, Ram Pai and Michael Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c

[PATCH v3 11/16] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-08-05 Thread Thiago Jung Bauermann
0. Signed-off-by: Ryan Grimm Reviewed-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/sysfs.c | 29 + 1 file changed, 29 insertions(+) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index e2147d7c9e72..f7100ab77d29 10

[PATCH v3 10/16] powerpc/pseries/svm: Unshare all pages before kexecing a new kernel

2019-08-05 Thread Thiago Jung Bauermann
, unsharing of pages is skipped. NOTE: While testing crashkernel, make sure at least 256M is reserved for crashkernel. Otherwise SWIOTLB allocation will fail and crash kernel will fail to boot. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor

[PATCH v3 09/16] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)

2019-08-05 Thread Thiago Jung Bauermann
From: Anshuman Khandual Secure guests need to share the DTL buffers with the hypervisor. To that end, use a kmem_cache constructor which converts the underlying buddy allocated SLUB cache pages into shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch

[PATCH v3 08/16] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-08-05 Thread Thiago Jung Bauermann
here. Introduce helper is_svm_platform() which uses the S bit of the MSR to tell whether we're running as a secure guest. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/svm.h | 26 arch/powerpc/kernel/paca.c

[PATCH v3 07/16] powerpc/pseries: Add and use LPPACA_SIZE constant

2019-08-05 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch

[PATCH v3 06/16] powerpc: Introduce the MSR_S bit

2019-08-05 Thread Thiago Jung Bauermann
userspace) 1 0 hypervisor ultravisor 1 1 problem reserved Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai [ cclaudio: Update the commit message ] Signed-off-by: Claudio Carvalho Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/reg.h | 3 +++ 1

[PATCH v3 05/16] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE

2019-08-05 Thread Thiago Jung Bauermann
From: Ram Pai These functions are used when the guest wants to grant the hypervisor access to certain pages. Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ultravisor-api.h | 2 ++ arch/powerpc/include/asm/ultravisor.h | 24

[PATCH v3 04/16] powerpc/prom_init: Add the ESM call to prom_init

2019-08-05 Thread Thiago Jung Bauermann
itching to secure mode. Signed-off-by: Ram Pai [ andmike: Generate an RTAS os-term hcall when the ESM ucall fails. ] Signed-off-by: Michael Anderson [ bauerman: Cleaned up the code a bit. ] Signed-off-by: Thiago Jung Bauermann --- .../admin-guide/kernel-parameters.txt | 5 + arch/power

[RFC PATCH v3 03/16] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-08-05 Thread Thiago Jung Bauermann
e comments. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/boot/main.c | 41 ++ arch/powerpc/boot/ops.h| 2 ++ arch/powerpc/boot/wrapper | 24 +--- arch/powerpc/boot/zImage.lds.S | 8 +++ 4 files changed, 72 insert

[PATCH v3 02/16] powerpc/pseries: Introduce option to build secure virtual machines

2019-08-05 Thread Thiago Jung Bauermann
Introduce CONFIG_PPC_SVM to control support for secure guests and include Ultravisor-related helpers when it is selected Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/asm-prototypes.h | 2 +- arch/powerpc/kernel/Makefile | 4 +++- arch/powerpc/platforms

[PATCH v3 00/16] Secure Virtual Machine Enablement

2019-08-05 Thread Thiago Jung Bauermann
lpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE powerpc/pseries/svm: Unshare all pages before kexecing a new kernel Ryan Grimm (2): powerpc/pseries/svm: Export guest SVM status to user space via sysfs powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs Sukadev Bhattipr

[PATCH v3 01/16] powerpc/kernel: Add ucall_norets() ultravisor call handler

2019-08-05 Thread Thiago Jung Bauermann
, the ucall.S file is placed under arch/powerpc/kernel. If ultravisor is not enabled, the ucalls will be redirected to the hypervisor which must handle/fail the call. Thanks to inputs from Ram Pai and Michael Anderson. Signed-off-by: Claudio Carvalho Signed-off-by: Thiago Jung Bauermann --- arch

[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 +

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

2019-08-05 Thread Thiago Jung Bauermann
erride 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 Bauerman

[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
_psp_pa()) which can 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_encr

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

2019-08-05 Thread Thiago Jung Bauermann
by: Thiago 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/

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

2019-08-05 Thread Thiago Jung Bauermann
dma_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/

[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 0/6] Remove x86-specific code from generic headers

2019-08-05 Thread Thiago Jung Bauermann
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 Jung Bauermann

Re: [PATCH 1/3] powerpc/spinlocks: Refactor SHARED_PROCESSOR

2019-07-30 Thread Thiago Jung Bauermann
Christopher M Riedl writes: >> On July 30, 2019 at 4:31 PM Thiago Jung Bauermann >> wrote: >> >> >> >> Christopher M. Riedl writes: >> >> > Determining if a processor is in shared processor mode is not a constant >> > so don't

Re: [PATCH 1/3] powerpc/spinlocks: Refactor SHARED_PROCESSOR

2019-07-30 Thread Thiago Jung Bauermann
SPLPAR depends on CONFIG_PPC_PSERIES, which depends on CONFIG_PPC_BOOK3S so the #ifdef above is unnecessary: if CONFIG_PPC_BOOK3S is unset then CONFIG_PPC_SPLPAR will be unset as well and the return expression should short-circuit to false. -- Thiago Jung Bauermann IBM Linux Technology Center

Re: [PATCH v12 01/11] MODSIGN: Export module signature definitions

2019-07-23 Thread Thiago Jung Bauermann
Hello Philipp, Philipp Rudo writes: > Hi Thiago, > > On Thu, 04 Jul 2019 15:57:34 -0300 > Thiago Jung Bauermann wrote: > >> Hello Philipp, >> >> Philipp Rudo writes: >> >> > Hi Thiago, >> > >> > >>

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: [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

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 splitt

Re: [PATCH v2 03/13] powerpc/prom_init: Add the ESM call to prom_init

2019-07-18 Thread Thiago Jung Bauermann
Alexey Kardashevskiy writes: > On 19/07/2019 07:28, Thiago Jung Bauermann wrote: >> >> Hello Segher, >> >> Thanks for your review and suggestions! >> >> Segher Boessenkool writes: >> >>> (Sorry to hijack your reply). >>> >>&

Re: [PATCH v2 03/13] powerpc/prom_init: Add the ESM call to prom_init

2019-07-18 Thread Thiago Jung Bauermann
Hello Segher, Thanks for your review and suggestions! Segher Boessenkool writes: > (Sorry to hijack your reply). > > On Thu, Jul 18, 2019 at 06:11:48PM +1000, Alexey Kardashevskiy wrote: >> On 13/07/2019 16:00, Thiago Jung Bauermann wrote: >> >From: Ram Pai >>

Re: [PATCH v2 04/13] powerpc/pseries/svm: Add helpers for UV_SHARE_PAGE and UV_UNSHARE_PAGE

2019-07-18 Thread Thiago Jung Bauermann
Hello Alexey, Thanks for your review! Alexey Kardashevskiy writes: > On 13/07/2019 16:00, Thiago Jung Bauermann wrote: >> From: Ram Pai >> >> These functions are used when the guest wants to grant the hypervisor >> access to certain pages. >> >> S

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-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 v3 6/6] s390/mm: Remove sev_active() function

2019-07-18 Thread Thiago Jung Bauermann
ferred: > > 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 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 Technology Center

[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

[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
_psp_pa()) which can 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 |

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

2019-07-17 Thread Thiago Jung Bauermann
erride 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 Bauerm

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

2019-07-17 Thread Thiago Jung Bauermann
dma_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

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

2019-07-17 Thread Thiago Jung Bauermann
by: Thiago 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 @@ p

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

2019-07-17 Thread Thiago Jung Bauermann
ve definition of ARCH_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 Chri

[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

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 S.

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 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

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

2019-07-15 Thread Thiago Jung Bauermann
ys and will then feed the 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: [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: [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: >> >> >> >> >> >&

[PATCH v2 13/13] powerpc/configs: Enable secure guest support in pseries and ppc64 defconfigs

2019-07-12 Thread Thiago Jung Bauermann
From: Ryan Grimm Enables running as a secure guest in platforms with an Ultravisor. Signed-off-by: Ryan Grimm Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/configs/ppc64_defconfig | 1 + arch/powerpc/configs/pseries_defconfig | 1 + 2 files changed, 2

[PATCH v2 12/13] powerpc/pseries/svm: Force SWIOTLB for secure guests

2019-07-12 Thread Thiago Jung Bauermann
o the ARCH_HAS_MEM_ENCRYPT hooks and call swiotlb_update_mem_attributes() to convert SWIOTLB's memory pool to shared memory. Signed-off-by: Anshuman Khandual [ bauerman: Use ARCH_HAS_MEM_ENCRYPT hooks to share swiotlb memory pool. ] Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/mem_encr

[PATCH v2 11/13] powerpc/pseries/iommu: Don't use dma_iommu_ops on secure guests

2019-07-12 Thread Thiago Jung Bauermann
Secure guest memory is inacessible to devices so regular DMA isn't possible. In that case set devices' dma_map_ops to NULL so that the generic DMA code path will use SWIOTLB and DMA to bounce buffers. Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/iommu.c | 6

<    1   2   3   4   5   6   7   8   9   >