Re: [PATCH] powerpc/mm: Use refcount_t for refcount

2019-08-09 Thread Chuhong Yuan
On Fri, Aug 9, 2019 at 8:36 PM Michael Ellerman wrote: > > Chuhong Yuan writes: > > Reference counters are preferred to use refcount_t instead of > > atomic_t. > > This is because the implementation of refcount_t can prevent > > overflows and detect possible use-after-free. > > So convert

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Segher Boessenkool
On Fri, Aug 09, 2019 at 10:12:56PM +0200, Arnd Bergmann wrote: > @@ -106,7 +106,7 @@ static inline u##size name(const volatile u##size > __iomem *addr)\ > { \ > u##size ret;

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Nick Desaulniers
On Fri, Aug 9, 2019 at 1:13 PM Arnd Bergmann wrote: > > On Fri, Aug 9, 2019 at 10:02 PM Christophe Leroy > wrote: > > > > Arnd Bergmann a écrit : > > > On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built > > > Linux wrote: > > > > > >> static inline void dcbz(void *addr) > > >>

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Segher Boessenkool
On Fri, Aug 09, 2019 at 10:03:01PM +0200, Christophe Leroy wrote: > Arnd Bergmann a écrit : > > >On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built > >Linux wrote: > > > >> static inline void dcbz(void *addr) > >> { > >>- __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Segher Boessenkool
On Fri, Aug 09, 2019 at 08:28:19PM +0200, Arnd Bergmann wrote: > On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > static inline void dcbz(void *addr) > > { > > - __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory"); > > + __asm__

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Nathan Chancellor
On Fri, Aug 09, 2019 at 11:21:05AM -0700, Nick Desaulniers wrote: > The input parameter is modified, so it should be an output parameter > with "=" to make it so that a copy of the input is not made by Clang. > > Link: https://bugs.llvm.org/show_bug.cgi?id=42762 > Link:

[Bug 204479] KASAN hit at modprobe zram

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204479 --- Comment #15 from Christophe Leroy (christophe.le...@c-s.fr) --- As far as I can see in the latest dmesg, the Oops occurs in raid6 pq module. An this time it is not anymore in kasan register global. -- You are receiving this mail because:

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Arnd Bergmann
On Fri, Aug 9, 2019 at 10:02 PM Christophe Leroy wrote: > > Arnd Bergmann a écrit : > > On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built > > Linux wrote: > > > >> static inline void dcbz(void *addr) > >> { > >> - __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) :

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Christophe Leroy
Arnd Bergmann a écrit : On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built Linux wrote: static inline void dcbz(void *addr) { - __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory"); + __asm__ __volatile__ ("dcbz %y0" : "=Z"(*(u8 *)addr) ::

Re: [PATCH 1/2] ASoC: fsl_esai: Add compatible string for imx6ull

2019-08-09 Thread Nicolin Chen
On Fri, Aug 09, 2019 at 06:27:46PM +0800, Shengjiu Wang wrote: > Add compatible string for imx6ull, from imx6ull platform, > the issue of channel swap after xrun is fixed in hardware. > > Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen > --- > sound/soc/fsl/fsl_esai.c | 1 + > 1 file

Re: [PATCH 2/2] ASoC: fsl_esai: Add new compatible string for imx6ull

2019-08-09 Thread Nicolin Chen
On Fri, Aug 09, 2019 at 06:27:47PM +0800, Shengjiu Wang wrote: > Add new compatible string "fsl,imx6ull-esai" in the binding document. > > Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen > --- > Documentation/devicetree/bindings/sound/fsl,esai.txt | 7 +-- > 1 file changed, 5

Re: [PATCH net-next v2] ibmveth: Allow users to update reported speed and duplex

2019-08-09 Thread David Miller
From: Jakub Kicinski Date: Tue, 6 Aug 2019 15:15:24 -0700 > On Tue, 6 Aug 2019 11:23:08 -0500, Thomas Falcon wrote: >> Reported ethtool link settings for the ibmveth driver are currently >> hardcoded and no longer reflect the actual capabilities of supported >> hardware. There is no interface

Re: [PATCH v8 3/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-09 Thread Mahesh Jagannath Salgaonkar
On 8/7/19 8:26 PM, Santosh Sivaraj wrote: > From: Balbir Singh > > The current code would fail on huge pages addresses, since the shift would > be incorrect. Use the correct page shift value returned by > __find_linux_pte() to get the correct physical address. The code is more > generic and can

Re: [PATCH v8 1/7] powerpc/mce: Schedule work from irq_work

2019-08-09 Thread Mahesh Jagannath Salgaonkar
On 8/7/19 8:26 PM, Santosh Sivaraj wrote: > schedule_work() cannot be called from MCE exception context as MCE can > interrupt even in interrupt disabled context. > > fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") > Signed-off-by: Santosh Sivaraj > --- >

Re: [PATCH] powerpc: fix inline asm constraints for dcbz

2019-08-09 Thread Arnd Bergmann
On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built Linux wrote: > static inline void dcbz(void *addr) > { > - __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory"); > + __asm__ __volatile__ ("dcbz %y0" : "=Z"(*(u8 *)addr) :: "memory"); > } > > static

[Bug 204479] KASAN hit at modprobe zram

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204479 --- Comment #14 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284303 --> https://bugzilla.kernel.org/attachment.cgi?id=284303=edit dmesg (kernel 5.3-rc3 + patch + 2nd patch, without CONFIG_SMP, v2, PowerMac G4 DP) However the

[Bug 204479] KASAN hit at modprobe zram

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204479 --- Comment #13 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284301 --> https://bugzilla.kernel.org/attachment.cgi?id=284301=edit dmesg (kernel 5.3-rc3 + patch + 2nd patch, without CONFIG_SMP, PowerMac G4 DP) Definitely an

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. >> >> I don't have a way to test SME, SEV,

Re: [PATCH 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

2019-08-09 Thread Christophe Leroy
Hi Daniel, Le 07/08/2019 à 18:34, Christophe Leroy a écrit : Le 07/08/2019 à 01:38, Daniel Axtens a écrit : KASAN support on powerpc64 is interesting:   - We want to be able to support inline instrumentation so as to be     able to catch global and stack issues.   - We run a lot of code at

[Bug 204479] KASAN hit at modprobe zram

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204479 --- Comment #12 from Christophe Leroy (christophe.le...@c-s.fr) --- Patch at https://patchwork.ozlabs.org/patch/1144756/ -- You are receiving this mail because: You are on the CC list for the bug.

[PATCH] powerpc/kasan: fix parallele loading of modules.

2019-08-09 Thread Christophe Leroy
Parallele loading of modules may lead to bad setup of shadow page table entries. First, lets align modules so that two modules never share the same shadow page. Second, ensure that two modules cannot allocate two page tables for the same PMD entry at the same time. This is done by using

[PATCH] powerpc/kasan: fix shadow area set up for modules.

2019-08-09 Thread Christophe Leroy
When loading modules, from time to time an Oops is encountered during the init of shadow area for globals. This is due to the last page not always being mapped depending on the exact distance between the start and the end of the shadow area and the alignment with the page addresses. Fix this by

[PATCH] powerpc/ptdump: fix addresses display on PPC32

2019-08-09 Thread Christophe Leroy
Commit 453d87f6a8ae ("powerpc/mm: Warn if W+X pages found on boot") wrongly changed KERN_VIRT_START from 0 to PAGE_OFFSET, leading to a shift in the displayed addresses. Lets revert that change to resync walk_pagetables()'s addr val and pgd_t pointer for PPC32. Fixes: 453d87f6a8ae ("powerpc/mm:

[Bug 204479] KASAN hit at modprobe zram

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204479 --- Comment #11 from Christophe Leroy (christophe.le...@c-s.fr) --- Thanks. Then it is not about SMP allthough there's anyway a theoritical problem with SMP that's I'll address in another patch. I think I finally spotted the issue. Let's take

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Matthew Wilcox
On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: > On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > > On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: > >> Should alloc_gigantic_page() be made available as an interface for general > >> use in the kernel. The test

Re: [PATCH 2/2] powerpc/mm: Warn if W+X pages found on boot

2019-08-09 Thread Christophe Leroy
Le 02/05/2019 à 07:51, Russell Currey a écrit : + if (radix_enabled()) + st.start_address = PAGE_OFFSET; + else + st.start_address = KERN_VIRT_START; KERN_VIRT_START doesn't exist on PPC32. Christophe Thanks a lot for the review! Applied all your

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

2019-08-09 Thread mpe
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. > > I don't have a way to test SME, SEV, nor s390's PEF so the patches have only >

Re: [PATCH v5 1/7] Documentation/powerpc: Ultravisor API

2019-08-09 Thread Michael Ellerman
Claudio Carvalho writes: > From: Sukadev Bhattiprolu > > POWER9 processor includes support for Protected Execution Facility (PEF). Which POWER9? Please be more precise. It's public knowledge that some versions of Power9 don't have PEF (or have it broken / fused off). People are going to try

Re: [PATCH] powerpc/mm: Use refcount_t for refcount

2019-08-09 Thread Michael Ellerman
Chuhong Yuan writes: > Reference counters are preferred to use refcount_t instead of > atomic_t. > This is because the implementation of refcount_t can prevent > overflows and detect possible use-after-free. > So convert atomic_t ref counters to refcount_t. > > Signed-off-by: Chuhong Yuan

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #11 from m...@ellerman.id.au --- bugzilla-dae...@bugzilla.kernel.org writes: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #10 from David Sterba (dste...@suse.com) --- > In my case it happened on 5.3-rc3, with a

Re: [Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-09 Thread Michael Ellerman
bugzilla-dae...@bugzilla.kernel.org writes: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #10 from David Sterba (dste...@suse.com) --- > In my case it happened on 5.3-rc3, with a strestest. The same machine has been > running fstests periodically, with slab debug on, but

[Bug 204375] kernel 5.2.4 w. KASAN enabled fails to boot on a PowerMac G4 3,6 at very early stage

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204375 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|RESOLVED|CLOSED

Re: [PATCH v3 38/41] powerpc: convert put_page() to put_user_page*()

2019-08-09 Thread Michael Ellerman
John Hubbard writes: > On 8/7/19 10:42 PM, Michael Ellerman wrote: >> Hi John, >> >> john.hubb...@gmail.com writes: >>> diff --git a/arch/powerpc/mm/book3s64/iommu_api.c >>> b/arch/powerpc/mm/book3s64/iommu_api.c >>> index b056cae3388b..e126193ba295 100644 >>> ---

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Mark Rutland
On Fri, Aug 09, 2019 at 03:16:33AM -0700, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: > > Should alloc_gigantic_page() be made available as an interface for general > > use in the kernel. The test module here uses very similar implementation > > from

[PATCH 1/2] ASoC: fsl_esai: Add compatible string for imx6ull

2019-08-09 Thread Shengjiu Wang
Add compatible string for imx6ull, from imx6ull platform, the issue of channel swap after xrun is fixed in hardware. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_esai.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index

[PATCH 2/2] ASoC: fsl_esai: Add new compatible string for imx6ull

2019-08-09 Thread Shengjiu Wang
Add new compatible string "fsl,imx6ull-esai" in the binding document. Signed-off-by: Shengjiu Wang --- Documentation/devicetree/bindings/sound/fsl,esai.txt | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/fsl,esai.txt

[Bug 204479] KASAN hit at modprobe zram

2019-08-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204479 --- Comment #10 from Erhard F. (erhar...@mailbox.org) --- Created attachment 284297 --> https://bugzilla.kernel.org/attachment.cgi?id=284297=edit dmesg (kernel 5.3-rc3 + patch, without CONFIG_SMP, PowerMac G4 DP) Here's the dmesg with the

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Anshuman Khandual
On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: >> Should alloc_gigantic_page() be made available as an interface for general >> use in the kernel. The test module here uses very similar implementation from >> HugeTLB to

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Matthew Wilcox
On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: > Should alloc_gigantic_page() be made available as an interface for general > use in the kernel. The test module here uses very similar implementation from > HugeTLB to allocate a PUD aligned memory block. Similar for mm_alloc()

[PATCH v6 11/12] powerpc/fsl_booke/kaslr: export offset in VMCOREINFO ELF notes

2019-08-09 Thread Jason Yan
Like all other architectures such as x86 or arm64, include KASLR offset in VMCOREINFO ELF notes to assist in debugging. After this, we can use crash --kaslr option to parse vmcore generated from a kaslr kernel. Note: The crash tool needs to support --kaslr too. Signed-off-by: Jason Yan Cc:

[PATCH v6 12/12] powerpc/fsl_booke/32: Document KASLR implementation

2019-08-09 Thread Jason Yan
Add document to explain how we implement KASLR for fsl_booke32. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook --- Documentation/powerpc/kaslr-booke32.rst | 42

[PATCH v6 09/12] powerpc/fsl_booke/kaslr: support nokaslr cmdline parameter

2019-08-09 Thread Jason Yan
One may want to disable kaslr when boot, so provide a cmdline parameter 'nokaslr' to support this. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Diana

[PATCH v6 08/12] powerpc/fsl_booke/kaslr: clear the original kernel if randomized

2019-08-09 Thread Jason Yan
The original kernel still exists in the memory, clear it now. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook Reviewed-by: Christophe Leroy Reviewed-by: Diana Craciun

[PATCH v6 06/12] powerpc/fsl_booke/32: implement KASLR infrastructure

2019-08-09 Thread Jason Yan
This patch add support to boot kernel from places other than KERNELBASE. Since CONFIG_RELOCATABLE has already supported, what we need to do is map or copy kernel to a proper place and relocate. Freescale Book-E parts expect lowmem to be mapped by fixed TLB entries(TLB1). The TLB1 entries are not

[PATCH v6 10/12] powerpc/fsl_booke/kaslr: dump out kernel offset information on panic

2019-08-09 Thread Jason Yan
When kaslr is enabled, the kernel offset is different for every boot. This brings some difficult to debug the kernel. Dump out the kernel offset when panic so that we can easily debug the kernel. This code is derived from x86/arm64 which has similar functionality. Signed-off-by: Jason Yan Cc:

[PATCH v6 05/12] powerpc/fsl_booke/32: introduce reloc_kernel_entry() helper

2019-08-09 Thread Jason Yan
Add a new helper reloc_kernel_entry() to jump back to the start of the new kernel. After we put the new kernel in a randomized place we can use this new helper to enter the kernel and begin to relocate again. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy

[PATCH v6 07/12] powerpc/fsl_booke/32: randomize the kernel image offset

2019-08-09 Thread Jason Yan
After we have the basic support of relocate the kernel in some appropriate place, we can start to randomize the offset now. Entropy is derived from the banner and timer, which will change every build and boot. This not so much safe so additionally the bootloader may pass entropy via the

[PATCH v6 04/12] powerpc/fsl_booke/32: introduce create_tlb_entry() helper

2019-08-09 Thread Jason Yan
Add a new helper create_tlb_entry() to create a tlb entry by the virtual and physical address. This is a preparation to support boot kernel at a randomized address. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul

[PATCH v6 01/12] powerpc: unify definition of M_IF_NEEDED

2019-08-09 Thread Jason Yan
M_IF_NEEDED is defined too many times. Move it to a common place and rename it to MAS2_M_IF_NEEDED which is much readable. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook

[PATCH v6 02/12] powerpc: move memstart_addr and kernstart_addr to init-common.c

2019-08-09 Thread Jason Yan
These two variables are both defined in init_32.c and init_64.c. Move them to init-common.c and make them __ro_after_init. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook

[PATCH v6 03/12] powerpc: introduce kernstart_virt_addr to store the kernel base

2019-08-09 Thread Jason Yan
Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we need a variable to store the kernel base. Signed-off-by: Jason Yan Cc: Diana Craciun Cc: Michael Ellerman Cc: Christophe Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Nicholas Piggin Cc: Kees Cook

[PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32

2019-08-09 Thread Jason Yan
This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals. Since CONFIG_RELOCATABLE has already supported, what we need to do is map or copy kernel to a proper place and relocate. Freescale

Re: [PATCH 6/8] arm-nommu: call dma_mmap_from_dev_coherent directly

2019-08-09 Thread Sergei Shtylyov
On 08.08.2019 19:00, Christoph Hellwig wrote: Ther is no need to go through dma_common_mmap for the arm-nommu There. :-) dma mmap implementation as the only possible memory not handled above could be that from the per-device coherent pool. Signed-off-by: Christoph Hellwig [...] MBR,

Re: [PATCH 2/2] powerpc: Convert flush_icache_range to C

2019-08-09 Thread Christophe Leroy
Le 09/08/2019 à 02:46, Alastair D'Silva a écrit : From: Alastair D'Silva Similar to commit 22e9c88d486a ("powerpc/64: reuse PPC32 static inline flush_dcache_range()") this patch converts flush_icache_range to C. Should we also convert __flush_dcache_icache() which does exactly the same

Re: [PATCH 1/2] powerpc: Allow flush_icache_range to work across ranges >4GB

2019-08-09 Thread Christophe Leroy
Le 09/08/2019 à 02:45, Alastair D'Silva a écrit : From: Alastair D'Silva When calling flush_icache_range with a size >4GB, we were masking off the upper 32 bits, so we would incorrectly flush a range smaller than intended. This patch replaces the 32 bit shifts with 64 bit ones, so that the

[PATCH v6 7/7] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-08-09 Thread Bharata B Rao
From: Anshuman Khandual CONFIG_PPC_UV adds support for ultravisor. Signed-off-by: Anshuman Khandual Signed-off-by: Bharata B Rao Signed-off-by: Ram Pai [ Update config help and commit message ] Signed-off-by: Claudio Carvalho --- arch/powerpc/Kconfig | 18 ++ 1 file

[PATCH v6 6/7] kvmppc: Support reset of secure guest

2019-08-09 Thread Bharata B Rao
Add support for reset of secure guest via a new ioctl KVM_PPC_SVM_OFF. This ioctl will be issued by QEMU during reset and includes the the following steps: - Ask UV to terminate the guest via UV_SVM_TERMINATE ucall - Unpin the VPA pages so that they can be migrated back to secure side when

[PATCH v6 5/7] kvmppc: Radix changes for secure guest

2019-08-09 Thread Bharata B Rao
- After the guest becomes secure, when we handle a page fault of a page belonging to SVM in HV, send that page to UV via UV_PAGE_IN. - Whenever a page is unmapped on the HV side, inform UV via UV_PAGE_INVAL. - Ensure all those routines that walk the secondary page tables of the guest don't do

[PATCH v6 4/7] kvmppc: Handle memory plug/unplug to secure VM

2019-08-09 Thread Bharata B Rao
Register the new memslot with UV during plug and unregister the memslot during unplug. Signed-off-by: Bharata B Rao Acked-by: Paul Mackerras --- arch/powerpc/include/asm/ultravisor-api.h | 1 + arch/powerpc/include/asm/ultravisor.h | 5 + arch/powerpc/kvm/book3s_hv.c |

[PATCH v6 3/7] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-08-09 Thread Bharata B Rao
H_SVM_INIT_START: Initiate securing a VM H_SVM_INIT_DONE: Conclude securing a VM As part of H_SVM_INIT_START, register all existing memslots with the UV. H_SVM_INIT_DONE call by UV informs HV that transition of the guest to secure mode is complete. These two states (transition to secure mode

[PATCH v6 2/7] kvmppc: Shared pages support for secure guests

2019-08-09 Thread Bharata B Rao
A secure guest will share some of its pages with hypervisor (Eg. virtio bounce buffers etc). Support sharing of pages between hypervisor and ultravisor. Once a secure page is converted to shared page, stop tracking that page as a device page. Signed-off-by: Bharata B Rao ---

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

2019-08-09 Thread Bharata B Rao
KVMPPC driver to manage page transitions of secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. H_SVM_PAGE_IN: Move the content of a normal page to secure page H_SVM_PAGE_OUT: Move the content of a secure page to normal page Private ZONE_DEVICE memory equal to the amount of secure memory

[PATCH v6 0/7] KVMPPC driver to manage secure guest pages

2019-08-09 Thread Bharata B Rao
Hi, A pseries guest can be run as a secure guest on Ultravisor-enabled POWER platforms. On such platforms, this driver will be used to manage the movement of guest pages between the normal memory managed by hypervisor(HV) and secure memory managed by Ultravisor(UV). Private ZONE_DEVICE memory

[PATCH v5 4/4] mm/nvdimm: Pick the right alignment default when creating dax devices

2019-08-09 Thread Aneesh Kumar K.V
Allow arch to provide the supported alignments and use hugepage alignment only if we support hugepage. Right now we depend on compile time configs whereas this patch switch this to runtime discovery. Architectures like ppc64 can have THP enabled in code, but then can have hugepage size disabled

[PATCH v5 3/4] mm/nvdimm: Use correct #defines instead of open coding

2019-08-09 Thread Aneesh Kumar K.V
Use PAGE_SIZE instead of SZ_4K and sizeof(struct page) instead of 64. If we have a kernel built with different struct page size the previous patch should handle marking the namespace disabled. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/label.c | 2 +-

[PATCH v5 2/4] mm/nvdimm: Add page size and struct page size to pfn superblock

2019-08-09 Thread Aneesh Kumar K.V
This is needed so that we don't wrongly initialize a namespace which doesn't have enough space reserved for holding struct pages with the current kernel. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/pfn.h | 5 - drivers/nvdimm/pfn_devs.c | 27 ++- 2 files

[PATCH v5 1/4] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-08-09 Thread Aneesh Kumar K.V
This patch add -EOPNOTSUPP as return from probe callback to indicate we were not able to initialize a namespace due to pfn superblock feature/version mismatch. We want to consider this a probe success so that we can create new namesapce seed and there by avoid marking the failed namespace as the

[PATCH v5 0/4] Mark the namespace disabled on pfn superblock mismatch

2019-08-09 Thread Aneesh Kumar K.V
We add new members to pfn superblock (PAGE_SIZE and struct page size) in this series. This is now checked while initializing the namespace. If we find a mismatch we mark the namespace disabled. This series also handle configs where hugepage support is not enabled by default. This can result in

[RFC V2 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-08-09 Thread Anshuman Khandual
This adds a test module which will validate architecture page table helpers and accessors regarding compliance with generic MM semantics expectations. This will help various architectures in validating changes to the existing page table helpers or addition of new ones. Cc: Andrew Morton Cc:

[RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Anshuman Khandual
This series adds a test validation for architecture exported page table helpers. Patch in the series adds basic transformation tests at various levels of the page table. This test was originally suggested by Catalin during arm64 THP migration RFC discussion earlier. Going forward it can include

Re: [PATCH 8/8] dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP

2019-08-09 Thread Geert Uytterhoeven
Hi Christoph, On Thu, Aug 8, 2019 at 6:01 PM Christoph Hellwig wrote: > CONFIG_ARCH_NO_COHERENT_DMA_MMAP is now functionally identical to > !CONFIG_MMU, so remove the separate symbol. The only difference is that > arm did not set it for !CONFIG_MMU, but arm uses a separate dma mapping >