Patchwork [v4,2/3] docs/memory: Explicitly state that MemoryRegion priority is signed

login
register
mail settings
Submitter Marcel Apfelbaum
Date Sept. 15, 2013, 4:16 p.m.
Message ID <1379261801-16969-3-git-send-email-marcel.a@redhat.com>
Download mbox | patch
Permalink /patch/275032/
State New
Headers show

Comments

Marcel Apfelbaum - Sept. 15, 2013, 4:16 p.m.
Priority was used to make visible some subregions by obscuring
the parent MemoryRegion addresses overlapping with the subregion.

By allowing the priority to be negative the opposite can be done:
Allow a subregion to be visible on all the addresses not covered
by other subregions.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
 docs/memory.txt | 4 ++++
 1 file changed, 4 insertions(+)
Peter Maydell - Sept. 15, 2013, 5:33 p.m.
On 15 September 2013 17:16, Marcel Apfelbaum <marcel.a@redhat.com> wrote:
> Priority was used to make visible some subregions by obscuring
> the parent MemoryRegion addresses overlapping with the subregion.
>
> By allowing the priority to be negative the opposite can be done:
> Allow a subregion to be visible on all the addresses not covered
> by other subregions.
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(but then I would since I wrote the text initially :-))

Remarks about the commit message in 1/3 apply here too I guess.

-- PMM

Patch

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
 ----------