From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91DBDC001B2 for ; Thu, 22 Dec 2022 13:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235326AbiLVNIw (ORCPT ); Thu, 22 Dec 2022 08:08:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiLVNIs (ORCPT ); Thu, 22 Dec 2022 08:08:48 -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 E897ABCA; Thu, 22 Dec 2022 05:08:43 -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=HhoSwzjsX6UdVDfKy5dRYCKC7f/qrncYptmJiwWeaRQ=; b=fesxcpNbE0oJeFZPMvmCh+d3LK qlIl5fScBoN+8WXxtBmMBH9rdrY9idvco1tIul3jlkdhxhghkVaaHm17DYGbDQgDU8hK634za4MtA m3KWiTP3XHN6XUyUw5x1jXhXBinDldSNQjFkDPcAWr4ES0rEmFmkVxN2X6HhWn1fgghfMQfRxqbDI yEsvxj27uIVkm/NGK9rMkTynU8ahAtwDC0z+Q6baYyYyGT1vtup4/JklCGYehMH25VtBhAnsCH68I UHG8MYkb5J4MbvsFVtgnylivBP0TOUeM/50mqLSHjTFEnxlxoBgXnXyHmPsocvXpwTWMuOh+U54ly pedw64mQ==; 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.96 #2 (Red Hat Linux)) id 1p8LJ5-00Dpt4-03; Thu, 22 Dec 2022 13:08:19 +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 F01CF3001E5; Thu, 22 Dec 2022 14:08:19 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D8FCC20D2DE37; Thu, 22 Dec 2022 14:08:19 +0100 (CET) Date: Thu, 22 Dec 2022 14:08:19 +0100 From: Peter Zijlstra To: "Li, Xin3" Cc: "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" , "andrew.cooper3@citrix.com" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "Shankar, Ravi V" Subject: Re: [RFC PATCH 21/32] x86/fred: FRED entry/exit and dispatch code Message-ID: References: <20221220063658.19271-1-xin3.li@intel.com> <20221220063658.19271-22-xin3.li@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 21, 2022 at 02:56:08AM +0000, Li, Xin3 wrote: > > > + if (!(BIT(vector) & noinstr_mask)) { > > > + state = irqentry_enter(regs); > > > + instrumentation_begin(); > > > + } > > > + > > > + exception_handlers[vector](regs); > > > + > > > + if (!(BIT(vector) & noinstr_mask)) { > > > + instrumentation_end(); > > > + irqentry_exit(regs, state); > > > + } > > > > This noinstr mask is daft; why not have DEFINE_FRED_HANDLER and > > DEFINE_FRED_HANDLER_RAW or something, have the normal one include the > > irqentry bits and use the _RAW one for the 'funny' ones that need to do it > > themselves? > > I wanted to keep "state = irqentry_enter(regs); instrumentation_begin();" > in the dispatch framework, instead of pushing down to the handlers. > > Of course, we could do it the other way if it is more preferred. Yes, please do as I suggested, it is consistent IDTENTRY macros.