From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web12.36573.1599221342000526924 for ; Fri, 04 Sep 2020 05:09:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-Sl6HoLQDOVSzOGnzH6hhYg-1; Fri, 04 Sep 2020 08:09:00 -0400 X-MC-Unique: Sl6HoLQDOVSzOGnzH6hhYg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA34D18A2263; Fri, 4 Sep 2020 12:08:58 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-161.ams2.redhat.com [10.36.112.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5273B69CA3; Fri, 4 Sep 2020 12:08:56 +0000 (UTC) Subject: =?UTF-8?B?UmU6IOWbnuWkjTog5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYyXSBVZWZpQ3B1UGtnL01wSW5pdExpYjogQWRkIGNoZWNrIGZvciBDUjMvR0RUL0lEVC4=?= To: "Yao, Jiewen" , "devel@edk2.groups.io" , "vanjeff_919@hotmail.com" , "Dong, Eric" , "Ni, Ray" Cc: "Lou, Yun" References: <163188258B195C29.8972@groups.io> From: "Laszlo Ersek" Message-ID: <9eb66e77-4eca-d5de-e586-486e5855e39d@redhat.com> Date: Fri, 4 Sep 2020 14:08:56 +0200 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US On 09/04/20 13:48, Yao, Jiewen wrote: > Jeff > I think the CR3 should be managed by the CPU driver. And it should NOT be changed by other module during post phase without a clear contract. > > Since CPU driver managed the value (or DebugAgent managing it under contract), it should *always* be valid. I don’t see the value to check the value managed by the module itself, and return EFI_UNSUPPORTED. > > If CPU driver sets CR3 above 4G and sync it to AP, then it is a bug. > We should fix the CPU driver or MP Library to *make it always work*. > > There are multiple options. For example, the CPU driver can always set a dedicate CR3/GDT/IDT for AP (below 4G). Then no matter BSP state is changed, we can always wake up AP correctly with a pre-defined state. Syncing BSP state to AP just an implementation choice, it is not absolute necessary. > > In a system boot, the ability to wake up AP is very important. Especially when the BIOS transfers the state to OS, the BSP need wake up AP to put AP in a good state, such as protected mode with paging disabled. Without doing that, we may get random system crash during boot. > > If we really really want to do some check to ensure AP state is good, I would rather to prepare a dedicated known good state for AP and always use this known good state for AP wakeup. > Giving up and returning UNSUPPORTED is definitely NOT my preference. Should we audit the various AllocatePageTableMemory() function implementations in edk2? Or is there more stuff we need to look at? Thanks Laszlo