Message ID | 170137899052.398.2740335306554226817.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp690720vqy; Thu, 30 Nov 2023 13:16:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaJFOhx2+FgH6TRGZ61HLldKeHrsb2Iv9JzotBmR6dvc5CUSwiBldr0pYtvDwUbleDFvXn X-Received: by 2002:a05:6a00:3a02:b0:6bd:7cbd:15ae with SMTP id fj2-20020a056a003a0200b006bd7cbd15aemr27529734pfb.26.1701379007034; Thu, 30 Nov 2023 13:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701379007; cv=none; d=google.com; s=arc-20160816; b=a//KbdCLCiowd3iCrHm1nasQVo/jPf9edIlGPByrS1xpqVZ9hYNNS49at8yKlSm+5U VX1Bczqr8QX7DsiABvikcSlQHSKAMQZDUt9FN7ittSYhVZaw0YsJGz1snFSMq1YQC4lX 93w0NW9+EwUs1SoH/tMgbEA30keDVSg4j2/lhMUaD1HDL5/G2vP8YwERkDlXw1uM9gru Q19XQmIOWImxbB/cc8EzbVafasVKCk3YLcEE6ddFLF2uhdDZhEDh+uW4E0CadrA++uG3 En0fCTEJ1aVzEGv/WS9D37E8/NAaMbof5uhJE8DaiQ37H+HwHWjI4DqYP6DxOrjchHKf vSEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=vavI3RxrLtloE3LjQEUBpt9Crabz1GqFixWES3vlEKk=; fh=9OA7zYIMwPyRGKpzJW87UpRXyIldaUc9DBUFB35efC8=; b=IoLTWmS5cJwLSwGgqSeo834e5TYhtoad/8Ayb9Md+3ofSKULaXIwEh60Tk91vQoU+H oxt/WK36F0iTMH3sgqot+mzcWmkyi1Hn2gixFI1pon+MZLOIMih6aRQA/BH/RYT3NVIA gsQ+QzdQvk0/IfzoN+9sbtfqB7iTrtCrGRp9JjqaNozmeCWbVTrVsy0rSaVC8I8eSaM/ uW5HuuRcetk4WsrnqwuV5aRp1r/Wy88VxaD0aRSDGed6nUBf71MWk/4/Gtlf7KVUQIyf sHF4zzmCLVZ5I5O7En759kkEqShID2eLjgi2CMeq2iuJFdXoPSsHFBcdpKpKywSkV9I2 JOEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aVl4TBu1; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k190-20020a6384c7000000b005c1b30caebasi2106599pgd.654.2023.11.30.13.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 13:16:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=aVl4TBu1; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 069CB8026DA7; Thu, 30 Nov 2023 13:16:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376876AbjK3VQa (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Thu, 30 Nov 2023 16:16:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376841AbjK3VQ0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 30 Nov 2023 16:16:26 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88E0910E5; Thu, 30 Nov 2023 13:16:32 -0800 (PST) Date: Thu, 30 Nov 2023 21:16:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701378991; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vavI3RxrLtloE3LjQEUBpt9Crabz1GqFixWES3vlEKk=; b=aVl4TBu1rzjQtgN1aiSMeuM5vbF9jPKmRH6nCb2HdvGPlcbeKQCu9XBgwxeUJIUjPp+I0j WcB+NV3w017sT0TMIjBvpc3z3HWcFobD0ftQT3/j689jZO/FSQ6QfVRRCIclWm8xgESTWS AwokAP74+E3Wc7b/60Wwc8T4i2UDNy2Yhn0atv6wGFVtJbW/DcDW4iSCdRS5/AmkuBXeNL qosoNJPvYVU/eYlIRDWP3lFMdz8/9ToeUcMgbKbrhHvLPHoeXpPXn+5A+rZUIAU7KACR/+ MdClDYbKUdxLsLg78jBOFEVlxWApPwKGvHoZXpUUJ4VtmZJrC09SkurKwSEOHw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701378991; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vavI3RxrLtloE3LjQEUBpt9Crabz1GqFixWES3vlEKk=; b=+oP2G7fyRT8waiZaoPuWiUTAGQ3kR68HD9o6om0xRgr30jlaLuOVFjfICBw6l/UDmd8MyP s6MFnPWLJECOXvAQ== From: "tip-bot2 for Uros Bizjak" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/percpu] x86/percpu: Declare const_pcpu_hot as extern const variable Cc: kernel test robot <lkp@intel.com>, Uros Bizjak <ubizjak@gmail.com>, Ingo Molnar <mingo@kernel.org>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231130162949.83518-1-ubizjak@gmail.com> References: <20231130162949.83518-1-ubizjak@gmail.com> MIME-Version: 1.0 Message-ID: <170137899052.398.2740335306554226817.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 30 Nov 2023 13:16:42 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784007160096125836 X-GMAIL-MSGID: 1784025193927548565 |
Series |
[tip:,x86/percpu] x86/percpu: Declare const_pcpu_hot as extern const variable
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Nov. 30, 2023, 9:16 p.m. UTC
The following commit has been merged into the x86/percpu branch of tip: Commit-ID: 4604c052b84d66407f5e68045a1939685eac401e Gitweb: https://git.kernel.org/tip/4604c052b84d66407f5e68045a1939685eac401e Author: Uros Bizjak <ubizjak@gmail.com> AuthorDate: Thu, 30 Nov 2023 17:27:35 +01:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Thu, 30 Nov 2023 20:19:33 +01:00 x86/percpu: Declare const_pcpu_hot as extern const variable const_pcpu_hot is aliased by linker to pcpu_hot, so there is no need to use the DECLARE_PER_CPU_ALIGNED() macro. Also, declare const_pcpu_hot as extern to avoid allocating storage space for the aliased structure. Fixes: ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20231130162949.83518-1-ubizjak@gmail.com Closes: https://lore.kernel.org/oe-kbuild-all/202311302257.tSFtZnly-lkp@intel.com/ --- arch/x86/include/asm/current.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Thu, Nov 30, 2023 at 09:16:30PM -0000, tip-bot2 for Uros Bizjak wrote: > The following commit has been merged into the x86/percpu branch of tip: > > Commit-ID: 4604c052b84d66407f5e68045a1939685eac401e > Gitweb: https://git.kernel.org/tip/4604c052b84d66407f5e68045a1939685eac401e > Author: Uros Bizjak <ubizjak@gmail.com> > AuthorDate: Thu, 30 Nov 2023 17:27:35 +01:00 > Committer: Ingo Molnar <mingo@kernel.org> > CommitterDate: Thu, 30 Nov 2023 20:19:33 +01:00 > > x86/percpu: Declare const_pcpu_hot as extern const variable > > const_pcpu_hot is aliased by linker to pcpu_hot, so there is no need > to use the DECLARE_PER_CPU_ALIGNED() macro. Also, declare const_pcpu_hot > as extern to avoid allocating storage space for the aliased structure. > > Fixes: ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation") > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com> > Signed-off-by: Ingo Molnar <mingo@kernel.org> > Link: https://lore.kernel.org/r/20231130162949.83518-1-ubizjak@gmail.com > Closes: https://lore.kernel.org/oe-kbuild-all/202311302257.tSFtZnly-lkp@intel.com/ > --- > arch/x86/include/asm/current.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h > index 0538d24..9fbd7cb 100644 > --- a/arch/x86/include/asm/current.h > +++ b/arch/x86/include/asm/current.h > @@ -37,8 +37,7 @@ static_assert(sizeof(struct pcpu_hot) == 64); > DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot); > > /* const-qualified alias to pcpu_hot, aliased by linker. */ > -DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override, > - const_pcpu_hot); > +extern const struct pcpu_hot __percpu_seg_override const_pcpu_hot; > > static __always_inline struct task_struct *get_current(void) > { WARNING: modpost: EXPORT symbol "const_pcpu_hot" [vmlinux] version generation failed, symbol will not be versioned. Is "const_pcpu_hot" prototyped in <asm/asm-prototypes.h>? WARNING: modpost: "const_pcpu_hot" [arch/x86/kvm/kvm.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [arch/x86/kvm/kvm-intel.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [kernel/trace/preemptirq_delay_test.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [fs/exfat/exfat.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [fs/ntfs/ntfs.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [fs/xfs/xfs.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [fs/btrfs/btrfs.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/acpi/acpi_pad.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/display/drm_display_helper.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/drm.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/ttm/ttm.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/i915/i915.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/misc/mei/mei.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/usb/core/usbcore.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/usb/class/cdc-acm.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/usb/class/usblp.ko] has no CRC! WARNING: modpost: "const_pcpu_hot" [drivers/usb/storage/usb-storage.ko] has no CRC! And the usual fix for those things: diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h index b1a98fa38828..7e6440bae63d 100644 --- a/arch/x86/include/asm/asm-prototypes.h +++ b/arch/x86/include/asm/asm-prototypes.h @@ -13,6 +13,7 @@ #include <asm/preempt.h> #include <asm/asm.h> #include <asm/gsseg.h> +#include <asm/current.h> #ifndef CONFIG_X86_CMPXCHG64 extern void cmpxchg8b_emu(void); does NOT fix it.
On Fri, Dec 1, 2023 at 5:25 PM Borislav Petkov <bp@alien8.de> wrote: > > On Thu, Nov 30, 2023 at 09:16:30PM -0000, tip-bot2 for Uros Bizjak wrote: > > The following commit has been merged into the x86/percpu branch of tip: > > > > Commit-ID: 4604c052b84d66407f5e68045a1939685eac401e > > Gitweb: https://git.kernel.org/tip/4604c052b84d66407f5e68045a1939685eac401e > > Author: Uros Bizjak <ubizjak@gmail.com> > > AuthorDate: Thu, 30 Nov 2023 17:27:35 +01:00 > > Committer: Ingo Molnar <mingo@kernel.org> > > CommitterDate: Thu, 30 Nov 2023 20:19:33 +01:00 > > > > x86/percpu: Declare const_pcpu_hot as extern const variable > > > > const_pcpu_hot is aliased by linker to pcpu_hot, so there is no need > > to use the DECLARE_PER_CPU_ALIGNED() macro. Also, declare const_pcpu_hot > > as extern to avoid allocating storage space for the aliased structure. > > > > Fixes: ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation") > > Reported-by: kernel test robot <lkp@intel.com> > > Signed-off-by: Uros Bizjak <ubizjak@gmail.com> > > Signed-off-by: Ingo Molnar <mingo@kernel.org> > > Link: https://lore.kernel.org/r/20231130162949.83518-1-ubizjak@gmail.com > > Closes: https://lore.kernel.org/oe-kbuild-all/202311302257.tSFtZnly-lkp@intel.com/ > > --- > > arch/x86/include/asm/current.h | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h > > index 0538d24..9fbd7cb 100644 > > --- a/arch/x86/include/asm/current.h > > +++ b/arch/x86/include/asm/current.h > > @@ -37,8 +37,7 @@ static_assert(sizeof(struct pcpu_hot) == 64); > > DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot); > > > > /* const-qualified alias to pcpu_hot, aliased by linker. */ > > -DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override, > > - const_pcpu_hot); > > +extern const struct pcpu_hot __percpu_seg_override const_pcpu_hot; > > > > static __always_inline struct task_struct *get_current(void) > > { > > WARNING: modpost: EXPORT symbol "const_pcpu_hot" [vmlinux] version generation failed, symbol will not be versioned. > Is "const_pcpu_hot" prototyped in <asm/asm-prototypes.h>? > WARNING: modpost: "const_pcpu_hot" [arch/x86/kvm/kvm.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [arch/x86/kvm/kvm-intel.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [kernel/trace/preemptirq_delay_test.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [fs/exfat/exfat.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [fs/ntfs/ntfs.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [fs/xfs/xfs.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [fs/btrfs/btrfs.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/acpi/acpi_pad.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/display/drm_display_helper.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/drm.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/ttm/ttm.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/i915/i915.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/misc/mei/mei.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/usb/core/usbcore.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/usb/class/cdc-acm.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/usb/class/usblp.ko] has no CRC! > WARNING: modpost: "const_pcpu_hot" [drivers/usb/storage/usb-storage.ko] has no CRC! > > And the usual fix for those things: > > diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h > index b1a98fa38828..7e6440bae63d 100644 > --- a/arch/x86/include/asm/asm-prototypes.h > +++ b/arch/x86/include/asm/asm-prototypes.h > @@ -13,6 +13,7 @@ > #include <asm/preempt.h> > #include <asm/asm.h> > #include <asm/gsseg.h> > +#include <asm/current.h> > > #ifndef CONFIG_X86_CMPXCHG64 > extern void cmpxchg8b_emu(void); > > does NOT fix it. I looked into this problem a bit, it is triggered by CONFIG_MODVERSIONS=y The problem is, that genksyms does not know the __seg_gs keyword and simply ignores the symbol. Running: make V=1 arch/x86/kernel/cpu/common.symtypes There is NOTHING regarding const_pcpu_hot in the resulting common.symtypes file. The unpatched source should also fail here due to __seg_gs keyword, but it magically didn't. I don't know what to do here. Uros.
On Fri, Dec 1, 2023 at 5:41 PM Uros Bizjak <ubizjak@gmail.com> wrote: > > On Fri, Dec 1, 2023 at 5:25 PM Borislav Petkov <bp@alien8.de> wrote: > > > > On Thu, Nov 30, 2023 at 09:16:30PM -0000, tip-bot2 for Uros Bizjak wrote: > > > The following commit has been merged into the x86/percpu branch of tip: > > > > > > Commit-ID: 4604c052b84d66407f5e68045a1939685eac401e > > > Gitweb: https://git.kernel.org/tip/4604c052b84d66407f5e68045a1939685eac401e > > > Author: Uros Bizjak <ubizjak@gmail.com> > > > AuthorDate: Thu, 30 Nov 2023 17:27:35 +01:00 > > > Committer: Ingo Molnar <mingo@kernel.org> > > > CommitterDate: Thu, 30 Nov 2023 20:19:33 +01:00 > > > > > > x86/percpu: Declare const_pcpu_hot as extern const variable > > > > > > const_pcpu_hot is aliased by linker to pcpu_hot, so there is no need > > > to use the DECLARE_PER_CPU_ALIGNED() macro. Also, declare const_pcpu_hot > > > as extern to avoid allocating storage space for the aliased structure. > > > > > > Fixes: ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation") > > > Reported-by: kernel test robot <lkp@intel.com> > > > Signed-off-by: Uros Bizjak <ubizjak@gmail.com> > > > Signed-off-by: Ingo Molnar <mingo@kernel.org> > > > Link: https://lore.kernel.org/r/20231130162949.83518-1-ubizjak@gmail.com > > > Closes: https://lore.kernel.org/oe-kbuild-all/202311302257.tSFtZnly-lkp@intel.com/ > > > --- > > > arch/x86/include/asm/current.h | 3 +-- > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h > > > index 0538d24..9fbd7cb 100644 > > > --- a/arch/x86/include/asm/current.h > > > +++ b/arch/x86/include/asm/current.h > > > @@ -37,8 +37,7 @@ static_assert(sizeof(struct pcpu_hot) == 64); > > > DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot); > > > > > > /* const-qualified alias to pcpu_hot, aliased by linker. */ > > > -DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override, > > > - const_pcpu_hot); > > > +extern const struct pcpu_hot __percpu_seg_override const_pcpu_hot; > > > > > > static __always_inline struct task_struct *get_current(void) > > > { > > > > WARNING: modpost: EXPORT symbol "const_pcpu_hot" [vmlinux] version generation failed, symbol will not be versioned. > > Is "const_pcpu_hot" prototyped in <asm/asm-prototypes.h>? > > WARNING: modpost: "const_pcpu_hot" [arch/x86/kvm/kvm.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [arch/x86/kvm/kvm-intel.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [kernel/trace/preemptirq_delay_test.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [fs/exfat/exfat.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [fs/ntfs/ntfs.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [fs/xfs/xfs.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [fs/btrfs/btrfs.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/acpi/acpi_pad.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/display/drm_display_helper.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/drm.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/ttm/ttm.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/gpu/drm/i915/i915.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/misc/mei/mei.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/usb/core/usbcore.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/usb/class/cdc-acm.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/usb/class/usblp.ko] has no CRC! > > WARNING: modpost: "const_pcpu_hot" [drivers/usb/storage/usb-storage.ko] has no CRC! > > > > And the usual fix for those things: > > > > diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h > > index b1a98fa38828..7e6440bae63d 100644 > > --- a/arch/x86/include/asm/asm-prototypes.h > > +++ b/arch/x86/include/asm/asm-prototypes.h > > @@ -13,6 +13,7 @@ > > #include <asm/preempt.h> > > #include <asm/asm.h> > > #include <asm/gsseg.h> > > +#include <asm/current.h> > > > > #ifndef CONFIG_X86_CMPXCHG64 > > extern void cmpxchg8b_emu(void); > > > > does NOT fix it. > > I looked into this problem a bit, it is triggered by CONFIG_MODVERSIONS=y > > The problem is, that genksyms does not know the __seg_gs keyword and > simply ignores the symbol. > > Running: > > make V=1 arch/x86/kernel/cpu/common.symtypes > > There is NOTHING regarding const_pcpu_hot in the resulting common.symtypes file. > > The unpatched source should also fail here due to __seg_gs keyword, > but it magically didn't. > > I don't know what to do here. I have a solution for both problems, genksyms and sparse issue. The exported declaration should be in generic named address space and the symbol casted to __seg_gs address space at usage site. Let me polish and test the patch a bit, I'll post the finished patch tomorrow. Uros.
diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h index 0538d24..9fbd7cb 100644 --- a/arch/x86/include/asm/current.h +++ b/arch/x86/include/asm/current.h @@ -37,8 +37,7 @@ static_assert(sizeof(struct pcpu_hot) == 64); DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot); /* const-qualified alias to pcpu_hot, aliased by linker. */ -DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override, - const_pcpu_hot); +extern const struct pcpu_hot __percpu_seg_override const_pcpu_hot; static __always_inline struct task_struct *get_current(void) {