All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Oleksandr Andrushchenko <andr2000@gmail.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: XC_PAGE_SIZE or XEN_PAGE_SIZE?
Date: Fri, 02 Dec 2016 04:03:34 -0700	[thread overview]
Message-ID: <5841631602000078001247A1@prv-mh.provo.novell.com> (raw)
In-Reply-To: <ae3eee51-6d8f-f097-fa4e-e1c3c6704554@gmail.com>

>>> On 02.12.16 at 08:49, <andr2000@gmail.com> wrote:
> While working on display protocol I found that there is no(?) common
> 
> ???_PAGE_SIZE define I can use for both Xen and Linux kernel:
> 
> Xen defines XC_PAGE_SIZE which is also used in Linux user-space and
> 
> kernel has XEN_PAGE_SIZE, but no XC_PAGE_SIZE.
> 
> So, the question is which define should I use?

In the abstract protocol there should be no need for this other
than in comments (as is the case for all other protocols with the
exception of vscsiif, which had a need to define its own
VSCSIIF_PAGE_SIZE), where I think just PAGE_SIZE will be fine.
In the end, frontend and backend are required to agree on a
page size via some side channel anyway, which usually is
achieved by base architecture assumptions (after all both run
on the same physical machine and hence with the same set of
architecture prerequisites). Arguably this is not an optimal model
(namely on architectures supporting varying page sizes), but if
we were to change it we should probably do so for all protocols.

In the implementation you use the manifest constant available: If
your code is in user space, use XC_PAGE_SIZE. In the kernel you'd
obviously use XEN_PAGE_SIZE.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-12-02 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  7:49 XC_PAGE_SIZE or XEN_PAGE_SIZE? Oleksandr Andrushchenko
2016-12-02 11:03 ` Jan Beulich [this message]
2016-12-02 11:20   ` Oleksandr Andrushchenko
2016-12-02 11:43     ` Jan Beulich
2016-12-02 11:45       ` Oleksandr Andrushchenko
2016-12-02 11:53       ` Andrew Cooper
2016-12-02 11:56         ` Oleksandr Andrushchenko

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=5841631602000078001247A1@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andr2000@gmail.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.