From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <amc96@srcf.net>
Cc: <xen-devel@lists.xenproject.org>, Wei Liu <wl@xen.org>,
Ian Jackson <iwj@xenproject.org>
Subject: Re: [PATCH for-4.16] freebsd/privcmd: fix MMAP_RESOURCE ioctl definition
Date: Mon, 15 Nov 2021 13:19:23 +0100 [thread overview]
Message-ID: <YZJQS5bG+/7M0fEh@Air-de-Roger> (raw)
In-Reply-To: <11c7c89d-ba8f-e1da-e2af-4ba186f92fbe@srcf.net>
On Mon, Nov 15, 2021 at 12:03:26PM +0000, Andrew Cooper wrote:
> On 15/11/2021 11:08, Roger Pau Monne wrote:
> > Current ioctl definition was wrong in both FreeBSD and Xen sources, as
> > the MMAP_RESOURCE ioctl needs to copy back the size of the resource
> > when passed a zero address and size. FreeBSD encodes in the definition
> > of the ioctl number whether parameters should be copied in (W) and/or
> > copied out (R). The current definition for MMAP_RESOURCE is lacking
> > the copy out part (R), and thus the call to query the size of a
> > resource would always return 0.
> >
> > This change will break the current ioctl interface, the tools can
> > however fall back to using the foreign memory interface in order to
> > map resources from guests.
> >
> > This was a shortcoming from when the hypercall and ioctl gained the
> > ability to query the size of the resources, as originally the
> > MMAP_RESOURCE ioctl didn't need to copy out any data.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Cc: Ian Jackson <iwj@xenproject.org>
> >
> > The change only affects FreeBSD, and it's only a change in a
> > definition of an ioctl, so it's unlikely to break existing code logic.
> > Without this change Xen tools won't be able to use the MMAP_RESOURCE
> > ioctl.
>
> I guess you found this while trying to fix test-resource, in which case
> a further argument for the change is "the unit tests now pass on FreeBSD" ?
Indeed. It seems like this is the only instance of a resource size
query that we have implemented so far.
Thanks, Roger.
next prev parent reply other threads:[~2021-11-15 12:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 11:08 [PATCH for-4.16] freebsd/privcmd: fix MMAP_RESOURCE ioctl definition Roger Pau Monne
2021-11-15 12:03 ` Andrew Cooper
2021-11-15 12:19 ` Roger Pau Monné [this message]
2021-11-15 12:25 ` Andrew Cooper
2021-11-16 15:12 ` Ian Jackson
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=YZJQS5bG+/7M0fEh@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=amc96@srcf.net \
--cc=iwj@xenproject.org \
--cc=wl@xen.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.