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: >> >> >> >> >> >> Michael S. Tsirkin writes: >> >> >> >> > On Wed, Apr 17, 2019

Re: [PATCH v9 05/10] namei: O_BENEATH-style path resolution flags

2019-07-13 Thread Al Viro
On Sat, Jul 13, 2019 at 03:41:53AM +0100, Al Viro wrote: > On Fri, Jul 12, 2019 at 04:00:26PM +0100, Al Viro wrote: > > On Fri, Jul 12, 2019 at 02:25:53PM +0100, Al Viro wrote: > > > > > if (flags & LOOKUP_BENEATH) { > > > nd->root = nd->path; > > > if (!(flags &

Re: [RFC PATCH kernel] powerpc/xive: Drop deregistered irqs

2019-07-13 Thread Benjamin Herrenschmidt
On Sat, 2019-07-13 at 18:53 +1000, Alexey Kardashevskiy wrote: > > On 13/07/2019 09:47, Benjamin Herrenschmidt wrote: > > On Fri, 2019-07-12 at 19:37 +1000, Alexey Kardashevskiy wrote: > > > > > > >

Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition

2019-07-13 Thread Segher Boessenkool
On Sun, Jul 14, 2019 at 07:45:15AM +0900, Masahiro Yamada wrote: > On Sat, Jul 13, 2019 at 10:17 PM Segher Boessenkool > wrote: > > On Sat, Jul 13, 2019 at 07:47:44AM -0500, Segher Boessenkool wrote: > > > On Sat, Jul 13, 2019 at 12:21:06PM +0900, Masahiro Yamada wrote: > > > > The KBUILD_ARFLAGS

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.3-1 tag

2019-07-13 Thread pr-tracker-bot
The pull request you sent on Sat, 13 Jul 2019 14:28:00 +1000: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.3-1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/192f0f8e9db7efe4ac98d47f5fa4334e43c1204d Thank you! --

Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition

2019-07-13 Thread Masahiro Yamada
On Sat, Jul 13, 2019 at 10:17 PM Segher Boessenkool wrote: > > On Sat, Jul 13, 2019 at 07:47:44AM -0500, Segher Boessenkool wrote: > > On Sat, Jul 13, 2019 at 12:21:06PM +0900, Masahiro Yamada wrote: > > > The KBUILD_ARFLAGS addition in arch/powerpc/Makefile has never worked > > > in a useful way

Re: [PATCH v4 6/8] KVM: PPC: Ultravisor: Restrict LDBAR access

2019-07-13 Thread Claudio Carvalho
On 7/1/19 3:46 AM, Ram Pai wrote: > On Mon, Jul 01, 2019 at 04:30:55PM +1000, Alexey Kardashevskiy wrote: >> >> On 01/07/2019 16:17, maddy wrote: >>> On 01/07/19 11:24 AM, Alexey Kardashevskiy wrote: On 29/06/2019 06:08, Claudio Carvalho wrote: > When the ultravisor firmware is

Re: [PATCH v4 3/8] KVM: PPC: Ultravisor: Add generic ultravisor call handler

2019-07-13 Thread Claudio Carvalho
On 7/11/19 9:57 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> From: Ram Pai >> >> Add the ucall() function, which can be used to make ultravisor calls >> with varied number of in and out arguments. Ultravisor calls can be made >> from the host or guests. >> >> This copies the

[PATCH V2] cpufreq: Make cpufreq_generic_init() return void

2019-07-13 Thread Viresh Kumar
It always returns 0 (success) and its return type should really be void. Over that, many drivers have added error handling code based on its return value, which is not required at all. change its return type to void and update all the callers. Signed-off-by: Viresh Kumar --- V1->V2: - Fixed

Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition

2019-07-13 Thread Segher Boessenkool
On Sat, Jul 13, 2019 at 07:47:44AM -0500, Segher Boessenkool wrote: > On Sat, Jul 13, 2019 at 12:21:06PM +0900, Masahiro Yamada wrote: > > The KBUILD_ARFLAGS addition in arch/powerpc/Makefile has never worked > > in a useful way because it is always overridden by the following code > > in the top

Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition

2019-07-13 Thread Segher Boessenkool
On Sat, Jul 13, 2019 at 12:21:06PM +0900, Masahiro Yamada wrote: > The KBUILD_ARFLAGS addition in arch/powerpc/Makefile has never worked > in a useful way because it is always overridden by the following code > in the top Makefile: > > # use the deterministic mode of AR if available >

Re: [RFC PATCH kernel] powerpc/xive: Drop deregistered irqs

2019-07-13 Thread Alexey Kardashevskiy
On 13/07/2019 09:47, Benjamin Herrenschmidt wrote: > On Fri, 2019-07-12 at 19:37 +1000, Alexey Kardashevskiy wrote: >> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/irq.c#n614 >> >> If so, then in order to do EOI, I'll need the desc which is

Re: [PATCH v4 2/8] powerpc: Introduce FW_FEATURE_ULTRAVISOR

2019-07-13 Thread Claudio Carvalho
On 7/11/19 9:57 AM, Michael Ellerman wrote: > Claudio Carvalho writes: >> diff --git a/arch/powerpc/include/asm/ultravisor.h >> b/arch/powerpc/include/asm/ultravisor.h >> new file mode 100644 >> index ..e5009b0d84ea >> --- /dev/null >> +++ b/arch/powerpc/include/asm/ultravisor.h >>

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

2019-07-13 Thread Halil Pasic
On Fri, 12 Jul 2019 17:11:29 +0200 Christoph Hellwig wrote: > On Fri, Jul 12, 2019 at 04:51:53PM +0200, Halil Pasic wrote: > > Thank you very much! I will have another look, but it seems to me, > > without further measures taken, this would break protected virtualization > > support on s390. The

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

2019-07-13 Thread Halil Pasic
On Fri, 12 Jul 2019 16:08:12 +0200 Christoph Hellwig wrote: > On Fri, Jul 12, 2019 at 03:09:12PM +0200, Halil Pasic wrote: > > This is the implementation for the guys that don't > > have ARCH_HAS_MEM_ENCRYPT. > > > > Means sev_active() may not be used in such code after this > > patch. What

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

2019-07-13 Thread Halil Pasic
On Fri, 12 Jul 2019 02:36:31 -0300 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 architectures to > define the sev_active() function, which doesn't make a lot of sense.

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

2019-07-13 Thread Christoph Hellwig
On Fri, Jul 12, 2019 at 05:42:49PM +0200, Halil Pasic wrote: > > Will do! I guess I should do the patch against the for-next branch of the > dma-mapping tree. But that branch does not have the s390 support patches > (yet?). > To fix it I need both e67a5ed1f86f and 64e1f0c531d1 "s390/mm: force >

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

2019-07-13 Thread Christoph Hellwig
While this looks generally good to me, I think we want to split this into three patches: 1) update the swiotlb printk 2) removing the dma-mapping check and printk 3) clean up the mem_encrypt.h interface.

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

