[PATCH v1] target/ppc: Support directed privileged doorbell interrupt (SDOOR)

Nicholas Piggin posted 1 patch 11 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230530130526.372701-1-npiggin@gmail.com
Maintainers: Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>
target/ppc/excp_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] target/ppc: Support directed privileged doorbell interrupt (SDOOR)
Posted by Nicholas Piggin 11 months, 2 weeks ago
BookS msgsndp instruction to self or DPDES register can cause SDOOR
interrupts which crash QEMU with exception not implemented.

Linux does not use msgsndp in SMT1, and KVM only uses DPDES to cause
doorbells when emulating a SMT guest (which is not the default), so
this has gone unnoticed.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
Another stable candidate.

 target/ppc/excp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index fea9221501..add2bc6bfe 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -1539,6 +1539,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
     case POWERPC_EXCP_DSEG:      /* Data segment exception                   */
     case POWERPC_EXCP_ISEG:      /* Instruction segment exception            */
     case POWERPC_EXCP_TRACE:     /* Trace exception                          */
+    case POWERPC_EXCP_SDOOR:     /* Doorbell interrupt                       */
         break;
     case POWERPC_EXCP_HISI:      /* Hypervisor instruction storage exception */
         msr |= env->error_code;
@@ -1584,7 +1585,6 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
     case POWERPC_EXCP_PERFM:     /* Embedded performance monitor interrupt   */
     case POWERPC_EXCP_VPUA:      /* Vector assist exception                  */
     case POWERPC_EXCP_MAINT:     /* Maintenance exception                    */
-    case POWERPC_EXCP_SDOOR:     /* Doorbell interrupt                       */
     case POWERPC_EXCP_HV_MAINT:  /* Hypervisor Maintenance exception         */
         cpu_abort(cs, "%s exception not implemented\n",
                   powerpc_excp_name(excp));
-- 
2.40.1
Re: [PATCH v1] target/ppc: Support directed privileged doorbell interrupt (SDOOR)
Posted by Daniel Henrique Barboza 11 months, 1 week ago
Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

On 5/30/23 10:05, Nicholas Piggin wrote:
> BookS msgsndp instruction to self or DPDES register can cause SDOOR
> interrupts which crash QEMU with exception not implemented.
> 
> Linux does not use msgsndp in SMT1, and KVM only uses DPDES to cause
> doorbells when emulating a SMT guest (which is not the default), so
> this has gone unnoticed.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> Another stable candidate.
> 
>   target/ppc/excp_helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index fea9221501..add2bc6bfe 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1539,6 +1539,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
>       case POWERPC_EXCP_DSEG:      /* Data segment exception                   */
>       case POWERPC_EXCP_ISEG:      /* Instruction segment exception            */
>       case POWERPC_EXCP_TRACE:     /* Trace exception                          */
> +    case POWERPC_EXCP_SDOOR:     /* Doorbell interrupt                       */
>           break;
>       case POWERPC_EXCP_HISI:      /* Hypervisor instruction storage exception */
>           msr |= env->error_code;
> @@ -1584,7 +1585,6 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
>       case POWERPC_EXCP_PERFM:     /* Embedded performance monitor interrupt   */
>       case POWERPC_EXCP_VPUA:      /* Vector assist exception                  */
>       case POWERPC_EXCP_MAINT:     /* Maintenance exception                    */
> -    case POWERPC_EXCP_SDOOR:     /* Doorbell interrupt                       */
>       case POWERPC_EXCP_HV_MAINT:  /* Hypervisor Maintenance exception         */
>           cpu_abort(cs, "%s exception not implemented\n",
>                     powerpc_excp_name(excp));
Re: [PATCH v1] target/ppc: Support directed privileged doorbell interrupt (SDOOR)
Posted by Cédric Le Goater 11 months, 2 weeks ago
On 5/30/23 15:05, Nicholas Piggin wrote:
> BookS msgsndp instruction to self or DPDES register can cause SDOOR
> interrupts which crash QEMU with exception not implemented.
> 
> Linux does not use msgsndp in SMT1, and KVM only uses DPDES to cause
> doorbells when emulating a SMT guest (which is not the default), so
> this has gone unnoticed.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Reviewed-by: Cédric Le Goater <clg@kaod.org>


> ---
> Another stable candidate.

Cc: qemu-stable@nongnu.org

Thanks,

C.

> 
>   target/ppc/excp_helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index fea9221501..add2bc6bfe 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1539,6 +1539,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
>       case POWERPC_EXCP_DSEG:      /* Data segment exception                   */
>       case POWERPC_EXCP_ISEG:      /* Instruction segment exception            */
>       case POWERPC_EXCP_TRACE:     /* Trace exception                          */
> +    case POWERPC_EXCP_SDOOR:     /* Doorbell interrupt                       */
>           break;
>       case POWERPC_EXCP_HISI:      /* Hypervisor instruction storage exception */
>           msr |= env->error_code;
> @@ -1584,7 +1585,6 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
>       case POWERPC_EXCP_PERFM:     /* Embedded performance monitor interrupt   */
>       case POWERPC_EXCP_VPUA:      /* Vector assist exception                  */
>       case POWERPC_EXCP_MAINT:     /* Maintenance exception                    */
> -    case POWERPC_EXCP_SDOOR:     /* Doorbell interrupt                       */
>       case POWERPC_EXCP_HV_MAINT:  /* Hypervisor Maintenance exception         */
>           cpu_abort(cs, "%s exception not implemented\n",
>                     powerpc_excp_name(excp));