Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1428049rwb; Thu, 10 Nov 2022 16:20:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf44UyTWqtZQbUrPqVVvXDmwuTeDm6SJILueJl/zmV7AjeHpnKMg+uYfLCoi7PQJViICOQyD X-Received: by 2002:a17:906:492:b0:7ad:bb54:75d3 with SMTP id f18-20020a170906049200b007adbb5475d3mr21711eja.484.1668126014401; Thu, 10 Nov 2022 16:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668126014; cv=none; d=google.com; s=arc-20160816; b=au2rlnX5iMPAygmC1OalOa85pA7436FXveWYF166BxLpe8tKzhtSHezNsgywjH/JON 5Wl0VPZeoQgAbMk+7S4ukP9MKoNwJT3a6faqnFEo5VMEFGjFwG2BKtkyctAkcenS/rsQ fTHjeV0zHHprODuuS26usmWFFy66Sr+he/V4CGmtIQhH8wA1fkEQInP1iAKK2fKLb5cy SSu+kCz2ChIg4SRgHmRz7qpgeB4sXjgrbucGEZzjXy6GQmuETE9Nl8U8RVM+KYnrRYkj p8CDxiZpCM/cUNvwEdFxt7YJn/ctbzoyj1yP0gm2o5GMDrmumA6nZ0WLmhLdnhA6XA9e RhZQ== 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=rxuIew5N7XlSmbHIpgzdQPZWBtXZmjMDCGh7xmY+7KY=; b=x2XQNyWxupV77SzuO5b/AR1Q79+HWPBMmMcWODlPkg3KY+fIG9n4eKGuT3ELtOJed8 z9w0yx1Q6hRu9W+aztciqeDmYc3rkWFEtq4ov+g2pQOE/1/6UqbWyQNq0CXjkEd0LFb4 cifUmtDt+UXaSBtUTtl2XnoNK5yXg0W8oRGhNxQjhX/uH9CvaldK9oCC6TFuxi03T3pp hac1DeFiXPXAw+xvCoZKBTZyme4cwzQ1wI6ddfo3nVyf2R2mLxca5hADbltdE6JgXM3O k0zBQIy/zkQ4dJFP9F5hJNaAarvx9NjAb31GOaV7Q1uEWbg3q3ozSkLNJQ/I1RkTNjoe ZknQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KhgyUGwT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rv14-20020a17090710ce00b0077d854aa10dsi557657ejb.57.2022.11.10.16.19.52; Thu, 10 Nov 2022 16:20:14 -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=@kernel.org header.s=k20201202 header.b=KhgyUGwT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbiKKAIT (ORCPT + 92 others); Thu, 10 Nov 2022 19:08:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiKKAIP (ORCPT ); Thu, 10 Nov 2022 19:08:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7E5549B5D; Thu, 10 Nov 2022 16:08:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 634FA61E63; Fri, 11 Nov 2022 00:08:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD5F4C433D6; Fri, 11 Nov 2022 00:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668125293; bh=b9iIdCTc1ieuRIXavaQqgz9xI52NeU2Y+J4WZOnadW4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KhgyUGwT03lsX4fiGnaV36Ln7cPE/O90Hhh7yJx9iN7OKLTQmeLEgUE1dQVFjHB7W bXT97g1I+DKI+p3z1spdS8n2jwA3LF9WfKKqmP+p4Nn72AmyYPMftzjNlq2VfCorCk 0hhPISe0Ob3DU0sw6utIfiL/HJ6uabpZawvCfu6kX4g2z/xfr5iRiq4zkhd3XYVHm8 WiuTsFHQQn7hR235oC/Hx07VdliAJIk5aLyQIBesSpZ41HDUBMgC1I/zIacBuQ0+pS V8gGicjMzPOCxpU0mgt+Ys1F9W2ylFA6UMeMqY6Kaavwbv79tppJmf++zY79PYca3n xmaapK3JuWkYA== Date: Thu, 10 Nov 2022 17:08:11 -0700 From: Nathan Chancellor To: "Li, Xin3" Cc: Peter Zijlstra , "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" , "hpa@zytor.com" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "Tian, Kevin" , "llvm@lists.linux.dev" , "Gustavo A. R. Silva" , Kees Cook 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Thu, Nov 10, 2022 at 11:00:51PM +0000, Li, Xin3 wrote: > > > > > > +#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. > > > > > > CFI needs $(cc-option,-fsanitize=kcfi), which, reported on LWN on Jun, > > > 2002, had not yet landed in the LLVM mainline (I'm using GCC). So > > > looks we are replying on people keeping an eye on it to make sure it's not > > broken? > > > > Well, the entire point of the warning that you are disabling here is to catch > > potential CFI failures at compile time, rather than run time :) > > Oh, of course I didn't intend to be opposed to CFI. Oh, I apologize if I gave the impression that you were, I did not mean to put words in your mouth! I was just giving additional context as to why we have that warning enable and how we use it to help catch potential run time failures at compile time, which does not require running CFI to keep CFI happy. Cheers, Nathan > > Clang also has -Wcast-function-type-strict, which Gustavo and Kees are working > > on getting enabled, so that even more CFI failures can be caught at compile > > time. > > > > https://github.com/ClangBuiltLinux/linux/issues/1724 > > https://lore.kernel.org/all/?q=-Wcast-function-type-strict > > > > Cheers, > > Nathan