From patchwork Sun Aug 7 20:57:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 108847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 009C1B6F75 for ; Mon, 8 Aug 2011 13:10:52 +1000 (EST) Received: from localhost ([::1]:41792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqAQH-0006g6-5i for incoming@patchwork.ozlabs.org; Sun, 07 Aug 2011 16:58:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqAQA-0006fm-Hy for qemu-devel@nongnu.org; Sun, 07 Aug 2011 16:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqAQ9-00018m-JH for qemu-devel@nongnu.org; Sun, 07 Aug 2011 16:58:06 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:57643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqAQ9-00016v-Bt for qemu-devel@nongnu.org; Sun, 07 Aug 2011 16:58:05 -0400 Received: by mail-qy0-f173.google.com with SMTP id 31so1381096qyk.4 for ; Sun, 07 Aug 2011 13:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=HSCitxeeC282CwIFA0e8OkuVe+xTCj1vYiILkKIAu0U=; b=tSy6Hy7XuoDrS5xnDD+mNYZaiia5LMTxbEAOVAby/NugbxStK4WGz5/khAXL59o7oK PcYFBM6X9o7LbThoV443YbzaSDInOVknNajjptn0buARGc8RNkZ3Fena+Jkzwqu+aqLX 5bnfa1Dev/8eSzKcJJwcoXS+BDzYuyAxuzn0k= Received: by 10.224.31.11 with SMTP id w11mr3194802qac.132.1312750685131; Sun, 07 Aug 2011 13:58:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.37.82 with HTTP; Sun, 7 Aug 2011 13:57:45 -0700 (PDT) From: Blue Swirl Date: Sun, 7 Aug 2011 20:57:45 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.173 Subject: [Qemu-devel] [PATCH 02/11] slavio_misc: avoid structure holes spotted by pahole X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Report from pahole on amd64 host: struct MiscState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ qemu_irq irq; /* 5648 8 */ uint32_t dummy; /* 5656 4 */ uint8_t config; /* 5660 1 */ uint8_t aux1; /* 5661 1 */ uint8_t aux2; /* 5662 1 */ uint8_t diag; /* 5663 1 */ uint8_t mctrl; /* 5664 1 */ uint8_t sysctrl; /* 5665 1 */ uint16_t leds; /* 5666 2 */ /* XXX 4 bytes hole, try to pack */ qemu_irq fdc_tc; /* 5672 8 */ /* size: 5680, cachelines: 89 */ /* sum members: 5676, holes: 1, sum holes: 4 */ /* last cacheline: 48 bytes */ }; /* definitions: 1 */ Fix by rearranging the structure to avoid padding. Signed-off-by: Blue Swirl --- hw/slavio_misc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) From 386cc069182db6e0657eac26270aa1a3ef282774 Mon Sep 17 00:00:00 2001 Message-Id: <386cc069182db6e0657eac26270aa1a3ef282774.1312750600.git.blauwirbel@gmail.com> In-Reply-To: <54eae070f9056790fa41b468360d23cdd17503f4.1312750600.git.blauwirbel@gmail.com> References: <54eae070f9056790fa41b468360d23cdd17503f4.1312750600.git.blauwirbel@gmail.com> From: Blue Swirl Date: Sun, 7 Aug 2011 19:03:18 +0000 Subject: [PATCH 02/11] slavio_misc: avoid structure holes spotted by pahole Report from pahole on amd64 host: struct MiscState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ qemu_irq irq; /* 5648 8 */ uint32_t dummy; /* 5656 4 */ uint8_t config; /* 5660 1 */ uint8_t aux1; /* 5661 1 */ uint8_t aux2; /* 5662 1 */ uint8_t diag; /* 5663 1 */ uint8_t mctrl; /* 5664 1 */ uint8_t sysctrl; /* 5665 1 */ uint16_t leds; /* 5666 2 */ /* XXX 4 bytes hole, try to pack */ qemu_irq fdc_tc; /* 5672 8 */ /* size: 5680, cachelines: 89 */ /* sum members: 5676, holes: 1, sum holes: 4 */ /* last cacheline: 48 bytes */ }; /* definitions: 1 */ Fix by rearranging the structure to avoid padding. Signed-off-by: Blue Swirl --- hw/slavio_misc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c index 198360d..1f5a2d7 100644 --- a/hw/slavio_misc.c +++ b/hw/slavio_misc.c @@ -37,13 +37,13 @@ typedef struct MiscState { SysBusDevice busdev; qemu_irq irq; + qemu_irq fdc_tc; uint32_t dummy; uint8_t config; uint8_t aux1, aux2; uint8_t diag, mctrl; uint8_t sysctrl; uint16_t leds; - qemu_irq fdc_tc; } MiscState; typedef struct APCState { -- 1.7.2.5