Message ID | b93623c94be2633a90b3abfc6a7ea6c1703f7a9a.1682673543.git.houwenlong.hwl@antgroup.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp819956vqo; Fri, 28 Apr 2023 03:09:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qZ7bhm6y2wgB2n+FTWOsOb7HhL/PbyH44JQp+8Ah+vlLnmif/uHO5EcJjqvkIG3B+yKlV X-Received: by 2002:a05:6a21:398e:b0:f0:6aaf:1abf with SMTP id ad14-20020a056a21398e00b000f06aaf1abfmr5869552pzc.4.1682676549214; Fri, 28 Apr 2023 03:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682676549; cv=none; d=google.com; s=arc-20160816; b=tI7y+8UGaQT728fNMMsDPHdGJ0mhFZgvz39ePhxhmgf2P/ZUJcktWgkqjIF+8+vg8K AszkU6J8PqUmARJXot+6qg9JMS8suu9AgcHpiI6RG7EtmjHKLE31NRKBLAbvTUqo16Ou JDaR1RH4uPwmO3E2dE1+vt/ryISWfkSE5gwUkLz6CQI8TxLv0rIvDM7859zJWTtAiFlA XuqxAVC8skVM115saa0YsAwcyp1bM45Jhg+cilbNBIn9UenjJBpTeyLN4C6zhq/LZMiP WW+wU3Xb0Mf6conS1tPx3xXdfltxBwebVALm8jLsEYYUgI0vxPIeqn2RrFwd6g5DfxUI feZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Tz1eBnWwuFKalpgC5LSYWF0H5qhfVAcDAFCNr+uxfWg=; b=usfL+FK4JlFz1cUoHR3smmwswcvzh9Y+mvcoYDcatqtjmLNvJke+edPwTZrl5E/4vc W+deY7V1yxTqqWcpKY3CIFNr0xUhjB/425v5QOHwqZ5T/xTgRYpgGpcaUZw54rhW+nqi phPXSb31EHHMsXSb/oJZ8bJUzTJHKIa4YT0svvVBfwZA1lacEd7MFWzGTe/zUDuwtsQ6 cognE6juXfttaGfdng6zGRKE9gjwrYLJtxl+y+qNlRp4Z9RdFmDpI70/itxrAmo48/m6 63d+3DbruoShhBbfUXmFNs4+FRheCrMNVD+IjaKLa+GN8gafhnuoXi+ckgLy1tzepkAV tnGQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k26-20020a63ba1a000000b00517aaf50a82si21584239pgf.854.2023.04.28.03.08.54; Fri, 28 Apr 2023 03:09:09 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345755AbjD1Jwq (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 99 others); Fri, 28 Apr 2023 05:52:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345790AbjD1Jwf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Apr 2023 05:52:35 -0400 Received: from out0-216.mail.aliyun.com (out0-216.mail.aliyun.com [140.205.0.216]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 248BA10E7; Fri, 28 Apr 2023 02:52:11 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047204;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---.STCEPMn_1682675524; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.STCEPMn_1682675524) by smtp.aliyun-inc.com; Fri, 28 Apr 2023 17:52:05 +0800 From: "Hou Wenlong" <houwenlong.hwl@antgroup.com> To: linux-kernel@vger.kernel.org Cc: "Thomas Garnier" <thgarnie@chromium.org>, "Lai Jiangshan" <jiangshan.ljs@antgroup.com>, "Kees Cook" <keescook@chromium.org>, "Hou Wenlong" <houwenlong.hwl@antgroup.com>, "Rafael J. Wysocki" <rafael@kernel.org>, "Pavel Machek" <pavel@ucw.cz>, "Thomas Gleixner" <tglx@linutronix.de>, "Ingo Molnar" <mingo@redhat.com>, "Borislav Petkov" <bp@alien8.de>, "Dave Hansen" <dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>, <linux-pm@vger.kernel.org> Subject: [PATCH RFC 09/43] x86/power/64: Adapt assembly for PIE support Date: Fri, 28 Apr 2023 17:50:49 +0800 Message-Id: <b93623c94be2633a90b3abfc6a7ea6c1703f7a9a.1682673543.git.houwenlong.hwl@antgroup.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <cover.1682673542.git.houwenlong.hwl@antgroup.com> References: <cover.1682673542.git.houwenlong.hwl@antgroup.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764414245358060961?= X-GMAIL-MSGID: =?utf-8?q?1764414245358060961?= |
Series |
x86/pie: Make kernel image's virtual address flexible
|
|
Commit Message
Hou Wenlong
April 28, 2023, 9:50 a.m. UTC
From: Thomas Garnier <thgarnie@chromium.org> From: Thomas Garnier <thgarnie@chromium.org> Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. Signed-off-by: Thomas Garnier <thgarnie@chromium.org> Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com> Cc: Lai Jiangshan <jiangshan.ljs@antgroup.com> Cc: Kees Cook <keescook@chromium.org> --- arch/x86/power/hibernate_asm_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S index 0a0539e1cc81..1d96a119d29d 100644 --- a/arch/x86/power/hibernate_asm_64.S +++ b/arch/x86/power/hibernate_asm_64.S @@ -39,7 +39,7 @@ SYM_FUNC_START(restore_registers) movq %rax, %cr4; # turn PGE back on /* We don't restore %rax, it must be 0 anyway */ - movq $saved_context, %rax + leaq saved_context(%rip), %rax movq pt_regs_sp(%rax), %rsp movq pt_regs_bp(%rax), %rbp movq pt_regs_si(%rax), %rsi @@ -70,7 +70,7 @@ SYM_FUNC_START(restore_registers) SYM_FUNC_END(restore_registers) SYM_FUNC_START(swsusp_arch_suspend) - movq $saved_context, %rax + leaq saved_context(%rip), %rax movq %rsp, pt_regs_sp(%rax) movq %rbp, pt_regs_bp(%rax) movq %rsi, pt_regs_si(%rax)