From patchwork Fri May 29 05:27:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49128 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A2EF22B3A for ; Fri, 29 May 2015 05:29:24 +0000 (UTC) Received: by wibbk2 with SMTP id bk2sf2315399wib.2 for ; Thu, 28 May 2015 22:29:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=2nI2tYeQ8YAuaATelpJOzdZAz9EGmRV0Z4UmUh0AS10=; b=hfPx1w8bqBiaUr/ePOwKRowsNqCwkhlLagcFAxq3bDh9C+GmEmjRgimSzHE07/R/+/ SJhe4618Pl4swK7Q0606Nztu5BpfS6M1iHyUWxeVzIdVEq4oiXdfshBfZUI2n1CL0SUd peeXlGzxf7tocSYl2b50lYVt+TF5bWnJXcnl0/4l/iVY3rhzq5Mp0XYmkgt1CSsdcOHf vgsv8sdF78+3XPqCnPN2+HlsBiUoJ5VOscYhHaCoUP3n4RxPzSZfVN6gzkBSQYuqOYdj pE6fi3dIecSIlAGt6A1FjfpG63hWH1s1BpmLxUN0Q3Ve+nA98oh14woj44/Nyod/+iRE 4Glw== X-Gm-Message-State: ALoCoQnB/jWLO7zo58Q62TGvJ/CRPVcgXsVbGb3im2WlRWjY7YqNRPVv/UI5TaQa75URkpVjjwwt X-Received: by 10.112.97.210 with SMTP id ec18mr5793095lbb.15.1432877363454; Thu, 28 May 2015 22:29:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.65 with SMTP id r1ls49949lag.61.gmail; Thu, 28 May 2015 22:29:23 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr6237770laj.88.1432877363339; Thu, 28 May 2015 22:29:23 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id t11si3779877lbf.65.2015.05.28.22.29.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 22:29:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labko7 with SMTP id ko7so44119166lab.2 for ; Thu, 28 May 2015 22:29:22 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr6383766lbh.56.1432877362922; Thu, 28 May 2015 22:29:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp32697lbb; Thu, 28 May 2015 22:29:22 -0700 (PDT) X-Received: by 10.55.33.30 with SMTP id h30mr12386294qkh.87.1432877361615; Thu, 28 May 2015 22:29:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m17si4664181qgd.53.2015.05.28.22.29.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 May 2015 22:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:33520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyCrA-0007hT-P1 for patch@linaro.org; Fri, 29 May 2015 01:29:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyCqB-0006Mj-3y for qemu-devel@nongnu.org; Fri, 29 May 2015 01:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyCq9-0005Ew-Uf for qemu-devel@nongnu.org; Fri, 29 May 2015 01:28:19 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:21696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyCq9-0005E9-9L; Fri, 29 May 2015 01:28:17 -0400 Received: from 172.24.2.119 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BGS73955; Fri, 29 May 2015 13:28:11 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.158.1; Fri, 29 May 2015 13:28:03 +0800 From: Shannon Zhao To: Date: Fri, 29 May 2015 13:27:09 +0800 Message-ID: <1432877231-5136-12-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1432877231-5136-1-git-send-email-zhaoshenglong@huawei.com> References: <1432877231-5136-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5567F8EB.0090, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a11e9ccfc717ebcd6bb82306e9a279f5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, mjt@tls.msk.ru, shannon.zhao@linaro.org, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v2 11/13] hw/alpha/typhoon.c: Fix misusing qemu_allocate_irqs for single irq 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao valgrind complains about: ==7055== 8 bytes in 1 blocks are definitely lost in loss record 403 of 2,192 ==7055== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==7055== by 0x24410F: malloc_and_trace (vl.c:2556) ==7055== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x2B7A8B: qemu_extend_irqs (irq.c:55) ==7055== by 0x2B7B17: qemu_allocate_irqs (irq.c:64) ==7055== by 0x2197CB: typhoon_init (typhoon.c:844) ==7055== by 0x2178FD: clipper_init (dp264.c:73) ==7055== by 0x2484DA: main (vl.c:4249) ==7055== ==7055== 8 bytes in 1 blocks are definitely lost in loss record 404 of 2,192 ==7055== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==7055== by 0x24410F: malloc_and_trace (vl.c:2556) ==7055== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) ==7055== by 0x2B7A8B: qemu_extend_irqs (irq.c:55) ==7055== by 0x2B7B17: qemu_allocate_irqs (irq.c:64) ==7055== by 0x219BA7: typhoon_init (typhoon.c:924) ==7055== by 0x2178FD: clipper_init (dp264.c:73) ==7055== by 0x2484DA: main (vl.c:4249) Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/alpha/typhoon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 7df842d..421162e 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -841,7 +841,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, } } - *p_rtc_irq = *qemu_allocate_irqs(typhoon_set_timer_irq, s, 1); + *p_rtc_irq = qemu_allocate_irq(typhoon_set_timer_irq, s, 0); /* Main memory region, 0x00.0000.0000. Real hardware supports 32GB, but the address space hole reserved at this point is 8TB. */ @@ -918,11 +918,11 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, /* Init the ISA bus. */ /* ??? Technically there should be a cy82c693ub pci-isa bridge. */ { - qemu_irq isa_pci_irq, *isa_irqs; + qemu_irq *isa_irqs; *isa_bus = isa_bus_new(NULL, get_system_memory(), &s->pchip.reg_io); - isa_pci_irq = *qemu_allocate_irqs(typhoon_set_isa_irq, s, 1); - isa_irqs = i8259_init(*isa_bus, isa_pci_irq); + isa_irqs = i8259_init(*isa_bus, + qemu_allocate_irq(typhoon_set_isa_irq, s, 0)); isa_bus_irqs(*isa_bus, isa_irqs); }