Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5006657ybb; Tue, 24 Mar 2020 09:14:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsVLyPxFsA0OEfoml7kqNpsOEwoqQI+iPyW0s/q/whu9pjawOzgMVz1Cz7m7Lir7ssAb6wQ X-Received: by 2002:a9d:7dd9:: with SMTP id k25mr8771617otn.266.1585066450769; Tue, 24 Mar 2020 09:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585066450; cv=none; d=google.com; s=arc-20160816; b=ieEXdpQbpSjEb1S2SyvzbQX35Uo1d5tPizg+K1Yp0ZRmy2L1tbBRRNyjGYWbPx71Sa MiD4Bivmocc7Vo80iWBEaFlpDm47MgMjwB0sYRLb7sLAzxgX0PV01eJGkp3UKIa5IyjY +nCN2eNqTUbjFH2LupFJavtuWwxMw5sVkNkIeX/gyHE9cZNNrYtqoUKTycknrhSPAEVw Y+jWcn4AiXMfXOiQuxdgeOUuyMh02ZljxHSJVaQwoCSFHMW7IpgCc3a3YfkbdYc50QtJ m0+3/n7sHN9OwxU+q/u8i89SaSIXArIUuCPAfk86VW4fQhtgcC/jZy4Wn25VSNcEHzCk Qr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id:dkim-signature; bh=heV7ZlB/DHsLTcnEevfvbwvxgJhlctXESkT1ov9n8cQ=; b=U8TEwJDkwH8bYZzO3+tMokN6YboKRpPoK+UuyeRrNF05qT2zsvGzzMWg8wD9NlSLyH i3L1v2VOrlGnPrTxrJ51ni1/pOV+28nRW5kSMGMFBQuKfwi8k1ulXz85Lk0oY+0fUSVe iM5b8X2IHUHBvdQowHwlhZRDMH+4d7ZQDCKiaujBz1MpI1AuMOwBB6CwffNYK8vo1BBO gFi2+1INVlHZbKkEVdG1oNnzrTyVwPubje4pwIGEuyjPmbEWeTTDEVizQNiOcGr6jb2J oZihX5baqAHuQRgqseHD1qV6BjdAfzAjwACj4BlnYeAk6MYObKHGECkE5NfBn/0+WEft SHvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="E/MzrpCv"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q196si9035536oic.143.2020.03.24.09.13.57; Tue, 24 Mar 2020 09:14:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="E/MzrpCv"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728713AbgCXQND (ORCPT + 99 others); Tue, 24 Mar 2020 12:13:03 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36916 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728294AbgCXQLg (ORCPT ); Tue, 24 Mar 2020 12:11:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=heV7ZlB/DHsLTcnEevfvbwvxgJhlctXESkT1ov9n8cQ=; b=E/MzrpCvIY4vx/iWg4yKwVEaBl esQCicKROBFlHX2+qToZ9J06Lzyc3u2V6i2a+ClL9xcYTgBENGaxOfW4zzuZvfGypozolIXm1PgUO 5ZPQ4NlzP5kDRuVbnNZa3gYCDX1qm+jRAfAjy4h0is45IUCawvgud1IQb/Mb96+V2CejWHjpaSCmd nzVJmE25adVP41bZ0NMdaHvyQHteUHWgnIuHE+ow9j8yMPSrfhP/Kcuo2VcHVjed/9R4UGPGjCVJZ NXeh4zCDhQ0pzmTFWF7xJ0dk2L/EIS7uxHc984uThBSdDQsoVcfCx51vMuv/ISjr86MbySmL8K0f5 89GlrPWA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jGm9J-0006bO-Or; Tue, 24 Mar 2020 16:11:29 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 33FB130610C; Tue, 24 Mar 2020 17:11:28 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 2364D29A490F3; Tue, 24 Mar 2020 17:11:28 +0100 (CET) Message-Id: <20200324160924.143334345@infradead.org> User-Agent: quilt/0.65 Date: Tue, 24 Mar 2020 16:31:17 +0100 From: Peter Zijlstra To: tglx@linutronix.de, jpoimboe@redhat.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org, peterz@infradead.org, mhiramat@kernel.org, mbenes@suse.cz, brgerst@gmail.com Subject: [PATCH v3 04/26] x86/kexec: Use RIP relative addressing References: <20200324153113.098167666@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Normally identity_mapped is not visible to objtool, due to: arch/x86/kernel/Makefile:OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o := y However, when we want to run objtool on vmlinux.o there is no hiding it: vmlinux.o: warning: objtool: .text+0x4c0f1: unsupported intra-function call Replace the (i386 inspired) pattern: call 1f 1: popq %r8 subq $(1b - relocate_kernel), %r8 With a x86_64 RIP-relative LEA: leaq relocate_kernel(%rip), %r8 Suggested-by: Brian Gerst Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf --- arch/x86/kernel/relocate_kernel_64.S | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/arch/x86/kernel/relocate_kernel_64.S +++ b/arch/x86/kernel/relocate_kernel_64.S @@ -196,10 +196,7 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_ma /* get the re-entry point of the peer system */ movq 0(%rsp), %rbp - call 1f -1: - popq %r8 - subq $(1b - relocate_kernel), %r8 + leaq relocate_kernel(%rip), %r8 movq CP_PA_SWAP_PAGE(%r8), %r10 movq CP_PA_BACKUP_PAGES_MAP(%r8), %rdi movq CP_PA_TABLE_PAGE(%r8), %rax