Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp659372ybh; Sun, 12 Jul 2020 19:35:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ4DKZgtMLM78RGdmgksod4oVkBZzXNgfigLg8lTOhNY5mTN2em4JQS/7+ahEQVka7jP1R X-Received: by 2002:a50:f413:: with SMTP id r19mr93119658edm.17.1594607712913; Sun, 12 Jul 2020 19:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594607712; cv=none; d=google.com; s=arc-20160816; b=AULWV7uKzqYYM/InIZWutrMcEJ/FVMEvZfC2Qt++FEOPz5xA4muyWGeUNarKDfwUju LtUBCF6qAODi2HOGagLE0+kbrz6oa1UnCoQSWJx0yx97Q0toUDS2LyUNXTA6lBFp8ZBc teT1xAfgGFUuNA6X45V50Ed6NDAzHjI1qY5eNWELDXjEAfkjGh0VSxklysH/e2urPPHK G8sVMCG3J3VaFmmXcbYfm+qvXt1gdRemJmBscnh2Xxn9Ka/7OkixQmwXalxml5IYbnmN YsnysPWoKtYPYErvY2euWxnAvqVaOz39v8iN6NzPRYHKDD4S8TdR9CBJxPsWs+97swyk Gxuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=86gu0C74GPG2i+vB7R9610DsdyKxfiqdWZYUsHZUDv4=; b=F3DJq0hIu3gpuFZ3Xci0aHCB8kxClpyE2QAAtwzl1a+j91i0ST+ALsXt2Znt3Ktlr/ E2wu6MPd/f3/DqFCyrYCJ/TfSd47QQ79eLFsj2OGdELqhHucRQrGmWWHqD6RJRqV3FSt p+ipBWR1JJzLNgfBfI/m2Z3/R+EuGdZKR8dDFDmn7O14egMC3UKPSxNclFN2bwTSyZFJ vWpYTgrFdDoTOCiARBwGFn2ajIhO963CT5niIZNUK3b3kgP+FKd1Qi1MWRmtV/Ne2ex1 9laPX49WZIFf3NqBiV+SdJjZTDyYiGJQ7R/ayO8vYr9sSyUKp+0eKfMK04GLx3X+u3no vtNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qiwlCzmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds18si10279084ejc.609.2020.07.12.19.34.49; Sun, 12 Jul 2020 19:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qiwlCzmo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727863AbgGMCdc (ORCPT + 99 others); Sun, 12 Jul 2020 22:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbgGMCdc (ORCPT ); Sun, 12 Jul 2020 22:33:32 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59EE9C061794 for ; Sun, 12 Jul 2020 19:33:32 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id y2so11898061ioy.3 for ; Sun, 12 Jul 2020 19:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=86gu0C74GPG2i+vB7R9610DsdyKxfiqdWZYUsHZUDv4=; b=qiwlCzmoF1Ifu7JhCGm296pf4B7cE1gM0U+okcuH+60FW0dZARwgDIfCXqZTtXS+ke JGRp17Cryv2Kfzi0DiYurzd0KwaTQe4rebSJA6Qqjbl1I8ddHfXT3//VYD0SkKNZBwOa B5/DbmFTzE8J0GMKp1hu3bfqVTyztZsjkbKta3bfGXpiU8mMSU20nKGW/ap7Ozo6lMWW lInaxM+b/sj2Hn8nDJPSLa7SWx0Qy6aqlHvmlIF4IdUfr6DYGFKmMazpMn6B2Biyyim8 m9b2wlS2LuN6siqi3M8ZXy5thuaN9TDwqH+yknze2wkuzEEjzJUOSxPKsDw6whEmJZNT sb0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=86gu0C74GPG2i+vB7R9610DsdyKxfiqdWZYUsHZUDv4=; b=FZ8T1mooi75WkJVwIOOtcpgC7RwBGbOliDVekMfW24c8iFFX50HmuFW61pwlIsNdow R6Z6Gjg4IU9l0L6FAICrMmvp0PJworcyDxmfSnh6DM4IrOSObwDRgQ4AqcElbo/Sv05f qE/ddBOuD4hpwXBsVfJRZIFvwqEYlxl5pWT8O5vk2YFS718fWHoxG0qi9kcdyER2Y6on 5MlMQ76ZUCWs8j15dpDno4O+iFHTMmlX80cITEyS2GU5ize9GEXt0yWb1phDw4n4Hzdb cb1YvqUByxL1zrw1ShemIljuH/IlqieNekofNcWNOwqLoh30ADPhki+FvzzNHR8RIs2S otVw== X-Gm-Message-State: AOAM533I7YwxKkhTJR/uEGTOjHciL1atrEdK7jIzSpSQDjZeMgbOMWP1 Dlmw1yoQgR3CVVbG4/xvKVgD8l7Yw76siwgb7Q== X-Received: by 2002:a02:a008:: with SMTP id a8mr85486997jah.68.1594607611745; Sun, 12 Jul 2020 19:33:31 -0700 (PDT) MIME-Version: 1.0 References: <20200713012428.1039487-1-caij2003@gmail.com> In-Reply-To: <20200713012428.1039487-1-caij2003@gmail.com> From: Brian Gerst Date: Sun, 12 Jul 2020 22:33:20 -0400 Message-ID: Subject: Re: [PATCH] x86/entry: add compatibility with IAS To: Jian Cai Cc: jiancai@google.com, Nick Desaulniers , manojgupta@google.com, Sedat Dilek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "the arch/x86 maintainers" , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Alexandre Chartre , Linux Kernel Mailing List , clang-built-linux 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 On Sun, Jul 12, 2020 at 9:26 PM Jian Cai wrote: > > Clang's integrated assembler does not allow symbols with non-absolute > values to be reassigned. This patch allows the affected code to be > compatible with IAS. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1043 > Reported-by: Nick Desaulniers > Reported-by: Sedat Dilek > Suggested-by: Nick Desaulniers > Tested-by: Sedat Dilek > Signed-off-by: Jian Cai > --- > arch/x86/include/asm/idtentry.h | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h > index f3d70830bf2a..77beed2cd6d9 100644 > --- a/arch/x86/include/asm/idtentry.h > +++ b/arch/x86/include/asm/idtentry.h > @@ -468,34 +468,32 @@ __visible noinstr void func(struct pt_regs *regs, \ > */ > .align 8 > SYM_CODE_START(irq_entries_start) > - vector=FIRST_EXTERNAL_VECTOR > - pos = . > + i = 1 Start with index 0. > + pos1 = . pos1 is unnecessary, as it's equal to irq_entries_start. > .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR) > UNWIND_HINT_IRET_REGS > - .byte 0x6a, vector > + .byte 0x6a, FIRST_EXTERNAL_VECTOR + i - 1 > jmp asm_common_interrupt > nop > /* Ensure that the above is 8 bytes max */ > - . = pos + 8 > - pos=pos+8 > - vector=vector+1 > + . = pos1 + 8 * i > + i = i + 1 If you swap these two lines then the index will be correct for the next stub if you start at 0.. > .endr > SYM_CODE_END(irq_entries_start) > > #ifdef CONFIG_X86_LOCAL_APIC > .align 8 > SYM_CODE_START(spurious_entries_start) > - vector=FIRST_SYSTEM_VECTOR > - pos = . > + i = 1 > + pos2 = . > .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR) > UNWIND_HINT_IRET_REGS > - .byte 0x6a, vector > + .byte 0x6a, FIRST_SYSTEM_VECTOR + i - 1 > jmp asm_spurious_interrupt > nop > /* Ensure that the above is 8 bytes max */ > - . = pos + 8 > - pos=pos+8 > - vector=vector+1 > + . = pos2 + 8 * i > + i = i + 1 > .endr > SYM_CODE_END(spurious_entries_start) > #endif -- Brian Gerst