Re: [PATCH] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry

2019-12-24 Thread Scott Wood
On Wed, 2019-12-25 at 11:24 +0800, Yingjie Bai wrote: > Hi Scott, > > __pa() returns 64bit in my setup. > > in arch/powerpc/include/asm/page.h > > #if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE) > #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + > VIRT_PHYS_OFFSET)) > #define __pa(

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-24 Thread Leon Romanovsky
On Tue, Dec 24, 2019 at 06:03:50PM -0800, John Hubbard wrote: > On 12/22/19 5:23 AM, Leon Romanovsky wrote: > > On Fri, Dec 20, 2019 at 03:54:55PM -0800, John Hubbard wrote: > > > On 12/20/19 10:29 AM, Leon Romanovsky wrote: > > > ... > > > > > $ ./build.sh > > > > > $ build/bin/run_tests.py > > >

[PATCH 2/2] powerpc/pseries/svm: Disable BHRB/EBB/PMU access

2019-12-24 Thread Sukadev Bhattiprolu
Ultravisor disables some CPU features like BHRB, EBB and PMU in secure virtual machines (SVMs). Skip accessing those registers in SVMs to avoid getting a Program Interrupt. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v2] - [Michael Ellerman] Optimize the code using FW_FEATURE_SVM

[PATCH 1/2] powerpc/pseries/svm: Use FW_FEATURE to detect SVM

2019-12-24 Thread Sukadev Bhattiprolu
Use FW_FEATURE_SVM to detect a secure guest (SVM). This would be more efficient than calling mfmsr() frequently. Suggested-by: Michael Ellerman Signed-off-by: Sukadev Bhattiprolu --- arch/powerpc/include/asm/firmware.h | 3 ++- arch/powerpc/include/asm/svm.h| 6 +- arch/po

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-24 Thread John Hubbard
On 12/22/19 5:23 AM, Leon Romanovsky wrote: On Fri, Dec 20, 2019 at 03:54:55PM -0800, John Hubbard wrote: On 12/20/19 10:29 AM, Leon Romanovsky wrote: ... $ ./build.sh $ build/bin/run_tests.py If you get things that far I think Leon can get a reproduction for you I'm not so optimistic about

Re: [PATCH] powerpc/mpc85xx: also write addr_h to spin table for 64bit boot entry

2019-12-24 Thread Scott Wood
On Tue, 2019-12-24 at 09:35 +0800, Yingjie Bai wrote: > Hi Michael, > Thanks for pointing out the issue. My mistake... > This patch should indeed make sense only when > CONFIG_PHYS_64BIT=y > > I could not find corenet32_smp_defconfig, but I guess in your config, > CONFIG_PHYS_64BIT=n ? > I will up

Re: [PATCH] powerpc/shared: include correct header for static key

2019-12-24 Thread Srikar Dronamraju
* Jason A. Donenfeld [2019-12-23 14:31:47]: > Recently, the spinlock implementation grew a static key optimization, > but the jump_label.h header include was left out, leading to build > errors: > > linux/arch/powerpc/include/asm/spinlock.h:44:7: error: implicit declaration > of function ???sta

Re: [RFC PATCH v2 04/10] lib: vdso: get pointer to vdso data from the arch

2019-12-24 Thread Segher Boessenkool
On Tue, Dec 24, 2019 at 08:15:11PM +0800, Andy Lutomirski wrote: > Does power have PC-relative data access? If so, I wonder if the code can be > arranged so that even the array accesses don’t require computing an absolute > address at any point. Not before ISA 3.0 (that is Power9). The bcl/mfl

Re: [RFC PATCH v2 04/10] lib: vdso: get pointer to vdso data from the arch

2019-12-24 Thread Andy Lutomirski
On Tue, Dec 24, 2019 at 4:15 AM Andy Lutomirski wrote: > > > > > On Dec 24, 2019, at 7:53 PM, christophe leroy > > wrote: > > > >  > > > >> Le 24/12/2019 à 03:27, Andy Lutomirski a écrit : > >>> On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy > >>> wrote: > >>> > >>> On powerpc, __arch_get_vd

Re: [RFC PATCH v2 04/10] lib: vdso: get pointer to vdso data from the arch

2019-12-24 Thread Andy Lutomirski
> On Dec 24, 2019, at 7:53 PM, christophe leroy wrote: > >  > >> Le 24/12/2019 à 03:27, Andy Lutomirski a écrit : >>> On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy >>> wrote: >>> >>> On powerpc, __arch_get_vdso_data() clobbers the link register, >>> requiring the caller to set a stack f

Re: [RFC PATCH v2 02/10] lib: vdso: move call to fallback out of common code.

2019-12-24 Thread Andy Lutomirski
> On Dec 24, 2019, at 7:41 PM, christophe leroy wrote: > >  > >> Le 24/12/2019 à 03:24, Andy Lutomirski a écrit : >>> On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy >>> wrote: >>> >>> On powerpc, VDSO functions and syscalls cannot be implemented in C >>> because the Linux kernel ABI requi

Re: [RFC PATCH v2 07/10] lib: vdso: don't use READ_ONCE() in __c_kernel_time()

2019-12-24 Thread Andy Lutomirski
> On Dec 24, 2019, at 7:12 PM, christophe leroy wrote: > >  > >> Le 24/12/2019 à 02:58, Andy Lutomirski a écrit : >>> On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy >>> wrote: >>> >>> READ_ONCE() forces the read of the 64 bit value of >>> vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec al

Re: [RFC PATCH v2 04/10] lib: vdso: get pointer to vdso data from the arch

2019-12-24 Thread christophe leroy
Le 24/12/2019 à 03:27, Andy Lutomirski a écrit : On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy wrote: On powerpc, __arch_get_vdso_data() clobbers the link register, requiring the caller to set a stack frame in order to save it. As the parent function already has to set a stack frame and

Re: [RFC PATCH v2 02/10] lib: vdso: move call to fallback out of common code.

2019-12-24 Thread christophe leroy
Le 24/12/2019 à 03:24, Andy Lutomirski a écrit : On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy wrote: On powerpc, VDSO functions and syscalls cannot be implemented in C because the Linux kernel ABI requires that CR[SO] bit is set in case of error and cleared when no error. As this canno

Re: [RFC PATCH v2 07/10] lib: vdso: don't use READ_ONCE() in __c_kernel_time()

2019-12-24 Thread christophe leroy
Le 24/12/2019 à 02:58, Andy Lutomirski a écrit : On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy wrote: READ_ONCE() forces the read of the 64 bit value of vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec allthough only the lower part is needed. Seems reasonable and very unlikely to be har