Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp110350rdb; Mon, 4 Dec 2023 23:18:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7oDGW/vMBkKxmQjivyFVw/QUyhkc0WMnSexnfZDoNGlGzJOnuLg9di536iUfWL+cgTOrk X-Received: by 2002:a05:6a20:a121:b0:185:d125:ea70 with SMTP id q33-20020a056a20a12100b00185d125ea70mr1321742pzk.19.1701760715639; Mon, 04 Dec 2023 23:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701760715; cv=none; d=google.com; s=arc-20160816; b=kBLkjqPLKJiO+3pBiTPLdyefZFK8dD3hyJ4098j6CvfYfsi5kSkX0VzXJgc7DUvMKS wC9PJOVNYWBfV+BeDnvkDpJoXyuaQVGp4XTEiW6jGkge7ZShzTqLDMJt5VAPOySkTPpl 6ZVyDbDsKrbyxhVanxVLrXN8zYqPF3JUgQe0x7GOuVTku4vJ9jMtx9xDIbpP5mTQ1zRa 6saS4jwJDlSutxoQ2QcfbTpaV8FPA5X9C2cpxsSZjM3ifKJoOKmPCs/jq01mPdkkh+3D +HYeUOhSVxJ79kM4b4xeORcvwFHZV36ChollwEowP8N/pZu0GRw4gzHTfzZxmeEanwHx /dbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Nk63w2FM4PAdC43nY6LXoZWQzTzQEt+cPn1qq6XLAvs=; fh=HAejCrz4htgyq+AHWa8EfdAgsX8pXGw7u/85G1yKZnc=; b=Mp3KytUVd4owzQZ1g2wXnq4muGT6ukb5XMi5U0r1SXlm8EUBksXCet7Q+nd4c1k5yY UmXqdt4Jg0mN2LVJ43BdM04RRgN5edSRZ03D3SI5lGIlSz0SLrfm33V+btplkrbRAw3s UGDtrw0Tfa0kSCdCo3JFtcqKihiPrmIyQ8DBwsfE7pklmtYgpxXBbQKAArZHNwwMYure y2YTJ/x7qbVaFuImFWEoymrW/Qf6uNqcqIw28ce29Kg9paPTgJXWNdw9BcsSwjAFUNPb Y+8rGg1yigRhIjhQc9Y06W9I1vq3hR1hB5o5fhXusWlvK9pNzmt17sC+KncjkgJnps8/ xaCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QA/2mpAM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bx42-20020a056a02052a00b005c663e195d6si4903119pgb.446.2023.12.04.23.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 23:18:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QA/2mpAM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EF3718020939; Mon, 4 Dec 2023 23:18:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344587AbjLEHSR (ORCPT + 99 others); Tue, 5 Dec 2023 02:18:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjLEHSN (ORCPT ); Tue, 5 Dec 2023 02:18:13 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21316127 for ; Mon, 4 Dec 2023 23:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701760697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nk63w2FM4PAdC43nY6LXoZWQzTzQEt+cPn1qq6XLAvs=; b=QA/2mpAMdHgZEZR+QLp+XJoddcLP+AqX+ZROo5vnkK0M21h4GftQ1y3NaazqwBS1AezF2n kkJ4Wy1w5QFR77LuYieUvcskkg0ppe0KpCm23qRHnAt0Z5Zk2QfrJvmEyQebuyhYE7gSJS H1tcF+jDBjkObLrGaJXPX68ku3sise4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455-YDj-lje6OVi0pLS1qQl3SQ-1; Tue, 05 Dec 2023 02:18:13 -0500 X-MC-Unique: YDj-lje6OVi0pLS1qQl3SQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C081835144; Tue, 5 Dec 2023 07:18:13 +0000 (UTC) Received: from localhost (unknown [10.72.113.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42989492BC6; Tue, 5 Dec 2023 07:18:11 +0000 (UTC) Date: Tue, 5 Dec 2023 15:18:09 +0800 From: Baoquan He To: Randy Dunlap 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 Subject: Re: [PATCH 1/2] riscv, crash: don't export some symbols when CONFIG_MMU=n Message-ID: References: <694baf13-65d0-4877-b6c7-56e3006f83be@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <694baf13-65d0-4877-b6c7-56e3006f83be@infradead.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Mon, 04 Dec 2023 23:18:33 -0800 (PST) On 12/04/23 at 11:14am, Randy Dunlap wrote: ...... > > --- > > arch/riscv/kernel/crash_core.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/arch/riscv/kernel/crash_core.c b/arch/riscv/kernel/crash_core.c > > index 55f1d7856b54..8706736fd4e2 100644 > > --- a/arch/riscv/kernel/crash_core.c > > +++ b/arch/riscv/kernel/crash_core.c > > @@ -5,17 +5,19 @@ > > > > void arch_crash_save_vmcoreinfo(void) > > { > > - VMCOREINFO_NUMBER(VA_BITS); > > VMCOREINFO_NUMBER(phys_ram_base); > > > > vmcoreinfo_append_str("NUMBER(PAGE_OFFSET)=0x%lx\n", PAGE_OFFSET); > > vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START); > > vmcoreinfo_append_str("NUMBER(VMALLOC_END)=0x%lx\n", VMALLOC_END); > > +#ifdef CONFIG_MMU > > + VMCOREINFO_NUMBER(VA_BITS); > > vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START); > > vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END); > > #ifdef CONFIG_64BIT > > vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR); > > vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END); > > +#endif > > #endif > > vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR); > > vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n", > > 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 --- 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 */ -- 2.41.0