thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-hw-arm-virt-Rename-variable-size-to-region_size-in-v.patch

ed5979
From bd5b7edbf8f4425f4b4e0d49a00cbdd48d9c6f48 Mon Sep 17 00:00:00 2001
ed5979
From: Gavin Shan <gshan@redhat.com>
ed5979
Date: Wed, 21 Dec 2022 08:48:45 +0800
ed5979
Subject: [PATCH 2/8] hw/arm/virt: Rename variable size to region_size in
ed5979
 virt_set_high_memmap()
ed5979
ed5979
RH-Author: Gavin Shan <gshan@redhat.com>
ed5979
RH-MergeRequest: 126: hw/arm/virt: Optimize high memory region address assignment
ed5979
RH-Bugzilla: 2113840
ed5979
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
ed5979
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
ed5979
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
ed5979
RH-Commit: [2/8] 1cadf1b00686cceb45821a58fdcb509bc5da335d
ed5979
ed5979
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2113840
ed5979
ed5979
This renames variable 'size' to 'region_size' in virt_set_high_memmap().
ed5979
Its counterpart ('region_base') will be introduced in next patch.
ed5979
ed5979
No functional change intended.
ed5979
ed5979
Signed-off-by: Gavin Shan <gshan@redhat.com>
ed5979
Reviewed-by: Eric Auger <eric.auger@redhat.com>
ed5979
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
ed5979
Reviewed-by: Marc Zyngier <maz@kernel.org>
ed5979
Tested-by: Zhenyu Zhang <zhenyzha@redhat.com>
ed5979
Message-id: 20221029224307.138822-3-gshan@redhat.com
ed5979
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ed5979
(cherry picked from commit 370bea9d1c78796eec235ed6cb4310f489931a62)
ed5979
Signed-off-by: Gavin Shan <gshan@redhat.com>
ed5979
---
ed5979
 hw/arm/virt.c | 15 ++++++++-------
ed5979
 1 file changed, 8 insertions(+), 7 deletions(-)
ed5979
ed5979
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
ed5979
index bea5f54720..ca098d40b8 100644
ed5979
--- a/hw/arm/virt.c
ed5979
+++ b/hw/arm/virt.c
ed5979
@@ -1739,15 +1739,16 @@ static uint64_t virt_cpu_mp_affinity(VirtMachineState *vms, int idx)
ed5979
 static void virt_set_high_memmap(VirtMachineState *vms,
ed5979
                                  hwaddr base, int pa_bits)
ed5979
 {
ed5979
+    hwaddr region_size;
ed5979
+    bool fits;
ed5979
     int i;
ed5979
 
ed5979
     for (i = VIRT_LOWMEMMAP_LAST; i < ARRAY_SIZE(extended_memmap); i++) {
ed5979
-        hwaddr size = extended_memmap[i].size;
ed5979
-        bool fits;
ed5979
+        region_size = extended_memmap[i].size;
ed5979
 
ed5979
-        base = ROUND_UP(base, size);
ed5979
+        base = ROUND_UP(base, region_size);
ed5979
         vms->memmap[i].base = base;
ed5979
-        vms->memmap[i].size = size;
ed5979
+        vms->memmap[i].size = region_size;
ed5979
 
ed5979
         /*
ed5979
          * Check each device to see if they fit in the PA space,
ed5979
@@ -1755,9 +1756,9 @@ static void virt_set_high_memmap(VirtMachineState *vms,
ed5979
          *
ed5979
          * For each device that doesn't fit, disable it.
ed5979
          */
ed5979
-        fits = (base + size) <= BIT_ULL(pa_bits);
ed5979
+        fits = (base + region_size) <= BIT_ULL(pa_bits);
ed5979
         if (fits) {
ed5979
-            vms->highest_gpa = base + size - 1;
ed5979
+            vms->highest_gpa = base + region_size - 1;
ed5979
         }
ed5979
 
ed5979
         switch (i) {
ed5979
@@ -1772,7 +1773,7 @@ static void virt_set_high_memmap(VirtMachineState *vms,
ed5979
             break;
ed5979
         }
ed5979
 
ed5979
-        base += size;
ed5979
+        base += region_size;
ed5979
     }
ed5979
 }
ed5979
 
ed5979
-- 
ed5979
2.31.1
ed5979