Re: [PATCH v6 2/4] resource: Use list_head to link sibling resource

2018-07-07 Thread Baoquan He
Hi, On 07/05/18 at 01:00am, kbuild test robot wrote: > Hi Baoquan, > > I love your patch! Yet something to improve: > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.18-rc3 next-20180704] > [if your patch is applied to the wrong git tree, please drop us a note to >

Re: powerpc: 32BIT vs. 64BIT (PPC32 vs. PPC64)

2018-07-07 Thread Randy Dunlap
On 07/07/2018 05:13 AM, Nicholas Piggin wrote: > On Fri, 6 Jul 2018 21:58:29 -0700 > Randy Dunlap wrote: > >> On 07/06/2018 06:45 PM, Benjamin Herrenschmidt wrote: >>> On Thu, 2018-07-05 at 14:30 -0700, Randy Dunlap wrote: Hi, Is there a good way (or a shortcut) to do something

Re: [PATCH kernel v5 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-07 Thread Nicholas Piggin
On Sat, 7 Jul 2018 22:44:45 +1000 Alexey Kardashevskiy wrote: > On Sat, 7 Jul 2018 21:43:03 +1000 > Nicholas Piggin wrote: > > > On Sat, 7 Jul 2018 20:44:10 +1000 > > Alexey Kardashevskiy wrote: > > > > > A VM which has: > > > - a DMA capable device passed through to it (eg. network

Re: [PATCH kernel v5 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-07 Thread Alexey Kardashevskiy
On Sat, 7 Jul 2018 21:43:03 +1000 Nicholas Piggin wrote: > On Sat, 7 Jul 2018 20:44:10 +1000 > Alexey Kardashevskiy wrote: > > > A VM which has: > > - a DMA capable device passed through to it (eg. network card); > > - running a malicious kernel that ignores H_PUT_TCE failure; > > -

Re: powerpc: 32BIT vs. 64BIT (PPC32 vs. PPC64)

2018-07-07 Thread Nicholas Piggin
On Fri, 6 Jul 2018 21:58:29 -0700 Randy Dunlap wrote: > On 07/06/2018 06:45 PM, Benjamin Herrenschmidt wrote: > > On Thu, 2018-07-05 at 14:30 -0700, Randy Dunlap wrote: > >> Hi, > >> > >> Is there a good way (or a shortcut) to do something like: > >> > >> $ make ARCH=powerpc O=PPC32

Re: [PATCH kernel v5 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-07 Thread Nicholas Piggin
On Sat, 7 Jul 2018 20:44:10 +1000 Alexey Kardashevskiy wrote: > A VM which has: > - a DMA capable device passed through to it (eg. network card); > - running a malicious kernel that ignores H_PUT_TCE failure; > - capability of using IOMMU pages bigger that physical pages > can create an

[PATCH kernel v5 1/2] vfio/spapr: Use IOMMU pageshift rather than pagesize

2018-07-07 Thread Alexey Kardashevskiy
The size is always equal to 1 page so let's use this. Later on this will be used for other checks which use page shifts to check the granularity of access. This should cause no behavioral change. Reviewed-by: David Gibson Acked-by: Alex Williamson Signed-off-by: Alexey Kardashevskiy --- As

[PATCH kernel v5 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-07 Thread Alexey Kardashevskiy
A VM which has: - a DMA capable device passed through to it (eg. network card); - running a malicious kernel that ignores H_PUT_TCE failure; - capability of using IOMMU pages bigger that physical pages can create an IOMMU mapping that exposes (for example) 16MB of the host physical memory to

[PATCH kernel v5 0/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-07 Thread Alexey Kardashevskiy
This is to improve page boundaries checking and should probably be cc:stable. I came accross this while debugging nvlink2 passthrough but the lack of checking might be exploited by the existing userspace. The get_user_pages() comment says it should be "phased out" but the only alternative seems

[PATCH] KVM: PPC: Book3S HV: fix constant size warning

2018-07-07 Thread Nicholas Mc Guire
The constants are 64bit but not explicitly declared UL resulting in sparse warnings. Fixed by declaring the constants UL. Signed-off-by: Nicholas Mc Guire --- sparse fallout from compile checking book3s_hv.c: arch/powerpc/kvm/book3s_hv.c:141:9: warning: constant 0x164520C62609AECA is so big

[PATCH] KVM: PPC: Book3S HV: add of_node_put() in success path

2018-07-07 Thread Nicholas Mc Guire
The call to of_find_compatible_node() is returning a pointer with incremented refcount so it must be explicitly decremented after the last use. As here it is only being used for checking of node presence but the result is not actually used in the success path it can be dropped immediately.