From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Wei Liu <wei.liu2@citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Jan Beulich <jbeulich@suse.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH RFC 0/2] Fix PAGE_SIZE issues in public headers
Date: Thu, 20 Oct 2016 07:11:42 +0200 [thread overview]
Message-ID: <bdbcfd42-4a79-0f32-2a99-322346fc4ea9@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1610191201080.16441@sstabellini-ThinkPad-X260>
On 19/10/16 21:20, Stefano Stabellini wrote:
> On Wed, 19 Oct 2016, Stefano Stabellini wrote:
>> On Wed, 19 Oct 2016, Juergen Gross wrote:
>>> On 19/10/16 12:46, Wei Liu wrote:
>>>> Reference to PAGE_SIZE slipped in to two public header files. QEMU build on
>>>> ARM64 is broken by this.
>>>>
>>>> This series tries to fix that. The approach is discussed at [0].
>>>>
>>>> QEMU will need to update its copy of usbif.h.
>>>
>>> There is no QEMU copy of Xen headers. This is the reason why an
>>> imcompatible change is not possible. With the patches there is no
>>> longer an urgent need for qemu to be modified.
>>
>> Yes, as long as we backport the fixes to the Xen stable trees as soon as
>> possible.
>
> I spoke too soon. Actually QEMU xen-usb.c references PAGE_SIZE
> directly, which also needs to be fixed. In this case, I think I would
> use XC_PAGE_SIZE, because we are already using it in that file and
> because this way we don't tie the fix with the public headers fixes in
> Xen.
>
> ---
>
> xen-usb: do not reference PAGE_SIZE
>
> PAGE_SIZE is undefined on ARM64. Use XC_PAGE_SIZE instead, which is
> always 4096 even when page granularity is 64K.
>
> For this to actually work with 64K pages, more changes are required.
>
> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
>
> diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
> index 174d715..de2ebd6 100644
> --- a/hw/usb/xen-usb.c
> +++ b/hw/usb/xen-usb.c
> @@ -160,7 +160,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
>
> for (i = 0; i < nr_segs; i++) {
> if ((unsigned)usbback_req->req.seg[i].offset +
> - (unsigned)usbback_req->req.seg[i].length > PAGE_SIZE) {
> + (unsigned)usbback_req->req.seg[i].length > XC_PAGE_SIZE) {
> xen_be_printf(xendev, 0, "segment crosses page boundary\n");
> return -EINVAL;
> }
> @@ -183,7 +183,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
>
> for (i = 0; i < usbback_req->nr_buffer_segs; i++) {
> seg = usbback_req->req.seg + i;
> - addr = usbback_req->buffer + i * PAGE_SIZE + seg->offset;
> + addr = usbback_req->buffer + i * XC_PAGE_SIZE + seg->offset;
> qemu_iovec_add(&usbback_req->packet.iov, addr, seg->length);
> }
> }
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-10-20 5:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 10:46 [PATCH RFC 0/2] Fix PAGE_SIZE issues in public headers Wei Liu
2016-10-19 10:46 ` [PATCH RFC 1/2] usbif.h: don't require PAGE_SIZE to be present Wei Liu
2016-10-19 11:45 ` Andrew Cooper
2016-10-19 12:11 ` Wei Liu
2016-10-19 12:13 ` David Vrabel
2016-10-19 18:08 ` Stefano Stabellini
2016-10-19 10:46 ` [PATCH RFC 2/2] vscsiif.h: " Wei Liu
2016-10-19 11:04 ` [PATCH RFC 0/2] Fix PAGE_SIZE issues in public headers Juergen Gross
2016-10-19 18:09 ` Stefano Stabellini
2016-10-19 19:20 ` Stefano Stabellini
2016-10-20 5:11 ` Juergen Gross [this message]
2016-10-24 15:26 ` Ian Jackson
2016-10-24 18:16 ` Stefano Stabellini
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=bdbcfd42-4a79-0f32-2a99-322346fc4ea9@suse.com \
--to=jgross@suse.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--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.