[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert
- To: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
- From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
- Date: Fri, 1 Nov 2019 19:17:27 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none
- 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-SenderADCheck; bh=1vzaubDtUDNP/lIo74ytTn2jiceW13gp+6YIJsrIIhA=; b=XcawuRoZ8Eyr1QvyOAX64OEyWdHeveZRZgRBmVMuJs3rCwIORJwVE2OJ5yP5EqtLCVP6hXKfYdb6UiSo92ybKut2eXtcqnlecjNV4Uz6HjaqQLcnZJgyDv9sLj56DdkL1sZYb9J4At6xvPWdOLKqT2f6GyKrlrsd5bQOK/b9CUWrnGlb9GXugFBqX+gqmf56F0a/udLNPh/GCLD1keeN5D8hNxhN/wK07+ZJrsfeH0Ccx4jbNFg/4b9Ep7uEXwCBHiI/xlIshGDSWGIwWCSW+t9dIemtALOWCvUz+FSOm2Taa3uJngZUTrrLws+ZAs9S7l4+0re0UIyPOAZOH2bb9g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L7aRjwc6kVYlnjJg0Ay/cisXSCZAkhS4snLwk92bt9BQSVIsZJJvzcFLRYkDHBIRuxpCaAqV2Yl553WuhbdaY0rDUp7VuYlwaKw5R/xHoflvztChddAZZnmK94Iwumvi+xAYvxFvVtSgaHeLuY+KTHWnYXq10Or+VfIyA9nLmIAAgSyCAQfCuCtRxtEY66QWOtUubLPxAqiybfO3oTJrUiN0HW2B0nb2yHZanMs0dnxjGZrWTdWuMqK0rQGRsFh0RDaSTwnw82rAGNXOIhlm9q2xKs2U5upHxcJfYZYUeGGX6aBldYmqxLJfNlc0ck3eRssk2wYUF34AkqypIjktFA==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=jgg@xxxxxxxxxxxx;
- Cc: Juergen Gross <jgross@xxxxxxxx>, David Zhou <David1.Zhou@xxxxxxx>, Ralph Campbell <rcampbell@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, "linux-rdma@xxxxxxxxxxxxxxx" <linux-rdma@xxxxxxxxxxxxxxx>, John Hubbard <jhubbard@xxxxxxxxxx>, "Felix.Kuehling@xxxxxxx" <Felix.Kuehling@xxxxxxx>, Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx>, "dri-devel@xxxxxxxxxxxxxxxxxxxxx" <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, "linux-mm@xxxxxxxxx" <linux-mm@xxxxxxxxx>, Jerome Glisse <jglisse@xxxxxxxxxx>, "amd-gfx@xxxxxxxxxxxxxxxxxxxxx" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, "nouveau@xxxxxxxxxxxxxxxxxxxxx" <nouveau@xxxxxxxxxxxxxxxxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>, Petr Cvek <petrcvekcz@xxxxxxxxx>, Christian König <christian.koenig@xxxxxxx>, Ben Skeggs <bskeggs@xxxxxxxxxx>
- Delivery-date: Fri, 01 Nov 2019 19:17:32 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVjcvKV253DVP8r0WB5NYgPgZcBadzahyAgAMzaQCAABG1AIAAByiA
- Thread-topic: [PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert
On Fri, Nov 01, 2019 at 02:51:46PM -0400, Boris Ostrovsky wrote:
> On 11/1/19 1:48 PM, Jason Gunthorpe wrote:
> > On Wed, Oct 30, 2019 at 12:55:37PM -0400, Boris Ostrovsky wrote:
> >> On 10/28/19 4:10 PM, Jason Gunthorpe wrote:
> >>> From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >>>
> >>> gntdev simply wants to monitor a specific VMA for any notifier events,
> >>> this can be done straightforwardly using mmu_range_notifier_insert() over
> >>> the VMA's VA range.
> >>>
> >>> The notifier should be attached until the original VMA is destroyed.
> >>>
> >>> It is unclear if any of this is even sane, but at least a lot of duplicate
> >>> code is removed.
> >> I didn't have a chance to look at the patch itself yet but as a heads-up
> > Thanks Boris. I spent a bit of time and got a VM running with a xen
> > 4.9 hypervisor and a kernel with this patch series. It a ubuntu bionic
> > VM with the distro's xen stuff.
> >
> > Can you give some guidance how you made it crash?
>
> It crashes trying to dereference mrn->ops->invalidate in
> mn_itree_invalidate() when a guest exits.
>
> I don't think you've initialized notifier ops. I don't see you using
> gntdev_mmu_ops anywhere.
So weird the compiler didn't complain about an unused static...
But yes, this is a mistake, it should be:
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 37b278857ad807..0ca35485fd3865 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -1011,6 +1011,7 @@ static int gntdev_mmap(struct file *flip, struct
vm_area_struct *vma)
if (use_ptemod) {
map->vma = vma;
+ map->notifier.ops = &gntdev_mmu_ops;
err = mmu_range_notifier_insert_locked(
&map->notifier, vma->vm_start,
vma->vm_end - vma->vm_start, vma->vm_mm);
Thanks,
Jason
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|