Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp894806ybh; Mon, 13 Jul 2020 04:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1zv9WBb7oJompLlWpgECXyCtTCQCMcmC/OqL7LrpOozLXIrRVVPjcRDVNPdWrFGO17CKX X-Received: by 2002:a05:6402:b9b:: with SMTP id cf27mr89993311edb.84.1594638867343; Mon, 13 Jul 2020 04:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594638867; cv=none; d=google.com; s=arc-20160816; b=KKAPkY2tyjienLTauPRYso2NHPBJdq322+79XisO6DnafIDbYhVX96Wb2wi7qDz/NQ PXjOXGN8TYqkgkBKM9Zyjah7NpQW8WvjSpzt5vX0d8nlVXwfgYjJAUFoWacjHJ+1LtF4 Yuh7u1EcYNd4UkiqpEvgTV9jk8obKkdntUYlKAYj9psGHDn3nVP0sAlSSbUCl4o3hAyt RVhZ6hSbcOqvMTFsg5lGawWHn1Vf6wzay0MB/R2Vo5XTMryYmJbzcGfO3dE4G3ho6Qoj 2JC8iO6ytPHXgE9iHqainVdaAh9m2jQPhTGm7/JKMiuhuImo7WBPeHjaIFOPDdHC+kiO EQAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+bQksqtMBYbc7jVH6wFxH9Kq69FFLyptC26npBtvTYE=; b=CDYDbL7CKTuDoc2DE9biX9RBAPxo7qc5hW/ulZURXtW2xoQwtsDUYxkXnZbmC2beAZ hHJ8pCaIYfbm+VPdvz8Lkqlk5S4QVYBxfxi099u5GDReSU90cg1vMkHFtr3Dj4cRvZaF ERejtf40N2uUJIoNaZeakooFGk4+lq+XSStYy6nQNe07Ya+ChEvfFe+AgOs2cJipxNIJ Bw3sol5YcNm1IBd27CB7oAkJ9VKTbPRFMVZKnGdCrZ7JVx1tbBp9oxXzSsx+eD9PVNO4 Tw+idxb6UzzOt/g+K0h5A3CbrfxN8OlisZaZS5lM2CXQuyb+gn86K4dGefieT86TFpK1 RFNA== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si8995643edw.265.2020.07.13.04.14.04; Mon, 13 Jul 2020 04:14:27 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729492AbgGMLNf (ORCPT + 99 others); Mon, 13 Jul 2020 07:13:35 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51426 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728950AbgGMLNe (ORCPT ); Mon, 13 Jul 2020 07:13:34 -0400 Received: by mail-wm1-f67.google.com with SMTP id 22so12916741wmg.1 for ; Mon, 13 Jul 2020 04:13:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+bQksqtMBYbc7jVH6wFxH9Kq69FFLyptC26npBtvTYE=; b=c6BXBtSCUk5sXLw2Cerm68nl9u+hBlMGBS2cMbre0b9nZlneqLJLtHKt0YcWqXyX6L ZI0qhUNLq6Eze/B1/O8DoTdo04a2Wx46lcJzh6cJRS2s0fzZPO2hF7wEy6RwyhXyYU1p SLr6YBcAe4eLLo09AR6+B9s2x25b49ZD3BWPdhGDxCyJ8DstkrHe62K3xS63Qe6mFzSt zpTSW2hP2Qs3IrgPkSLwdrVctLUhLCz5gDIhTS3XuOyydxRRRTUReXQSBXZFCyfSUJcN yzcubI8ICLc6IK1wIEc+6XQsga+6zxpMKtKwTMK7/Hv16gKV/tqP0dXnvUtECNxJ7laj 2uaw== X-Gm-Message-State: AOAM530zEAnHyFPuOT7cppc8Uzbo0KdoZPwkrjIVHaZlheDOcE0m83q5 vgoL33vls5FbskSlkZxbYQ0= X-Received: by 2002:a1c:7e87:: with SMTP id z129mr19002816wmc.45.1594638811968; Mon, 13 Jul 2020 04:13:31 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id s15sm21310898wmj.41.2020.07.13.04.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 04:13:31 -0700 (PDT) Date: Mon, 13 Jul 2020 11:13:30 +0000 From: Wei Liu To: Sedat Dilek Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Alexandre Chartre , Wei Liu , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Jian Cai , Nathan Chancellor Subject: Re: [PATCH] x86/entry: Fix vectors to IDTENTRY_SYSVEC for CONFIG_HYPERV Message-ID: <20200713111330.kpppbjbjwwij2rgq@liuwe-devbox-debian-v2> References: <20200712231050.5147-1-sedat.dilek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200712231050.5147-1-sedat.dilek@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 01:10:50AM +0200, Sedat Dilek wrote: > When using Clang's Integrated Assembler (LLVM_IAS=1) we fell over > ClangBuiltLinux (CBL) issue #1043 where Jian Cai provided a fix. > > With Jian's fix applied another issue raised up when CONFIG_HYPERV=m. > > It turned out that the conversion of vectors to IDTENTRY_SYSVEC in > case of CONFIG_HYPERV was incomplete and fails with a build error: > > :9:6: error: expected absolute expression > .if HYPERVISOR_REENLIGHTENMENT_VECTOR == 3 > ^ > :1:1: note: while in macro instantiation > idtentry HYPERVISOR_REENLIGHTENMENT_VECTOR asm_sysvec_hyperv_reenlightenment sysvec_hyperv_reenlightenment has_error_code=0 > ^ > ./arch/x86/include/asm/idtentry.h:627:1: note: while in macro instantiation > idtentry_sysvec HYPERVISOR_REENLIGHTENMENT_VECTOR sysvec_hyperv_reenlightenment; > ^ > :9:6: error: expected absolute expression > .if HYPERVISOR_STIMER0_VECTOR == 3 > ^ > :1:1: note: while in macro instantiation > idtentry HYPERVISOR_STIMER0_VECTOR asm_sysvec_hyperv_stimer0 sysvec_hyperv_stimer0 has_error_code=0 > ^ > ./arch/x86/include/asm/idtentry.h:628:1: note: while in macro instantiation > idtentry_sysvec HYPERVISOR_STIMER0_VECTOR sysvec_hyperv_stimer0; Hmm... Interesting. GCC never complained. Guests are perhaps broken in a rather subtle way. > > I and Nathan double-checked the hyperv(isor) vectors: > > $ rg --no-heading "HYPERVISOR_REENLIGHTENMENT_VECTOR|HYPERVISOR_STIMER0_VECTOR" > $ rg --no-heading "HYPERV_REENLIGHTENMENT_VECTOR|HYPERV_STIMER0_VECTOR" > > Fix these typos in arch/x86/include/asm/idtentry.h: > > HYPERVISOR_REENLIGHTENMENT_VECTOR -> HYPERV_REENLIGHTENMENT_VECTOR > HYPERVISOR_STIMER0_VECTOR -> HYPERV_STIMER0_VECTOR > > For more details see CBL issue #1088. > > With both fixes applied I was able to build/assemble with a snapshot > version of LLVM/Clang from Debian/experimental. I think the issue found here is independent of the other. This patch shouldn't need to wait for the other to land. > > Cc: Jian Cai > Cc: clang-built-linux@googlegroups.com > Reviewed-by: Nathan Chancellor > Fixes: a16be368dd3f ("x86/entry: Convert various hypervisor vectors to IDTENTRY_SYSVEC") > Link: https://github.com/ClangBuiltLinux/linux/issues/1043 > Link: https://github.com/ClangBuiltLinux/linux/issues/1088 > Signed-off-by: Sedat Dilek > --- > arch/x86/include/asm/idtentry.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h > index 513eb2ccbdbf..a811f6c6cf15 100644 > --- a/arch/x86/include/asm/idtentry.h > +++ b/arch/x86/include/asm/idtentry.h > @@ -624,8 +624,8 @@ DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_NESTED_VECTOR, sysvec_kvm_posted_intr_nested > > #if IS_ENABLED(CONFIG_HYPERV) > DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_hyperv_callback); > -DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment); > -DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_STIMER0_VECTOR, sysvec_hyperv_stimer0); > +DECLARE_IDTENTRY_SYSVEC(HYPERV_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment); > +DECLARE_IDTENTRY_SYSVEC(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0); Reviewed-by: Wei Liu Thomas, can you pick this up for 5.8? Thanks. Wei.