From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.72226.1679577327246126723 for ; Thu, 23 Mar 2023 06:15:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=B00XMMG7; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679577327; x=1711113327; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=bdbRDyfCszQ3x5BKVsDBN4WkowHTAdT+O8FbpHAj274=; b=B00XMMG7f/PRprvidygprw/cQSmVDzecZAF4XyEZDm/C6oFii23H1IkP GVd2bhmp+X64egGOoZIEnp0VrXeaYp3wmGn4xp/MNO3KiZI60TJxHDsdT x8OEMnYyNqlLIioISau6hpMmUETx2GxO6AVHN7uDyylOretcVHAy5yA2A dELZLobwhwfy3N2O/niqAcWXEOOShIAFsqaqlLQqdYe+sEL3bDUtoxOfb OrNnYHvJ5S1uZ7guGKNPI2tNnZSyg7jPfMM+qC7NKxiJLlWumPN/gPUeW rNv/CqT1jQnst9fkT9zKO+p+I4tsdJkAQDz+xrelBV84fCUsm7iqDPt9I Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="319139081" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="319139081" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 06:11:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="928227264" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="928227264" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 23 Mar 2023 06:11:57 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 23 Mar 2023 06:11:57 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 23 Mar 2023 06:11:56 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Thu, 23 Mar 2023 06:11:56 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Thu, 23 Mar 2023 06:11:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bT7MI3gF2xC4sWKATgvq77MQDcfhx6SyzZwt2rFBEn0RuY5iJb2vHZrfuhb++j69s/F4G7ZYCXze55JRU8HdVB1du3ObgPWt9tPP50XMgRMOwe0mXJMmDsoVGwNsBdwIfIvam5Ubf4QyAhlV6+MHQLqbXa9w9WshjtFhjbCfarlNqp7DDxbtdDllzN7ZEu0U0TyqJVD/w89uvGBojuFXe6w/RMHMcE5S5hXGttsIEk8xmRQmOuGRYVReCISUfSXnhZyjuTkNpy97VSmYXYqYkBjQO1GjSB5SHpzIwuujU83fvybUUEOKyolDo4ZjAYE1mFf78S23mTxC953cRqMWUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lLocalUOfUEpuFFIjT2mBYSkAdJNAoOIpshTQZ+GVdY=; b=GEy5raf+Pxtmk9HiMP//rQqAYs9Qb11ElkagDHXVF0/RTdP9bQ83NLKCioiXjlX1bUPg2o4hiy8rlmrbiePBee61/pSbik1GVy9qAt6V/9XfvPVmn1z6qcp/TX46EsUY7zTBRN2gzHGdY+loxL6Blq7mR1WW7fXaqYk32FzMREVNmO/jlAmKl8TEZl/Jf2ecT4oNYE4arNoZDqET/PlNCaN+v4BdRTMh9VYV4Okx07d3FymDt7AFJfA1f/XwMBTpucMT4SDOQK1IL/Jg/fqRwsC6oaruX4r6mYygx4p65Z0/W3ytTS50U+EMwQU8jS/vD80oMPOJ5kpt1HXcjSyp7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by MN2PR11MB4551.namprd11.prod.outlook.com (2603:10b6:208:269::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 13:11:54 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69%7]) with mapi id 15.20.6178.037; Thu, 23 Mar 2023 13:11:54 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann , "Liu, Zhiguang" Subject: Re: [Patch V4 11/21] UefiCpuPkg/CpuPageTableLib:Modify RandomTest to check Mask/Attr Thread-Topic: [Patch V4 11/21] UefiCpuPkg/CpuPageTableLib:Modify RandomTest to check Mask/Attr Thread-Index: AQHZXVrsLW4NryXAA06/dMshlPGh9a8IVm6A Date: Thu, 23 Mar 2023 13:11:54 +0000 Message-ID: References: <20230323074057.549-1-dun.tan@intel.com> <20230323074057.549-12-dun.tan@intel.com> In-Reply-To: <20230323074057.549-12-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|MN2PR11MB4551:EE_ x-ms-office365-filtering-correlation-id: 2cbc4fee-6be9-49d6-a4ca-08db2ba02cb3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8RwU7lucgftLgapq6qHeXE1ZgHw7wJ1BK1nOkMcJWNdaGjAMmtq/dYEinr6OvF6smQpvkIkPppCV60zaI/IG0nrm7nH6iDkKYxkvBDCOcC1LamlYME8/mbXp+RJDEyqxEGTzr6BvP2s32UIUBuOYvi0ykAz0EZWpXoA7+HS77ZkKGhFUJtOT9kvH7ht4QGAfYoCjewE4DB19rIpbLjM3Q30RvS2uDjSEvb+Kjp4IPTH598IuBOEc9xH9oPnBN66QfTWwdduBmMLTHeQZPVdwrYdnhqe8A8iBZEIHIRLQANENWlHmToIOxbNWPpjTI46OrmAqWqvWl6fUkehrFihulBgZ5aSW0asjDn2pCSV50dGLHsF18SKNd8YItEHTXy7aFN1Chad7BTe2lB5LhZeqinMdjUoTx0nUvH12wute5Y8m34OQyots72hZ794XpKrQ74oTDGsyQrPFHUcnSBQGnF2yL6UeAZx8if+dtDC5mx2yEkkbaen9qGQeHqUj7WOp2jvnKpC8nSxNYksvvFHIfK5rLJCs6f8oBuohZGdbR7OU3CnI1vXfsEyEhybEZ2NyhWWXbz7Yycsixud4qAS7pOY5pOTebvlnw8X9/mKgYbsYIz1UhyOYKuaPBbOqQeuFCmi1zBaNe8I81f8V00uYGuXnlV8NLF3qe2FulaTRmw5q9fZsMqptxtLZj1IIOM886mFAsN6BEbdxozcJP+HisQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(366004)(376002)(396003)(39860400002)(136003)(451199018)(76116006)(8676002)(66476007)(66556008)(4326008)(64756008)(66446008)(66946007)(110136005)(316002)(54906003)(5660300002)(122000001)(41300700001)(82960400001)(52536014)(53546011)(6506007)(8936002)(107886003)(26005)(9686003)(186003)(83380400001)(478600001)(7696005)(71200400001)(86362001)(33656002)(55016003)(38100700002)(38070700005)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ALfRM9zFUhKkmbdql/k5ftedlVdyPoq5svpEdKPPiru0tLI22ohOFaHYyBuo?= =?us-ascii?Q?6cp8u7TldTQ0Bm89dH5yC5v1DAuZfdXU2kf4Y/wJALdHCkS5NRvsfhbBhXTb?= =?us-ascii?Q?gGz6WCh6dKvwoNBq/Vq3WRZs52dUEQcpYarP2IDaVqfUBiZi9U3DjfbCWLJ9?= =?us-ascii?Q?jubPySq6t4zmVCOSw4qYR+HBLoDOZtG1Zf9Je/lBGH2/CgRnpf7ZYV/TYNJa?= =?us-ascii?Q?8OJ4LEZNhNR13UukDXlAd0wYloyhNDPw0elaIuMNvgIxjqzDVS2+wsYvSfP3?= =?us-ascii?Q?IhIu+2tNeKWGyfAUbMCjuBOZnkHH4XAEZMMp7jyNvlGWtZd58IdAxLHjTMmS?= =?us-ascii?Q?mjjtsEwZ3KZtbpp696XbpUpAGlVlydxs/vcN8ZdtmFj1dgxqAsC/dP04L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tWBlG/D2+Gb4KwttW2jIyATLvA01HT8MgqP9NgwX1bQLTVa3vxACW/?= =?us-ascii?Q?9u7haTHVg2XJzlg/y8TwFIKgfEu2GXU7TKZbHlN6DIea9apQTtmvn8XmfE77?= =?us-ascii?Q?EicvOcIYXfomEJiwIxqHqqxrdewUKTN94hAFQg4c65im3ulL45jmCf8px5d5?= =?us-ascii?Q?M2xhPvmzdX+eOzBZXXb+/mnt47vbH5EDu3lyMCmeZtzqSmEY3BN2vstKnW2u?= =?us-ascii?Q?xF0yIt1gYEGvFAJa8+AvHVMeMcLGN18lyWtGRZL+vGULn8r8GMAN11nhYIzC?= =?us-ascii?Q?gPpRrBeuYGOdzAa2Mc/FH2g9AyJbG/3f3IWCti41?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cbc4fee-6be9-49d6-a4ca-08db2ba02cb3 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2023 13:11:54.7164 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yeB9ToPyf992EFIN/9igFLjrqo4225iVSdeXep8pHYbIhlgUJWn6P0Qb6KaDNTWa8+qwLUM0wT7Lxq4R7Gd5GA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4551 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Tan, Dun > Sent: Thursday, March 23, 2023 3:41 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Kumar, > Rahul R ; Gerd Hoffmann ; > Liu, Zhiguang > Subject: [Patch V4 11/21] UefiCpuPkg/CpuPageTableLib:Modify RandomTest > to check Mask/Attr >=20 > Modify RandomTest to check invalid input. When creating new page > table or updating exsiting page table: > 1.If set [LinearAddress, LinearAddress+Length] to non-preset, all 1. "non-present" > + // > + if (MapEntrys->Maps[MapsIndex].Length > 0) { > + for (Index =3D 0; Index < MapCount; Index++) { > + if ((PreviousAddress < Map[Index].LinearAddress) && > + (MapEntrys->Maps[MapsIndex].LinearAddress < > Map[Index].LinearAddress) && (RangeLimit > PreviousAddress)) > + { > + // > + // MapEntrys->Maps[MapsIndex] contains not-present range in > exsiting page table. > + // > + break; > + } > + > + PreviousAddress =3D Map[Index].LinearAddress + Map[Index].Length; > + } > + > + if (PreviousAddress < RangeLimit) { 2. can you use "if (Index < MapCount)"?