All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH] paravirt/xen: add pvop for page_is_ram
Date: Tue, 10 Mar 2009 14:19:11 -0700	[thread overview]
Message-ID: <49B6D94F.9070902@goop.org> (raw)
In-Reply-To: <49B5BD63.1090909@zytor.com>

H. Peter Anvin wrote:
> Jeremy Fitzhardinge wrote:
>   
>> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>
>> A guest domain may have external pages mapped into its address space,
>> in order to share memory with other domains.  These shared pages are
>> more akin to io mappings than real RAM, and should not pass the
>> page_is_ram test.  Add a paravirt op for this so that a hypervisor
>> backend can validate whether a page should be considered ram or not.
>>
>> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>
>>     
>
> Why are these pages mapped as RAM in the memory map?  That is the right
> way to handle that, not by adding yet another bloody hook...
>   
Granted pages can turn up anywhere dynamically, since they're pages 
borrowed from other domains for the purposes of IO.  They're not static 
regions of non-RAM like the other cases page_is_ram() tests for,

They can't be mapped via normal pte operations (because they have 
additional state associated with them, like the grant handle), so 
/dev/mem can't just create an aliased mapping by copying the pte.

page_is_ram is used to:

   1. prevent /dev/mem from mapping non-RAM pages
   2. prevent ioremap from mapping any RAM pages
   3. testing for RAMness in PAT

3) isn't yet relevant to Xen; ioremap can't map granted pages either, so 
2) isn't terribly relevent, so the main motivation for this patch is 
1).  This allows us to reject usermode attempts to map granted pages, 
rather than oopsing (as a failed set_pte will raise a page fault).

So, more cosmetic than essential, but I don't see a better way to 
implement this functionality if its to be there at all.

    J

WARNING: multiple messages have this Message-ID (diff)
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Subject: Re: [PATCH] paravirt/xen: add pvop for page_is_ram
Date: Tue, 10 Mar 2009 14:19:11 -0700	[thread overview]
Message-ID: <49B6D94F.9070902@goop.org> (raw)
In-Reply-To: <49B5BD63.1090909@zytor.com>

H. Peter Anvin wrote:
> Jeremy Fitzhardinge wrote:
>   
>> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>
>> A guest domain may have external pages mapped into its address space,
>> in order to share memory with other domains.  These shared pages are
>> more akin to io mappings than real RAM, and should not pass the
>> page_is_ram test.  Add a paravirt op for this so that a hypervisor
>> backend can validate whether a page should be considered ram or not.
>>
>> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>
>>     
>
> Why are these pages mapped as RAM in the memory map?  That is the right
> way to handle that, not by adding yet another bloody hook...
>   
Granted pages can turn up anywhere dynamically, since they're pages 
borrowed from other domains for the purposes of IO.  They're not static 
regions of non-RAM like the other cases page_is_ram() tests for,

They can't be mapped via normal pte operations (because they have 
additional state associated with them, like the grant handle), so 
/dev/mem can't just create an aliased mapping by copying the pte.

page_is_ram is used to:

   1. prevent /dev/mem from mapping non-RAM pages
   2. prevent ioremap from mapping any RAM pages
   3. testing for RAMness in PAT

3) isn't yet relevant to Xen; ioremap can't map granted pages either, so 
2) isn't terribly relevent, so the main motivation for this patch is 
1).  This allows us to reject usermode attempts to map granted pages, 
rather than oopsing (as a failed set_pte will raise a page fault).

