xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: identify a Xen PV domU to fix devmem_is_allowed
Date: Mon, 29 Feb 2016 11:28:49 +0100	[thread overview]
Message-ID: <20160229102849.GA18202@aepfle.de> (raw)

What is the correct way to identify a Xen PV domU in the kenrel?
devmem_is_allowed() used to disable access to pages < 256 in domU.
With pvops this check was removed, or never ported forward.

Would this change be the correct fix?

+++ b/arch/x86/mm/init.c
@@ -637,7 +637,7 @@ void __init init_mem_mapping(void)
 int devmem_is_allowed(unsigned long pagenr)
 {
        if (pagenr < 256)
-               return 1;
+               return !xen_pv_domain();
        if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
                return 0;
        if (!page_is_ram(pagenr))

Olaf

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

             reply	other threads:[~2016-02-29 10:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 10:28 Olaf Hering [this message]
2016-02-29 15:10 ` identify a Xen PV domU to fix devmem_is_allowed Konrad Rzeszutek Wilk
2016-02-29 15:29   ` Olaf Hering
2016-02-29 18:32     ` Boris Ostrovsky
2016-03-01 15:14       ` Olaf Hering
2016-03-01 10:38   ` Jan Beulich
2016-03-01 14:34     ` Konrad Rzeszutek Wilk
2016-03-01 14:45       ` Boris Ostrovsky
2016-03-15 16:57         ` Olaf Hering
2016-03-15 18:56           ` Boris Ostrovsky
2016-03-21 21:29           ` Boris Ostrovsky
2016-03-22 18:37             ` Boris Ostrovsky
2016-03-23  8:28               ` Olaf Hering
2016-06-06 21:17               ` Olaf Hering
2016-03-01 16:23   ` Olaf Hering
2016-03-01 15:29 ` David Vrabel

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=20160229102849.GA18202@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).