WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1 of 5] xentrace: fix t_info_pages calculation fo

To: Christoph Egger <Christoph.Egger@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Thu, 24 Mar 2011 12:34:53 +0000
Cc:
Delivery-date: Thu, 24 Mar 2011 05:35:31 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=4r01Uyo7iZmfguDNyICdZ0sKjd2oOqm1XSPZo0kZSkM=; b=Gk4tbY0rfN/A3iopv1FUr3dpqh5Yg6A8OR3q9Q8nwVkuMpMBVU1N62OtPKibH97G7O KG49aFN5d+gHDk0itV38X/ujvPzdeUK97cma5wNutXMFUwiO293kY4wrW9l7pDZK+wto i5X9kwABS/NGyqYtJgsYaEqTfi+DuDYr5cuvk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=He1gSq+2FMoui9SlC4R/tV9Nh30xyL7IKoZ9IN0Harzf6UxNHVA9Yz1Mc/AHmwCwGz A8Caj9jh9s+jKlNvFoBrghLgWLT+f+jAGM1i7wmKmN3HenkmazoDlGNfRWbgXK/Y2mf1 gXSgdZA7LD7zwvuQY1vb6Q1Z+CMIPyRQjFDew=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D8B347E.3000504@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcvqH9/Px3IFjozUHkuEOsiGY1XJVw==
Thread-topic: [Xen-devel] [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
User-agent: Microsoft-Entourage/12.28.0.101117
You need c/s 23074


On 24/03/2011 12:09, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:

> 
> This patch does not compile for me. There's no <xen/pfn.h>.
> 
> Christoph
> 
> 
> On 03/23/11 18:54, Olaf Hering wrote:
>> # HG changeset patch
>> # User Olaf Hering<olaf@xxxxxxxxx>
>> # Date 1300900084 -3600
>> # Node ID 14ac28e4656d0c235c5edf119426b1bcf3bf33d4
>> # Parent  8e1c737b2c44249dd1c0e4e1b8978d5d35020226
>> xentrace: fix t_info_pages calculation for the default case
>> 
>> The default tracebuffer size of 32 pages was not tested with the previous
>> patch.
>> As a result, t_info_pages will become zero and alloc_xenheap_pages() fails.
>> Catch this case and allocate at least one page.
>> 
>> Signed-off-by: Olaf Hering<olaf@xxxxxxxxx>
>> 
>> diff -r 8e1c737b2c44 -r 14ac28e4656d xen/common/trace.c
>> --- a/xen/common/trace.c Wed Mar 23 15:24:19 2011 +0000
>> +++ b/xen/common/trace.c Wed Mar 23 18:08:04 2011 +0100
>> @@ -29,6 +29,7 @@
>>   #include<xen/init.h>
>>   #include<xen/mm.h>
>>   #include<xen/percpu.h>
>> +#include<xen/pfn.h>
>>   #include<xen/cpu.h>
>>   #include<asm/atomic.h>
>>   #include<public/sysctl.h>
>> @@ -109,6 +110,7 @@
>>   {
>>       struct t_buf dummy;
>>       typeof(dummy.prod) size;
>> +    unsigned int t_info_bytes;
>> 
>>       /* force maximum value for an unsigned type */
>>       size = -1;
>> @@ -122,11 +124,9 @@
>>           pages = size;
>>       }
>> 
>> -    t_info_pages = num_online_cpus() * pages + t_info_first_offset;
>> -    t_info_pages *= sizeof(uint32_t);
>> -    t_info_pages /= PAGE_SIZE;
>> -    if ( t_info_pages % PAGE_SIZE )
>> -        t_info_pages++;
>> +    t_info_bytes = num_online_cpus() * pages + t_info_first_offset;
>> +    t_info_bytes *= sizeof(uint32_t);
>> +    t_info_pages = PFN_UP(t_info_bytes);
>>       return pages;
>>   }



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