summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Cross <cross@oxidecomputer.com>2021-08-31 15:07:01 +0000
committerRobert Mustacchi <rm@fingolfin.org>2021-09-03 08:17:41 -0700
commitd7b40b493097c87910a5c1cf1316bb7c4be5bafd (patch)
tree1d804942381b54abf7062ebe28fdd64465255789
parent6703a0e87b73700da5f26904f87f406b8ca509c3 (diff)
downloadillumos-joyent-d7b40b493097c87910a5c1cf1316bb7c4be5bafd.tar.gz
14042 GPT: Closed ranges conflict with other code causing panics
Reviewed by: Patrick Mooney <pmooney@pfmooney.com> Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_gpt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_gpt.c b/usr/src/uts/i86pc/io/vmm/vmm_gpt.c
index 6624e0fa6d..9f6cc44aac 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_gpt.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_gpt.c
@@ -359,12 +359,12 @@ vmm_gpt_populate_entry(vmm_gpt_t *gpt, uint64_t gpa)
/*
* Ensures that PTEs for the region of address space bounded by
- * [start, end] exist in the tree.
+ * [start, end) exist in the tree.
*/
void
vmm_gpt_populate_region(vmm_gpt_t *gpt, uint64_t start, uint64_t end)
{
- for (uint64_t page = start; page <= end; page += PAGESIZE) {
+ for (uint64_t page = start; page < end; page += PAGESIZE) {
vmm_gpt_populate_entry(gpt, page);
}
}
@@ -451,13 +451,13 @@ vmm_gpt_vacate_entry(vmm_gpt_t *gpt, uint64_t gpa)
/*
* Cleans up the unused inner nodes in the GPT for a region of guest
- * physical address space bounded by `start` and `end`. The region
- * must map no pages.
+ * physical address space bounded by [start..end). The region must
+ * map no pages.
*/
void
vmm_gpt_vacate_region(vmm_gpt_t *gpt, uint64_t start, uint64_t end)
{
- for (uint64_t page = start; page <= end; page += PAGESIZE) {
+ for (uint64_t page = start; page < end; page += PAGESIZE) {
vmm_gpt_vacate_entry(gpt, page);
}
}
@@ -488,14 +488,14 @@ vmm_gpt_unmap(vmm_gpt_t *gpt, uint64_t gpa)
/*
* Un-maps the region of guest physical address space bounded by
- * start and end. Returns the number of pages that are unmapped.
+ * [start..end). Returns the number of pages that are unmapped.
*/
size_t
vmm_gpt_unmap_region(vmm_gpt_t *gpt, uint64_t start, uint64_t end)
{
size_t n = 0;
- for (uint64_t page = start; page <= end; page += PAGESIZE) {
+ for (uint64_t page = start; page < end; page += PAGESIZE) {
if (vmm_gpt_unmap(gpt, page) != 0)
n++;
}