Skip to contentSkip to conversation

target/ppc: Support directed privileged doorbell interrupt (SDOOR)

PATCH Applied Nicholas Piggin 3 participants 3 messages May 30, 2023 – Jun 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: Support directed privileged doorbell interrupt (SDOOR)

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.

---
Another stable candidate.

 target/ppc/excp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/excp_helper.c +1 -1
index fea9221501..add2bc6bfe 100644
@@ -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));
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Nicholas Piggin

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.

Quoted 2 lines

---
Another stable candidate.

Thanks,

C.

Quoted 24 lines
  target/ppc/excp_helper.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/excp_helper.c +1 -1
index fea9221501..add2bc6bfe 100644
@@ -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 lore raw
In reply to Nicholas Piggin

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,

Daniel

Quoted 34 lines · Nicholas Piggin

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.

---
Another stable candidate.

  target/ppc/excp_helper.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/excp_helper.c +1 -1
index fea9221501..add2bc6bfe 100644
@@ -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));