Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19229450rwd; Wed, 28 Jun 2023 06:49:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GS9U65dKteiLmHJJlhXG6PxYixig1arkQnXX/mI0iAPz3xG6Y+ZdJDSfnXmkRqW8A9RTV X-Received: by 2002:a2e:9b4e:0:b0:2b3:4e76:9c6a with SMTP id o14-20020a2e9b4e000000b002b34e769c6amr23915520ljj.39.1687960187358; Wed, 28 Jun 2023 06:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687960187; cv=none; d=google.com; s=arc-20160816; b=Y4gXIIaSa0Xsukk1Z8JCESxGZvcecTL+HflJa89wsf+CrbgWJP5R/lw4hi/gq+R9m1 soDIySp5kY3e2D9BFlqhTSaZPUf2XRVvVYWUDY5JsWy9iYI2+sSsyKxTlsPnXmE06h5r nHdmJeQJOpu+yAQqyeLlwaPP6WsdziyZKkSw9NCDD5XIvblab8f+nEHLBROXVStzjGa9 RKwcKqbgoU39uqRckptV/hKkMzCT/ge9Q3/sUEeBM4SeVXY12IFCQMrHsgpIyHGVHdtD g8WTE/kX/7+QZW0evdKI5IdTg8Mi0b1iWbltAlcGWqOljM64U1xwnZUjQhujDs2j7kIm GPng== 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=ytMNkCq5mj8QRrqKEhG7DQ+40mAfpQCegQXaR8xPOy8=; fh=+zOaqbd9DKCbq+LwgMuD/+2pfAmnf1K5CMOjaI+TqWo=; b=EP4H2amf8AYD5gBA/1hDvBlqDrDXKIi9SMlI0TAu1losDhkts0ScvV1qLuPZBhlszw xvBRJqauz8fC7E/OCy36GdXL8KksLv5PvlJEEbNglxP74YbIWsntoFiqlPw01J9bJG8y ReZweXa6E2LVVOIJrvAvt3U2xUaoyAtR588xe8qVkcQvxE6esINtUmpYtK7ICCF1IULA v0IjdAw2exHtwAQWmFRCAl4Q2e9FQ1A3d4a799LTOACrSN1XSbMqV9LVM4aE+nXHp9oB aVvNiyHlKL9q1Yrb+1tr2Ke9mx++VtwnLcjns3lBXmUwHjFvV9WHaVh3q3cQVWbA84u4 QG0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hTq8v5SM; 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 gg9-20020a170906e28900b009929ea29c3bsi97191ejb.1001.2023.06.28.06.49.22; Wed, 28 Jun 2023 06:49:47 -0700 (PDT) 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=casper.20170209 header.b=hTq8v5SM; 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 S231949AbjF1Ngh (ORCPT + 99 others); Wed, 28 Jun 2023 09:36:37 -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> 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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.