All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value
@ 2016-12-08  3:42 Aneesh Kumar K.V
  2016-12-08 21:17 ` Ram Pai
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Aneesh Kumar K.V @ 2016-12-08  3:42 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V

In commit a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
LPCR_VRMASD wrongly as below.

-#define   LPCR_VRMASD  (0x1ful << (63-16))
+#define   LPCR_VRMASD_SH       47
+#define   LPCR_VRMASD          (ASM_CONST(1) << LPCR_VRMASD_SH)

We initialize the VRMA bits in LPCR to 0x00 in kvm. Hence using a different
mask value as above while updating lpcr should not have any impact.

This patch updates it to the correct value
Fixes: a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated

Reported-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/reg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 9e1499f98def..1c17e208db78 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -337,7 +337,7 @@
 #define   LPCR_DPFD_SH		52
 #define   LPCR_DPFD		(ASM_CONST(7) << LPCR_DPFD_SH)
 #define   LPCR_VRMASD_SH	47
-#define   LPCR_VRMASD		(ASM_CONST(1) << LPCR_VRMASD_SH)
+#define   LPCR_VRMASD		(ASM_CONST(1f) << LPCR_VRMASD_SH)
 #define   LPCR_VRMA_L		ASM_CONST(0x0008000000000000)
 #define   LPCR_VRMA_LP0		ASM_CONST(0x0001000000000000)
 #define   LPCR_VRMA_LP1		ASM_CONST(0x0000800000000000)
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value
  2016-12-08  3:42 [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value Aneesh Kumar K.V
@ 2016-12-08 21:17 ` Ram Pai
  2016-12-08 21:21 ` Paul Mackerras
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ram Pai @ 2016-12-08 21:17 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: benh, paulus, mpe, linuxppc-dev

On Thu, Dec 08, 2016 at 09:12:13AM +0530, Aneesh Kumar K.V wrote:
> In commit a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> LPCR_VRMASD wrongly as below.
> 
> -#define   LPCR_VRMASD  (0x1ful << (63-16))
> +#define   LPCR_VRMASD_SH       47
> +#define   LPCR_VRMASD          (ASM_CONST(1) << LPCR_VRMASD_SH)
> 
> We initialize the VRMA bits in LPCR to 0x00 in kvm. Hence using a different
> mask value as above while updating lpcr should not have any impact.
> 
> This patch updates it to the correct value
> Fixes: a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> 
> Reported-by: Ram Pai <linuxram@us.ibm.com>

  actually this was reported by He Jia.

> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/reg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index 9e1499f98def..1c17e208db78 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -337,7 +337,7 @@
>  #define   LPCR_DPFD_SH		52
>  #define   LPCR_DPFD		(ASM_CONST(7) << LPCR_DPFD_SH)
>  #define   LPCR_VRMASD_SH	47
> -#define   LPCR_VRMASD		(ASM_CONST(1) << LPCR_VRMASD_SH)
> +#define   LPCR_VRMASD		(ASM_CONST(1f) << LPCR_VRMASD_SH)
						  ^^^^
		Shouldn't this be 0x1f instead of 1f  ?

RP

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value
  2016-12-08  3:42 [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value Aneesh Kumar K.V
  2016-12-08 21:17 ` Ram Pai
@ 2016-12-08 21:21 ` Paul Mackerras
  2016-12-17  0:26 ` kbuild test robot
  2017-01-27  0:40 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Paul Mackerras @ 2016-12-08 21:21 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: benh, mpe, linuxppc-dev

On Thu, Dec 08, 2016 at 09:12:13AM +0530, Aneesh Kumar K.V wrote:
> In commit a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> LPCR_VRMASD wrongly as below.
> 
> -#define   LPCR_VRMASD  (0x1ful << (63-16))
> +#define   LPCR_VRMASD_SH       47
> +#define   LPCR_VRMASD          (ASM_CONST(1) << LPCR_VRMASD_SH)
> 
> We initialize the VRMA bits in LPCR to 0x00 in kvm. Hence using a different
> mask value as above while updating lpcr should not have any impact.
> 
> This patch updates it to the correct value
> Fixes: a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> 
> Reported-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/reg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index 9e1499f98def..1c17e208db78 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -337,7 +337,7 @@
>  #define   LPCR_DPFD_SH		52
>  #define   LPCR_DPFD		(ASM_CONST(7) << LPCR_DPFD_SH)
>  #define   LPCR_VRMASD_SH	47
> -#define   LPCR_VRMASD		(ASM_CONST(1) << LPCR_VRMASD_SH)
> +#define   LPCR_VRMASD		(ASM_CONST(1f) << LPCR_VRMASD_SH)

Don't you need an 0x in there?  Did you compile-test this?

