* [PATCH] microvm: do not use the lastest cpu version
@ 2025-02-13 9:41 Ani Sinha
2025-02-19 16:30 ` Igor Mammedov
2025-02-19 17:50 ` Sergio Lopez Pascual
0 siblings, 2 replies; 3+ messages in thread
From: Ani Sinha @ 2025-02-13 9:41 UTC (permalink / raw)
To: Sergio Lopez, Paolo Bonzini, Michael S. Tsirkin, Marcel Apfelbaum,
Richard Henderson, Eduardo Habkost, Zhao Liu
Cc: Ani Sinha, imammedo, qemu-devel
Microvm machines are not versioned and therefore there is no requirement to use
the latest cpu model by default. Let microvms use the non-versioned cpu model.
Those users who need spefific cpu versions can use explicit commandline to
select the cpu version desired.
CC: imammedo@redhat.com
CC: zhao1.liu@intel.com
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
hw/i386/microvm.c | 2 +-
target/i386/cpu.c | 15 ---------------
target/i386/cpu.h | 4 ----
3 files changed, 1 insertion(+), 20 deletions(-)
Pipeline passes:
https://gitlab.com/anisinha/qemu/-/pipelines/1669159835
See also Igor's comment on
https://patchwork.ozlabs.org/project/qemu-devel/patch/20250128035526.3750043-1-anisinha@redhat.com/
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index a8d354aabe..b8be1542ff 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -458,7 +458,7 @@ static void microvm_machine_state_init(MachineState *machine)
microvm_memory_init(mms);
- x86_cpus_init(x86ms, CPU_VERSION_LATEST);
+ x86_cpus_init(x86ms, 1);
microvm_devices_init(mms);
}
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index b5dd60d281..6d251c0025 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5513,18 +5513,6 @@ void x86_cpu_set_default_version(X86CPUVersion version)
default_cpu_version = version;
}
-static X86CPUVersion x86_cpu_model_last_version(const X86CPUModel *model)
-{
- int v = 0;
- const X86CPUVersionDefinition *vdef =
- x86_cpu_def_get_versions(model->cpudef);
- while (vdef->version) {
- v = vdef->version;
- vdef++;
- }
- return v;
-}
-
/* Return the actual version being used for a specific CPU model */
static X86CPUVersion x86_cpu_model_resolve_version(const X86CPUModel *model)
{
@@ -5532,9 +5520,6 @@ static X86CPUVersion x86_cpu_model_resolve_version(const X86CPUModel *model)
if (v == CPU_VERSION_AUTO) {
v = default_cpu_version;
}
- if (v == CPU_VERSION_LATEST) {
- return x86_cpu_model_last_version(model);
- }
return v;
}
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index c67b42d34f..71f150a05f 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -2701,10 +2701,6 @@ void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip,
TPRAccess access);
/* Special values for X86CPUVersion: */
-
-/* Resolve to latest CPU version */
-#define CPU_VERSION_LATEST -1
-
/*
* Resolve to version defined by current machine type.
* See x86_cpu_set_default_version()
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] microvm: do not use the lastest cpu version
2025-02-13 9:41 [PATCH] microvm: do not use the lastest cpu version Ani Sinha
@ 2025-02-19 16:30 ` Igor Mammedov
2025-02-19 17:50 ` Sergio Lopez Pascual
1 sibling, 0 replies; 3+ messages in thread
From: Igor Mammedov @ 2025-02-19 16:30 UTC (permalink / raw)
To: Ani Sinha
Cc: Sergio Lopez, Paolo Bonzini, Michael S. Tsirkin, Marcel Apfelbaum,
Richard Henderson, Eduardo Habkost, Zhao Liu, qemu-devel
On Thu, 13 Feb 2025 15:11:00 +0530
Ani Sinha <anisinha@redhat.com> wrote:
> Microvm machines are not versioned and therefore there is no requirement to use
> the latest cpu model by default. Let microvms use the non-versioned cpu model.
> Those users who need spefific cpu versions can use explicit commandline to
> select the cpu version desired.
Above says why we can do this but,
I'd also add here a reason why we are doing that to begin with.
>
> CC: imammedo@redhat.com
> CC: zhao1.liu@intel.com
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/i386/microvm.c | 2 +-
> target/i386/cpu.c | 15 ---------------
> target/i386/cpu.h | 4 ----
> 3 files changed, 1 insertion(+), 20 deletions(-)
>
> Pipeline passes:
> https://gitlab.com/anisinha/qemu/-/pipelines/1669159835
> See also Igor's comment on
> https://patchwork.ozlabs.org/project/qemu-devel/patch/20250128035526.3750043-1-anisinha@redhat.com/
>
> diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
> index a8d354aabe..b8be1542ff 100644
> --- a/hw/i386/microvm.c
> +++ b/hw/i386/microvm.c
> @@ -458,7 +458,7 @@ static void microvm_machine_state_init(MachineState *machine)
>
> microvm_memory_init(mms);
>
> - x86_cpus_init(x86ms, CPU_VERSION_LATEST);
> + x86_cpus_init(x86ms, 1);
>
> microvm_devices_init(mms);
> }
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index b5dd60d281..6d251c0025 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -5513,18 +5513,6 @@ void x86_cpu_set_default_version(X86CPUVersion version)
> default_cpu_version = version;
> }
>
> -static X86CPUVersion x86_cpu_model_last_version(const X86CPUModel *model)
> -{
> - int v = 0;
> - const X86CPUVersionDefinition *vdef =
> - x86_cpu_def_get_versions(model->cpudef);
> - while (vdef->version) {
> - v = vdef->version;
> - vdef++;
> - }
> - return v;
> -}
> -
> /* Return the actual version being used for a specific CPU model */
> static X86CPUVersion x86_cpu_model_resolve_version(const X86CPUModel *model)
> {
> @@ -5532,9 +5520,6 @@ static X86CPUVersion x86_cpu_model_resolve_version(const X86CPUModel *model)
> if (v == CPU_VERSION_AUTO) {
> v = default_cpu_version;
> }
> - if (v == CPU_VERSION_LATEST) {
> - return x86_cpu_model_last_version(model);
> - }
> return v;
> }
>
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index c67b42d34f..71f150a05f 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2701,10 +2701,6 @@ void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip,
> TPRAccess access);
>
> /* Special values for X86CPUVersion: */
> -
> -/* Resolve to latest CPU version */
> -#define CPU_VERSION_LATEST -1
> -
> /*
> * Resolve to version defined by current machine type.
> * See x86_cpu_set_default_version()
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] microvm: do not use the lastest cpu version
2025-02-13 9:41 [PATCH] microvm: do not use the lastest cpu version Ani Sinha
2025-02-19 16:30 ` Igor Mammedov
@ 2025-02-19 17:50 ` Sergio Lopez Pascual
1 sibling, 0 replies; 3+ messages in thread
From: Sergio Lopez Pascual @ 2025-02-19 17:50 UTC (permalink / raw)
To: Ani Sinha, Paolo Bonzini, Michael S. Tsirkin, Marcel Apfelbaum,
Richard Henderson, Eduardo Habkost, Zhao Liu
Cc: imammedo, qemu-devel
Ani Sinha <anisinha@redhat.com> writes:
> Microvm machines are not versioned and therefore there is no requirement to use
> the latest cpu model by default. Let microvms use the non-versioned cpu model.
> Those users who need spefific cpu versions can use explicit commandline to
> select the cpu version desired.
>
> CC: imammedo@redhat.com
> CC: zhao1.liu@intel.com
> Signed-off-by: Ani Sinha <anisinha@redhat.com>
> ---
> hw/i386/microvm.c | 2 +-
> target/i386/cpu.c | 15 ---------------
> target/i386/cpu.h | 4 ----
> 3 files changed, 1 insertion(+), 20 deletions(-)
Reviewed-by: Sergio Lopez <slp@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-19 17:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 9:41 [PATCH] microvm: do not use the lastest cpu version Ani Sinha
2025-02-19 16:30 ` Igor Mammedov
2025-02-19 17:50 ` Sergio Lopez Pascual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).