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 79CBDEB64D7 for ; Wed, 28 Jun 2023 13:36:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231935AbjF1Ngj (ORCPT ); Wed, 28 Jun 2023 09:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbjF1Ngc (ORCPT ); Wed, 28 Jun 2023 09:36:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30737E4B; Wed, 28 Jun 2023 06:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=ytMNkCq5mj8QRrqKEhG7DQ+40mAfpQCegQXaR8xPOy8=; b=hTq8v5SMGqKnRYTlooA05bx+Lj HRsozeIMcbs653IAaL+XNxCu6YICEE0b0CTdaYd0qHf4tfYBxP8Z0aiOY9+6U+6YGB4y8fMoWE82a tIokfXhEns2lo+ZchXhidsFn5/peKcmJyfXQsYcmVtAKNJeCxwFXhefsLPMGw1q5srfBPR4ELKInp SlYUXTieGCmAasREoJyoRxSY8OV0FwFTkC54mkhirbu70zX66NdujVbKpR17ENFBMubV7c2wvmx+z 7ieoGmbW/EWfsBkNHW4jmHqREGUFRknwi501NHA8pzjGtbC7e5dC/ZghtE0Mw1hA+Eb1gwCDkj5bE Vq2LosxQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qEVKg-003olR-0n; Wed, 28 Jun 2023 13:35:42 +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 5432C30005E; Wed, 28 Jun 2023 15:35:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3B98924810076; Wed, 28 Jun 2023 15:35:41 +0200 (CEST) Date: Wed, 28 Jun 2023 15:35:41 +0200 From: Peter Zijlstra To: "Huang, Kai" Cc: "kirill.shutemov@linux.intel.com" , "kvm@vger.kernel.org" , "Raj, Ashok" , "Huang, Ying" , "Hansen, Dave" , "david@redhat.com" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "linux-kernel@vger.kernel.org" , "Chatre, Reinette" , "Christopherson,, Sean" , "pbonzini@redhat.com" , "mingo@redhat.com" , "Yamahata, Isaku" , "nik.borisov@suse.com" , "tglx@linutronix.de" , "Luck, Tony" , "linux-mm@kvack.org" , "hpa@zytor.com" , "imammedo@redhat.com" , "Shahar, Sagi" , "bp@alien8.de" , "Brown, Len" , "Gao, Chao" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "Williams, Dan J" , "x86@kernel.org" Subject: Re: [PATCH v12 07/22] x86/virt/tdx: Add skeleton to enable TDX on demand Message-ID: <20230628133541.GF2438817@hirez.programming.kicks-ass.net> References: <104d324cd68b12e14722ee5d85a660cccccd8892.1687784645.git.kai.huang@intel.com> <20230627095012.ln47s62pqzdrnb7x@box.shutemov.name> <20230627121853.ek5zr7sfiezfkfyj@box.shutemov.name> <9361abfa9bf22c2a1a4b25e5495bcccc5b8dcd43.camel@intel.com> <7b61715ad35d7b9916f55df72378e02e62c5cc4e.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b61715ad35d7b9916f55df72378e02e62c5cc4e.camel@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 12:28:12AM +0000, Huang, Kai wrote: > On Tue, 2023-06-27 at 22:37 +0000, Huang, Kai wrote: > > > > > > > > +/* > > > > + * Do the module global initialization if not done yet. > > > > + * It's always called with interrupts and preemption disabled. > > > > + */ > > > > > > If interrupts are always disabled why do you need _irqsave()? > > > > > > > I'll remove the _irqsave(). > > > > AFAICT Isaku preferred this for additional security, but this is not > > necessary. > > > > > > Damn. I think we can change the comment to say this function is called with > preemption being disabled, but _can_ be called with interrupt disabled. And we > keep using the _irqsave() version. > > /* > * Do the module global initialization if not done yet. It's always > * called with preemption disabled and can be called with interrupts > * disabled. > */ That's still not explaining *why*, what you want to say is: Can be called locally or through an IPI function call.