lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Dec 2023 09:08:37 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Baoquan He <bhe@...hat.com>
Cc:     Stephen Rothwell <sfr@...b.auug.org.au>, akpm@...ux-foundation.org,
        ignat@...udflare.com, linux-next@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
        kexec@...ts.infradead.org, eric_devolder@...oo.com
Subject: Re: [PATCH 1/2] riscv, crash: don't export some symbols when
 CONFIG_MMU=n



On 12/4/23 23:18, Baoquan He wrote:
> On 12/04/23 at 11:14am, Randy Dunlap wrote:

[]

>>
>> Both riscv 32-bit and 64-bit complain:
>>
>> ../arch/riscv/kernel/crash_core.c: In function 'arch_crash_save_vmcoreinfo':
>> ../arch/riscv/kernel/crash_core.c:11:58: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]
>>    11 |         vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START);
>>       |                                                        ~~^
>>       |                                                          |
>>       |                                                          long unsigned int
>>       |                                                        %x
> 
> Thanks for all these testing.
> 
> This warning is irrelevant to the kexec patch, it's becasue 
> VMALLOC_START is defined as 0 which is int when CONFIG_MMU=n.
> 
> Below patch can fix the warning.
> 
> From 46984a0287e5f1b41ae3e9adfcfa0d26b71db8f4 Mon Sep 17 00:00:00 2001
> From: Baoquan He <bhe@...hat.com>
> Date: Tue, 5 Dec 2023 11:02:55 +0800
> Subject: [PATCH] riscv: fix VMALLC_START definition
> Content-type: text/plain
> 
> When below config items are set, compiler complained:
> 
> --------------------
> CONFIG_CRASH_CORE=y
> CONFIG_KEXEC_CORE=y
> CONFIG_CRASH_DUMP=y
> ......
> -----------------------
> 
> -------------------------------------------------------------------
> arch/riscv/kernel/crash_core.c: In function 'arch_crash_save_vmcoreinfo':
> arch/riscv/kernel/crash_core.c:11:58: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Wformat=]
> 11 |         vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START);
>    |                                                        ~~^
>    |                                                          |
>    |                                                          long unsigned int
>    |                                                        %x
> ----------------------------------------------------------------------
> 
> This is because on riscv macro VMALLOC_START has different type when
> CONFIG_MMU is set or unset.
> 
> arch/riscv/include/asm/pgtable.h:
> --------------------------------------------------
> 
> Changing it to _AC(0, UL) in case CONFIG_MMU=n can fix the warning.
> 
> Signed-off-by: Baoquan He <bhe@...hat.com>

Reported-by: Randy Dunlap <rdunlap@...radead.org>
Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org> # build-tested


Thanks.

> ---
>  arch/riscv/include/asm/pgtable.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
> index 294044429e8e..ab00235b018f 100644
> --- a/arch/riscv/include/asm/pgtable.h
> +++ b/arch/riscv/include/asm/pgtable.h
> @@ -899,7 +899,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
>  #define PAGE_KERNEL		__pgprot(0)
>  #define swapper_pg_dir		NULL
>  #define TASK_SIZE		0xffffffffUL
> -#define VMALLOC_START		0
> +#define VMALLOC_START		_AC(0, UL)
>  #define VMALLOC_END		TASK_SIZE
>  
>  #endif /* !CONFIG_MMU */

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