Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp666477ybh; Sun, 12 Jul 2020 19:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxClsgYEZI2GilkY+uR1tuXUhBGaJhr+nfwYjGeS6I7G21EKwHbd2YSTP33mu0/j6AbuEr3 X-Received: by 2002:a17:906:40cb:: with SMTP id a11mr4089501ejk.340.1594608932240; Sun, 12 Jul 2020 19:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594608932; cv=none; d=google.com; s=arc-20160816; b=lmeAdA8jJVq9jGUdep6BRdjMWfaybp2fO+lZZaEPfG3KakAkLk1C5ZwjG2SgJ02knD 1B7nNDbx95yr2/3Shjf6S43Qs7BVG/dc217cxrd2K6XGC9rHW6dDBccOH2JisZAxPqn2 jjbpDVto4ZGpsRi+84lurh7KHuXT3uyjeyUs/STC/3kC8t9//MaMOULZX4ouikk9FBdG 9SXMufObHGiL2nmOvLmatiDkNEeX/7ayv16XhByVpI/bCwA8XLzUjrtA5B6UMrXmJVHC nUA0HPfmksmobwoFIaQrinJkCRQVW3KFncmoUBNkRLjXo3N6MB7OLRzPqlpKc4gDpAlN OuDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=o2kSFHN4HGSBMB4M9W3uTWmnegum+jrs9F0qbYSqLis=; b=jFYcIFuUJfscnLY48t1coVUZatswYw87am6Ema0iUpVN7+29SLqr+mrfXhMk0Y3GW/ HYjnjP+CKbH/0twI5ozrPRRlRm3rQI6fEicSQyzvyCLgpY5R96CQn+aQOheBaCx54aMy UuxS1EIOGYcr2JksPlMgUNcrPm3l3r3VcYGHkQwO+5B7ukqlcH6evch8M6nPFVxg8ixC 7t5dVDQ2DC8jCOlzI4AgB8UxBPvVx4XcAEEkvRc3XZ21wZhvbOTuE28aL7SDikcuOs5E Nnll8H4yCzxfj2K2kRZmQYfGpGWLxMANhVRUk5+BaZETT5K256n1/V+CeiWrLPSbYE90 dLXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=XeDsLFtu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si7462672eju.669.2020.07.12.19.55.09; Sun, 12 Jul 2020 19:55:32 -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=fail header.i=@gmail.com header.s=20161025 header.b=XeDsLFtu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728580AbgGMCyd (ORCPT + 99 others); Sun, 12 Jul 2020 22:54:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726991AbgGMCyc (ORCPT ); Sun, 12 Jul 2020 22:54:32 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EB34C061794 for ; Sun, 12 Jul 2020 19:54:32 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id e3so5171882qvo.10 for ; Sun, 12 Jul 2020 19:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=o2kSFHN4HGSBMB4M9W3uTWmnegum+jrs9F0qbYSqLis=; b=XeDsLFtuqp0vXCZgf+5jopr5+SV5eXE2lzN+ymKjOvq72JPr8G81zMzrYbL09JDy24 V2KIqx3t9DaU84xiUbdPzy6juCZcnlgAnvtPSogPbxFy+fkWvAK0WzBs8ViB2Xv4xQb8 xvUMKHe45yrniM7AyHASI1EWLNVuCUTcONT/dU4s9O9zxAlKObUnM9cl+5gFtZUUhy7O zJHstL7ztzB4iP0PPzFNnCLt3ztKZ7vjykiTXqtMZ9f+hcfc4KYj66h45IHUZdjDy39W f0f1RHFY+sU9UW0wafApklgR8Y7+uikZqWyyy7s3pvfdNhRhi2987qp3SJ1oleBtghnT B15Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=o2kSFHN4HGSBMB4M9W3uTWmnegum+jrs9F0qbYSqLis=; b=spk+gncYQDsMbrtehtl8MnRSOtA9cbNl5NB1s/3WeBfeie9pFiwP1KqSrQRrZKhSbr 5IUtTy1z9Vr53bgsMFVWC2twR7zdYCaaQjdUx32w35P1IKVulerRj882kWQwJwHLMbip w3cYlZXAgc+3Fkzg9HEQiBMO8D17FpuB/0fLw/Z6A5g6kD0mIyLkNVDVlT+rVjy4Xpo3 HgTT0WTR6l763QpTR9HeLqnsR6dHuT2/CtXjbqK7RYPH/sfRs7j3YK7CsnDeDqOF87G/ XRdSSWXP+zHVs7PKFifYOqcH6cdDK6zWAn5FZJ9TnKaDrJztmIbnZywvX3BbWB6Oy1Lx rx5Q== X-Gm-Message-State: AOAM532ZN9tbNJkPraJnvJ2EqXGPebsDpw27ci8HmJPOicvEkXsv0rUu CjwpeVk8/ykhaDNq4khMjBA= X-Received: by 2002:a05:6214:1882:: with SMTP id cx2mr79943466qvb.240.1594608871743; Sun, 12 Jul 2020 19:54:31 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id r5sm18161539qtc.20.2020.07.12.19.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2020 19:54:31 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Sun, 12 Jul 2020 22:54:29 -0400 To: Jian Cai Cc: jiancai@google.com, ndesaulniers@google.com, manojgupta@google.com, sedat.dilek@gmail.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Alexandre Chartre , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] x86/entry: add compatibility with IAS Message-ID: <20200713025429.GA704795@rani.riverdale.lan> References: <20200713012428.1039487-1-caij2003@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200713012428.1039487-1-caij2003@gmail.com> 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 06:24:22PM -0700, 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 > + pos1 = . > .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 > .endr > SYM_CODE_END(irq_entries_start) I think it would be a little cleaner to initialize i to 0, and drop pos. i.e. couldn't we do i = 0 ... .byte 0x6a, FIRST_EXTERNAL_VECTOR + i ... i = i + 1 . = irq_entries_start + 8 * i > > #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 > -- > 2.27.0.383.g050319c2ae-goog >