From: Jan Beulich <jbeulich@suse.com>
To: Teddy Astie <teddy.astie@vates.tech>
Cc: "Juergen Gross" <jgross@suse.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>,
"Joerg Roedel" <joro@8bytes.org>, "Will Deacon" <will@kernel.org>,
"Robin Murphy" <robin.murphy@arm.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
xen-devel@lists.xenproject.org, iommu@lists.linux.dev
Subject: Re: [RFC PATCH] iommu/xen: Add Xen PV-IOMMU driver
Date: Mon, 17 Jun 2024 15:43:20 +0200 [thread overview]
Message-ID: <af39bac8-bb0d-415b-8cb3-79f3d5369d9d@suse.com> (raw)
In-Reply-To: <eceaa7e7-d07f-4a41-b39a-0b32be6724ae@vates.tech>
On 17.06.2024 15:36, Teddy Astie wrote:
> Le 13/06/2024 à 16:32, Jan Beulich a écrit :
>> On 13.06.2024 15:50, Teddy Astie wrote:
>>> @@ -214,6 +215,38 @@ struct xen_add_to_physmap_range {
>>> };
>>> DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range);
>>>
>>> +/*
>>> + * With some legacy devices, certain guest-physical addresses cannot safely
>>> + * be used for other purposes, e.g. to map guest RAM. This hypercall
>>> + * enumerates those regions so the toolstack can avoid using them.
>>> + */
>>> +#define XENMEM_reserved_device_memory_map 27
>>> +struct xen_reserved_device_memory {
>>> + xen_pfn_t start_pfn;
>>> + xen_ulong_t nr_pages;
>>> +};
>>> +DEFINE_GUEST_HANDLE_STRUCT(xen_reserved_device_memory);
>>> +
>>> +struct xen_reserved_device_memory_map {
>>> +#define XENMEM_RDM_ALL 1 /* Request all regions (ignore dev union). */
>>> + /* IN */
>>> + uint32_t flags;
>>> + /*
>>> + * IN/OUT
>>> + *
>>> + * Gets set to the required number of entries when too low,
>>> + * signaled by error code -ERANGE.
>>> + */
>>> + unsigned int nr_entries;
>>> + /* OUT */
>>> + GUEST_HANDLE(xen_reserved_device_memory) buffer;
>>> + /* IN */
>>> + union {
>>> + struct physdev_pci_device pci;
>>> + } dev;
>>> +};
>>> +DEFINE_GUEST_HANDLE_STRUCT(xen_reserved_device_memory_map);
>>
>> This is a tools-only (i.e. unstable) sub-function in Xen; even the comment
>> at the top says "toolstack". It is therefore not suitable for use in a
>> kernel.
>>
> IMO this comment actually describes how the toolstack uses the
> hypercall, but I don't think it is actually reserved for toolstack use.
Well, the canonical version of the header is quite explicit about this,
by having the definition in a __XEN__ || __XEN_TOOLS__ section.
> Or maybe we should allow the kernel to use this hypercall as well.
That's an option to consider.
Jan
next prev parent reply other threads:[~2024-06-17 13:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 13:50 [RFC PATCH] iommu/xen: Add Xen PV-IOMMU driver Teddy Astie
2024-06-13 14:32 ` Jan Beulich
2024-06-17 13:36 ` Teddy Astie
2024-06-17 13:36 ` Teddy Astie
2024-06-17 13:43 ` Jan Beulich [this message]
2024-06-19 16:30 ` Jason Gunthorpe
2024-06-21 15:09 ` Teddy Astie
2024-06-23 3:21 ` Baolu Lu
2024-06-24 11:09 ` Robin Murphy
2024-06-25 1:18 ` Baolu Lu
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=af39bac8-bb0d-415b-8cb3-79f3d5369d9d@suse.com \
--to=jbeulich@suse.com \
--cc=iommu@lists.linux.dev \
--cc=jgross@suse.com \
--cc=joro@8bytes.org \
--cc=marmarek@invisiblethingslab.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=robin.murphy@arm.com \
--cc=sstabellini@kernel.org \
--cc=teddy.astie@vates.tech \
--cc=will@kernel.org \
--cc=xen-devel@lists.xenproject.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.