|
Pablo Greco |
e6a3ae |
From 0d087d9d5276866b7a7c17cdb23e71b5636dc529 Mon Sep 17 00:00:00 2001
|
|
Pablo Greco |
e6a3ae |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
Date: Fri, 22 Nov 2019 11:53:43 +0000
|
|
Pablo Greco |
e6a3ae |
Subject: [PATCH 10/16] vmxcap: correct the name of the variables
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
Message-id: <20191122115348.25000-11-pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
Patchwork-id: 92607
|
|
Pablo Greco |
e6a3ae |
O-Subject: [RHEL8.2/rhel qemu-kvm PATCH 10/15] vmxcap: correct the name of the variables
|
|
Pablo Greco |
e6a3ae |
Bugzilla: 1689270
|
|
Pablo Greco |
e6a3ae |
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
Pablo Greco |
e6a3ae |
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
Pablo Greco |
e6a3ae |
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
The low bits are 1 if the control must be one, the high bits
|
|
Pablo Greco |
e6a3ae |
are 1 if the control can be one. Correct the variable names
|
|
Pablo Greco |
e6a3ae |
as they are very confusing.
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Pablo Greco |
e6a3ae |
(cherry picked from commit 49d51b8927a9ea7267f4677a2e92f5046ce74025)
|
|
Pablo Greco |
e6a3ae |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
Pablo Greco |
e6a3ae |
---
|
|
Pablo Greco |
e6a3ae |
scripts/kvm/vmxcap | 14 +++++++-------
|
|
Pablo Greco |
e6a3ae |
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
Pablo Greco |
e6a3ae |
|
|
Pablo Greco |
e6a3ae |
diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap
|
|
Pablo Greco |
e6a3ae |
index 99a8146..2db6832 100755
|
|
Pablo Greco |
e6a3ae |
--- a/scripts/kvm/vmxcap
|
|
Pablo Greco |
e6a3ae |
+++ b/scripts/kvm/vmxcap
|
|
Pablo Greco |
e6a3ae |
@@ -51,15 +51,15 @@ class Control(object):
|
|
Pablo Greco |
e6a3ae |
return (val & 0xffffffff, val >> 32)
|
|
Pablo Greco |
e6a3ae |
def show(self):
|
|
Pablo Greco |
e6a3ae |
print(self.name)
|
|
Pablo Greco |
e6a3ae |
- mbz, mb1 = self.read2(self.cap_msr)
|
|
Pablo Greco |
e6a3ae |
- tmbz, tmb1 = 0, 0
|
|
Pablo Greco |
e6a3ae |
+ mb1, cb1 = self.read2(self.cap_msr)
|
|
Pablo Greco |
e6a3ae |
+ tmb1, tcb1 = 0, 0
|
|
Pablo Greco |
e6a3ae |
if self.true_cap_msr:
|
|
Pablo Greco |
e6a3ae |
- tmbz, tmb1 = self.read2(self.true_cap_msr)
|
|
Pablo Greco |
e6a3ae |
+ tmb1, tcb1 = self.read2(self.true_cap_msr)
|
|
Pablo Greco |
e6a3ae |
for bit in sorted(self.bits.keys()):
|
|
Pablo Greco |
e6a3ae |
- zero = not (mbz & (1 << bit))
|
|
Pablo Greco |
e6a3ae |
- one = mb1 & (1 << bit)
|
|
Pablo Greco |
e6a3ae |
- true_zero = not (tmbz & (1 << bit))
|
|
Pablo Greco |
e6a3ae |
- true_one = tmb1 & (1 << bit)
|
|
Pablo Greco |
e6a3ae |
+ zero = not (mb1 & (1 << bit))
|
|
Pablo Greco |
e6a3ae |
+ one = cb1 & (1 << bit)
|
|
Pablo Greco |
e6a3ae |
+ true_zero = not (tmb1 & (1 << bit))
|
|
Pablo Greco |
e6a3ae |
+ true_one = tcb1 & (1 << bit)
|
|
Pablo Greco |
e6a3ae |
s= '?'
|
|
Pablo Greco |
e6a3ae |
if (self.true_cap_msr and true_zero and true_one
|
|
Pablo Greco |
e6a3ae |
and one and not zero):
|
|
Pablo Greco |
e6a3ae |
--
|
|
Pablo Greco |
e6a3ae |
1.8.3.1
|
|
Pablo Greco |
e6a3ae |
|