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.129.124]) by mx.groups.io with SMTP id smtpd.web10.4483.1687170418046513172 for ; Mon, 19 Jun 2023 03:26:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HIfEKUD1; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687170417; 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=z7jKhlVd6KSICwrpuANBUU2jCXFjoA1N5IZHl3/2N7E=; b=HIfEKUD1e8rUSsDxzxI+LgYwd8CG00dYmZNEXBOnwVjultexWnxIuGaRQnePBAGE0Rqpj2 UZ531WhWTtb19cfswf+k+eTNNsh3+FP3xB5cXJnMTDsrDnNUeUXXKpeBUfoEfZJW4gZcZf WXguMrmpabfJ6/8dJJhYytIbeylyVHk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-c2BRTeceO2ux12K668EbIQ-1; Mon, 19 Jun 2023 06:26:55 -0400 X-MC-Unique: c2BRTeceO2ux12K668EbIQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 453EB80006E; Mon, 19 Jun 2023 10:26:55 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.194.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C684140E952; Mon, 19 Jun 2023 10:26:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9AD6F1807DCF; Mon, 19 Jun 2023 12:26:53 +0200 (CEST) Date: Mon, 19 Jun 2023 12:26:53 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, dun.tan@intel.com Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Tom Lendacky , Ray Ni Subject: Re: [edk2-devel] [Patch V5 01/14] OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry Message-ID: <6pm5wr2q4ykrl3n4rg5i2phxwbhsibuwntujezvjezanr2tvsy@7l7nzqqplmwe> References: <20230608022742.1292-1-dun.tan@intel.com> <20230608022742.1292-2-dun.tan@intel.com> MIME-Version: 1.0 In-Reply-To: <20230608022742.1292-2-dun.tan@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 08, 2023 at 10:27:29AM +0800, duntan wrote: > Remove code that apply AddressEncMask to non-leaf entry when split > smm page table by MemEncryptSevLib. In FvbServicesSmm driver, it > calls MemEncryptSevClearMmioPageEncMask to clear AddressEncMask > bit in page table for a specific range. In AMD SEV feature, this > AddressEncMask bit in page table is used to indicate if the memory > is guest private memory or shared memory. But all memory used by > page table are treated as encrypted regardless of encryption bit. > So remove the EncMask bit for smm non-leaf page table entry > doesn't impact AMD SEV feature. > If page split happens in the AddressEncMask bit clear process, > there will be some new non-leaf entries with AddressEncMask > applied in smm page table. When ReadyToLock, code in PiSmmCpuDxe > module will use CpuPageTableLib to modify smm page table. So > remove code to apply AddressEncMask for new non-leaf entries > since CpuPageTableLib doesn't consume the EncMask PCD. > > Signed-off-by: Dun Tan > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Tom Lendacky > Cc: Ray Ni Whole series: Tested-by: Gerd Hoffmann Acked-by: Gerd Hoffmann