aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-04-10 16:58:56 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-04-10 16:58:56 +0100
commit555249a59e9cdd6b58da103aba5cf3a2d45c899f (patch)
treefb7fa2d4f6759c8b62cb3016b1b83f567f57d104
parent836b36af9340c42d5a6642070d99944329e388bc (diff)
parent0b47ec4b95ad1952e55e639711d442f8ec6e1345 (diff)
Merge remote-tracking branch 'remotes/ehabkost-gl/tags/x86-next-pull-request' into staging
x86 and CPU bug fixes for 6.0-rc3 * Add missing features to EPYC-Rome CPU model (Babu Moger) * Fix crash with "-device ...-cpu-core,help" (Greg Kurz) # gpg: Signature made Fri 09 Apr 2021 21:20:18 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost-gl/tags/x86-next-pull-request: cpu/core: Fix "help" of CPU core device types i386: Add missing cpu feature bits in EPYC-Rome model Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/cpu/core.c10
-rw-r--r--target/i386/cpu.c12
2 files changed, 20 insertions, 2 deletions
diff --git a/hw/cpu/core.c b/hw/cpu/core.c
index 92d3b2fbad..9876075155 100644
--- a/hw/cpu/core.c
+++ b/hw/cpu/core.c
@@ -66,10 +66,16 @@ static void core_prop_set_nr_threads(Object *obj, Visitor *v, const char *name,
static void cpu_core_instance_init(Object *obj)
{
- MachineState *ms = MACHINE(qdev_get_machine());
CPUCore *core = CPU_CORE(obj);
- core->nr_threads = ms->smp.threads;
+ /*
+ * Only '-device something-cpu-core,help' can get us there before
+ * the machine has been created. We don't care to set nr_threads
+ * in this case since it isn't used afterwards.
+ */
+ if (current_machine) {
+ core->nr_threads = current_machine->smp.threads;
+ }
}
static void cpu_core_class_init(ObjectClass *oc, void *data)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6b3e9467f1..ad99cad0e7 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4179,6 +4179,18 @@ static X86CPUDefinition builtin_x86_defs[] = {
.xlevel = 0x8000001E,
.model_id = "AMD EPYC-Rome Processor",
.cache_info = &epyc_rome_cache_info,
+ .versions = (X86CPUVersionDefinition[]) {
+ { .version = 1 },
+ {
+ .version = 2,
+ .props = (PropValue[]) {
+ { "ibrs", "on" },
+ { "amd-ssbd", "on" },
+ { /* end of list */ }
+ }
+ },
+ { /* end of list */ }
+ }
},
{
.name = "EPYC-Milan",