qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [RFC PATCH 02/10] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows
Date: Tue, 12 Aug 2014 17:32:57 +1000	[thread overview]
Message-ID: <53E9C329.90800@ozlabs.ru> (raw)
In-Reply-To: <20140812011724.GA7628@voom.redhat.com>

On 08/12/2014 11:17 AM, David Gibson wrote:
> On Thu, Jul 31, 2014 at 07:34:06PM +1000, Alexey Kardashevskiy wrote:
>> The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max.
>> We are going to add huge DMA windows support so this will create small
>> window and unexpectedly fail later.
> 
> I'm not entirely clear on what you're saying here.  Are you saying
> that the kernel interface silently truncates a window > 4G, rather
> than failing?
> 
> If so, that's a kernel bug which should be addressed - obviously we'd
> still need this as a workaround for older kernels, but it should be
> treated as a workaround, not as the real fix.


This is an RFC patchset and I have a KVM_CREATE_SPAPR_TCE_64 patch for
kernel but since we are still thinking whether to allocate these tables in
the userspace or not, I have not posted it.


>> This disables KVM_CREATE_SPAPR_TCE for windows bigger that 4GB. Since
>> those windows are normally mapped at the boot time, there will be no
>> performance impact.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>  hw/ppc/spapr_iommu.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
>> index f6e32a4..36f5d27 100644
>> --- a/hw/ppc/spapr_iommu.c
>> +++ b/hw/ppc/spapr_iommu.c
>> @@ -113,11 +113,11 @@ static MemoryRegionIOMMUOps spapr_iommu_ops = {
>>  static int spapr_tce_table_realize(DeviceState *dev)
>>  {
>>      sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);
>> +    uint64_t window_size = tcet->nb_table << tcet->page_shift;
>>  
>> -    if (kvm_enabled()) {
>> +    if (kvm_enabled() && !(window_size >> 32)) {
>>          tcet->table = kvmppc_create_spapr_tce(tcet->liobn,
>> -                                              tcet->nb_table <<
>> -                                              tcet->page_shift,
>> +                                              window_size,
>>                                                &tcet->fd,
>>                                                tcet->vfio_accel);
>>      }
> 


-- 
Alexey

  reply	other threads:[~2014-08-12  7:33 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  9:34 [Qemu-devel] [RFC PATCH 00/10] spapr: vfio: Enable Dynamic DMA windows (DDW) Alexey Kardashevskiy
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 01/10] qom: Make object_child_foreach safe for objects removal Alexey Kardashevskiy
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 02/10] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows Alexey Kardashevskiy
2014-08-12  1:17   ` David Gibson
2014-08-12  7:32     ` Alexey Kardashevskiy [this message]
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 03/10] spapr_pci: Make find_phb()/find_dev() public Alexey Kardashevskiy
2014-08-11 11:39   ` Alexander Graf
2014-08-11 14:56     ` Alexey Kardashevskiy
2014-08-11 17:16       ` Alexander Graf
2014-08-12  1:19   ` David Gibson
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 04/10] spapr_iommu: Make spapr_tce_find_by_liobn() public Alexey Kardashevskiy
2014-08-12  1:19   ` David Gibson
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 05/10] linux headers update for DDW Alexey Kardashevskiy
2014-08-12  1:20   ` David Gibson
2014-08-12  7:16     ` Alexey Kardashevskiy
2014-08-13  3:23       ` David Gibson
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 06/10] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support Alexey Kardashevskiy
2014-08-11 11:51   ` Alexander Graf
2014-08-11 15:34     ` Alexey Kardashevskiy
2014-08-12  1:45   ` David Gibson
2014-08-12  7:25     ` Alexey Kardashevskiy
2014-08-13  3:27       ` David Gibson
2014-08-14  8:29         ` Alexey Kardashevskiy
2014-08-15  0:04           ` David Gibson
2014-08-15  3:09             ` Alexey Kardashevskiy
2014-08-15  4:20               ` David Gibson
2014-08-15  5:27                 ` Alexey Kardashevskiy
2014-08-15  5:30                   ` David Gibson
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 07/10] spapr: Add "ddw" machine option Alexey Kardashevskiy
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 08/10] spapr_pci: Enable DDW Alexey Kardashevskiy
2014-08-11 11:59   ` Alexander Graf
2014-08-11 15:26     ` Alexey Kardashevskiy
2014-08-11 17:29       ` Alexander Graf
2014-08-12  0:13         ` Alexey Kardashevskiy
2014-08-12  3:59           ` Alexey Kardashevskiy
2014-08-12  9:36             ` Alexander Graf
2014-08-12  2:10   ` David Gibson
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 09/10] spapr_pci_vfio: " Alexey Kardashevskiy
2014-08-11 12:02   ` Alexander Graf
2014-08-11 15:01     ` Alexey Kardashevskiy
2014-08-11 17:30       ` Alexander Graf
2014-08-12  0:03         ` Alexey Kardashevskiy
2014-08-12  9:37           ` Alexander Graf
2014-08-12 15:10             ` Alexey Kardashevskiy
2014-08-12 15:28               ` Alexander Graf
2014-08-13  0:18                 ` Alexey Kardashevskiy
2014-08-14 13:38                   ` Alexander Graf
2014-08-15  0:09                     ` David Gibson
2014-08-15  3:22                       ` Alexey Kardashevskiy
2014-08-15  3:16                     ` Alexey Kardashevskiy
2014-08-15  7:37                       ` Alexander Graf
2014-08-12  2:14   ` David Gibson
2014-07-31  9:34 ` [Qemu-devel] [RFC PATCH 10/10] vfio: Enable DDW ioctls to VFIO IOMMU driver Alexey Kardashevskiy
2014-08-05  1:30 ` [Qemu-devel] [RFC PATCH 00/10] spapr: vfio: Enable Dynamic DMA windows (DDW) Alexey Kardashevskiy
2014-08-10 23:50   ` Alexey Kardashevskiy

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=53E9C329.90800@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).