Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Jürgen Groß
On 12.01.21 11:03, Roger Pau Monné wrote: On Tue, Jan 12, 2021 at 06:57:30AM +0100, Jürgen Groß wrote: On 11.01.21 16:29, Roger Pau Monne wrote: Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and addr = 0 in order to fetch the size of a specific resource. Add a shortcut to

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-12 Thread Roger Pau Monné
On Tue, Jan 12, 2021 at 06:57:30AM +0100, Jürgen Groß wrote: > On 11.01.21 16:29, Roger Pau Monne wrote: > > Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and > > addr = 0 in order to fetch the size of a specific resource. > > > > Add a shortcut to the default map resource path,

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread Jürgen Groß
On 12.01.21 06:50, Jürgen Groß wrote: On 11.01.21 23:39, Andrew Cooper wrote: On 11/01/2021 22:09, boris.ostrov...@oracle.com wrote: On 1/11/21 10:29 AM, Roger Pau Monne wrote: +    xdata.domid = kdata.dom; +    xdata.type = kdata.type; +    xdata.id = kdata.id; + +    if (!kdata.addr &&

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread Jürgen Groß
On 11.01.21 16:29, Roger Pau Monne wrote: Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and addr = 0 in order to fetch the size of a specific resource. Add a shortcut to the default map resource path, since fetching the size requires no address to be passed in, and thus no VMA

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread Jürgen Groß
On 11.01.21 23:39, Andrew Cooper wrote: On 11/01/2021 22:09, boris.ostrov...@oracle.com wrote: On 1/11/21 10:29 AM, Roger Pau Monne wrote: + xdata.domid = kdata.dom; + xdata.type = kdata.type; + xdata.id = kdata.id; + + if (!kdata.addr && !kdata.num) { I think we should

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread Andrew Cooper
On 11/01/2021 22:09, boris.ostrov...@oracle.com wrote: > On 1/11/21 10:29 AM, Roger Pau Monne wrote: >> >> +xdata.domid = kdata.dom; >> +xdata.type = kdata.type; >> +xdata.id = kdata.id; >> + >> +if (!kdata.addr && !kdata.num) { > > I think we should not allow only one of them to

Re: [PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread boris . ostrovsky
On 1/11/21 10:29 AM, Roger Pau Monne wrote: > > + xdata.domid = kdata.dom; > + xdata.type = kdata.type; > + xdata.id = kdata.id; > + > + if (!kdata.addr && !kdata.num) { I think we should not allow only one of them to be zero. If it's only kdata.num then we will end up with

[PATCH] xen/privcmd: allow fetching resource sizes

2021-01-11 Thread Roger Pau Monne
Allow issuing an IOCTL_PRIVCMD_MMAP_RESOURCE ioctl with num = 0 and addr = 0 in order to fetch the size of a specific resource. Add a shortcut to the default map resource path, since fetching the size requires no address to be passed in, and thus no VMA to setup. Fixes: 3ad0876554caf