...
...
6
special default_cpu_version value of CPU_VERSION_LEGACY is used.
6
special default_cpu_version value of CPU_VERSION_LEGACY is used.
7
- It was thought that future machines would use the latest value of cpu
7
- It was thought that future machines would use the latest value of cpu
8
versions corresponding to default_cpu_version value of
8
versions corresponding to default_cpu_version value of
9
CPU_VERSION_LATEST [1].
9
CPU_VERSION_LATEST [1].
10
10
11
Unfortunately, all pc machines still use the default cpu version of 1 for
11
All pc machines still use the default cpu version of 1 for
12
unversioned cpu models. Only microvms use CPU_VERSION_LATEST.
12
unversioned cpu models. CPU_VERSION_LATEST is a moving target and
13
changes with time. Therefore, if machines use CPU_VERSION_LATEST, it would
14
mean that over a period of time, for the same machine type, the cpu version
15
would be different depending on what is latest at that time. This would
16
break guests even when they use a constant machine type. Therefore, for
17
pc machines, use of CPU_VERSION_LATEST is not possible. Currently, only
18
microvms use CPU_VERSION_LATEST.
13
19
14
This change cleans up the complicated logic around default_cpu_version
20
This change cleans up the complicated logic around default_cpu_version
15
including getting rid of default_cpu_version property itself. A couple of new
21
including getting rid of default_cpu_version property itself. A couple of new
16
flags are introduced, one for the legacy model for machines 4.0.1 and older
22
flags are introduced, one for the legacy model for machines 4.0.1 and older
17
and other for microvms. For older machines, a new pc machine property is
23
and other for microvms. For older machines, a new pc machine property is
...
...
40
include/hw/i386/x86.h | 5 ++++-
46
include/hw/i386/x86.h | 5 ++++-
41
target/i386/cpu.c | 50 +++++++++++++++++++++----------------------
47
target/i386/cpu.c | 50 +++++++++++++++++++++----------------------
42
target/i386/cpu.h | 21 ++++--------------
48
target/i386/cpu.h | 21 ++++--------------
43
8 files changed, 69 insertions(+), 57 deletions(-)
49
8 files changed, 69 insertions(+), 57 deletions(-)
44
50
51
changelog:
52
v2: explain in commit log why use of CPU_VERSION_LATEST for machines
53
is problematic.
54
45
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
55
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
46
index XXXXXXX..XXXXXXX 100644
56
index XXXXXXX..XXXXXXX 100644
47
--- a/hw/i386/microvm.c
57
--- a/hw/i386/microvm.c
48
+++ b/hw/i386/microvm.c
58
+++ b/hw/i386/microvm.c
49
@@ -XXX,XX +XXX,XX @@ static void microvm_machine_state_init(MachineState *machine)
59
@@ -XXX,XX +XXX,XX @@ static void microvm_machine_state_init(MachineState *machine)
...
...
diff view generated by jsdifflib