On 2021/6/5 05:40, Sean Christopherson wrote:
On Fri, Jun 04, 2021, Lai Jiangshan wrote:
@@ -326,6 +335,7 @@ static pt_element_t ac_test_alloc_pt(ac_pool_t *pool)
{
pt_element_t ret = pool->pt_pool + pool->pt_pool_current;
pool->pt_pool_current += PAGE_SIZE;
+ memset(va(ret), 0, PAGE_SIZE);
Should this go in a separate patch? This seems like a bug fix.
I don't think we need to separate the patch. It is a patch for the testing
repository in which there is no real bug.
I prefer to add the test in a single patch with everything the test needs.
return ret;
}
+static int check_effective_sp_permissions(ac_pool_t *pool)
+{
+ unsigned long ptr1 = 0x123480000000;
+ unsigned long ptr2 = ptr1 + 2 * 1024 * 1024;
+ unsigned long ptr3 = ptr1 + 1 * 1024 * 1024 * 1024;
+ unsigned long ptr4 = ptr3 + 2 * 1024 * 1024;
I belatedly remembered we have SZ_2M and SZ_1G, I think we can use those here
instead of open coding the math.
Will do.
Thanks
Lai