Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp21998417rwd; Fri, 30 Jun 2023 02:29:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlHc32SlK+QFDJcHauRgmSWe/zfHXVq3tJhYtdyJLgaYYmUbRALKmxWMhMMn+hVadSv+jcBO X-Received: by 2002:a05:6358:cc2a:b0:133:b16:b714 with SMTP id gx42-20020a056358cc2a00b001330b16b714mr2006354rwb.7.1688117349877; Fri, 30 Jun 2023 02:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688117349; cv=none; d=google.com; s=arc-20160816; b=Du1cPcAdftIfksXoLzSdw+xczAU9Czv5D6YThH+RznL3h+ix5FgOORfAiQ8W7VCzLb qfm2IfDSvjCsa3+BWZWeSoTGeq7gIPk6zyvTmb0ryzoISXXO+DYQKVQEKPXiLAoAf6EZ LlvripFUfnLU5U1xwfpGhr3Iy77BSwUTE8T7//kbzrzbcYX7K72evVTOgEEtQMpB/Tsm 2YyTpUaMXetndYo8ihOxgHR+c20BXzjEUwKvkk4JNLcHrHazYAWY7j8sBo4NGtFGFsld z9VE5x7NM2PZNb6mMIW5YWXGmGQIcDm0X4GAa9a/RTjwWtmSLBIapgevgjO/UN1qKQE2 MEmw== 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=iTX8DaTvNk5W0MCthv55SgD+0pWkPm2TRQnZZ/JQ/qY=; fh=K7bJ+ENudDZG2uoSRRxDUm3ue2KIJZ5Z7SEhoqtgCwU=; b=t4lRZ5PRHQkqSXXxJ0OrII4wfHy1CtFoLeaq4ZynhhpTakqrR5B8VtrFbuXgIDvEU9 awCX83HMh9JKYsHc2++7SCs4bFMZzJYpF7CfJQHXfchjGDVhXIY02s9WMAlcCMFH9+9n t8ljRq1D/2YPhn0FTHfVaJTsxXWfmrXG1qQVfUjpp4AblyhxMHjEW16U1hoD/QvGhKs3 1zoTHYwFNyN4GYzfunoEki+lXBd1iYxTMA3C3lITpRrfhNgoKn+RetyBTFe3xKEE3ytm I4FjTb646kaVzMTrW9d/cHcD/irawlQs5OLSwm08pECRkHclAOzuIMDFpgy5Tjq77h3M InCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=XmROkBf3; 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 p24-20020a63e658000000b0053f812a109esi12423064pgj.796.2023.06.30.02.28.55; Fri, 30 Jun 2023 02:29:09 -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=desiato.20200630 header.b=XmROkBf3; 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 S232525AbjF3JXe (ORCPT + 99 others); Fri, 30 Jun 2023 05:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbjF3JXS (ORCPT ); Fri, 30 Jun 2023 05:23:18 -0400 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 296A419C; Fri, 30 Jun 2023 02:23:15 -0700 (PDT) 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=iTX8DaTvNk5W0MCthv55SgD+0pWkPm2TRQnZZ/JQ/qY=; b=XmROkBf3JCdjF81mNoAr+LIl+f Vw8rNxXyhVFIA0bcfCCqDkKp3Al+MOXDa0mh1xa9kPkY5ab+csf2UZDMVn5QeNXvnolMSu7KXZamX liALNMxlMn2C5LbM5kDAFUWhYIBVmAef4LIoP1kjEkKtDU2knGS7fXjBFuUqkKkncUp4hZzHaJSz9 jhw4r3B8HYmhS3zz7YVk0EBMRfidp7WyeP9dAzb36mYOOsr0Lxbf6/FsQgwJai7oPDdjonVeM7Hv7 YYyJhy0l1q7TWDUSN2nX/2Xt/NOP8giii0QyfQDX6v4keJsJdG9b6/BcmIYd2X+JGtxww/4uDsPOi sxo96+iQ==; 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 1qFAKn-007wJ4-0D; Fri, 30 Jun 2023 09:22:33 +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 51BE7300118; Fri, 30 Jun 2023 11:22:32 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 31692245D3645; Fri, 30 Jun 2023 11:22:32 +0200 (CEST) Date: Fri, 30 Jun 2023 11:22:32 +0200 From: Peter Zijlstra To: "Huang, Kai" Cc: "kvm@vger.kernel.org" , "x86@kernel.org" , "Raj, Ashok" , "Hansen, Dave" , "david@redhat.com" , "bagasdotme@gmail.com" , "ak@linux.intel.com" , "Wysocki, Rafael J" , "linux-kernel@vger.kernel.org" , "Chatre, Reinette" , "mingo@redhat.com" , "pbonzini@redhat.com" , "Christopherson,, Sean" , "Yamahata, Isaku" , "nik.borisov@suse.com" , "tglx@linutronix.de" , "Luck, Tony" , "kirill.shutemov@linux.intel.com" , "hpa@zytor.com" , "imammedo@redhat.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "linux-mm@kvack.org" , "bp@alien8.de" , "Brown, Len" , "Shahar, Sagi" , "Huang, Ying" , "Williams, Dan J" , "Gao, Chao" Subject: Re: [PATCH v12 07/22] x86/virt/tdx: Add skeleton to enable TDX on demand Message-ID: <20230630092232.GB2533791@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> <20230628133541.GF2438817@hirez.programming.kicks-ass.net> <03def8b40a7db14f31d2ad67fb1a201e8ae8bce0.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03def8b40a7db14f31d2ad67fb1a201e8ae8bce0.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 Thu, Jun 29, 2023 at 12:15:13AM +0000, Huang, Kai wrote: > > Can be called locally or through an IPI function call. > > > > Thanks. As in another reply, if using spinlock is OK, then I think we can say > it will be called either locally or through an IPI function call. Otherwise, we > do via a new separate function tdx_global_init() and no lock is needed in that > function. The caller should call it properly. IPI must use raw_spinlock_t. I'm ok with using raw_spinlock_t if there's actual need for that, but the code as presented didn't -- in comments or otherwise -- make it clear why it was as it was. TDX not specifying time constraints on the various TD/SEAM-CALLs is ofcourse sad, but alas.