From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mx.groups.io with SMTP id smtpd.web08.1862.1631323044768008386 for ; Fri, 10 Sep 2021 18:17:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=b3SVI5nG; spf=pass (domain: google.com, ip: 209.85.216.42, mailfrom: erdemaktas@google.com) Received: by mail-pj1-f42.google.com with SMTP id f11-20020a17090aa78b00b0018e98a7cddaso2611975pjq.4 for ; Fri, 10 Sep 2021 18:17:24 -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=ybCHBMcWdwKtNUYP8ia4gVKNwThDBaJi1foIz5pLn4c=; b=b3SVI5nGLWA59C1UZbyCaT+ZL6IMTd9nniD2Po/kak2/Ry2cEkzPIYdeDetAvGlqUL AGnG2TT9Wkd8Je2lliYJZ8KSIOYXIuQfFKfKOFIvAQ3uIonLgJ3qm1EGa/UmZa4CpQDv T/AsJWoydAxR/5LRzUXFFbNyGA7U1FjHlNNmSoufZKjyVdVRAULhb2a9Lt0bCV995HJ4 o70JgCD2GAio7qu9UqAjE/QU5q9wlTUpe9FEmEt5wXcN/LNzLGbj8ywUGrUwXLzcCcGA xQmxWoDyVjgqtiMPVrd7O4D0z933r2m8ktuiMQgIOWmImisi9/y+csQtaVD3yBaOVb6r lGkA== 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=ybCHBMcWdwKtNUYP8ia4gVKNwThDBaJi1foIz5pLn4c=; b=WYk1vTeF7Rtc3YReWrPW1TJ0vMlTwAFZBIlDQM1O/ysgIuur5brSTjum7l+H3BZL/V PFWLSra5MBwo+LLhd89vgZm/AXdY/URrjAFpW0VojrQLG2dAruyzuwaq4NfGh3LDizhK xS9NIZm9jiqZi7jr/FOg2UVbjAiVhhCxhDD4Wg4WN5IeQnG1CC9Gv4jKyk1iv30cuGu0 gW0LEy08iuanqrlwJHjvlnyRWGujfV4JvCmeY3bJGJVoqOqZSnkWRyjpll9FvONTNXea R7Pi3Kjn/PN5nmI7U+siQ2QIytDA7gdwnM288fv3/Xiqb7V3bcFYceUL0l5mFoegEUwB S33g== X-Gm-Message-State: AOAM532+CJNOW28c2AEZnTk/mt9KKH1Ni687jOjaNoZG7iAA3LnRCEj2 7R+8AcfbR2CcoSY9uVwSi3Um5KTxOIDEVyxMgYVcNg== X-Google-Smtp-Source: ABdhPJz0sSOVt3iMfh+VhasAWioMo8iKCRzUh90M/MEpUCoAQ/0Xkmf27vnuJ2aUvusZzGjeYqiHuj7G+ycPJK0sW0g= X-Received: by 2002:a17:90a:1a50:: with SMTP id 16mr534779pjl.164.1631323044005; Fri, 10 Sep 2021 18:17:24 -0700 (PDT) MIME-Version: 1.0 References: <81c97a782bbbf83043854ad8a86d14604918d788.1630289827.git.min.m.xu@intel.com> In-Reply-To: <81c97a782bbbf83043854ad8a86d14604918d788.1630289827.git.min.m.xu@intel.com> From: "Erdem Aktas" Date: Sat, 11 Sep 2021 04:17:12 +0300 Message-ID: Subject: Re: [PATCH V5 2/2] OvmfPkg/ResetVector: Enable Intel TDX in ResetVector of Ovmf To: Min Xu Cc: edk2-devel-groups-io , Ard Biesheuvel , Gerd Hoffmann , Jordan Justen , Brijesh Singh , James Bottomley , Jiewen Yao , Tom Lendacky Content-Type: text/plain; charset="UTF-8" On Mon, Aug 30, 2021 at 5:35 AM 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: > + ; > + ; In Td guest, BSP/AP shares the same entry point > + ; BSP builds up the page table, while APs shouldn't do the same task. > + ; Instead, APs just leverage the page table which is built by BSP. > + ; APs will wait until the page table is ready. > + ; > +TdxApWait: > + cmp byte[TDX_WORK_AREA_PGTBL_READY], 0 > + je TdxApWait > + jmp ExitInitTdxWorkarea Don't we need memory fence before je TdxApWait > +; Check TDX features, Non-TDX or TDX-BSP or TDX-APs? > +; > +; By design TDX BSP is reponsible for inintializing the PageTables. s/reponsible/responsible s/inintializing/initializing