2019-07-13 Thread Christoph Hellwig
On Sat, Jul 13, 2019 at 01:45:52AM -0300, Thiago Jung Bauermann wrote: > powerpc is also going to use this feature, so put it in a generic location. Looks good, even without a third arch using it we should never habe symbols defined under arch/$(ARCH) that are used in common code to start with.

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

2019-07-13 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-13 Thread Thiago Jung Bauermann
From: Anshuman Khandual SWIOTLB checks range of incoming CPU addresses to be bounced and sees if the device can access it through its 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

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

2019-07-13 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

[PATCH v2 10/13] powerpc/pseries/svm: Disable doorbells in SVM guests

2019-07-13 Thread Thiago Jung Bauermann
From: Sukadev Bhattiprolu Normally, the HV emulates some instructions like MSGSNDP, MSGCLRP from a KVM guest. To emulate the instructions, it must first read the instruction from the guest's memory and decode its parameters. However for a secure guest (aka SVM), the page containing the

[PATCH v2 09/13] powerpc/pseries/svm: Export guest SVM status to user space via sysfs

2019-07-13 Thread Thiago Jung Bauermann
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 create a cpu attribute: /sys/devices/system/cpu/svm which will read 0 or 1 based on the S bit of the guest's CPU 0.

[PATCH v2 08/13] powerpc/pseries/svm: Unshare all pages before kexecing a new kernel

2019-07-13 Thread Thiago Jung Bauermann
From: Ram Pai A new kernel deserves a clean slate. Any pages shared with the hypervisor is unshared before invoking the new kernel. However there are exceptions. If the new kernel is invoked to dump the current kernel, or if there is a explicit request to preserve the state of the current

[PATCH v2 07/13] powerpc/pseries/svm: Use shared memory for Debug Trace Log (DTL)

2019-07-13 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 ---

[PATCH v2 06/13] powerpc/pseries/svm: Use shared memory for LPPACA structures

2019-07-13 Thread Thiago Jung Bauermann
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 from memblock, a contiguous chunk of memory is allocated and then converted into shared memory. Subsequent

[PATCH v2 05/13] powerpc/pseries: Add and use LPPACA_SIZE constant

2019-07-13 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

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

2019-07-13 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 | 15 +++ 2

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

2019-07-13 Thread Thiago Jung Bauermann
From: Ram Pai Make the Enter-Secure-Mode (ESM) ultravisor call to switch the VM to secure mode. Add "svm=" command line option to turn on switching 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 [

[RFC PATCH v2 02/13] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-07-13 Thread Thiago Jung Bauermann
From: Benjamin Herrenschmidt For secure VMs, the signing tool will create a ticket called the "ESM blob" for the Enter Secure Mode ultravisor call with the signatures of the kernel and initrd among other things. This adds support to the wrapper script for adding that blob via the "-e" option to

[PATCH v2 01/13] powerpc/pseries: Introduce option to build secure virtual machines

2019-07-13 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/ultravisor.h | 2 +- arch/powerpc/kernel/Makefile | 4 +++-

[PATCH v2 00/13] Secure Virtual Machine Enablement

2019-07-13 Thread Thiago Jung Bauermann
Hello, The main change in this version was to rebase on top of cleanup series I just posted: https://lore.kernel.org/linuxppc-dev/20190713044554.28719-1-bauer...@linux.ibm.com/ In addition to the patches above, this patch series applies on top of v4 of Claudio Carvalho's "kvmppc: