Re: [RFC v6 27/62] powerpc: helper to validate key-access permissions of a pte

2017-07-20 Thread Aneesh Kumar K.V
Ram Pai writes: > On Thu, Jul 20, 2017 at 12:12:47PM +0530, Aneesh Kumar K.V wrote: >> Ram Pai writes: >> >> > helper function that checks if the read/write/execute is allowed >> > on the pte. >> > >> > Signed-off-by: Ram Pai >> > --- >> > arch/powerpc/include/asm/book3s/64/pgtable.h |4 +

Re: [PATCH] qe: fix compile issue for arm64

2017-07-20 Thread Michael Ellerman
Zhao Qiang writes: > Signed-off-by: Zhao Qiang > --- > drivers/soc/fsl/qe/qe.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c > index 2ef6fc6..d48fa4a 100644 > --- a/drivers/soc/fsl/qe/qe.c > +++ b/drivers/soc/fsl/qe/qe.c > @@ -229,7

Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest

2017-07-20 Thread Michael Ellerman
Vaidyanathan Srinivasan writes: > * Nicholas Piggin [2017-07-21 11:16:44]: >> diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c >> b/arch/powerpc/platforms/pseries/pseries_energy.c >> index 164a13d3998a..35c891aabef0 100644 >> --- a/arch/powerpc/platforms/pseries/pseries_energy.c >> +

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Benjamin Herrenschmidt
On Fri, 2017-07-21 at 10:10 +0530, Santosh Sivaraj wrote: > In case of a bogus clock id, the default case sets 'ret' to -1, which forces > it > to fallback to the syscall. > > I think the solution is probably to do the syscall fallback in asm, and > > everything else in C. > > Ok. That's what Ser

[PATCH 2/2] powerpc/xmon: revisit SPR support

2017-07-20 Thread Balbir Singh
This patch readjusts the SPR's adds support for IAMR/AMR UAMOR/AMOR based on their supported ISA revisions. The HDEC SPR is now printed with 16 hex digits instead of 8, so that we can see the expanded values on ISA 300. There is also support for printing the PIDR/TIDR for ISA 300 and PSSCR and PTCR

[PATCH 1/2] powerpc/xmon: support dumping software pagetables

2017-07-20 Thread Balbir Singh
It would be nice to be able to dump page tables in a particular context Example use cases Dumping PTE contents to see the keys (useful for debugging) c000ba48c880 c000bab438b0 2677 2675 T 2 protection_keys 0:mon> ds c000ba48c880 0x77f7 translating tsk c000ba48c880, a

Re: [PATCH v4] powerpc/mm/radix: Workaround prefetch issue with KVM

