From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.web10.1791.1631322858939543067 for ; Fri, 10 Sep 2021 18:14:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=F+VpoKrW; spf=pass (domain: google.com, ip: 209.85.215.170, mailfrom: erdemaktas@google.com) Received: by mail-pg1-f170.google.com with SMTP id h3so3403258pgb.7 for ; Fri, 10 Sep 2021 18:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OxgGNxgOiOFqQCa+wvWL6mJh/K+GH0XzHpygGttLByE=; b=F+VpoKrWK9qo8tV66mFcSbxdeDOEB+GXbtYMkiAI/NzxtiT48dYr5Ox0q4tI7fd1nW juYkabJ5zemihbe/2EvB+zGynvG1i7ORSuoWy3IbdC8Azby/Hkd1QL4Yncwlt038FNHp BelHXYp8EPPXuZG4hGOL2DGxGlpmUfU7o2+mXEh+Z6UTxhU9pi6Lght+cpZ8B36ZROG5 HkSAwCHIjtLUbZTKf5D2Ln6Ny1VLMX4GBPl3AMTqCrgaFdX+BoNOJf3prvIMMzgBlodb mSTtFFbGmPzEHMLC8Tg9KJSfO6FtO5ln2ropYhHJgkC6sx+SzFr2B+tNXY2U+2MgcQsO PIUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OxgGNxgOiOFqQCa+wvWL6mJh/K+GH0XzHpygGttLByE=; b=yHY3cMTtmwrvKwQd2pHXkeDNchrzO7jsXO09xnzRx9hT5ZYyziSk8oJQ5kGNHg6lEz g3twm5jxkqls5vUXT/E+0Qlz3pbI1BASj/XzhdJKcl6RyyDzw4c0Exm7//dJgpFMJ9xD gCE7cI5Rvd44FEF60cVhEEbhTxt8lUfKGr26lL8GRQxxtxh+RXs7AH4IHfB2ohqhfeOA K6VXhn6/ZHI6enxfAFcx5JneOMEhUzNOkO/aQD45Pu8cuaNmcUHIGN0okCYTM1I+pqE+ t2AD/EhF+8MQSthsB2VbBP2L4MYhKPiNQ4TKXANFquGqPNKaDB73fat/x1ZHwVU/uDEJ y/Zg== X-Gm-Message-State: AOAM533de2sFuEG7hG8jcGMOV2ZxQ0Va5UKhcs8aXjCvLpDbi15Gw0vl DUTQaEOYNspH4cQ9hxLHgCc1PsG+PVsr3bKV2/CoBA== X-Google-Smtp-Source: ABdhPJwZ4wPJfsGiX4zjNIrrnCjWxZA1jiARQ2X8C3IkMsScEoh9gE8NGT4YlEoszgSlSZ5l7ybXUe91r1mDlMuzAmU= X-Received: by 2002:a63:d10b:: with SMTP id k11mr477999pgg.26.1631322858266; Fri, 10 Sep 2021 18:14:18 -0700 (PDT) MIME-Version: 1.0 References: <31e974a9ef1ef191a1f76e81fa91047d12ee2169.1628767741.git.min.m.xu@intel.com> In-Reply-To: <31e974a9ef1ef191a1f76e81fa91047d12ee2169.1628767741.git.min.m.xu@intel.com> From: "Erdem Aktas" Date: Sat, 11 Sep 2021 04:14:07 +0300 Message-ID: Subject: Re: [PATCH 03/23] OvmfPkg/ResetVector: Enable Intel TDX in ResetVector of Ovmf To: Min Xu Cc: edk2-devel-groups-io , Ard Biesheuvel , Jordan Justen , Brijesh Singh , James Bottomley , Jiewen Yao , Tom Lendacky Content-Type: text/plain; charset="UTF-8" On Thu, Aug 12, 2021 at 2:57 PM Min Xu wrote: > > +; > +; Check if it is Intel Tdx > +; > +; Modified: EAX, EBX, ECX, EDX > +; > +; If it is Intel Tdx, EAX is zero > +; If it is not Intel Tdx, EAX is non-zero > +; > +IsTdx: IsTdx returns 0 when TDX is enabled in CPUID but IsTdxEnabled return 1 when TDX is enabled. Is this intentional? here is how IsTdxEnabled defined. ; If TDX is enabled then EAX will be 1 ; If TDX is disabled then EAX will be 0. ; IsTdxEnabled: > +TdxApWait: > + cmp byte[TDX_WORK_AREA_PGTBL_READY], 0 > + je TdxApWait Don't we need memory fence before je TdxApWait. I did not check what the compiler generates for this loop. -Erdem