From patchwork Fri Mar 25 10:10:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 8669331 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F65CC0554 for ; Fri, 25 Mar 2016 10:10:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A340A20382 for ; Fri, 25 Mar 2016 10:10:49 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id DF0B7203A0 for ; Fri, 25 Mar 2016 10:10:48 +0000 (UTC) Received: from localhost ([::1]:55245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajOhc-0005q4-6g for patchwork-qemu-devel@patchwork.kernel.org; Fri, 25 Mar 2016 06:10:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajOhR-0005oc-Bj for qemu-devel@nongnu.org; Fri, 25 Mar 2016 06:10:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajOhO-0002sm-Kj for qemu-devel@nongnu.org; Fri, 25 Mar 2016 06:10:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajOhO-0002sh-CT for qemu-devel@nongnu.org; Fri, 25 Mar 2016 06:10:34 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 03DEB811A2 for ; Fri, 25 Mar 2016 10:10:34 +0000 (UTC) Received: from fam-t430.redhat.com (vpn1-7-157.pek2.redhat.com [10.72.7.157]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2PAAU3r003053; Fri, 25 Mar 2016 06:10:33 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 25 Mar 2016 18:10:28 +0800 Message-Id: <1458900629-2334-2-git-send-email-famz@redhat.com> In-Reply-To: <1458900629-2334-1-git-send-email-famz@redhat.com> References: <1458900629-2334-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini Subject: [Qemu-devel] [PATCH 1/2] memory: Remove code for mr->may_overlap 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The collision check does nothing and hasn't been used. Remove the variable together with related code. Signed-off-by: Fam Zheng --- 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 2de7898..f071a7c 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -188,7 +188,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 95f7209..d5b75f2 100644 --- a/memory.c +++ b/memory.c @@ -1054,13 +1054,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) { @@ -1098,10 +1091,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, */ @@ -1861,7 +1850,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; @@ -1869,27 +1857,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; @@ -1915,7 +1882,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); } @@ -1925,7 +1891,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); }