qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: Alex Williamson <alex.williamson@redhat.com>,
	qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [RFC PATCH v3 13/18] spapr_pci: Enable DDW
Date: Wed, 10 Sep 2014 23:16:00 +0200	[thread overview]
Message-ID: <5410BF90.4090609@suse.de> (raw)
In-Reply-To: <54106715.5010401@ozlabs.ru>



On 10.09.14 16:58, Alexey Kardashevskiy wrote:
> On 09/10/2014 11:01 PM, Alexander Graf wrote:
>>
>>
>> On 29.08.14 12:12, Alexey Kardashevskiy wrote:
>>> This implements DDW for emulated PHB.
>>>
>>> This advertises the query/create/remove RTAS tokens in device tree.
>>> This does not advertise the reset RTAS token though, will be added later.
>>>
>>> The "ddw" property is enabled by default on a PHB but for compatibility
>>> pseries-2.1 machine disables it.
>>>
>>> Since QEMU does not implement any 64bit DMA capable device, this hack
>>> has been used to enable 64bit DMA on E1000:
>>>
>>> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
>>> index 0fc29a0..131f80a 100644
>>> --- a/hw/net/e1000.c
>>> +++ b/hw/net/e1000.c
>>> @@ -240,6 +240,7 @@ static const uint32_t mac_reg_init[] = {
>>>      [STATUS] =  0x80000000 | E1000_STATUS_GIO_MASTER_ENABLE |
>>>                  E1000_STATUS_ASDV | E1000_STATUS_MTXCKOK |
>>>                  E1000_STATUS_SPEED_1000 | E1000_STATUS_FD |
>>> +                E1000_STATUS_PCIX_MODE |
>>>                  E1000_STATUS_LU,
>>>      [MANC] =    E1000_MANC_EN_MNG2HOST | E1000_MANC_RCV_TCO_EN |
>>>                  E1000_MANC_ARP_EN | E1000_MANC_0298_EN |
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> ---
>>> Changes:
>>> v3:
>>> * removed reset
>>> * windows_num is now 1 or bigger rather than 0-based value and it is only
>>> changed in PHB code, not in RTAS
>>> * added page mask check in create()
>>>
>>> v2:
>>> * tested on hacked emulated E1000
>>> * implemented DDW reset on the PHB reset
>>> * spapr_pci_ddw_remove/spapr_pci_ddw_reset are public for reuse by VFIO
>>> ---
>>>  hw/ppc/spapr.c              |  9 +++++
>>>  hw/ppc/spapr_pci.c          | 94 +++++++++++++++++++++++++++++++++++++++++++++
>>>  include/hw/pci-host/spapr.h |  7 ++++
>>>  3 files changed, 110 insertions(+)
>>>
>>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>>> index d2d3c27..663cb75 100644
>>> --- a/hw/ppc/spapr.c
>>> +++ b/hw/ppc/spapr.c
>>> @@ -1670,11 +1670,20 @@ static const TypeInfo spapr_machine_info = {
>>>  static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data)
>>>  {
>>>      MachineClass *mc = MACHINE_CLASS(oc);
>>> +    static GlobalProperty compat_props[] = {
>>> +        {
>>> +            .driver   = TYPE_SPAPR_PCI_HOST_BRIDGE,
>>> +            .property = "ddw",
>>> +            .value    = stringify(off),
>>> +        },
>>> +        { /* end of list */ }
>>> +    };
>>>  
>>>      mc->name = "pseries-2.1";
>>>      mc->desc = "pSeries Logical Partition (PAPR compliant) v2.1";
>>>      mc->alias = "pseries";
>>>      mc->is_default = 1;
>>> +    mc->compat_props = compat_props;
>>>  }
>>>  
>>>  static const TypeInfo spapr_machine_2_1_info = {
>>> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
>>> index 2968b39..04ee1dc 100644
>>> --- a/hw/ppc/spapr_pci.c
>>> +++ b/hw/ppc/spapr_pci.c
>>> @@ -470,6 +470,76 @@ static const MemoryRegionOps spapr_msi_ops = {
>>>  };
>>>  
>>>  /*
>>> + * Dynamic DMA windows
>>> + */
>>> +static int spapr_pci_ddw_query(sPAPRPHBState *sphb,
>>> +                               uint32_t *windows_available,
>>> +                               uint32_t *page_size_mask)
>>> +{
>>> +    *windows_available = 1;
>>> +    *page_size_mask = DDW_PGSIZE_64K | DDW_PGSIZE_16M;
>>> +
>>> +    return 0;
>>
>> What exactly does this return? The number of still available windows?
>> The total number of windows?
> 
> 1. Number of available windows
> 2. page masks supported for new windows.
> 
> This is what RTAS's counterpart does. We can change it to something better
> if we want but I cannot think of anything better.

The reason I'm asking is that I don't quite grasp why we're always
returning 1 available window.

1 window is already taken by the default window, no? So "1" naturally
would mean no ddw window. If we ignore that one, what if I create 1 ddw
window? The call would still return 1, so could I create another one? If
I can, why didn't the call return 2 in the first place?


Alex

  reply	other threads:[~2014-09-10 21:16 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 10:12 [Qemu-devel] [RFC PATCH v3 00/18] spapr: vfio: Enable Dynamic DMA windows (DDW) Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 01/18] spapr: Make machine naming conventions closer to those for PC Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 02/18] qom: Make object_child_foreach safe for objects removal Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 03/18] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows Alexey Kardashevskiy
2014-09-05 12:40   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 04/18] spapr_pci: Introduce a liobn number generating macros Alexey Kardashevskiy
2014-09-05 12:41   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 05/18] spapr_vio: " Alexey Kardashevskiy
2014-09-05 12:42   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 06/18] spapr_pci: Make find_phb()/find_dev() public Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 07/18] spapr_iommu: Make spapr_tce_find_by_liobn() public Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 08/18] spapr_iommu: Implement free_table() helper Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 09/18] spapr_rtas: Reserve DDW RTAS token numbers Alexey Kardashevskiy
2014-09-06  9:29   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 10/18] spapr_pci: Define DDW callbacks Alexey Kardashevskiy
2014-09-06  9:30   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 11/18] spapr_pci: Add windows counter Alexey Kardashevskiy
2014-09-06  9:31   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 12/18] spapr_rtas: Add Dynamic DMA windows (DDW) RTAS calls support Alexey Kardashevskiy
2014-09-26  5:26   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 13/18] spapr_pci: Enable DDW Alexey Kardashevskiy
2014-09-10 13:01   ` Alexander Graf
2014-09-10 14:58     ` Alexey Kardashevskiy
2014-09-10 21:16       ` Alexander Graf [this message]
2014-09-11  2:53         ` Alexey Kardashevskiy
2014-09-26  5:39   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 14/18] spapr_pci_vfio: Call spapr_pci::reset on reset Alexey Kardashevskiy
2014-09-26  5:40   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 15/18] linux headers update for SPAPR (DDW + EEH) Alexey Kardashevskiy
2014-09-26  5:40   ` David Gibson
2014-09-26  6:55     ` Alexey Kardashevskiy
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 16/18] spapr_pci_vfio: Enable DDW Alexey Kardashevskiy
2014-09-10 13:03   ` Alexander Graf
2014-09-10 15:00     ` Alexey Kardashevskiy
2014-09-10 21:17       ` Alexander Graf
2014-09-11  2:55         ` Alexey Kardashevskiy
2014-09-11  8:34           ` Alexander Graf
2014-09-26  5:47   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 17/18] vfio: Enable DDW ioctls to VFIO IOMMU driver Alexey Kardashevskiy
2014-09-26  5:47   ` David Gibson
2014-08-29 10:12 ` [Qemu-devel] [RFC PATCH v3 18/18] spapr: Add pseries-2.2 machine 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=5410BF90.4090609@suse.de \
    --to=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --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).