qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic
@ 2023-09-05 14:56 Philippe Mathieu-Daudé
  2023-09-05 17:20 ` Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-05 14:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-arm, Philippe Mathieu-Daudé

Simplify gicv3_class_name() logic. No functional change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/intc/arm_gicv3_common.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
index 2ebf880ead..8863f06b67 100644
--- a/hw/intc/arm_gicv3_common.c
+++ b/hw/intc/arm_gicv3_common.c
@@ -612,13 +612,12 @@ type_init(register_types)
 
 const char *gicv3_class_name(void)
 {
-    if (kvm_irqchip_in_kernel()) {
-        return "kvm-arm-gicv3";
-    } else {
-        if (kvm_enabled()) {
+    if (kvm_enabled()) {
+        if (!kvm_irqchip_in_kernel()) {
             error_report("Userspace GICv3 is not supported with KVM");
             exit(1);
         }
-        return "arm-gicv3";
+        return "kvm-arm-gicv3";
     }
+    return "arm-gicv3";
 }
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic
  2023-09-05 14:56 [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic Philippe Mathieu-Daudé
@ 2023-09-05 17:20 ` Richard Henderson
  2023-09-06  8:40 ` Francisco Iglesias
  2023-09-08 12:16 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2023-09-05 17:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Peter Maydell, qemu-arm

On 9/5/23 07:56, Philippe Mathieu-Daudé wrote:
> Simplify gicv3_class_name() logic. No functional change intended.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/intc/arm_gicv3_common.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic
  2023-09-05 14:56 [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic Philippe Mathieu-Daudé
  2023-09-05 17:20 ` Richard Henderson
@ 2023-09-06  8:40 ` Francisco Iglesias
  2023-09-08 12:16 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Francisco Iglesias @ 2023-09-06  8:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-devel, Peter Maydell, qemu-arm

On [2023 Sep 05] Tue 16:56:51, Philippe Mathieu-Daudé wrote:
> Simplify gicv3_class_name() logic. No functional change intended.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>

> ---
>  hw/intc/arm_gicv3_common.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
> index 2ebf880ead..8863f06b67 100644
> --- a/hw/intc/arm_gicv3_common.c
> +++ b/hw/intc/arm_gicv3_common.c
> @@ -612,13 +612,12 @@ type_init(register_types)
>  
>  const char *gicv3_class_name(void)
>  {
> -    if (kvm_irqchip_in_kernel()) {
> -        return "kvm-arm-gicv3";
> -    } else {
> -        if (kvm_enabled()) {
> +    if (kvm_enabled()) {
> +        if (!kvm_irqchip_in_kernel()) {
>              error_report("Userspace GICv3 is not supported with KVM");
>              exit(1);
>          }
> -        return "arm-gicv3";
> +        return "kvm-arm-gicv3";
>      }
> +    return "arm-gicv3";
>  }
> -- 
> 2.41.0
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic
  2023-09-05 14:56 [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic Philippe Mathieu-Daudé
  2023-09-05 17:20 ` Richard Henderson
  2023-09-06  8:40 ` Francisco Iglesias
@ 2023-09-08 12:16 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-09-08 12:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-devel, qemu-arm

On Tue, 5 Sept 2023 at 15:56, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Simplify gicv3_class_name() logic. No functional change intended.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/intc/arm_gicv3_common.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
> index 2ebf880ead..8863f06b67 100644
> --- a/hw/intc/arm_gicv3_common.c
> +++ b/hw/intc/arm_gicv3_common.c
> @@ -612,13 +612,12 @@ type_init(register_types)
>
>  const char *gicv3_class_name(void)
>  {
> -    if (kvm_irqchip_in_kernel()) {
> -        return "kvm-arm-gicv3";
> -    } else {
> -        if (kvm_enabled()) {
> +    if (kvm_enabled()) {
> +        if (!kvm_irqchip_in_kernel()) {
>              error_report("Userspace GICv3 is not supported with KVM");
>              exit(1);
>          }
> -        return "arm-gicv3";
> +        return "kvm-arm-gicv3";
>      }
> +    return "arm-gicv3";
>  }

This doesn't seem to me to be obviously clearer or
simpler than the current code, which is the same basic
logic as the GICv2 gic_class_name(), but with the extra
condition of "report the error for the case we don't
support yet". In particular the major condition for
"should we be using kvm-arm-gicv3" is not "are we
using KVM?" but "are we using the KVM in-kernel irqchip?".

thanks
-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-08 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-05 14:56 [PATCH] hw/intc/arm_gicv3: Simplify gicv3_class_name() logic Philippe Mathieu-Daudé
2023-09-05 17:20 ` Richard Henderson
2023-09-06  8:40 ` Francisco Iglesias
2023-09-08 12:16 ` Peter Maydell

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).