From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.94534.1679637641374533517 for ; Thu, 23 Mar 2023 23:00:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JTbKRgQZ; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: dun.tan@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679637655; x=1711173655; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Swl2keEfb/8L9XH+NR4+jQb+7OothqTGC+LUzGzuyyY=; b=JTbKRgQZGzYu8d4C82Q7WtiuSGzQHivBvxL1WgZYxIOAkkYnbAxkKIn0 jYcUNNbMQ7WWBX6YFGqga02ilMR/aAUjGuECa3WrspvIlcE83OBN2czyh 5/pjiSLTGZLgm05hgiwtuglJX4IvUe5VlzhxOSvjphwmDlNEoYjJao0EU jv85XEDYCCuyie7rLCxwdlOmVSvJ8D9taqfkY9rwlXrDqWMdPnmUBdNbW P+q3SWygi/okh0T0+iHK8EheJ/vhd7Cu/sxMxFxcrdbIi/TgL3N/5lGgs DW6fslmT/0Bs8V3aRqCNbUx9JhHl8hbnruWV9I9Nn9SxmqDtkpwJlcKDz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="320093950" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="320093950" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 23:00:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="1012122101" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="1012122101" Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.92]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 23:00:54 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann Subject: [Patch V5 11/22] UefiCpuPkg/CpuPageTableLib: Add LastMapEntry pointer Date: Fri, 24 Mar 2023 14:00:09 +0800 Message-Id: <20230324060020.940-12-dun.tan@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: <20230324060020.940-1-dun.tan@intel.com> References: <20230324060020.940-1-dun.tan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add LastMapEntry pointer to replace MapEntrys->Maps[MapsIndex] in SingleMapEntryTest () of RandomTest. Signed-off-by: Dun Tan Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann --- UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.c b/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.c index 52eb9daa10..612fddcee0 100644 --- a/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.c +++ b/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.c @@ -621,10 +621,12 @@ SingleMapEntryTest ( UINTN Level; UINT64 Value; UNIT_TEST_STATUS TestStatus; + MAP_ENTRY *LastMapEntry; MapsIndex = MapEntrys->Count; GenerateSingleRandomMapEntry (MaxAddress, MapEntrys); + LastMapEntry = &MapEntrys->Maps[MapsIndex]; PageTableBufferSize = 0; Status = PageTableMap ( @@ -632,10 +634,10 @@ SingleMapEntryTest ( PagingMode, NULL, &PageTableBufferSize, - MapEntrys->Maps[MapsIndex].LinearAddress, - MapEntrys->Maps[MapsIndex].Length, - &MapEntrys->Maps[MapsIndex].Attribute, - &MapEntrys->Maps[MapsIndex].Mask + LastMapEntry->LinearAddress, + LastMapEntry->Length, + &LastMapEntry->Attribute, + &LastMapEntry->Mask ); if (PageTableBufferSize != 0) { UT_ASSERT_EQUAL (Status, RETURN_BUFFER_TOO_SMALL); @@ -651,10 +653,10 @@ SingleMapEntryTest ( PagingMode, Buffer, &PageTableBufferSize, - MapEntrys->Maps[MapsIndex].LinearAddress, - MapEntrys->Maps[MapsIndex].Length, - &MapEntrys->Maps[MapsIndex].Attribute, - &MapEntrys->Maps[MapsIndex].Mask + LastMapEntry->LinearAddress, + LastMapEntry->Length, + &LastMapEntry->Attribute, + &LastMapEntry->Mask ); } -- 2.31.1.windows.1