2017-07-20 Thread Paul Mackerras
On Thu, Jul 20, 2017 at 05:36:56PM +1000, Benjamin Herrenschmidt wrote: > There's a somewhat architectural issue with Radix MMU and KVM. > > When coming out of a guest with AIL (ie, MMU enabled), we start > executing hypervisor code with the PID register still containing > whatever the guest has b

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Santosh Sivaraj
* Michael Ellerman wrote (on 2017-07-20 23:18:26 +1000): > Santosh Sivaraj writes: > > > Current vDSO64 implementation does not have support for coarse > > clocks (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls > > back to system call. Below is a benchmark of the difference

Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest

2017-07-20 Thread Vaidyanathan Srinivasan
* Nicholas Piggin [2017-07-21 11:16:44]: > On Thu, 20 Jul 2017 23:03:21 +1000 > Michael Ellerman wrote: > > > Nicholas Piggin writes: > > > > > This driver currently reports the H_BEST_ENERGY is unsupported even > > > when booting in a non-LPAR environment (e.g., powernv). Prevent it. > >

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Anton Blanchard
Hi, > > +static notrace int gettime_syscall_fallback(clockid_t clk_id, > > +struct timespec *tp) > > +{ > > + register clockid_t id asm("r3") = clk_id; > > + register struct timespec *t asm("r4") = tp; > > + register int nr asm("r0") = __NR_clock_getti

[PATCH] qe: fix compile issue for arm64

2017-07-20 Thread Zhao Qiang
Signed-off-by: Zhao Qiang --- drivers/soc/fsl/qe/qe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 2ef6fc6..d48fa4a 100644 --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc/fsl/qe/qe.c @@ -229,7 +229,9 @@ int qe_setbrg(enum qe_clock b

Re: KVM guests freeze under upstream kernel

2017-07-20 Thread joserz
On Thu, Jul 20, 2017 at 03:21:59PM +1000, Paul Mackerras wrote: > On Thu, Jul 20, 2017 at 12:02:23AM -0300, jos...@linux.vnet.ibm.com wrote: > > On Thu, Jul 20, 2017 at 09:42:50AM +1000, Benjamin Herrenschmidt wrote: > > > On Wed, 2017-07-19 at 16:46 -0300, jos...@linux.vnet.ibm.com wrote: > > > >

Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest

2017-07-20 Thread Nicholas Piggin
On Thu, 20 Jul 2017 23:03:21 +1000 Michael Ellerman wrote: > Nicholas Piggin writes: > > > This driver currently reports the H_BEST_ENERGY is unsupported even > > when booting in a non-LPAR environment (e.g., powernv). Prevent it. > > Just delete the printk(). Users don't know what that mean

Re: [PATCH 0/4] Allow non-legacy cards to be vgaarb default

2017-07-20 Thread Daniel Axtens
Hi Ard, > (+ Laszlo) > > On 19 July 2017 at 02:28, Daniel Axtens wrote: >> Hi all, >> >> Previously I posted a patch that provided a quirk for a hibmc card >> behind a particular Huawei bridge that allowed it to be marked as the >> default device in the VGA arbiter.[0] This lead to some discussio

Re: [RFC v6 27/62] powerpc: helper to validate key-access permissions of a pte

2017-07-20 Thread Ram Pai
On Thu, Jul 20, 2017 at 12:12:47PM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > helper function that checks if the read/write/execute is allowed > > on the pte. > > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/include/asm/book3s/64/pgtable.h |4 +++ > > arch/powerpc/include

Re: [RFC v6 11/62] powerpc: initial pkey plumbing

2017-07-20 Thread Ram Pai
On Thu, Jul 20, 2017 at 11:34:10AM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > basic setup to initialize the pkey system. Only 64K kernel in HPT > > mode, enables the pkey system. > > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/Kconfig | 16 ++ > >

Re: [RFC v6 01/62] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages

2017-07-20 Thread Ram Pai
On Thu, Jul 20, 2017 at 11:21:51AM +0530, Aneesh Kumar K.V wrote: > > . > > > /* > > @@ -116,8 +104,8 @@ int __hash_page_4K(unsigned long ea, unsigned long > > access, unsigned long vsid, > > * On hash insert failure we use old pte value and we don't > > * want

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Segher Boessenkool
On Fri, Jul 21, 2017 at 07:17:39AM +1000, Benjamin Herrenschmidt wrote: > > Great patch! Always good to see asm replaced with C. > > Yeah ewll ... when C becomes some kind of weird glorifed asm like > below, I don't see much of a point ;-) Yeah. > > > diff --git a/arch/powerpc/kernel/vdso64/gett

Re: [PATCH] drivers: cpuidle: Disable preemption before get_lppaca function call in pseries_idle_probe function

2017-07-20 Thread Benjamin Herrenschmidt
On Thu, 2017-07-20 at 14:57 -0300, Victor Aoqui wrote: > When CONFIG_PREEMPT=y, the following warning shows up: > > BUG: using smp_processor_id() in preemptible [] code: swapper/0/1 > caller is pseries_processor_idle_init+0x58/0x21c > > This warning shows up because preemption cannot occu

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Benjamin Herrenschmidt
On Thu, 2017-07-20 at 23:18 +1000, Michael Ellerman wrote: > Santosh Sivaraj writes: > > > Current vDSO64 implementation does not have support for coarse > > clocks (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls > > back to system call. Below is a benchmark of the difference

[PATCH] drivers: cpuidle: Disable preemption before get_lppaca function call in pseries_idle_probe function

2017-07-20 Thread Victor Aoqui
When CONFIG_PREEMPT=y, the following warning shows up: BUG: using smp_processor_id() in preemptible [] code: swapper/0/1 caller is pseries_processor_idle_init+0x58/0x21c This warning shows up because preemption cannot occur when using get_paca(), otherwise the paca_struct it points to may

[PATCH] powerpc/kernel: Avoid preemption check during iommu_range_alloc

2017-07-20 Thread Victor Aoqui
Replaced __this_cpu_read function call by raw_cpu_read in iommu_range_alloc function. Preemption doesn't need to be disabled since any CPU can safely use IOMMU pool. Signed-off-by: Victor Aoqui --- arch/powerpc/kernel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ar

[PATCH v2] powerpc/mm: Implemented default_hugepagesz verification for powerpc

2017-07-20 Thread Victor Aoqui
Implemented default hugepage size verification (default_hugepagesz=) in order to allow allocation of defined number of pages (hugepages=) only for supported hugepage sizes. Signed-off-by: Victor Aoqui --- v2: - Renamed default_hugepage_setup_sz function to hugetlb_default_size_setup; - Added po

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Michael Ellerman
Santosh Sivaraj writes: > Current vDSO64 implementation does not have support for coarse > clocks (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls > back to system call. Below is a benchmark of the difference in execution > time with and without vDSO support. Hi Santosh, Grea

Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest

2017-07-20 Thread Michael Ellerman
Nicholas Piggin writes: > This driver currently reports the H_BEST_ENERGY is unsupported even > when booting in a non-LPAR environment (e.g., powernv). Prevent it. Just delete the printk(). Users don't know what that means, and developers have other better ways to detect that the hcall is missin

Re: [PATCH] powerpc/asm/cacheflush: Cleanup cacheflush function params

2017-07-20 Thread Michael Ellerman
Geert Uytterhoeven writes: > On Thu, Jul 20, 2017 at 1:43 PM, Michael Ellerman wrote: >> Matt Brown writes: >>> The cacheflush prototypes currently use start and stop values and each >>> call requires typecasting the address to an unsigned long. >>> This patch changes the cacheflush prototypes

Re: [PATCH] powerpc/asm/cacheflush: Cleanup cacheflush function params

2017-07-20 Thread Geert Uytterhoeven
On Thu, Jul 20, 2017 at 1:43 PM, Michael Ellerman wrote: > Matt Brown writes: >> The cacheflush prototypes currently use start and stop values and each >> call requires typecasting the address to an unsigned long. >> This patch changes the cacheflush prototypes to follow the x86 style of >> using

Re: [RESEND PATCH] powerpc: defconfig: Cleanup from old Kconfig options

2017-07-20 Thread Michael Ellerman
Krzysztof Kozlowski writes: > Remove old, dead Kconfig option USB_LED. It is gone since > commit a335aaf3125c ("usb: misc: remove outdated USB LED driver"). > > Signed-off-by: Krzysztof Kozlowski > --- > arch/powerpc/configs/c2k_defconfig| 1 - > arch/powerpc/configs/ppc6xx_defconfig | 1 -

[PATCH] powerpc/pseries: energy driver only print message when LPAR guest

2017-07-20 Thread Nicholas Piggin
This driver currently reports the H_BEST_ENERGY is unsupported even when booting in a non-LPAR environment (e.g., powernv). Prevent it. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/pseries_energy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms

Re: [PATCH] powerpc/asm/cacheflush: Cleanup cacheflush function params

2017-07-20 Thread Michael Ellerman
Hi Matt, Thanks for tackling this mess. Matt Brown writes: > The cacheflush prototypes currently use start and stop values and each > call requires typecasting the address to an unsigned long. > This patch changes the cacheflush prototypes to follow the x86 style of > using a base and size value

[PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Santosh Sivaraj
Current vDSO64 implementation does not have support for coarse clocks (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls back to system call. Below is a benchmark of the difference in execution time with and without vDSO support. (Non-coarse clocks are also included just for compl

[PATCH v4] powerpc/mm/radix: Workaround prefetch issue with KVM

2017-07-20 Thread Benjamin Herrenschmidt
There's a somewhat architectural issue with Radix MMU and KVM. When coming out of a guest with AIL (ie, MMU enabled), we start executing hypervisor code with the PID register still containing whatever the guest has been using. The problem is that the CPU can (and will) then start prefetching or s

Re: [PATCH v2 2/3] powerpc/powernv: machine check use kernel crash path

2017-07-20 Thread Mahesh Jagannath Salgaonkar
On 07/19/2017 12:29 PM, Nicholas Piggin wrote: > There are quite a few machine check exceptions that can be caused by > kernel bugs. To make debugging easier, use the kernel crash path in > cases of synchronous machine checks that occur in kernel mode, if that > would not result in the machine goin

Re: [PATCH] powerpc/asm/cacheflush: Cleanup cacheflush function params

2017-07-20 Thread Geert Uytterhoeven
On Thu, Jul 20, 2017 at 8:28 AM, Matt Brown wrote: > The cacheflush prototypes currently use start and stop values and each > call requires typecasting the address to an unsigned long. > This patch changes the cacheflush prototypes to follow the x86 style of > using a base and size values, with ba