[PATCH v2 5/5] target/arm: cpu: alter error message for host CPU type

Mohamed Mediouni posted 5 patches 3 weeks, 6 days ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Pedro Barbuda <pbarbuda@microsoft.com>, Mohamed Mediouni <mohamed@unpredictable.fr>
[PATCH v2 5/5] target/arm: cpu: alter error message for host CPU type
Posted by Mohamed Mediouni 3 weeks, 6 days ago
Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
---
 target/arm/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 7e3e84b4bb..e73d7eb4fc 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1629,8 +1629,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
      * this is the first point where we can report it.
      */
     if (cpu->host_cpu_probe_failed) {
-        if (!kvm_enabled() && !hvf_enabled()) {
-            error_setg(errp, "The 'host' CPU type can only be used with KVM or HVF");
+        if (!kvm_enabled() && !hvf_enabled() && !whpx_enabled()) {
+            error_setg(errp, "The 'host' CPU type can only be used with KVM, HVF or WHPX");
         } else {
             error_setg(errp, "Failed to retrieve host CPU features");
         }
-- 
2.50.1 (Apple Git-155)
Re: [PATCH v2 5/5] target/arm: cpu: alter error message for host CPU type
Posted by Philippe Mathieu-Daudé 3 weeks, 5 days ago
On 11/3/26 16:10, Mohamed Mediouni wrote:
> Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> ---
>   target/arm/cpu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 7e3e84b4bb..e73d7eb4fc 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -1629,8 +1629,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
>        * this is the first point where we can report it.
>        */
>       if (cpu->host_cpu_probe_failed) {
> -        if (!kvm_enabled() && !hvf_enabled()) {
> -            error_setg(errp, "The 'host' CPU type can only be used with KVM or HVF");
> +        if (!kvm_enabled() && !hvf_enabled() && !whpx_enabled()) {
> +            error_setg(errp, "The 'host' CPU type can only be used with KVM, HVF or WHPX");

Squash with patch #1?

>           } else {
>               error_setg(errp, "Failed to retrieve host CPU features");
>           }
Re: [PATCH v2 5/5] target/arm: cpu: alter error message for host CPU type
Posted by Philippe Mathieu-Daudé 3 weeks, 5 days ago
On Thu, 12 Mar 2026 at 19:19, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 11/3/26 16:10, Mohamed Mediouni wrote:
> > Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
> > ---
> >   target/arm/cpu.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> > index 7e3e84b4bb..e73d7eb4fc 100644
> > --- a/target/arm/cpu.c
> > +++ b/target/arm/cpu.c
> > @@ -1629,8 +1629,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
> >        * this is the first point where we can report it.
> >        */
> >       if (cpu->host_cpu_probe_failed) {
> > -        if (!kvm_enabled() && !hvf_enabled()) {
> > -            error_setg(errp, "The 'host' CPU type can only be used with KVM or HVF");
> > +        if (!kvm_enabled() && !hvf_enabled() && !whpx_enabled()) {
> > +            error_setg(errp, "The 'host' CPU type can only be used with KVM, HVF or WHPX");
>
> Squash with patch #1?
>
> >           } else {
> >               error_setg(errp, "Failed to retrieve host CPU features");
> >           }
>

At any rate,
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>