xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] restrict trace buffer MFNs
@ 2010-06-28 10:42 Jan Beulich
  2010-06-28 12:16 ` George Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2010-06-28 10:42 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 805 bytes --]

Since they're being passed to Dom0 using an array of uint32_t, they
must be representable as 32-bit quantities, and hence the buffer
allocation must specify an upper address boundary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/common/trace.c	2010-06-28 11:58:37.000000000 +0200
+++ 2010-06-15/xen/common/trace.c	2010-06-28 12:16:05.000000000 +0200
@@ -130,7 +130,8 @@ static int alloc_trace_bufs(void)
         char         *rawbuf;
         struct t_buf *buf;
 
-        if ( (rawbuf = alloc_xenheap_pages(order, 0)) == NULL )
+        if ( (rawbuf = alloc_xenheap_pages(
+                order, MEMF_bits(32 + PAGE_SHIFT))) == NULL )
         {
             printk("Xen trace buffers: memory allocation failed\n");
             opt_tbuf_size = 0;




[-- Attachment #2: trace-restrict-mfn.patch --]
[-- Type: text/plain, Size: 799 bytes --]

Since they're being passed to Dom0 using an array of uint32_t, they
must be representable as 32-bit quantities, and hence the buffer
allocation must specify an upper address boundary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-06-15.orig/xen/common/trace.c	2010-06-28 11:58:37.000000000 +0200
+++ 2010-06-15/xen/common/trace.c	2010-06-28 12:16:05.000000000 +0200
@@ -130,7 +130,8 @@ static int alloc_trace_bufs(void)
         char         *rawbuf;
         struct t_buf *buf;
 
-        if ( (rawbuf = alloc_xenheap_pages(order, 0)) == NULL )
+        if ( (rawbuf = alloc_xenheap_pages(
+                order, MEMF_bits(32 + PAGE_SHIFT))) == NULL )
         {
             printk("Xen trace buffers: memory allocation failed\n");
             opt_tbuf_size = 0;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] restrict trace buffer MFNs
  2010-06-28 10:42 [PATCH] restrict trace buffer MFNs Jan Beulich
@ 2010-06-28 12:16 ` George Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2010-06-28 12:16 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

Assuming the runes are correct:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

On Mon, Jun 28, 2010 at 11:42 AM, Jan Beulich <JBeulich@novell.com> wrote:
> Since they're being passed to Dom0 using an array of uint32_t, they
> must be representable as 32-bit quantities, and hence the buffer
> allocation must specify an upper address boundary.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
> --- 2010-06-15.orig/xen/common/trace.c  2010-06-28 11:58:37.000000000 +0200
> +++ 2010-06-15/xen/common/trace.c       2010-06-28 12:16:05.000000000 +0200
> @@ -130,7 +130,8 @@ static int alloc_trace_bufs(void)
>         char         *rawbuf;
>         struct t_buf *buf;
>
> -        if ( (rawbuf = alloc_xenheap_pages(order, 0)) == NULL )
> +        if ( (rawbuf = alloc_xenheap_pages(
> +                order, MEMF_bits(32 + PAGE_SHIFT))) == NULL )
>         {
>             printk("Xen trace buffers: memory allocation failed\n");
>             opt_tbuf_size = 0;
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-28 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28 10:42 [PATCH] restrict trace buffer MFNs Jan Beulich
2010-06-28 12:16 ` George Dunlap

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).