Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1463411pxp; Sun, 20 Mar 2022 18:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWhhSE76eskBkaAUHg54qM6aE22yOGz6nMbf6QlseMK6Yf5EVsny9mp3joxGmsGJ3u5cgi X-Received: by 2002:a17:902:aa0a:b0:154:9ce:366 with SMTP id be10-20020a170902aa0a00b0015409ce0366mr10742012plb.8.1647825572845; Sun, 20 Mar 2022 18:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647825572; cv=none; d=google.com; s=arc-20160816; b=emJESpVxEG4O8C2AU5qZMg5Bll9IqknTd9OLvc31cGpCBnuwg6mCziIba9UexsGU+R DjQZkJTjN5ULgFIUZa1StXgYdZh3w1JpeJ7t7s04PuVNKj/N/maQbQvkPAKMrloTA39N uft7ZWR4p8ZhOIoDMUncFE6kOT85LKoBk204kT9YW0E0ng4R6KK3utMciAwTJpdFIuHQ YT6bdBgssqD9Gq+q/1QCQLilz4rS9se0T5NIGpBZmnblGJxJuO/7iHODg+c7H8nyJM/o H1KNrOmAU8oTUt8TsDw8R7ZBWI6aYwYzRYAoWgVYlIy0RGC2+NYQw3Sv3GatNUQBQdpC TfbA== 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=wjdIIYFmarmoCBTyFZsb6TX9MR9Vs2Uny1ApyHKioMg=; b=PHB4dKGtqO8S6a0LkXLle+jS9gXgbMRjCub0VRJaXcfvXJARxcVn48aZtZeXzFaGBD K1hNtdJWgcYHAi9YjWe1YgkCXUODUv3h/bMqbbLI39sLEluw+voght9w+3i2sN6IJ4Uf /LNQuyI3NDuecftz7owQbpalOLkvHhOmcRVDfX5qLii5nNEZpjTi4o1JShHRC+Z/MoWt IpbAfLgfB2X2GXTrbA4svbU22PVZc9q1xvaaZhHsIkplpv6I6zw21tnnodLUAgx28S2K LLX2g6CSjfDFm+7vdoGuvEubslIpysAOetkB6A94qcjkgLXC3V6ioIbmq+Tvr1IKvi6Z 4Yjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=idalnSWu; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x195-20020a627ccc000000b004fa3a8dff86si2461654pfc.61.2022.03.20.18.18.35; Sun, 20 Mar 2022 18:19:32 -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=@linuxfoundation.org header.s=korg header.b=idalnSWu; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239189AbiCRQZb (ORCPT + 99 others); Fri, 18 Mar 2022 12:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239128AbiCRQZW (ORCPT ); Fri, 18 Mar 2022 12:25:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D602F09F0; Fri, 18 Mar 2022 09:21:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A61961774; Fri, 18 Mar 2022 16:21:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E756EC340E8; Fri, 18 Mar 2022 16:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647620480; bh=0kbUdPgdG/ygPeHnHoAJ1qXfejq0ixJB5sK4dDeLqeU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=idalnSWuwFfBy0/Dqg7PTorUAnbZ2CowEQ8GHbLco1L4jwkhrQpAasbdFKaD6yauQ 8MFIDhfWc+xn8YHxnc/GfbLFol3UxDEqnL5h5CrXuWRfSrWwP9CEe+cJzsAIb3pf+A wwYFZQRsNVJ/WfMeq2XouItBh8GggL/bwZ7DosXQ= Date: Fri, 18 Mar 2022 17:21:16 +0100 From: Greg Kroah-Hartman To: James Morse Cc: Florian Fainelli , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Catalin Marinas , Sasha Levin Subject: Re: [PATCH 5.4 18/43] arm64: entry: Add macro for reading symbol addresses from the trampoline Message-ID: References: <20220317124527.672236844@linuxfoundation.org> <20220317124528.180267687@linuxfoundation.org> <113e7675-4263-2a20-81d0-9634f03511d2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 On Fri, Mar 18, 2022 at 05:18:39PM +0100, Greg Kroah-Hartman wrote: > On Fri, Mar 18, 2022 at 12:11:32PM +0000, James Morse wrote: > > Hi Florian, > > > > On 3/17/22 8:48 PM, Florian Fainelli wrote: > > > On 3/17/22 5:45 AM, Greg Kroah-Hartman wrote: > > > > From: James Morse > > > > > > > > commit b28a8eebe81c186fdb1a0078263b30576c8e1f42 upstream. > > > > > > > > The trampoline code needs to use the address of symbols in the wider > > > > kernel, e.g. vectors. PC-relative addressing wouldn't work as the > > > > trampoline code doesn't run at the address the linker expected. > > > > > > > > tramp_ventry uses a literal pool, unless CONFIG_RANDOMIZE_BASE is > > > > set, in which case it uses the data page as a literal pool because > > > > the data page can be unmapped when running in user-space, which is > > > > required for CPUs vulnerable to meltdown. > > > > > > > > Pull this logic out as a macro, instead of adding a third copy > > > > of it. > > > > > > > > Reviewed-by: Catalin Marinas > > > > Signed-off-by: James Morse > > > > Signed-off-by: Sasha Levin > > > > > > This commit causes a linking failure with CONFIG_ARM_SDE_INTERFACE=y > > > enabled in the kernel: > > > > > > LD .tmp_vmlinux.kallsyms1 > > > /local/users/fainelli/buildroot/output/arm64/host/bin/aarch64-linux-ld: > > > arch/arm64/kernel/entry.o: in function `__sdei_asm_exit_trampoline': > > > /local/users/fainelli/buildroot/output/arm64/build/linux-custom/arch/arm64/kernel/entry.S:1352: > > > undefined reference to `__sdei_asm_trampoline_next_handler' > > > make[2]: *** [Makefile:1100: vmlinux] Error 1 > > > make[1]: *** [package/pkg-generic.mk:295: > > > /local/users/fainelli/buildroot/output/arm64/build/linux-custom/.stamp_built] > > > Error 2 > > > make: *** [Makefile:27: _all] Error 2 > > > > ... and with CONFIG_RANDOMIZE_BASE turned off, which is why allyesconfig didn't catch it. > > This is because I kept the next_handler bit of the label when it conflicted, which isn't needed > > because the __entry_tramp bit added by the macro serves the same purpose. > > > > The below diff fixes it: > > ----------%<---------- > > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > > index e4b5a15c2e2e..cfc0bb6c49f7 100644 > > --- a/arch/arm64/kernel/entry.S > > +++ b/arch/arm64/kernel/entry.S > > @@ -1190,7 +1190,7 @@ __entry_tramp_data_start: > > __entry_tramp_data_vectors: > > .quad vectors > > #ifdef CONFIG_ARM_SDE_INTERFACE > > -__entry_tramp_data___sdei_asm_trampoline_next_handler: > > +__entry_tramp_data___sdei_asm_handler: > > .quad __sdei_asm_handler > > #endif /* CONFIG_ARM_SDE_INTERFACE */ > > .popsection // .rodata > > @@ -1319,7 +1319,7 @@ ENTRY(__sdei_asm_entry_trampoline) > > */ > > 1: str x4, [x1, #(SDEI_EVENT_INTREGS + S_ORIG_ADDR_LIMIT)] > > - tramp_data_read_var x4, __sdei_asm_trampoline_next_handler > > + tramp_data_read_var x4, __sdei_asm_handler > > br x4 > > ENDPROC(__sdei_asm_entry_trampoline) > > NOKPROBE(__sdei_asm_entry_trampoline) > > ----------%<---------- > > > > Good news - this didn't happen with v5.10. > > > > I don't see this in v5.4.185 yet. > > > > Greg/Sasha, what is least work for you?: > > A new version of this patch, > > A fixup on top of the series, > > Reposting the series with this fixed. > > Let me merge this into this commit. Well I would if it would actually apply :( Can you send a version that isn't whitespace corrupted? thanks, greg k-h