Re: [kvm-unit-tests PATCH V2] x86: Add a test to check effective permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux