From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O3zgm-0003Fw-1i for qemu-devel@nongnu.org; Mon, 19 Apr 2010 18:43:36 -0400 Received: from [140.186.70.92] (port=48720 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3zgk-0003FG-UZ for qemu-devel@nongnu.org; Mon, 19 Apr 2010 18:43:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O3zgj-0007FW-4v for qemu-devel@nongnu.org; Mon, 19 Apr 2010 18:43:34 -0400 Received: from mx20.gnu.org ([199.232.41.8]:45749) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3zgj-0007FI-2k for qemu-devel@nongnu.org; Mon, 19 Apr 2010 18:43:33 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1O3zgi-00064M-7D for qemu-devel@nongnu.org; Mon, 19 Apr 2010 18:43:32 -0400 From: Paul Brook Subject: Re: [Qemu-devel] dummy field in CPUTLBEntry? Date: Mon, 19 Apr 2010 23:43:26 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004192343.26621.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jun Koi > I find the way we calculate the dummy field in CPUTLBEntry funny. What > is the point of having: > > ((-sizeof(target_ulong) * 3) & (sizeof(unsigned long) - > 1)) > > in its size? Why shouldnt it be more simple, like below? > > uint8_t dummy[(1 << CPU_TLB_ENTRY_BITS) - (sizeof(target_ulong) * > 3 + sizeof(unsigned long))]; > No, because of alignment. Consider the case of 32-bit target_ulong and 64-bit unsigned long). Paul