Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp429401rdb; Tue, 5 Dec 2023 09:09:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGO8n/s3M1ooNbQNYEeMdkeyUc29FvIj6+wh8szY0gNfxJ8LDZAMHQ8Zs+1dT6vI3iEpBr5 X-Received: by 2002:a17:90a:2d86:b0:286:da5c:2225 with SMTP id p6-20020a17090a2d8600b00286da5c2225mr1325613pjd.71.1701796140681; Tue, 05 Dec 2023 09:09:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701796140; cv=none; d=google.com; s=arc-20160816; b=QyK95nZ9yybqZS9FL+t75TFiky0lb9Dekqp3RN6YpnodWdVp+1gff7pNKTjXuE2r29 Ltn/msQ9kHoE10WZfs9Tbnk1PpXENG/JXKGX2djsxy4UHigrK4vAqPwv/hwfVyPizKz7 ZH/O62fw+yeimCMBIqBQb6jtDm+KuvY8lPj7unuwwFqCdzCSnR+YKy80yYx/amH72fYf KmhKjgsDjEZcDa52qYCkeMMb8lGMYXYUkJmybreC4P4XobprbpDQtU/PQqbnbzrQGg08 Klu8PHcQLcOxo0ehbUt+UzVPhZY3dsLd5pNXHwF7wcD8DYM9v+Bjte3QnTROEC+upCoK 27Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1llierF4zA5793A0h8X4gsP2jzq0+KwCB4rIq5DDmzk=; fh=QNAU/5NZxVvp2DlElz/Hms8qzlAVfxtJgUuaY402hro=; b=zQCp7Ix6vdPhk4zBK7Jpg9Gl3V3ysrPA0gzCdx/L4Q344TcpL+p0MYNqhN+A6GNMi4 JnJjp/S4egrMn4bZY/mTysNq1t7EPD/XPYWpY2Yf01Br9Y4QQNnKkvwE4RpVFSaQ8T5y uI6Er9PJ1oBVmgrOGBUlR8jlJxfg+1HeSqUEZRmjQPbzRRW6ImNWuHCvpm3hvRaHVuh3 Kif0wckKiGIbjXRIo6UDY3VXfgqRskDl9kPKgFoRpTuMaf70reDqu7S0IPJVNoXO4D6k rCga6yj8+dMUdE0AjMNUgxB2RmubmkAuVZkd7xzJ1QVq0/ia/FvaWPbFyqQ0K6nocjjP SOXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VZUbUKqL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i20-20020a17090adc1400b0028669f28affsi6258296pjv.165.2023.12.05.09.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:09:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=VZUbUKqL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 534BD8043935; Tue, 5 Dec 2023 09:08:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbjLERIp (ORCPT + 99 others); Tue, 5 Dec 2023 12:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbjLERIo (ORCPT ); Tue, 5 Dec 2023 12:08:44 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F189DA9; Tue, 5 Dec 2023 09:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=1llierF4zA5793A0h8X4gsP2jzq0+KwCB4rIq5DDmzk=; b=VZUbUKqL5NX+XS5uyMthkp/nId OVaS08z9q7+cJ/3uONusQZfOFscvx0ZTXbIZSnZT6EdhPkAutf+jaoCPUWR1+i1iKmTSBkWhWqC9z rLAvq6LZuTWic/4zPopHcUaTSjoDKVAKgJbPild6F4eMt0OLO7Jk7siA51jy2isnDjzc5tfX5tsRY USwbjhPxdzSuFN9BPjemmk9vEwRdLxgahXg+SOkZgs5yP4BoUpnDF46pypE5PeFkhwc0JwAVrdOiX r2KD3WhCfOfl1FwGLCedvoOedXoLU0gokVgNE8o/V8nipxbt0kMPNBF80tW1ZOwooSuZ6rhIXM22E eJ12iGJw==; Received: from [50.53.46.231] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rAYuW-007zp0-1J; Tue, 05 Dec 2023 17:08:40 +0000 Message-ID: <5f9f018a-dc4f-42f0-ba90-2f44d2f61a7c@infradead.org> Date: Tue, 5 Dec 2023 09:08:37 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] riscv, crash: don't export some symbols when CONFIG_MMU=n Content-Language: en-US To: Baoquan He Cc: Stephen Rothwell , akpm@linux-foundation.org, ignat@cloudflare.com, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, eric_devolder@yahoo.com References: <694baf13-65d0-4877-b6c7-56e3006f83be@infradead.org> From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 09:08:54 -0800 (PST) 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 > 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 Reported-by: Randy Dunlap Acked-by: Randy Dunlap Tested-by: Randy Dunlap # 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