From patchwork Fri Apr 28 09:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Wenlong X-Patchwork-Id: 88550 Return-Path: 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 + 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 ); 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 ; 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" To: linux-kernel@vger.kernel.org Cc: "Thomas Garnier" , "Lai Jiangshan" , "Kees Cook" , "Hou Wenlong" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , , "H. Peter Anvin" 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: References: MIME-Version: 1.0 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: 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?= From: Thomas Garnier From: Thomas Garnier Add a new _ASM_MOVABS macro to fetch a symbol address. Replace "_ASM_MOV $, %dst" code construct that are not compatible with PIE. Signed-off-by: Thomas Garnier Signed-off-by: Hou Wenlong Cc: Lai Jiangshan Cc: Kees Cook --- 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)