Message ID | 637c162d03b2c04f443d4308749fbffcb5093c63.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 b10csp812449vqo; Fri, 28 Apr 2023 02:53:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ628OV4cn7YNWgDq3ETAQPOTthYYuXnDzApXa2EP2QytfmMaupejZ5sBLffHWzF4MonJXmc X-Received: by 2002:a62:1bcd:0:b0:63d:40bb:a88b with SMTP id b196-20020a621bcd000000b0063d40bba88bmr8316146pfb.14.1682675611740; Fri, 28 Apr 2023 02:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682675611; cv=none; d=google.com; s=arc-20160816; b=Y32V0YEKjF1saEuDZ7Ak3AR2YLFH13vv4oQeMkAnk4edUkdxYbKKenPYn3jzQLFyWC PtCEqsTV7+3NTcnqyCVGJIj4otxb9f8FcnNzwr9g/QLVjgxek6PuOzVd/gtelQm/GRo+ K3AZUEH+MCP9cdj5urK9N2TzzwcBVYOG4nzJnYTfxPxMln5pASn4b7v20/sokmDP3uhG vwhiv4brct52VvW7nP/ETS/5Egn3oaFy0/9BiDMQIWS2KzEbb846mNxYzmqv0tItjZ0J 6+SQROZ/0EeNOTnI+/YZYpDI/m1Qudv2Gh1r3G8x6b2p8E8lhs68sejiw5PUG1ZcoVfc iRPQ== 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=ggxuzpee8soAzYDjYhn3CvpzzmPCoGjgXu2bQ6UwUmA=; b=gNBAo6o3qKVl3KQ3wQ7JRV26s2jXim2sZuSqN9Z5KhVtOhjCM02D2FssE/aUSM8iYe DmVElX0OtBOKSiZfPB47YV/50uxMWy3SvPZQn8l+jQh89JJhgC0Gx2cPnV/ZumH3+EvF HRRGiM8969LuwcFoNQKvzyAddDF0a1Y/lA4zWlCShcMK0fmIdiGDUW0tqlrfKuQwdTu/ nmLefpaTPgPMuLdSeuTDYwJ2aUNw/VmwEccCVNH6nR0vE5axVKUgLYq3nDgRIpxllHzb cB1K9y/jxI3pHQ8JSRkKMo9hfLjOZ1PCtBab3YogTdJkjeLFkcCaqYdU6Jn7FNlTqRpU +nUw== 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 a3-20020aa79703000000b0063d19a45a93si20759840pfg.280.2023.04.28.02.53.15; Fri, 28 Apr 2023 02:53:31 -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 S1345689AbjD1JwD (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 99 others); Fri, 28 Apr 2023 05:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345628AbjD1Jvy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Apr 2023 05:51:54 -0400 Received: from out0-218.mail.aliyun.com (out0-218.mail.aliyun.com [140.205.0.218]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F77149D5 for <linux-kernel@vger.kernel.org>; Fri, 28 Apr 2023 02:51:52 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047194;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---.STFoG4E_1682675505; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.STFoG4E_1682675505) by smtp.aliyun-inc.com; Fri, 28 Apr 2023 17:51:45 +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>, "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> Subject: [PATCH RFC 02/43] x86: Add macro to get symbol address for PIE support Date: Fri, 28 Apr 2023 17:50:42 +0800 Message-Id: <637c162d03b2c04f443d4308749fbffcb5093c63.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?1764413262296562423?= X-GMAIL-MSGID: =?utf-8?q?1764413262296562423?= |
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> Add a new _ASM_MOVABS macro to fetch a symbol address. Replace "_ASM_MOV $<symbol>, %dst" code construct that are not compatible with PIE. 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/include/asm/asm.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index fbcfec4dc4cc..05974cc060c6 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -35,6 +35,7 @@ #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) #define _ASM_MOV __ASM_SIZE(mov) +#define _ASM_MOVABS __ASM_SEL(movl, movabsq) #define _ASM_INC __ASM_SIZE(inc) #define _ASM_DEC __ASM_SIZE(dec) #define _ASM_ADD __ASM_SIZE(add)