All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tianyu Lan <ltykernel@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	hch@infradead.org, m.szyprowski@samsung.com,
	robin.murphy@arm.com, michael.h.kelley@microsoft.com,
	Tianyu Lan <Tianyu.Lan@microsoft.com>,
	iommu@lists.linux-foundation.org, linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org, vkuznets@redhat.com,
	brijesh.singh@amd.com, konrad.wilk@oracle.com,
	parri.andrea@gmail.com, thomas.lendacky@amd.com,
	"krish.sadhukhan@oracle.com" <krish.sadhukhan@oracle.com>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH V2 1/2] Swiotlb: Add swiotlb_alloc_from_low_pages switch
Date: Fri, 25 Feb 2022 22:28:54 +0800	[thread overview]
Message-ID: <a80a7efa-f15d-3649-f39f-c24820f9ef2b@gmail.com> (raw)
In-Reply-To: <40f91949-58fa-4be2-5b01-ea34dda58670@gmail.com>

On 2/23/2022 5:46 PM, Tianyu Lan wrote:
> 
> 
> On 2/23/2022 12:00 AM, Christoph Hellwig wrote:
>> On Tue, Feb 22, 2022 at 11:07:19PM +0800, Tianyu Lan wrote:
>>> Thanks for your comment. That means we need to expose an
>>> swiotlb_device_init() interface to allocate bounce buffer and initialize
>>> io tlb mem entry. DMA API Current  rmem_swiotlb_device_init() only works
>>> for platform with device tree. The new API should be called in the bus
>>> driver or new DMA API. Could you check whether this is a right way 
>>> before
>>> we start the work.
>>
>> Do these VMs use ACPI?  We'd probably really want some kind of higher
>> level configuration and not have the drivers request it themselves.
> 
> Yes, Hyper-V isolation VM uses ACPI. Devices are enumerated via vmbus 
> host and there is no child device information in ACPI table. The host 
> driver seems to be the right place to call new API.

Hi Christoph:
      One more perspective is that one device may have multiple queues 
and each queues should have independent swiotlb bounce buffer to avoid 
spin lock overhead. The number of queues is only available in the device
driver. This means new API needs to be called in the device driver 
according to queue number.

WARNING: multiple messages have this Message-ID (diff)
From: Tianyu Lan <ltykernel@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-hyperv@vger.kernel.org, brijesh.singh@amd.com,
	dave.hansen@linux.intel.com, hpa@zytor.com, kys@microsoft.com,
	hch@infradead.org, wei.liu@kernel.org, sthemmin@microsoft.com,
	x86@kernel.org, decui@microsoft.com,
	michael.h.kelley@microsoft.com, mingo@redhat.com,
	parri.andrea@gmail.com, thomas.lendacky@amd.com,
	Tianyu Lan <Tianyu.Lan@microsoft.com>,
	konrad.wilk@oracle.com, haiyangz@microsoft.com, bp@alien8.de,
	"krish.sadhukhan@oracle.com" <krish.sadhukhan@oracle.com>,
	tglx@linutronix.de, linux-kernel@vger.kernel.org,
	iommu@lists.linux-foundation.org, vkuznets@redhat.com,
	robin.murphy@arm.com,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH V2 1/2] Swiotlb: Add swiotlb_alloc_from_low_pages switch
Date: Fri, 25 Feb 2022 22:28:54 +0800	[thread overview]
Message-ID: <a80a7efa-f15d-3649-f39f-c24820f9ef2b@gmail.com> (raw)
In-Reply-To: <40f91949-58fa-4be2-5b01-ea34dda58670@gmail.com>

On 2/23/2022 5:46 PM, Tianyu Lan wrote:
> 
> 
> On 2/23/2022 12:00 AM, Christoph Hellwig wrote:
>> On Tue, Feb 22, 2022 at 11:07:19PM +0800, Tianyu Lan wrote:
>>> Thanks for your comment. That means we need to expose an
>>> swiotlb_device_init() interface to allocate bounce buffer and initialize
>>> io tlb mem entry. DMA API Current  rmem_swiotlb_device_init() only works
>>> for platform with device tree. The new API should be called in the bus
>>> driver or new DMA API. Could you check whether this is a right way 
>>> before
>>> we start the work.
>>
>> Do these VMs use ACPI?  We'd probably really want some kind of higher
>> level configuration and not have the drivers request it themselves.
> 
> Yes, Hyper-V isolation VM uses ACPI. Devices are enumerated via vmbus 
> host and there is no child device information in ACPI table. The host 
> driver seems to be the right place to call new API.

Hi Christoph:
      One more perspective is that one device may have multiple queues 
and each queues should have independent swiotlb bounce buffer to avoid 
spin lock overhead. The number of queues is only available in the device
driver. This means new API needs to be called in the device driver 
according to queue number.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2022-02-25 14:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 12:23 [PATCH V2 0/2] x86/hyperv/Swiotlb: Add swiotlb_set_alloc_from_low_pages() switch function Tianyu Lan
2022-02-09 12:23 ` Tianyu Lan
2022-02-09 12:23 ` [PATCH V2 1/2] Swiotlb: Add swiotlb_alloc_from_low_pages switch Tianyu Lan
2022-02-09 12:23   ` Tianyu Lan
2022-02-14  8:19   ` Christoph Hellwig
2022-02-14  8:19     ` Christoph Hellwig
2022-02-14 11:28     ` Tianyu Lan
2022-02-14 11:28       ` Tianyu Lan
2022-02-14 13:58       ` Christoph Hellwig
2022-02-14 13:58         ` Christoph Hellwig
2022-02-15 15:32         ` Tianyu Lan
2022-02-15 15:32           ` Tianyu Lan
2022-02-21 15:14           ` Tianyu Lan
2022-02-21 15:14             ` Tianyu Lan
2022-02-22  8:05             ` Christoph Hellwig
2022-02-22  8:05               ` Christoph Hellwig
2022-02-22 15:07               ` Tianyu Lan
2022-02-22 15:07                 ` Tianyu Lan
2022-02-22 16:00                 ` Christoph Hellwig
2022-02-22 16:00                   ` Christoph Hellwig
2022-02-23  9:46                   ` Tianyu Lan
2022-02-23  9:46                     ` Tianyu Lan
2022-02-25 14:28                     ` Tianyu Lan [this message]
2022-02-25 14:28                       ` Tianyu Lan
2022-03-01 11:53                       ` Christoph Hellwig
2022-03-01 11:53                         ` Christoph Hellwig
2022-03-01 14:01                         ` Tianyu Lan
2022-03-01 14:01                           ` Tianyu Lan
2022-02-09 12:23 ` [PATCH V2 2/2] x86/hyperv: Make swiotlb bounce buffer allocation not just from low pages Tianyu Lan
2022-02-09 12:23   ` Tianyu Lan

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=a80a7efa-f15d-3649-f39f-c24820f9ef2b@gmail.com \
    --to=ltykernel@gmail.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=hpa@zytor.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=krish.sadhukhan@oracle.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=michael.h.kelley@microsoft.com \
    --cc=mingo@redhat.com \
    --cc=parri.andrea@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@kernel.org \
    --cc=x86@kernel.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.