All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Alex Williamson
	<alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	chegu_vinod-VXdhtT5mjnY@public.gmane.org,
	qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/2] vfio: Provide module option to disable vfio_iommu_type1 hugepage support
Date: Tue, 28 May 2013 12:42:14 -0400	[thread overview]
Message-ID: <20130528164214.GC6073@phenom.dumpdata.com> (raw)
In-Reply-To: <20130528162637.28848.76733.stgit-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>

On Tue, May 28, 2013 at 10:27:52AM -0600, Alex Williamson wrote:
> Add a module option to vfio_iommu_type1 to disable IOMMU hugepage
> support.  This causes iommu_map to only be called with single page
> mappings, disabling the IOMMU driver's ability to use hugepages.
> This option can be enabled by loading vfio_iommu_type1 with
> disable_hugepages=1 or dynamically through sysfs.  If enabled
> dynamically, only new mappings are restricted.
> 
> Signed-off-by: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---

> 
> As suggested by Konrad.  This is cleaner to add as a follow-on
> 
>  drivers/vfio/vfio_iommu_type1.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> index 6654a7e..8a2be4e 100644
> --- a/drivers/vfio/vfio_iommu_type1.c
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -48,6 +48,12 @@ module_param_named(allow_unsafe_interrupts,
>  MODULE_PARM_DESC(allow_unsafe_interrupts,
>  		 "Enable VFIO IOMMU support for on platforms without interrupt remapping support.");
>  
> +static bool disable_hugepages;
> +module_param_named(disable_hugepages,
> +		   disable_hugepages, bool, S_IRUGO | S_IWUSR);
> +MODULE_PARM_DESC(disable_hugepages,
> +		 "Disable VFIO IOMMU support for IOMMU hugepages.");
> +
>  struct vfio_iommu {
>  	struct iommu_domain	*domain;
>  	struct mutex		lock;
> @@ -270,6 +276,11 @@ static long vfio_pin_pages(unsigned long vaddr, long npage,
>  		return -ENOMEM;
>  	}
>  
> +	if (unlikely(disable_hugepages)) {
> +		vfio_lock_acct(1);
> +		return 1;
> +	}
> +
>  	/* Lock all the consecutive pages from pfn_base */
>  	for (i = 1, vaddr += PAGE_SIZE; i < npage; i++, vaddr += PAGE_SIZE) {
>  		unsigned long pfn = 0;
> 

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	chegu_vinod@hp.com
Subject: Re: [PATCH 3/2] vfio: Provide module option to disable vfio_iommu_type1 hugepage support
Date: Tue, 28 May 2013 12:42:14 -0400	[thread overview]
Message-ID: <20130528164214.GC6073@phenom.dumpdata.com> (raw)
In-Reply-To: <20130528162637.28848.76733.stgit@bling.home>

On Tue, May 28, 2013 at 10:27:52AM -0600, Alex Williamson wrote:
> Add a module option to vfio_iommu_type1 to disable IOMMU hugepage
> support.  This causes iommu_map to only be called with single page
> mappings, disabling the IOMMU driver's ability to use hugepages.
> This option can be enabled by loading vfio_iommu_type1 with
> disable_hugepages=1 or dynamically through sysfs.  If enabled
> dynamically, only new mappings are restricted.
> 
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---

> 
> As suggested by Konrad.  This is cleaner to add as a follow-on
> 
>  drivers/vfio/vfio_iommu_type1.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> index 6654a7e..8a2be4e 100644
> --- a/drivers/vfio/vfio_iommu_type1.c
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -48,6 +48,12 @@ module_param_named(allow_unsafe_interrupts,
>  MODULE_PARM_DESC(allow_unsafe_interrupts,
>  		 "Enable VFIO IOMMU support for on platforms without interrupt remapping support.");
>  
> +static bool disable_hugepages;
> +module_param_named(disable_hugepages,
> +		   disable_hugepages, bool, S_IRUGO | S_IWUSR);
> +MODULE_PARM_DESC(disable_hugepages,
> +		 "Disable VFIO IOMMU support for IOMMU hugepages.");
> +
>  struct vfio_iommu {
>  	struct iommu_domain	*domain;
>  	struct mutex		lock;
> @@ -270,6 +276,11 @@ static long vfio_pin_pages(unsigned long vaddr, long npage,
>  		return -ENOMEM;
>  	}
>  
> +	if (unlikely(disable_hugepages)) {
> +		vfio_lock_acct(1);
> +		return 1;
> +	}
> +
>  	/* Lock all the consecutive pages from pfn_base */
>  	for (i = 1, vaddr += PAGE_SIZE; i < npage; i++, vaddr += PAGE_SIZE) {
>  		unsigned long pfn = 0;
> 

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: iommu@lists.linux-foundation.org, chegu_vinod@hp.com,
	qemu-devel@nongnu.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/2] vfio: Provide module option to disable vfio_iommu_type1 hugepage support
Date: Tue, 28 May 2013 12:42:14 -0400	[thread overview]
Message-ID: <20130528164214.GC6073@phenom.dumpdata.com> (raw)
In-Reply-To: <20130528162637.28848.76733.stgit@bling.home>

On Tue, May 28, 2013 at 10:27:52AM -0600, Alex Williamson wrote:
> Add a module option to vfio_iommu_type1 to disable IOMMU hugepage
> support.  This causes iommu_map to only be called with single page
> mappings, disabling the IOMMU driver's ability to use hugepages.
> This option can be enabled by loading vfio_iommu_type1 with
> disable_hugepages=1 or dynamically through sysfs.  If enabled
> dynamically, only new mappings are restricted.
> 
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---

> 
> As suggested by Konrad.  This is cleaner to add as a follow-on
> 
>  drivers/vfio/vfio_iommu_type1.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> index 6654a7e..8a2be4e 100644
> --- a/drivers/vfio/vfio_iommu_type1.c
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -48,6 +48,12 @@ module_param_named(allow_unsafe_interrupts,
>  MODULE_PARM_DESC(allow_unsafe_interrupts,
>  		 "Enable VFIO IOMMU support for on platforms without interrupt remapping support.");
>  
> +static bool disable_hugepages;
> +module_param_named(disable_hugepages,
> +		   disable_hugepages, bool, S_IRUGO | S_IWUSR);
> +MODULE_PARM_DESC(disable_hugepages,
> +		 "Disable VFIO IOMMU support for IOMMU hugepages.");
> +
>  struct vfio_iommu {
>  	struct iommu_domain	*domain;
>  	struct mutex		lock;
> @@ -270,6 +276,11 @@ static long vfio_pin_pages(unsigned long vaddr, long npage,
>  		return -ENOMEM;
>  	}
>  
> +	if (unlikely(disable_hugepages)) {
> +		vfio_lock_acct(1);
> +		return 1;
> +	}
> +
>  	/* Lock all the consecutive pages from pfn_base */
>  	for (i = 1, vaddr += PAGE_SIZE; i < npage; i++, vaddr += PAGE_SIZE) {
>  		unsigned long pfn = 0;
> 

  parent reply	other threads:[~2013-05-28 16:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24 17:24 [PATCH 0/2] vfio: type1 iommu hugepage support Alex Williamson
2013-05-24 17:24 ` [Qemu-devel] " Alex Williamson
2013-05-24 17:24 ` Alex Williamson
     [not found] ` <20130524171613.14229.84050.stgit-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-05-24 17:24   ` [PATCH 1/2] vfio: Convert type1 iommu to use rbtree Alex Williamson
2013-05-24 17:24     ` [Qemu-devel] " Alex Williamson
2013-05-24 17:24     ` Alex Williamson
2013-05-24 17:24   ` [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1 Alex Williamson
2013-05-24 17:24     ` [Qemu-devel] " Alex Williamson
2013-05-24 17:24     ` Alex Williamson
     [not found]     ` <20130524172438.14229.59476.stgit-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-05-25 11:20       ` Konrad Rzeszutek Wilk
2013-05-25 11:20         ` [Qemu-devel] " Konrad Rzeszutek Wilk
2013-05-25 11:20         ` Konrad Rzeszutek Wilk
     [not found]         ` <20130525112009.GC2418-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2013-05-25 14:23           ` Alex Williamson
2013-05-25 14:23             ` [Qemu-devel] " Alex Williamson
2013-05-25 14:23             ` Alex Williamson
2013-05-27  8:41       ` Sethi Varun-B16395
2013-05-27  8:41         ` [Qemu-devel] " Sethi Varun-B16395
2013-05-27  8:41         ` Sethi Varun-B16395
     [not found]         ` <C5ECD7A89D1DC44195F34B25E172658D552685-RL0Hj/+nBVDYdknt8GnhQq4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-05-27 13:37           ` Alex Williamson
2013-05-27 13:37             ` [Qemu-devel] " Alex Williamson
2013-05-27 13:37             ` Alex Williamson
2013-05-25 11:21   ` [PATCH 0/2] vfio: type1 iommu hugepage support Konrad Rzeszutek Wilk
2013-05-25 11:21     ` [Qemu-devel] " Konrad Rzeszutek Wilk
2013-05-25 11:21     ` Konrad Rzeszutek Wilk
     [not found]     ` <20130525112153.GD2418-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2013-05-25 14:39       ` Alex Williamson
2013-05-25 14:39         ` [Qemu-devel] " Alex Williamson
2013-05-25 14:39         ` Alex Williamson
2013-05-28 16:27   ` [PATCH 3/2] vfio: Provide module option to disable vfio_iommu_type1 " Alex Williamson
2013-05-28 16:27     ` [Qemu-devel] " Alex Williamson
2013-05-28 16:27     ` Alex Williamson
     [not found]     ` <20130528162637.28848.76733.stgit-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-05-28 16:42       ` Konrad Rzeszutek Wilk [this message]
2013-05-28 16:42         ` [Qemu-devel] " Konrad Rzeszutek Wilk
2013-05-28 16:42         ` Konrad Rzeszutek Wilk
2013-05-31  2:33     ` Chegu Vinod
2013-05-31  2:33       ` [Qemu-devel] " Chegu Vinod
2013-05-31  2:33       ` Chegu Vinod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130528164214.GC6073@phenom.dumpdata.com \
    --to=konrad.wilk-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=chegu_vinod-VXdhtT5mjnY@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.