From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.web11.1837.1631322942823797007 for ; Fri, 10 Sep 2021 18:15:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=rfxyR5RS; spf=pass (domain: google.com, ip: 209.85.216.53, mailfrom: erdemaktas@google.com) Received: by mail-pj1-f53.google.com with SMTP id t20so2501534pju.5 for ; Fri, 10 Sep 2021 18:15:42 -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=oQ2LcSQBocq+i8oP+mVoByY5xNNc6n2USkVlKk/DTeg=; b=rfxyR5RSiPMaJDNsZGYlx8U/YeJCyxQt/QCTi47FIxLkULtHMUmJ+qO93/NGNsydSZ EwR1H9TgM8w0+q+YZQB7N33r6FR16L/1N1LmiBzplze6SzK5OwqVSWBH8ap56P2rWLhX 3JOwW4dfCUux6XOfETPbMS2E6Chb1XsQYGu/51I1E1HyWhfXKj58bmn1m60ahVGqsMMm 8dlUQxYg25aNg+hRs3uA/WdiOwgfTCd9MkhxI28rI+lylbbdTa2iKNQEzHCxoYiQ3kq3 2BC4oxmvq6iZ44PRu5iHv62ICZjMsumzj2P9nBIlA16YvMAlpQemO37eEniZ3zzi79E/ 4ZhA== 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=oQ2LcSQBocq+i8oP+mVoByY5xNNc6n2USkVlKk/DTeg=; b=ep/i5xFlYKOZn+4PpcVq7XjfvfzPx65MSM9A5LAAuPh/gOdMXPNFeRHJG281vf+7Qn pxFoy90YNMkXhCC995vUp0q+1pk3bnJ54qxaxU9f9dxYHNxTQLJXEVG5DDzkrj9l1apB DYX0CCz8yTaBTuk21fUHIbWJGsJ8hUudv81DgsRHBDwKh4GwPYFtAq0rc4g4yax1huJl ttni6BnkwaGwLx/Jr/OTbd8yvOiOPlqovetF6Mncd0GjnD9bOzCkY3XPZfUuEQkcc/kZ Lugki720RkuTkzlgmq5Cc8TEOoXjmhFv3jyIc54cNRU0qao/GXBpFexBWm3RfEX34fAC q4Eg== X-Gm-Message-State: AOAM530O9Z9Ha1XWB5YGFY0B6rAGoG0Kwya2Bca6G9uyFOusNm/54pBu KC8iSIZ+gQYbNn5M3C5D5mhHy9Y1pTDUB0FDvr8/Bw== X-Google-Smtp-Source: ABdhPJxJL5K6jFSAehKUQVe8JW/0a0BbVzm7+CG5RWD6BofRge/5f4uzxMVrs+HB+Aka+FbjKeYqeiBKKshoU+h5cKg= X-Received: by 2002:a17:90a:1b2a:: with SMTP id q39mr433328pjq.219.1631322942166; Fri, 10 Sep 2021 18:15:42 -0700 (PDT) MIME-Version: 1.0 References: <8f56e6f50477bf00d5121e6515388fe68525b1e2.1628767741.git.min.m.xu@intel.com> In-Reply-To: <8f56e6f50477bf00d5121e6515388fe68525b1e2.1628767741.git.min.m.xu@intel.com> From: "Erdem Aktas" Date: Sat, 11 Sep 2021 04:15:30 +0300 Message-ID: Subject: Re: [PATCH 07/23] MdePkg: Update BaseIoLibIntrinsicSev to support Tdx To: Min Xu Cc: edk2-devel-groups-io , Michael D Kinney , Liming Gao , Zhiguang Liu , 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: > +UINT8 > +EFIAPI > +TdMmioRead8 ( > + IN UINTN Address > + ) > +{ > + UINT64 Value; > + UINT64 Status; > + > + Address |= TdSharedPageMask (); Why is the SharedBit set? VMM does not care if the sharedbit is set. Actually it should not even be aware of it. > + MemoryFence (); > + Status = TdVmCall (TDVMCALL_MMIO, TDVMCALL_ACCESS_SIZE_1, TDVMCALL_ACCESS_READ, Address, 0, &Value); > + if (Status != 0) { So for some reason, MMIO read fails, we are doing a memory read. Why should an MMIO read fail? Could you elaborate which use case this covers?