Re: [PATCH v8 10/14] KVM: selftests: aarch64: Add aarch64/page_fault_test

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

 



On Mon, Sep 26, 2022, Ricardo Koller wrote:
> On Thu, Sep 22, 2022 at 07:32:42PM +0000, Sean Christopherson wrote:
> > On Thu, Sep 22, 2022, Ricardo Koller wrote:
> > > +	void *hva = (void *)region->region.userspace_addr;
> > > +	uint64_t paging_size = region->region.memory_size;
> > > +	int ret, fd = region->fd;
> > > +
> > > +	if (fd != -1) {
> > > +		ret = fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> > > +				0, paging_size);
> > > +		TEST_ASSERT(ret == 0, "fallocate failed, errno: %d\n", errno);
> > > +	} else {
> > > +		if (is_backing_src_hugetlb(region->backing_src_type))
> > > +			return false;
> > 
> > Why is hugetlb disallowed?  I thought anon hugetlb supports MADV_DONTNEED?
> > 
> 
> It fails with EINVAL (only tried on arm) for both the PAGE_SIZE and the huge
> page size. And note that the address is aligned as well.
> 
> madvise(0xffffb7c00000, 2097152, MADV_DONTNEED) = -1 EINVAL (Invalid argument)
> 	^^^^^^^^^^^^^^	^^^^^^^
> 	2M aligned	2M (hugepage size)
> 			
> madvise(0xffff9e800000, 4096, MADV_DONTNEED) = -1 EINVAL (Invalid argument)   
> 			^^^^
> 			PAGE_SIZE

I think this needs to be root caused before merging.  Unless I'm getting turned
around, MADV_DONTEED should work, i.e. there is a test bug lurking somewhere.



[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