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/
Home Products Support Community News


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

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
From: Keir Fraser <keir@xxxxxxx>
Date: Wed, 23 Mar 2011 12:33:03 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Wed, 23 Mar 2011 05:33:50 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:user-agent:date:subject:from:to:cc :message-id:thread-topic:thread-index:in-reply-to:mime-version :content-type:content-transfer-encoding; bh=DmIJzm7CKv6HNwJOwxP4QHdbX5kVTOWv5aekfKPQx+M=; b=CV4qLlyRFs72ObwYrui//FgIVWkDa5jIbPKIKJ4LmqQLGBOBK2arYtYgjQvauPWqHP yLrzaQt+ccOtOYp1qg4r1cI8ZSw9z2TsMaq+fn6KH46Ev4FpWsvue5I0qrG0uRk3MV9Z XEIovEBKMs/byM7UTxyzdof6uc+Xd03KYzq0Q=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=dKfrFQ2snKi+vMO0AVB8hLNcEAoR/J5w2+Fykm/u2QgyodB88TZytoE4bkExy3wkd+ tovRnq83SP2FB0aWWpZ9Aes5NpZMeszGjlDvneQFLoujFH1dss9HYGAiodtMTm9mx2OO 2sekcSTO/Tnxy+X6ywFIOrlJJsmhXL70Y6naU=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110323112040.GB28535@xxxxxxxxx>
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: AcvpVnPVvQet2WbXd0Cuo+dTu/HiWg==
Thread-topic: [Xen-devel] [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
User-agent: Microsoft-Entourage/
On 23/03/2011 11:20, "Olaf Hering" <olaf@xxxxxxxxx> wrote:

>>>>      t_info_pages /= PAGE_SIZE;
>>>> -    if ( t_info_pages % PAGE_SIZE )
>>>> +    if ( t_info_pages % PAGE_SIZE || t_info_pages == 0 )
>>> While certainly not having a significant effect, to the unsuspecting
>>> reader this looks like a bug - is it really meant to be a remainder
>>> operation on the *result* of a division (rather than on the original
>>> dividend)? Couldn't you just (ab)use PFN_UP() here?
>> By which you mean to replace the division and subsequent if statement with
>> t_info_pages = PFN_UP(t_info_pages).
> I did not know about PFN_UP() until now, using it would work as well.

As opposed to the existing code (even including your latest patch) which
doesn't work properly. You need to respin at least your patch 1/5.

 -- Keir

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>