Blame SOURCES/kvm-i386-Don-t-print-warning-if-phys-bits-was-set-automa.patch

016a62
From 7e78c8e8b5a9cab9ef4604dc29eab4b4323e9b9b Mon Sep 17 00:00:00 2001
016a62
From: Eduardo Habkost <ehabkost@redhat.com>
016a62
Date: Tue, 13 Aug 2019 01:53:55 +0100
016a62
Subject: [PATCH 01/21] i386: Don't print warning if phys-bits was set
016a62
 automatically
016a62
016a62
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
016a62
Message-id: <20190813015355.17556-1-ehabkost@redhat.com>
016a62
Patchwork-id: 89946
016a62
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH] i386: Don't print warning if phys-bits was set automatically
016a62
Bugzilla: 1719127
016a62
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
016a62
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
016a62
RH-Acked-by: John Snow <jsnow@redhat.com>
016a62
016a62
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1719127
016a62
BRANCH: rhel-8.1.0
016a62
UPSTREAM: fea306520ea4b2f189dd23c70a6afd2fc4ffafdc
016a62
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23026463
016a62
016a62
If cpu->host_phys_bits_limit is set, QEMU will make
016a62
cpu->phys_bits be lower than host_phys_bits on some cases.  This
016a62
triggers a warning that was supposed to be printed only if
016a62
phys-bits was explicitly set in the command-line.
016a62
016a62
Reorder the code so the value of cpu->phys_bits is validated
016a62
before the cpu->host_phys_bits handling.  This will avoid
016a62
unexpected warnings when cpu->host_phys_bits_limit is set.
016a62
016a62
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
016a62
Message-Id: <20190611205420.20286-1-ehabkost@redhat.com>
016a62
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
016a62
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
016a62
(cherry picked from commit fea306520ea4b2f189dd23c70a6afd2fc4ffafdc)
016a62
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
016a62
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
016a62
---
016a62
 target/i386/cpu.c | 18 +++++++++---------
016a62
 1 file changed, 9 insertions(+), 9 deletions(-)
016a62
016a62
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
016a62
index c8f50a7..c69116c 100644
016a62
--- a/target/i386/cpu.c
016a62
+++ b/target/i386/cpu.c
016a62
@@ -5116,15 +5116,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
016a62
             uint32_t host_phys_bits = x86_host_phys_bits();
016a62
             static bool warned;
016a62
 
016a62
-            if (cpu->host_phys_bits) {
016a62
-                /* The user asked for us to use the host physical bits */
016a62
-                cpu->phys_bits = host_phys_bits;
016a62
-                if (cpu->host_phys_bits_limit &&
016a62
-                    cpu->phys_bits > cpu->host_phys_bits_limit) {
016a62
-                    cpu->phys_bits = cpu->host_phys_bits_limit;
016a62
-                }
016a62
-            }
016a62
-
016a62
             /* Print a warning if the user set it to a value that's not the
016a62
              * host value.
016a62
              */
016a62
@@ -5136,6 +5127,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
016a62
                 warned = true;
016a62
             }
016a62
 
016a62
+            if (cpu->host_phys_bits) {
016a62
+                /* The user asked for us to use the host physical bits */
016a62
+                cpu->phys_bits = host_phys_bits;
016a62
+                if (cpu->host_phys_bits_limit &&
016a62
+                    cpu->phys_bits > cpu->host_phys_bits_limit) {
016a62
+                    cpu->phys_bits = cpu->host_phys_bits_limit;
016a62
+                }
016a62
+            }
016a62
+
016a62
             if (cpu->phys_bits &&
016a62
                 (cpu->phys_bits > TARGET_PHYS_ADDR_SPACE_BITS ||
016a62
                 cpu->phys_bits < 32)) {
016a62
-- 
016a62
1.8.3.1
016a62