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 45AE8C433FE for ; Sun, 24 Apr 2022 01:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237493AbiDXBar (ORCPT ); Sat, 23 Apr 2022 21:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbiDXBap (ORCPT ); Sat, 23 Apr 2022 21:30:45 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D247760AB2; Sat, 23 Apr 2022 18:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650763666; x=1682299666; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=IA1Lmj4ocO6/xXKqNHTWqrt9z5lmz4IZWJmRXxw1fbk=; b=cOC+J7B5gLiZDso6hMbROPhzRNuHxAL7gvSWHZ+1c22tFB8Nnci2pfKn gUbKQ9F9bwjF9P9wXLeINcas19aaiHz4bpqwQZpw9KXJ8G3xfHVBHp4bh V0Q67YQUGt4wk2JCqxZg/dNL5TnWZ1dp0smjZPySqGF8n1IMikwypm5hl swZ2ksRQHSWPtM7UFWSQgdDSW39TiT8yxwEopD5j0zG/qxem9uvYuDrXl WoB6Gp2ZMz7PT93zj0k2Sy/aQdKA8SmiBPA9Mr20q+nSryCFvwhZpaaXh /5r0eWQ8hZ2o07Z5olOhFcnrJ+7CDaj7FiyNnZFRbw/5uNesT3qyfW6Nf w==; X-IronPort-AV: E=McAfee;i="6400,9594,10326"; a="265144118" X-IronPort-AV: E=Sophos;i="5.90,285,1643702400"; d="scan'208";a="265144118" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2022 18:27:46 -0700 X-IronPort-AV: E=Sophos;i="5.90,285,1643702400"; d="scan'208";a="729114400" Received: from mhammack-mobl1.amr.corp.intel.com (HELO [10.212.213.135]) ([10.212.213.135]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2022 18:27:44 -0700 Message-ID: <4bff50c3-4065-65a3-b698-28f2391bb776@linux.intel.com> Date: Sat, 23 Apr 2022 18:27:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.7.0 Subject: Re: [PATCH v3 08/21] x86/virt/tdx: Do logical-cpu scope TDX module initialization Content-Language: en-US To: Kai Huang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: seanjc@google.com, pbonzini@redhat.com, dave.hansen@intel.com, len.brown@intel.com, tony.luck@intel.com, rafael.j.wysocki@intel.com, reinette.chatre@intel.com, dan.j.williams@intel.com, peterz@infradead.org, ak@linux.intel.com, kirill.shutemov@linux.intel.com, isaku.yamahata@intel.com References: <35081dba60ef61c313c2d7334815247248b8d1da.1649219184.git.kai.huang@intel.com> From: Sathyanarayanan Kuppuswamy In-Reply-To: <35081dba60ef61c313c2d7334815247248b8d1da.1649219184.git.kai.huang@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/5/22 9:49 PM, Kai Huang wrote: > Logical-cpu scope initialization requires calling TDH.SYS.LP.INIT on all > BIOS-enabled cpus, otherwise the TDH.SYS.CONFIG SEAMCALL will fail. IIUC, this change handles logical CPU initialization part of TDX module initialization. So why talk about TDH.SYS.CONFIG failure here? Are they related? > TDH.SYS.LP.INIT can be called concurrently on all cpus. IMO, if you move the following paragraph to the beginning, it is easier to understand "what" and "why" part of this change. > > Following global initialization, do the logical-cpu scope initialization > by calling TDH.SYS.LP.INIT on all online cpus. Whether all BIOS-enabled > cpus are online is not checked here for simplicity. The caller of > tdx_init() should guarantee all BIOS-enabled cpus are online. Include specification reference for TDX module initialization and TDH.SYS.LP.INIT. In TDX module spec, section 22.2.35 (TDH.SYS.LP.INIT Leaf), mentions some environment requirements. I don't see you checking here for it? Is this already met? -- Sathyanarayanan Kuppuswamy Linux Kernel Developer