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.11547.1679312560277723237 for ; Mon, 20 Mar 2023 04:42:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZjM9SKGB; 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=1679312558; 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=GJaFE4GAyaV90gRvJ3qmpIJVwQw7Mb47Wu3xzcrnVFQ=; b=ZjM9SKGB+h07g72iGsaPhduVtwtulTKENycrqTGU1hStGGu/tYSh4HqRNByV15szxhga65 Lm5osbknqbHdq/XptqYzC4m7Yy7C6VPjorWwUJEY3bBPtAOqZZFAFHaYvED7KexBwlS/L7 Vw3vfPQ7meUJXcdgT1UKmFHxgWPRqX4= 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-653-biUHUO73MSyIvOoY-eh6oA-1; Mon, 20 Mar 2023 07:42:35 -0400 X-MC-Unique: biUHUO73MSyIvOoY-eh6oA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BACD800045; Mon, 20 Mar 2023 11:42:35 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.144]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F8A52027047; Mon, 20 Mar 2023 11:42:35 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B58DE1800081; Mon, 20 Mar 2023 12:42:33 +0100 (CET) Date: Mon, 20 Mar 2023 12:42:33 +0100 From: "Gerd Hoffmann" To: Dun Tan Cc: devel@edk2.groups.io, Eric Dong , Ray Ni , Rahul Kumar Subject: Re: [Patch V3 07/18] UefiCpuPkg/CpuPageTableLib:Add check for Mask and Attr Message-ID: <20230320114233.uu4ppxygo7mghv7j@sirius.home.kraxel.org> References: <20230320053329.410-1-dun.tan@intel.com> <20230320053329.410-8-dun.tan@intel.com> MIME-Version: 1.0 In-Reply-To: <20230320053329.410-8-dun.tan@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 20, 2023 at 01:33:18PM +0800, Dun Tan wrote: > For different usage, check if the combination for Mask and > Attr is valid when creating or updating page table. > > 1.For non-present range > 1.1Mask.Present is 0 but some other attributes is provided. > This case is invalid. > 1.2Mask.Present is 1 and Attr.Present is 0. In this case,all > other attributes should not be provided. > 1.3Mask.Present is 1 and Attr.Present is 1. In this case,all > attributes should be provided to intialize the attribute. > > 2.For present range > 2.1Mask.Present is 1 and Attr.Present is 0.In this case, all > other attributes should not be provided. > All other usage for present range is permitted. > In the mentioned cases, 1.2 and 2.1 can be merged into 1 check. This patch breaks OVMF. Log tail: AP Loop Mode is 1 AP Vector: non-16-bit = 3EFCE000/447 GetMicrocodePatchInfoFromHob: MicrocodeBase = 0x0, MicrocodeSize = 0x0 WakeupBufferStart = 87000, WakeupBufferSize = DD AP Vector: 16-bit = 87000/39, ExchangeInfo = 87039/A4 CpuDxe: 5-Level Paging = 0 CPU[0000]: Microcode revision = 00000000, expected = 00000000 CPU[0001]: Microcode revision = 00000000, expected = 00000000 ASSERT /home/kraxel/projects/edk2/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c(65): Status == ((RETURN_STATUS)(0x8000000000000000ULL | (5))) take care, Gerd