Paul.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value
  2016-12-08  3:42 [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value Aneesh Kumar K.V
  2016-12-08 21:17 ` Ram Pai
  2016-12-08 21:21 ` Paul Mackerras
@ 2016-12-17  0:26 ` kbuild test robot
  2017-01-27  0:40 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2016-12-17  0:26 UTC (permalink / raw)
  To: Aneesh Kumar K.V
  Cc: kbuild-all, benh, paulus, mpe, linuxppc-dev, Aneesh Kumar K.V

[-- Attachment #1: Type: text/plain, Size: 4006 bytes --]

Hi Aneesh,

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.9 next-20161216]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aneesh-Kumar-K-V/powerpc-mm-Fixup-wrong-LPCR_VRMASD-value/20161208-161150
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-pseries_defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All error/warnings (new ones prefixed by >>):

   In file included from arch/powerpc/include/asm/bitops.h:46:0,
                    from include/linux/bitops.h:36,
                    from include/linux/kernel.h:10,
                    from include/linux/list.h:8,
                    from include/linux/preempt.h:10,
                    from include/linux/hardirq.h:4,
                    from include/linux/kvm_host.h:10,
                    from arch/powerpc/kvm/book3s_hv.c:21:
   arch/powerpc/kvm/book3s_hv.c: In function 'kvmppc_hv_setup_htab_rma':
>> arch/powerpc/include/asm/reg.h:341:35: error: invalid suffix "fUL" on integer constant
    #define   LPCR_VRMASD  (ASM_CONST(1f) << LPCR_VRMASD_SH)
                                      ^
   arch/powerpc/include/asm/asm-compat.h:14:26: note: in definition of macro '__ASM_CONST'
    #  define __ASM_CONST(x) x##UL
                             ^
>> arch/powerpc/include/asm/reg.h:341:25: note: in expansion of macro 'ASM_CONST'
    #define   LPCR_VRMASD  (ASM_CONST(1f) << LPCR_VRMASD_SH)
                            ^~~~~~~~~
>> arch/powerpc/kvm/book3s_hv.c:3079:32: note: in expansion of macro 'LPCR_VRMASD'
     kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD);
                                   ^~~~~~~~~~~
--
   In file included from arch/powerpc/include/asm/bitops.h:46:0,
                    from include/linux/bitops.h:36,
                    from include/linux/kernel.h:10,
                    from include/linux/list.h:8,
                    from include/linux/preempt.h:10,
                    from include/linux/hardirq.h:4,
                    from include/linux/kvm_host.h:10,
                    from arch/powerpc/kvm/book3s_64_mmu_hv.c:21:
   arch/powerpc/kvm/book3s_64_mmu_hv.c: In function 'kvm_htab_write':
>> arch/powerpc/include/asm/reg.h:341:35: error: invalid suffix "fUL" on integer constant
    #define   LPCR_VRMASD  (ASM_CONST(1f) << LPCR_VRMASD_SH)
                                      ^
   arch/powerpc/include/asm/asm-compat.h:14:26: note: in definition of macro '__ASM_CONST'
    #  define __ASM_CONST(x) x##UL
                             ^
>> arch/powerpc/include/asm/reg.h:341:25: note: in expansion of macro 'ASM_CONST'
    #define   LPCR_VRMASD  (ASM_CONST(1f) << LPCR_VRMASD_SH)
                            ^~~~~~~~~
>> arch/powerpc/kvm/book3s_64_mmu_hv.c:1416:35: note: in expansion of macro 'LPCR_VRMASD'
        kvmppc_update_lpcr(kvm, lpcr, LPCR_VRMASD);
                                      ^~~~~~~~~~~

vim +/fUL +341 arch/powerpc/include/asm/reg.h

   335	#define   LPCR_VPM1		ASM_CONST(0x4000000000000000)
   336	#define   LPCR_ISL		ASM_CONST(0x2000000000000000)
   337	#define   LPCR_VC_SH		61
   338	#define   LPCR_DPFD_SH		52
   339	#define   LPCR_DPFD		(ASM_CONST(7) << LPCR_DPFD_SH)
   340	#define   LPCR_VRMASD_SH	47
 > 341	#define   LPCR_VRMASD		(ASM_CONST(1f) << LPCR_VRMASD_SH)
   342	#define   LPCR_VRMA_L		ASM_CONST(0x0008000000000000)
   343	#define   LPCR_VRMA_LP0		ASM_CONST(0x0001000000000000)
   344	#define   LPCR_VRMA_LP1		ASM_CONST(0x0000800000000000)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 20849 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: powerpc/mm: Fixup wrong LPCR_VRMASD value
  2016-12-08  3:42 [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value Aneesh Kumar K.V
                   ` (2 preceding siblings ...)
  2016-12-17  0:26 ` kbuild test robot
@ 2017-01-27  0:40 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-01-27  0:40 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V

On Thu, 2016-12-08 at 03:42:13 UTC, "Aneesh Kumar K.V" wrote:
> In commit a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> LPCR_VRMASD wrongly as below.
> 
> -#define   LPCR_VRMASD  (0x1ful << (63-16))
> +#define   LPCR_VRMASD_SH       47
> +#define   LPCR_VRMASD          (ASM_CONST(1) << LPCR_VRMASD_SH)
> 
> We initialize the VRMA bits in LPCR to 0x00 in kvm. Hence using a different
> mask value as above while updating lpcr should not have any impact.
> 
> This patch updates it to the correct value
> Fixes: a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated
> 
> Reported-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/4ab2537c4204b976e4ca350bbdc193

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-27  0:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08  3:42 [PATCH] powerpc/mm: Fixup wrong LPCR_VRMASD value Aneesh Kumar K.V
2016-12-08 21:17 ` Ram Pai
2016-12-08 21:21 ` Paul Mackerras
2016-12-17  0:26 ` kbuild test robot
2017-01-27  0:40 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.