powerpc/mm: Fixup wrong LPCR_VRMASD value
PATCH 1/1 powerpc/mm: Fixup wrong LPCR_VRMASD value
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
--- arch/powerpc/include/asm/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/reg.h +1 -1
@@ -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)
Signature · 1 line
2.10.2
Quoted 7 lines · Aneesh Kumar K.V
In commit
a4b349540a26af("powerpc/mm: Cleanup LPCR defines") we updatedLPCR_VRMASDwrongly as below.(quoted diff) +2
-1-#define LPCR_VRMASD (0x1ful << (63-16)) +#define LPCR_VRMASD_SH 47 +#define LPCR_VRMASD (ASM_CONST(1) << LPCR_VRMASD_SH)
Quoted 7 lines
We initialize the VRMA bits in LPCR to
0x00in 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 updatedReported-by Ram Pai <[email protected]>
actually this was reported by He Jia.
Quoted 10 lines
Signed-off-by Aneesh Kumar K.V <[email protected]>--- arch/powerpc/include/asm/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/include/asm/reg.h +0
-0
arch/powerpc/include/asm/reg.h line 340
Quoted 5 lines
arch/powerpc/include/asm/reg.h +1
-1@@ -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
Quoted 24 lines · Aneesh Kumar K.V
In commit
a4b349540a26af("powerpc/mm: Cleanup LPCR defines") we updatedLPCR_VRMASDwrongly as below.(quoted diff) +2
-1-#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
0x00in 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 updatedReported-by Ram Pai <[email protected]>Signed-off-by Aneesh Kumar K.V <[email protected]>--- arch/powerpc/include/asm/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/include/asm/reg.h +0
-0
arch/powerpc/include/asm/reg.h line 340
Quoted 5 lines
arch/powerpc/include/asm/reg.h +1
-1@@ -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.
kbuild test robot
build botreproduce: 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…
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
Michael Ellerman
AppliedQuoted 7 lines · Aneesh Kumar K.V
In commit
a4b349540a26af("powerpc/mm: Cleanup LPCR defines") we updatedLPCR_VRMASDwrongly as below.(quoted diff) +2
-1-#define LPCR_VRMASD (0x1ful << (63-16)) +#define LPCR_VRMASD_SH 47 +#define LPCR_VRMASD (ASM_CONST(1) << LPCR_VRMASD_SH)
Quoted 8 lines
We initialize the VRMA bits in LPCR to
0x00in 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 updatedReported-by Ram Pai <[email protected]>Signed-off-by Aneesh Kumar K.V <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/4ab2537c4204b976e4ca350bbdc193
cheers