From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id CD5CA9417E1 for ; Thu, 21 Sep 2023 09:06:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=DlfKPwezr2SkUECQN3sbpHeR1O2SoJ+jdRghlclJmu4=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1695287168; v=1; b=wsyvmam8FNId9Igz3CZCylpCsNVOQMnIb8IaXG0wbVhnfD1cjrHC1FjJ4Ab/ivk2AFUNZkt4 kEEdQvw2E6T7LsbapuvRAR0VmiEjyA3G7RHWmLQqsBR12LV43ym44uRtPQzUBZ8APgrmgZQB1ct 757kvrSL04dt1nDgVaXDgsGc= X-Received: by 127.0.0.2 with SMTP id jDgZYY7687511x3qya26ZLzf; Thu, 21 Sep 2023 02:06:08 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.11769.1695287167602100893 for ; Thu, 21 Sep 2023 02:06:07 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DFC5861E45 for ; Thu, 21 Sep 2023 09:06:06 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F051C197C4 for ; Thu, 21 Sep 2023 09:06:06 +0000 (UTC) X-Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2c022ce8114so11064611fa.1 for ; Thu, 21 Sep 2023 02:06:06 -0700 (PDT) X-Gm-Message-State: bhlGjgjhhn8A0ORAspsBYpG0x7686176AA= X-Google-Smtp-Source: AGHT+IGFCy4QuSE51PzkLWd+lB2cak+KBvU/Hx5oq4psYWqwrGhHrdp2MPSklR0+/SO5aPUoIR72dumpUUPbwb/ssmA= X-Received: by 2002:a2e:8683:0:b0:2c0:9bd:c6f with SMTP id l3-20020a2e8683000000b002c009bd0c6fmr4556764lji.41.1695287164481; Thu, 21 Sep 2023 02:06:04 -0700 (PDT) MIME-Version: 1.0 References: <20230629100847.1132-1-dun.tan@intel.com> In-Reply-To: <20230629100847.1132-1-dun.tan@intel.com> From: "Ard Biesheuvel" Date: Thu, 21 Sep 2023 09:05:53 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [Patch V8 00/14] Subject: [Patch V8 00/14] Use CpuPageTableLib to create and update smm page table To: devel@edk2.groups.io, dun.tan@intel.com, Ray Ni , Michael Kinney Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=wsyvmam8; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Thu, 29 Jun 2023 at 10:09, duntan wrote: > > In the V8 patch set: > In 'OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry', I refined the commit message and added comments in the code around the areas being changed to explain this code change. > > Only resend the changed patch in OvmfPkg. The patch set has been reviewed-by > > Dun Tan (14): > OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry > MdeModulePkg: Remove other attribute protection in UnsetGuardPage > UefiCpuPkg: Use CpuPageTableLib to convert SMM paging attribute. This patch breaks SMM on IA32. !!!! IA32 Exception Type - 0E(#PF - Page-Fault) CPU Apic ID - 00000000 !!!! ExceptionData - 00000008 I:0 R:1 U:0 W:0 P:0 PK:0 SS:0 SGX:0 EIP - 07FF97A6, CS - 00000008, EFLAGS - 00000046 EAX - 07FF2400, ECX - 07FC5140, EDX - 06AD7120, EBX - FFFFFFFF ESP - 07FCCDB4, EBP - 07FCCF4C, ESI - 00000000, EDI - 00000000 DS - 00000020, ES - 00000020, FS - 00000020, GS - 00000020, SS - 00000020 CR0 - 8001003B, CR2 - 06AD713C, CR3 - 07FA5000, CR4 - 00000668 DR0 - 00000000, DR1 - 00000000, DR2 - 00000000, DR3 - 00000000 DR6 - FFFF0FF0, DR7 - 00000400 GDTR - 07FC3000 0000004F, IDTR - 07FC6000 000000FF LDTR - 00000000, TR - 00000040 FXSAVE_STATE - 07FC7D60 qemu: terminating on signal 2 This appears to be a result from the following code in UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c:SmmInitPageTable() @@ -31,7 +31,7 @@ SmmInitPageTable ( InitializeSpinLock (mPFLock); mPhysicalAddressBits = 32; mPagingMode = PagingPae; which seems to be the wrong paging mode. However, 'Paging32bit' is not actually supported by the library so changing it results in an ASSERT(): Patch page table start ... ASSERT_RETURN_ERROR (Status = Unsupported) ASSERT [PiSmmCpuDxeSmm] /home/ardb/build/edk2/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c(537): !(((INTN)(RETURN_STATUS)(Status)) < 0) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108937): https://edk2.groups.io/g/devel/message/108937 Mute This Topic: https://groups.io/mt/99847923/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-