Skip to contentSkip to conversation

s390x/protvirt: allow to IPL secure execution guests with -no-reboot

PATCH In review Christian Borntraeger 5 participants 8 messages Jul 21, 2020 – Jul 23, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x/protvirt: allow to IPL secure execution guests with -no-reboot

Right now -no-reboot does prevent secure execution guests from running. This is right from an implementation aspect, as we have modeled the transition from non-secure to secure as a program directed IPL. From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into secure mode similar to the functions that we use for kdump/kexec. In other words we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1 Function 10 is not a classic reboot. For example it can only be called once. To call it a 2nd time a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot.

Fixes 4d226deafc44 ("s390x: protvirt: Support unpack facility")
---
 hw/s390x/ipl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/s390x/ipl.c +2 -1
index ce21494c08..e312a35133 100644
@@ -633,7 +633,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
         }
     }
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
         /* ignore -no-reboot, send no event  */
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
     } else {
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Christian Borntraeger

Right now -no-reboot does prevent secure execution guests from running. This is right from an implementation aspect, as we have modeled the transition from non-secure to secure as a program directed IPL.
From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into secure mode similar to the functions that we use for kdump/kexec. In other words we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1 Function 10 is not a classic reboot. For example it can only be called once. To call it a 2nd time a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot.

Fixes 4d226deafc44 ("s390x: protvirt: Support unpack facility")
---
  hw/s390x/ipl.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/s390x/ipl.c +0 -0
index ce21494c08..e312a35133 100644

hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 640

Quoted 9 lines
hw/s390x/ipl.c +2 -1
@@ -633,7 +633,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
          }
      }
      if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
          /* ignore -no-reboot, send no event  */
          qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
      } else {

I agree that the observable behavior is more logical this way, as the transition to secure mode is more like to kexec (transfer control to an in-memory kernel) than to the other IPL methods (boot from a device).

Signature · 2 lines
Kind Regards,
   Viktor
Reviewed-by on v1 1/1
#2 lore raw
In reply to Christian Borntraeger
Quoted 25 lines · Christian Borntraeger

Right now -no-reboot does prevent secure execution guests from running. This is right from an implementation aspect, as we have modeled the transition from non-secure to secure as a program directed IPL. From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into secure mode similar to the functions that we use for kdump/kexec. In other words we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1 Function 10 is not a classic reboot. For example it can only be called once. To call it a 2nd time a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot.

Fixes 4d226deafc44 ("s390x: protvirt: Support unpack facility")
---
 hw/s390x/ipl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/s390x/ipl.c +0 -0
index ce21494c08..e312a35133 100644

hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 640

Quoted 9 lines
hw/s390x/ipl.c +2 -1
@@ -633,7 +633,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
         }
     }
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
         /* ignore -no-reboot, send no event  */
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
     } else {
Signature · 3 lines
Thanks,

David / dhildenb
Reviewed-by on v1 1/1
#3 lore raw
In reply to Christian Borntraeger
Quoted 1 line · Christian Borntraeger

Right now -no-reboot does prevent secure execution guests from running.

s/-no-reboot/--no-reboot/

Quoted 2 lines

This is right from an implementation aspect, as we have modeled the transition from non-secure to secure as a program directed IPL.

s/secure/protected/

Quoted 3 lines

From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into secure mode similar to the functions

s/secure/protected/

Quoted 3 lines

that we use for kdump/kexec. In other words we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1 Function 10 is not a classic reboot. For example it can only be called

s/Function/function/ and maybe also add a comma

Quoted 6 lines

once. To call it a 2nd time a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot.

Fixes 4d226deafc44 ("s390x: protvirt: Support unpack facility")
Quoted 19 lines
---
 hw/s390x/ipl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/s390x/ipl.c +2 -1
index ce21494c08..e312a35133 100644
@@ -633,7 +633,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
         }
     }
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
         /* ignore -no-reboot, send no event  */
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
     } else {
#4 lore raw
Quoted 4 lines · Janosch Frank
Quoted 1 line · Christian Borntraeger

Right now -no-reboot does prevent secure execution guests from running.

s/-no-reboot/--no-reboot/

Actually qemu --help gives the parameters with just one "-"

Not sure about secure vs protected. Whatever Conny prefers.

#5 lore raw
Quoted 10 lines · On Tue, 21 Jul 2020 14:29:29 +0200 Christian Borntraeger…
Quoted 4 lines · Janosch Frank
Quoted 1 line · Christian Borntraeger

Right now -no-reboot does prevent secure execution guests from running.

s/-no-reboot/--no-reboot/

Actually qemu --help gives the parameters with just one "-"

Not sure about secure vs protected. Whatever Conny prefers.

The doc seems to talk about "protected virtualization", "protected mode", and "secure guests". What about (slight rewording):

"s390x/protvirt: allow to IPL secure guests with -no-reboot

Right now, -no-reboot prevents secure guests from running. This is correct from an implementation point of view, as we have modeled the transition from non-secure to secure as a program directed IPL. From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into protected mode similar to the functions that we use for kdump/kexec. In other words, we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1, function 10 is not a classic reboot. For example, it can only be called once. Before calling it a second time, a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot."

I think this is still appropriate for hard freeze.

#6 lore raw
Quoted 32 lines · Cornelia Huck
Quoted 10 lines · On Tue, 21 Jul 2020 14:29:29 +0200 Christian Borntraeger…
Quoted 4 lines · Janosch Frank
Quoted 1 line · Christian Borntraeger

Right now -no-reboot does prevent secure execution guests from running.

s/-no-reboot/--no-reboot/

Actually qemu --help gives the parameters with just one "-"

Not sure about secure vs protected. Whatever Conny prefers.

The doc seems to talk about "protected virtualization", "protected mode", and "secure guests". What about (slight rewording):

"s390x/protvirt: allow to IPL secure guests with -no-reboot

Right now, -no-reboot prevents secure guests from running. This is correct from an implementation point of view, as we have modeled the transition from non-secure to secure as a program directed IPL. From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into protected mode similar to the functions that we use for kdump/kexec. In other words, we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1, function 10 is not a classic reboot. For example, it can only be called once. Before calling it a second time, a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot."

Quoted 1 line

I think this is still appropriate for hard freeze.

i agree. Can you pick this up and fixup the patch description according to your preference? Your proposal looks fine.

#7 lore raw
In reply to Christian Borntraeger
Quoted 24 lines · On Tue, 21 Jul 2020 06:32:02 -0400 Christian Borntraeger…

Right now -no-reboot does prevent secure execution guests from running. This is right from an implementation aspect, as we have modeled the transition from non-secure to secure as a program directed IPL. From a user perspective, this is not the behavior of least surprise.

We should implement the IPL into secure mode similar to the functions that we use for kdump/kexec. In other words we do not stop here when -no-reboot is specified on the command line. Like function 0 or function 1 Function 10 is not a classic reboot. For example it can only be called once. To call it a 2nd time a real reboot/reset must happen in-between. So function code 10 is more or less a state transition reset, but not a "standard" reset or reboot.

Fixes 4d226deafc44 ("s390x: protvirt: Support unpack facility")
---
 hw/s390x/ipl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/s390x/ipl.c +0 -0
index ce21494c08..e312a35133 100644

hw/s390x/ipl.c void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) · line 640

Quoted 9 lines
hw/s390x/ipl.c +2 -1
@@ -633,7 +633,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
         }
     }
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
         /* ignore -no-reboot, send no event  */
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
     } else {

Thanks, queued to s390-fixes.