All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: peter.maydell@linaro.org, jean-philippe@linaro.org,
	mst@redhat.com, qemu-devel@nongnu.org, peterx@redhat.com,
	qemu-arm@nongnu.org, pbonzini@redhat.com, bbhushan2@marvell.com,
	eric.auger.pro@gmail.com
Subject: Re: [PATCH v3 1/5] qdev: Introduce DEFINE_PROP_RESERVED_REGION
Date: Tue, 23 Jun 2020 10:57:15 +0200	[thread overview]
Message-ID: <87r1u6jh1w.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <f0ec7470-d683-1bfd-103d-54c57ebd3863@redhat.com> (Auger Eric's message of "Tue, 23 Jun 2020 10:22:47 +0200")

Auger Eric <eric.auger@redhat.com> writes:

> Hi Markus,
>
> On 6/22/20 1:22 PM, Markus Armbruster wrote:
>> Eric Auger <eric.auger@redhat.com> writes:
>> 
>>> Introduce a new property defining a reserved region:
>>> <low address>, <high address>, <type>.
>>>
>>> This will be used to encode reserved IOVA regions.
>>>
>>> For instance, in virtio-iommu use case, reserved IOVA regions
>>> will be passed by the machine code to the virtio-iommu-pci
>>> device (an array of those). The type of the reserved region
>>> will match the virtio_iommu_probe_resv_mem subtype value:
>>> - VIRTIO_IOMMU_RESV_MEM_T_RESERVED (0)
>>> - VIRTIO_IOMMU_RESV_MEM_T_MSI (1)
>>>
>>> on PC/Q35 machine, this will be used to inform the
>>> virtio-iommu-pci device it should bypass the MSI region.
>>> The reserved region will be: 0xfee00000, 0xfeefffff, 1.
>>>
>>> On ARM, we can declare the ITS MSI doorbell as an MSI
>>> region to prevent MSIs from being mapped on guest side.
>>>
>>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
[...]
>>> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
>>> index cc924815da..15b84adbee 100644
>>> --- a/hw/core/qdev-properties.c
>>> +++ b/hw/core/qdev-properties.c
[...]
>>> +static void set_reserved_region(Object *obj, Visitor *v, const char *name,
>>> +                                void *opaque, Error **errp)
>>> +{
>>> +    DeviceState *dev = DEVICE(obj);
>>> +    Property *prop = opaque;
>>> +    ReservedRegion *rr = qdev_get_prop_ptr(dev, prop);
>>> +    Error *local_err = NULL;
>>> +    const char *endptr;
>>> +    char *str;
>>> +    int ret;
>>> +
>>> +    if (dev->realized) {
>>> +        qdev_prop_set_after_realize(dev, name, errp);
>>> +        return;
>>> +    }
>>> +
>>> +    visit_type_str(v, name, &str, &local_err);
>>> +    if (local_err) {
>>> +        error_propagate(errp, local_err);
>>> +        return;
>>> +    }
>>> +
>>> +    ret = qemu_strtou64(str, &endptr, 16, &rr->low);
>>> +    if (ret) {
>>> +        error_setg(errp, "Failed to decode reserved region low addr");
>>> +        error_append_hint(errp,
>>> +                          "should be an address in hexadecimal\n");
>> 
>> Comes out like this:
>> 
>>     qemu-system-x86_64: -device ...: Failed to decode reserved region low addr
>>     should be an address in hexadecimal
>> 
>> I'd capitalize the other way, to get
>> 
>>     qemu-system-x86_64: -device ...: failed to decode reserved region low addr
>>     Should be an address in hexadecimal
>> 
>> Note: output is made up; I failed at figuring out how to use the new
>> property.  An example in PATCH 4's commit message might help.
> OK I will add one example. In practice in the virtio-iommu case the
> property is not really meant to be passed by the end-user but should be
> set by the machine code. However I have just tested from the cmd line
> and it looks using commas as separators is a bad idea because it
> collides with ',' separating properties. So if you're OK I will change
> the comma into ':'.

Please do.

[...]



  reply	other threads:[~2020-06-23  8:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 15:12 [PATCH v3 0/5] VIRTIO-IOMMU probe request support and MSI bypass on ARM Eric Auger
2020-06-11 15:12 ` [PATCH v3 1/5] qdev: Introduce DEFINE_PROP_RESERVED_REGION Eric Auger
2020-06-22 11:22   ` Markus Armbruster
2020-06-23  8:22     ` Auger Eric
2020-06-23  8:57       ` Markus Armbruster [this message]
2020-06-23 15:15       ` Markus Armbruster
2020-06-23 15:22         ` Auger Eric
2020-06-11 15:12 ` [PATCH v3 2/5] virtio-iommu: Implement RESV_MEM probe request Eric Auger
2020-06-17  9:16   ` Jean-Philippe Brucker
2020-06-18  9:04     ` Auger Eric
2020-06-11 15:12 ` [PATCH v3 3/5] virtio-iommu: Handle reserved regions in the translation process Eric Auger
2020-06-17  9:16   ` Jean-Philippe Brucker
2020-06-11 15:12 ` [PATCH v3 4/5] virtio-iommu-pci: Add array of Interval properties Eric Auger
2020-06-11 15:12 ` [PATCH v3 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs Eric Auger
2020-06-17  9:18   ` Jean-Philippe Brucker

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=87r1u6jh1w.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=bbhushan2@marvell.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=jean-philippe@linaro.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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 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.