From patchwork Mon May 23 15:09:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9132063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 06C34607D5 for ; Mon, 23 May 2016 15:33:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE54B28219 for ; Mon, 23 May 2016 15:33:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0DBD28237; Mon, 23 May 2016 15:33:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3DC7828219 for ; Mon, 23 May 2016 15:33:18 +0000 (UTC) Received: from localhost ([::1]:48920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rr2-0005b5-JG for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 May 2016 11:33:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUu-0002Hs-Oc for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4rUk-00045D-FK for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:23 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4rUk-000455-4p for qemu-devel@nongnu.org; Mon, 23 May 2016 11:10:14 -0400 Received: by mail-wm0-x244.google.com with SMTP id f75so9713464wmf.2 for ; Mon, 23 May 2016 08:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7w+KBeoi2+e7PNol0aLDFBNkbYlVXOgJTOcHQevoKkA=; b=atsN6Hr8dlPLPlLWz2ADZyfOwWe6bREnJCkvOehXUfLJupqmYelDyAwKNrBOczKqOf OQyH0tpXzThtejnJd4VFtMdHlgvuh7RxMK99l9s7eUim3R9nNbJJigbl0dBrzjgBxKzA vh6U7FI9hSgMf3I7HckKUcBJfWatUTiO8UbHo4RMfHCAZ0uz9jC9HS3uqRX9Lg4lRKKc ZE9oFgWB8NOs5yPMG4wY+NEBisyKIsPDD3rYhRzQ0UUqbsv8k+lore/61IGZjCd0kb91 oDR6dnr0aHWq+T180dQzkKH89t84upJ5bpzGMCHEhgdoanUCYVD86ex/wIIuDKYefZUC 2rFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7w+KBeoi2+e7PNol0aLDFBNkbYlVXOgJTOcHQevoKkA=; b=COtTKeEWAu7ckenvxa4CzID4QTB+4sO/vuFu32TaTKO+F5jvtlIY7ULfOszJM+PVIY DHv9cF/y3V7gkXyiDFC99tuZM36s6YVBA94jtGFKoOX2DIKII7Ho2p0yMhnCOw6BhDjN 7H5zIE+H059/rFckb8Huq62aGKoxAP6EfuTF7liv5JtKg3Mc9P9+9Zr5smaFhfarP+HO r26ImssdlErUv16Xan6JzJytblB9Vi9o44/pVw2dzsbogGYfPOs5FiLDErVT08ntCjY7 CPztOtQ6f4MP/JF4i7vTk3sFqnIcvC5ObrSRg+Tlw+oHynclqTjjK/gSqIqdwhym9YvM vSqA== X-Gm-Message-State: ALyK8tK6sQHSczptIAoXJyfdi/GKVt1BbEp9VNvWWZ0roP26IUBDur7wtlr2WkLyRPcKzA== X-Received: by 10.194.81.72 with SMTP id y8mr14729851wjx.83.1464016213625; Mon, 23 May 2016 08:10:13 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-252-58.clienti.tiscali.it. [78.12.252.58]) by smtp.gmail.com with ESMTPSA id ac2sm19250359wjc.35.2016.05.23.08.10.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 08:10:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 23 May 2016 17:09:46 +0200 Message-Id: <1464016199-43768-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> References: <1464016199-43768-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 11/24] memory: Remove code for mr->may_overlap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Fam Zheng The collision check does nothing and hasn't been used. Remove the variable together with related code. Signed-off-by: Fam Zheng Message-Id: <1458900629-2334-2-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 1 - memory.c | 35 ----------------------------------- 2 files changed, 36 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 7fb9188..f649697 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -187,7 +187,6 @@ struct MemoryRegion { MemoryRegion *alias; hwaddr alias_offset; int32_t priority; - bool may_overlap; QTAILQ_HEAD(subregions, MemoryRegion) subregions; QTAILQ_ENTRY(MemoryRegion) subregions_link; QTAILQ_HEAD(coalesced_ranges, CoalescedMemoryRange) coalesced; diff --git a/memory.c b/memory.c index 9daac5e..ac5236b 100644 --- a/memory.c +++ b/memory.c @@ -1057,13 +1057,6 @@ static void memory_region_get_priority(Object *obj, Visitor *v, visit_type_int32(v, name, &value, errp); } -static bool memory_region_get_may_overlap(Object *obj, Error **errp) -{ - MemoryRegion *mr = MEMORY_REGION(obj); - - return mr->may_overlap; -} - static void memory_region_get_size(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { @@ -1101,10 +1094,6 @@ static void memory_region_initfn(Object *obj) memory_region_get_priority, NULL, /* memory_region_set_priority */ NULL, NULL, &error_abort); - object_property_add_bool(OBJECT(mr), "may-overlap", - memory_region_get_may_overlap, - NULL, /* memory_region_set_may_overlap */ - &error_abort); object_property_add(OBJECT(mr), "size", "uint64", memory_region_get_size, NULL, /* memory_region_set_size, */ @@ -1864,7 +1853,6 @@ void memory_region_del_eventfd(MemoryRegion *mr, static void memory_region_update_container_subregions(MemoryRegion *subregion) { - hwaddr offset = subregion->addr; MemoryRegion *mr = subregion->container; MemoryRegion *other; @@ -1872,27 +1860,6 @@ static void memory_region_update_container_subregions(MemoryRegion *subregion) memory_region_ref(subregion); QTAILQ_FOREACH(other, &mr->subregions, subregions_link) { - if (subregion->may_overlap || other->may_overlap) { - continue; - } - if (int128_ge(int128_make64(offset), - int128_add(int128_make64(other->addr), other->size)) - || int128_le(int128_add(int128_make64(offset), subregion->size), - int128_make64(other->addr))) { - continue; - } -#if 0 - printf("warning: subregion collision %llx/%llx (%s) " - "vs %llx/%llx (%s)\n", - (unsigned long long)offset, - (unsigned long long)int128_get64(subregion->size), - subregion->name, - (unsigned long long)other->addr, - (unsigned long long)int128_get64(other->size), - other->name); -#endif - } - QTAILQ_FOREACH(other, &mr->subregions, subregions_link) { if (subregion->priority >= other->priority) { QTAILQ_INSERT_BEFORE(other, subregion, subregions_link); goto done; @@ -1918,7 +1885,6 @@ void memory_region_add_subregion(MemoryRegion *mr, hwaddr offset, MemoryRegion *subregion) { - subregion->may_overlap = false; subregion->priority = 0; memory_region_add_subregion_common(mr, offset, subregion); } @@ -1928,7 +1894,6 @@ void memory_region_add_subregion_overlap(MemoryRegion *mr, MemoryRegion *subregion, int priority) { - subregion->may_overlap = true; subregion->priority = priority; memory_region_add_subregion_common(mr, offset, subregion); }