Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3262023rwb; Sat, 12 Nov 2022 02:16:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Z6wixPg+y3JQ7M9B7YIyjx95gH44RkFyVeeMXnxDMDhgdnX1CKLYkcJ3UQJHefgZi8Dv/ X-Received: by 2002:a17:906:148c:b0:7ad:f0ae:bc88 with SMTP id x12-20020a170906148c00b007adf0aebc88mr4888576ejc.188.1668248218441; Sat, 12 Nov 2022 02:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668248218; cv=none; d=google.com; s=arc-20160816; b=OZMUAExamaCo8Ls2UVBBjUUSBYYODFhBWQsfAI4Dj94LrgMxrUISbFkWeWaQwedPyu bkJvmQRoD8O6VP8mlL8ILDCJMWR0cmkYPdJ8kQ20XmlHx+xOwsqnjTLKS/lstdKfR0QY 3xZKC/7j0Ax34g5t6GhaAKW/5/P4ISp7dmoSE7RHLzt+ujlSU8hOVLk+gAQ7UnmMXozC mLcbLA3FT9CJ+vC7IyrQUZc49lmIespQTR1PTj0vdTDEnHGTQqro1QLztyEJtO4zc9Nd zdtPwZztp8aWyy+H5HKdz85qGrCXaxSR4d+ApRTm2hGcpt8aMLy6nBLSQcNSo9zhMVkv iBGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aKOTb8X0RrZ73pUTzPb8AcL3BXawV6mvmfnTQpI/3cI=; b=ensPqLR32OGmVw5dliuU2Ht9sfne5QZ4THGB8bRU8Obn6MrEWZQCpSVdlttVCLvFz4 +5bpObkVOLbM3ZSQOoZr8KIzg7Lc65CwWSk9z8pmA/ibcel6yqfAZFdz9SGqxXTB2Tek TRWj3FoUkF9OufyVsGLx7nQc8LR60AGGpD51jvS5xDOfN9eGrZVEEADLxw/H2GRH5/mU TUMPLk9LP8diThf/les2XbHtSiCm2go++cm0tEwrMkSnzf5tCS7HvZLuU0PU7hCmatR4 od8Ef30YBHrSCfQVTaC56QFhqLq0+ZsI9Mfr4tTMsrMYPjov1pLRrsdB7EwFhX79Mq7v sM+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=dubaVRnZ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gi18-20020a1709070c9200b007ae1d040bffsi3069814ejc.223.2022.11.12.02.16.34; Sat, 12 Nov 2022 02:16:58 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=dubaVRnZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234387AbiKLJsk (ORCPT + 91 others); Sat, 12 Nov 2022 04:48:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbiKLJsi (ORCPT ); Sat, 12 Nov 2022 04:48:38 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EF06E031; Sat, 12 Nov 2022 01:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aKOTb8X0RrZ73pUTzPb8AcL3BXawV6mvmfnTQpI/3cI=; b=dubaVRnZ1fySNyJ6m8N5GztbWz brhbwhhQFUPXnTZNKyvfvrOk6LEfmvw+2aCqUpKdcsGwClLE+fnxPRFCGTjXiKHP1hMrx94w/Itzd FJErYxzxXhyXZvS7RUDQ2KMtbnW961omQAHIKiV4odkVb6gDougTsAInCHk2dyIPgf5M3CZqrbLUZ Z9+MSYQajkyJdP1n8EMnQuRCR/N6vw6feW0CQU3meVWIr5ipVPeV04GOEQdJlKi2ETRZu9cASIR8g PX60poQ5D5m5+/pltlYpHSBVdICLbfSwDdIYkJcaLRMv/kKz5j3Yoo9zLZJXXEOOAW2gSWeYwOUL3 VCH/yXwQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1otn7I-000FpZ-HW; Sat, 12 Nov 2022 09:48:02 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9413730013F; Sat, 12 Nov 2022 10:47:58 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4A6AA20831B7F; Sat, 12 Nov 2022 10:47:58 +0100 (CET) Date: Sat, 12 Nov 2022 10:47:58 +0100 From: Peter Zijlstra To: "H. Peter Anvin" Cc: "Li, Xin3" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "kvm@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "Tian, Kevin" Subject: Re: [RESEND PATCH 2/6] x86/traps: add a system interrupt table for system interrupt dispatch Message-ID: References: <20221110061545.1531-1-xin3.li@intel.com> <20221110061545.1531-3-xin3.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Fri, Nov 11, 2022 at 02:07:05PM -0800, H. Peter Anvin wrote: > On November 10, 2022 11:55:22 AM PST, "Li, Xin3" wrote: > >> > Signed-off-by: H. Peter Anvin (Intel) > >> > Signed-off-by: Xin Li > >> > >> This is not a valid SOB, it would suggest hpa is the author, but he's not in in > >> From. > > > >HPA wrote the initial dispatch code for FRED, and I worked with him to > >refactor it for KVM/VMX NMI/IRQ dispatch. So use SOB from both. No? > > > >> > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index > >> > 178015a820f0..95dd917ef9ad 100644 > >> > --- a/arch/x86/kernel/traps.c > >> > +++ b/arch/x86/kernel/traps.c > >> > @@ -1444,6 +1444,61 @@ DEFINE_IDTENTRY_SW(iret_error) } #endif > >> > > >> > +#define SYSV(x,y) [(x) - FIRST_SYSTEM_VECTOR] = > >> > +(system_interrupt_handler)y > >> > + > >> > +#pragma GCC diagnostic push > >> > +#pragma GCC diagnostic ignored "-Wcast-function-type" > >> > >> How does this not break CFI ? > > > >I wasn't aware of it, will check. > > > > It doesn't break CFI because the arguments passed is always a strict > superset of the ones expected and they are free enough that they are > always passed in registers. It does break CFI because the signature hash doesn't match and you'll trigger an explicit UD2.