From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.2095.1636094780504213310 for ; Thu, 04 Nov 2021 23:46:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SXOHcwjr; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636094779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b8M1Trhij2a7Jxc+trR4QOFTjUUv41p3XyoldXyOvO0=; b=SXOHcwjr0S1ylTfC7v88BLKA4EgWogx1pk0sRIF5WhUO9qTYUvIJA+NVVMMCDuI1yhscj+ 7/WrH9bf7/sleLuhDoCT9XUGF6uk0LvWKSHiwolrbhgni/fnKbITxkW0snBHrZtTE7oOBq xM7UG/h/oPxSKEWRDYURYkKzmRV878Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-lAi6g3fZMIOuKPPQMOzmZw-1; Fri, 05 Nov 2021 02:46:16 -0400 X-MC-Unique: lAi6g3fZMIOuKPPQMOzmZw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD7A810A8E10; Fri, 5 Nov 2021 06:46:14 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79B335D9D3; Fri, 5 Nov 2021 06:46:14 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 915DA1800923; Fri, 5 Nov 2021 07:46:12 +0100 (CET) Date: Fri, 5 Nov 2021 07:46:12 +0100 From: "Gerd Hoffmann" To: devel@edk2.groups.io, min.m.xu@intel.com Cc: Tom Lendacky , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul1" Subject: Re: [edk2-devel] [PATCH V3 14/29] UefiCpuPkg: Enable Tdx support in MpInitLib Message-ID: <20211105064612.yxjrsxste3qyctqe@sirius.home.kraxel.org> References: <9d8a7f7da913a1062d3f01e24615bb8bdc958458.1635769996.git.min.m.xu@intel.com> <20211103060914.scktdnjbfzrtu4xk@sirius.home.kraxel.org> <20211104081004.4mhzk7hqozg3prrp@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > Can't you create something in MdePkg/Library/Baselib and then use it > > everywhere it's needed? > > > Do you mean put the basic Tdx functions in MdePkg/Library/BaseLib? If that is the case, then I would add below basic Tdx functions in BaseLib: > - TdIsEnabled () > - TdCall () > - TdVmCall () That is the cpuid-based check and the asm code for td calls, correct? > Gerd, what's your thought? Looks fine to me. take care, Gerd