From patchwork Mon Sep 16 08:21:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 275142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 75B992C00E2 for ; Mon, 16 Sep 2013 18:22:45 +1000 (EST) Received: from localhost ([::1]:60540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLU4x-000196-HM for incoming@patchwork.ozlabs.org; Mon, 16 Sep 2013 04:22:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLU3c-0007yB-AD for qemu-devel@nongnu.org; Mon, 16 Sep 2013 04:21:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLU3X-0003Nc-IH for qemu-devel@nongnu.org; Mon, 16 Sep 2013 04:21:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLU3X-0003NI-A3 for qemu-devel@nongnu.org; Mon, 16 Sep 2013 04:21:15 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8G8LDZI025140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Sep 2013 04:21:13 -0400 Received: from localhost.localdomain.com (vpn-203-148.tlv.redhat.com [10.35.203.148]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8G8L4w7000771; Mon, 16 Sep 2013 04:21:11 -0400 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Mon, 16 Sep 2013 11:21:15 +0300 Message-Id: <1379319676-27297-3-git-send-email-marcel.a@redhat.com> In-Reply-To: <1379319676-27297-1-git-send-email-marcel.a@redhat.com> References: <1379319676-27297-1-git-send-email-marcel.a@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, mst@redhat.com, jan.kiszka@siemens.com, pbonzini@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v5 2/3] docs/memory: Explictly state that MemoryRegion priority is signed 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 When memory regions overlap, priority can be used to specify which of them takes priority. By making the priority values signed rather than unsigned, we make it more convenient to implement a situation where one "background" region should appear only where no other region exists: rather than having to explicitly specify a high priority for all the other regions, we can let them take the default (zero) priority and specify a negative priority for the background region. Signed-off-by: Peter Maydell Signed-off-by: Marcel Apfelbaum --- Changes from v4: - Addressed Peter Maydell comments - Changed commit comment docs/memory.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/memory.txt b/docs/memory.txt index feb9fe9..174c0d7 100644 --- a/docs/memory.txt +++ b/docs/memory.txt @@ -80,6 +80,10 @@ guest. This is done with memory_region_add_subregion_overlap(), which allows the region to overlap any other region in the same container, and specifies a priority that allows the core to decide which of two regions at the same address are visible (highest wins). +Priority values are signed, and the default value is zero. This means that +you can use memory_region_add_subregion_overlap() both to specify a region +that must sit 'above' any others (with a positive priority) and also a +background region that sits 'below' others (with a negative priority). Visibility ----------