So, more cosmetic than essential, but I don't see a better way to 
implement this functionality if its to be there at all.

    J

  reply	other threads:[~2009-03-10 21:19 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28  1:59 [PATCH] xen: core dom0 support Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen dom0: Make hvc_xen console work for dom0 Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen dom0: Initialize xenbus " Jeremy Fitzhardinge
2009-02-28  1:59   ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen dom0: Set up basic IO permissions " Jeremy Fitzhardinge
2009-02-28  1:59   ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen-dom0: only selectively disable cpu features Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen dom0: Add support for the platform_ops hypercall Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen mtrr: Add mtrr_ops support for Xen mtrr Jeremy Fitzhardinge
2009-02-28  1:59   ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen: disable PAT Jeremy Fitzhardinge
2009-02-28  1:59   ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen/dom0: use _PAGE_IOMAP in ioremap to do machine mappings Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] paravirt/xen: add pvop for page_is_ram Jeremy Fitzhardinge
2009-03-10  1:07   ` H. Peter Anvin
2009-03-10 21:19     ` Jeremy Fitzhardinge [this message]
2009-03-10 21:19       ` Jeremy Fitzhardinge
2009-03-10 22:21       ` H. Peter Anvin
2009-03-10 22:44         ` Jeremy Fitzhardinge
2009-03-10 22:44           ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen/dom0: Use host E820 map Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen: implement XENMEM_machphys_mapping Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen: clear reserved bits in l3 entries given in the initial pagetables Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen/dom0: add XEN_DOM0 config option Jeremy Fitzhardinge
2009-02-28  1:59   ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen: allow enable use of VGA console on dom0 Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen mtrr: Use specific cpu_has_foo macros instead of generic cpu_has() Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen mtrr: Kill some unneccessary includes Jeremy Fitzhardinge
2009-02-28  1:59   ` Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen mtrr: Use generic_validate_add_page() Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen mtrr: Implement xen_get_free_region() Jeremy Fitzhardinge
2009-02-28  1:59 ` [PATCH] xen mtrr: Add xen_{get,set}_mtrr() implementations Jeremy Fitzhardinge
2009-02-28  5:28 ` [PATCH] xen: core dom0 support Andrew Morton
2009-02-28  6:52   ` Jeremy Fitzhardinge
2009-02-28  6:52     ` Jeremy Fitzhardinge
2009-02-28  7:20     ` Ingo Molnar
2009-02-28  7:20       ` Ingo Molnar
2009-02-28  8:05       ` Jeremy Fitzhardinge
2009-02-28  8:05         ` Jeremy Fitzhardinge
2009-02-28  8:36         ` Ingo Molnar
2009-02-28  8:36           ` Ingo Molnar
2009-02-28  9:57           ` Jeremy Fitzhardinge
2009-02-28  9:57             ` Jeremy Fitzhardinge
2009-03-02  9:26       ` Gerd Hoffmann
2009-03-02  9:26         ` Gerd Hoffmann
2009-03-02 12:04         ` Ingo Molnar
2009-03-02 12:04           ` Ingo Molnar
2009-03-02 12:26           ` Gerd Hoffmann
2009-03-02 12:26             ` Gerd Hoffmann
2009-02-28 12:09     ` Nick Piggin
2009-02-28 12:09       ` Nick Piggin
2009-02-28 18:11       ` [Xen-devel] " Jody Belka
2009-02-28 18:11         ` Jody Belka
2009-02-28 18:15         ` Andi Kleen
2009-03-01 23:38           ` Jeremy Fitzhardinge
2009-03-01 23:38             ` Jeremy Fitzhardinge
2009-03-02  0:14             ` Andi Kleen
2009-03-01 23:27       ` Jeremy Fitzhardinge
2009-03-01 23:27         ` Jeremy Fitzhardinge
2009-03-02  6:37         ` Nick Piggin
2009-03-02  6:37           ` Nick Piggin
2009-03-02  8:05           ` Jeremy Fitzhardinge
2009-03-02  8:05             ` Jeremy Fitzhardinge
2009-03-02  8:19             ` Nick Piggin
2009-03-02  8:19               ` Nick Piggin
2009-03-02  9:05               ` Jeremy Fitzhardinge
2009-03-04 17:34             ` Anthony Liguori
2009-03-04 17:34               ` Anthony Liguori
2009-03-04 17:38               ` Jeremy Fitzhardinge
2009-03-04 17:38                 ` Jeremy Fitzhardinge
2009-03-05 10:59               ` [Xen-devel] " George Dunlap
2009-03-05 10:59                 ` George Dunlap
2009-03-05 14:37                 ` [Xen-devel] " Anthony Liguori
2009-03-05 14:37                   ` Anthony Liguori
2009-03-04 17:31           ` Anthony Liguori
2009-03-04 17:31             ` Anthony Liguori
2009-03-04 19:03         ` Anthony Liguori
2009-03-04 19:16           ` H. Peter Anvin
2009-03-04 19:33             ` Anthony Liguori
2009-03-04 19:33               ` Anthony Liguori
2009-02-28 16:14     ` Andi Kleen
2009-03-01 23:34       ` Jeremy Fitzhardinge
2009-03-01 23:34         ` Jeremy Fitzhardinge
2009-03-01 23:52         ` H. Peter Anvin
2009-03-02  0:08           ` Jeremy Fitzhardinge
2009-03-02  0:08             ` Jeremy Fitzhardinge
2009-03-02  0:14             ` H. Peter Anvin
2009-03-02  0:42               ` Jeremy Fitzhardinge
2009-03-02  0:42                 ` Jeremy Fitzhardinge
2009-03-02  0:46                 ` H. Peter Anvin
2009-03-02  0:10         ` Andi Kleen
2009-02-28  8:42   ` Ingo Molnar
2009-02-28  8:42     ` Ingo Molnar
2009-02-28  9:46     ` Jeremy Fitzhardinge
2009-02-28  9:46       ` Jeremy Fitzhardinge
2009-03-02 12:08       ` Ingo Molnar
2009-03-02 12:08         ` Ingo Molnar
2009-03-07  9:06         ` Jeremy Fitzhardinge
2009-03-07  9:06           ` Jeremy Fitzhardinge
2009-03-08 11:01           ` Ingo Molnar
2009-03-08 11:01             ` Ingo Molnar
2009-03-08 21:56             ` H. Peter Anvin
2009-03-08 22:06               ` Ingo Molnar
2009-03-08 22:06                 ` Ingo Molnar
2009-03-08 22:08                 ` H. Peter Anvin
2009-03-08 22:12                   ` Ingo Molnar
2009-03-08 22:12                     ` Ingo Molnar
2009-03-09 18:06                     ` Jeremy Fitzhardinge
2009-03-09 18:06                       ` Jeremy Fitzhardinge
2009-03-10 12:44                       ` Ingo Molnar
2009-03-10 12:44                         ` Ingo Molnar
2009-03-10 12:49                       ` Nick Piggin
2009-03-10 12:49                         ` Nick Piggin
2009-03-05 13:52   ` Morten P.D. Stevens
2009-03-08 14:25     ` Manfred Knick
2009-03-09 19:51       ` Morten P.D. Stevens
2009-03-09 20:00       ` Morten P.D. Stevens
2009-02-28  6:17 ` Boris Derzhavets
2009-02-28  6:23   ` [Xen-devel] " Jeremy Fitzhardinge
2009-02-28  6:23     ` Jeremy Fitzhardinge
2009-02-28  6:28     ` Boris Derzhavets

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=49B6D94F.9070902@goop.org \
    --to=jeremy@goop.org \
    --cc=hpa@zytor.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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.