Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1866039rwd; Thu, 25 May 2023 20:35:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5m0hwTOYNXIa3yze6aAQ+pBNN1K7+cAqxub1ZIfHZBGfWRtb8BrcL1bSPaJBUfzcdtbBr9 X-Received: by 2002:a17:902:cecd:b0:1af:f751:1be4 with SMTP id d13-20020a170902cecd00b001aff7511be4mr1098219plg.63.1685072105953; Thu, 25 May 2023 20:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685072105; cv=none; d=google.com; s=arc-20160816; b=vf92lRmI7poP7hsvT7pXAU/9JINhy6YgjLS59yt0Bwpnyy8RyhmqrQSuXKh4UFCFDF mzK5hvx7+ui/JmIcpCM1flXo5Jq0g5w7a+dqMdH6qgWZHAJaG4vTLvCYlAsdsnlDZyme YnW0fcHNnPO0uIqgw/hCW7+KG0AapwVKm42OqFqJHv+2haV1wm2gWlAPGzrNi0FCXh9Y 1X1IGFDMLUcqwOUa88Svvy/yomgfzYsvN/hXGrpgrsdC7g+cy3yYVk8FOWV76kEOHZE3 Tb61jei43mwt8wnUs1+uaGjGOtXUay9RvKNkQBMWp2V1Xy7BEW2gXnqqblCSxtjCC35v DwdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FGc2DpRwzN2CfKjvI105cUP9f2PjEF2afGAtgtqFB38=; b=ks0y2l1HyvZlZL2YlvvqvqbtwHjZ+vg2BW7iWOMkCS4Qsm3dJU++vo47mcRnSfeZq6 8oWUFXc+Ti433x5CGopZpDg5SS5GhrLypVhWI06P8du/Jeb0e5B0kQDvvgmp0HA3XlLX I8/tNVq8j10lvHyDgKPG68XfKv9XbDejOqB+oc4QtyXlpWqLIeZvWhIg7qxIH+UOOgSq JaH2Fr3gLxLvP57PYgYajBttGFKtZmhruB58YWbbFNn9WxuU/aWbIWr82FzmFheTb+51 mX10BMmyazJyU3zr7F0REv9yNCTIxGS6daCadFJ3raRjvgtElvE9NIJVTDkM5o8r5yzL FsYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=YTvd3rCS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a170903230f00b00198ff2d6543si48252plh.117.2023.05.25.20.34.50; Thu, 25 May 2023 20:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=YTvd3rCS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbjEZDY2 (ORCPT + 99 others); Thu, 25 May 2023 23:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbjEZDY0 (ORCPT ); Thu, 25 May 2023 23:24:26 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AC1E6; Thu, 25 May 2023 20:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=FGc2DpRwzN2CfKjvI105cUP9f2PjEF2afGAtgtqFB38=; b=YTvd3rCSPD25KbM3zkOAIlVuR3 Y5s+ExS6tTZlXbDqpXmqzSK36KOhFcQlkX6awiu+skf+fogZ0Mcpnu5OYgnCeS3OIT7GxLGDygWoa qmuQ0mRx4ABgpPWVLwjmXhZ9hhPGRpt0FiIdItqNzX/DNA/+o54fZWx1/w2uAXntceixEkzZyrPYP fwZKLmMh/U1qV1o9VDbM3qWnfkydv7jpMGMgoWDk7f2FpzjpUmK00cBNsTez9m/FJPeddt6em4F0s E1znANbwABARAz8t7GPcYarxWvxmj6SSdTYeWGaWacJlDaTvisgIISzBWC+P4bSe6cuqkd/3LHZ9H NOaHeNQA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q2O3t-000rME-2a; Fri, 26 May 2023 03:24:17 +0000 Date: Thu, 25 May 2023 20:24:17 -0700 From: Luis Chamberlain To: Song Liu Cc: Alan Maguire , Arnd Bergmann , Arnd Bergmann , Andy Lutomirski , Borislav Petkov , linux-modules@vger.kernel.org, Zhen Lei , Peter Zijlstra , Kees Cook , linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] kallsyms: remove unused arch_get_kallsym() helper Message-ID: References: <20230517131820.936553-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On Thu, May 25, 2023 at 06:45:35PM -0700, Song Liu wrote: > + Alan Maguire > > On Wed, May 24, 2023 at 12:24 AM Luis Chamberlain wrote: > > > > On Wed, May 24, 2023 at 08:25:13AM +0200, Arnd Bergmann wrote: > > > On Wed, May 24, 2023, at 07:07, Luis Chamberlain wrote: > > > > On Wed, May 17, 2023 at 03:18:07PM +0200, Arnd Bergmann wrote: > > > >> From: Arnd Bergmann > > > >> > > > >> The arch_get_kallsym() function was introduced so that x86 could override > > > >> it, but that override was removed in bf904d2762ee ("x86/pti/64: Remove > > > >> the SYSCALL64 entry trampoline"), so now this does nothing except causing > > > >> a warning about a missing prototype: > > > >> > > > >> kernel/kallsyms.c:662:12: error: no previous prototype for 'arch_get_kallsym' [-Werror=missing-prototypes] > > > >> 662 | int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value, > > > >> > > > >> Restore the old behavior before d83212d5dd67 ("kallsyms, x86: Export > > > >> addresses of PTI entry trampolines") to simplify the code and avoid > > > >> the warning. > > > >> > > > >> Signed-off-by: Arnd Bergmann > > > > > > > > Shouldn't this go through x86 as this sort of fixesss commit > > > > bf904d2762ee ("x86/pti/64: Remove the SYSCALL64 entry trampoline")? > > > > > > That works for me as well, as long as someone picks it up. It's > > > not really x86 any more though since that commit is five years > > > old and removed the last reference from the x86 code. > > > > Fair enough. > > > > > I sent it to you since you are the one that merged most of > > > the kallsyms patches through the module tree, but I guess > > > you are not actually maintaining that file (not blaming you, > > > I'd also try to stay away from kallsyms). > > > > > > I can resend it to Andrew for the -mm tree. > > > > OK, I just took the patch in, it's on the train, better get on before > > it gets lost. > > This change broke compilation of BPF selftests in modules-next > branch: > > progs/bpf_iter_ksym.c:62:13: error: no member named 'pos_arch_end' in > 'struct kallsym_iter' > if (!iter->pos_arch_end || iter->pos_arch_end > iter->pos) > ~~~~ ^ > progs/bpf_iter_ksym.c:62:35: error: no member named 'pos_arch_end' in > 'struct kallsym_iter' > if (!iter->pos_arch_end || iter->pos_arch_end > iter->pos) > ~~~~ ^ > > I haven't looked into the proper fix for it yet. A quick attempt: Arnd, can you verify? diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_ksym.c b/tools/testing/selftests/bpf/progs/bpf_iter_ksym.c index 5ddcc46fd886..521267818f4d 100644 --- a/tools/testing/selftests/bpf/progs/bpf_iter_ksym.c +++ b/tools/testing/selftests/bpf/progs/bpf_iter_ksym.c @@ -59,9 +59,7 @@ int dump_ksym(struct bpf_iter__ksym *ctx) } else { BPF_SEQ_PRINTF(seq, "0x%llx %c %s ", value, type, iter->name); } - if (!iter->pos_arch_end || iter->pos_arch_end > iter->pos) - BPF_SEQ_PRINTF(seq, "CORE "); - else if (!iter->pos_mod_end || iter->pos_mod_end > iter->pos) + if (!iter->pos_mod_end || iter->pos_mod_end > iter->pos) BPF_SEQ_PRINTF(seq, "MOD "); else if (!iter->pos_ftrace_mod_end || iter->pos_ftrace_mod_end > iter->pos) BPF_SEQ_PRINTF(seq, "FTRACE_MOD ");