Re: [PATCH v4 3/3] target/s390x: Return UVC cmd code, RC and RRC value when DIAG 308 Subcode 10 fails to enter secure mode

2025-04-22 Thread Thomas Huth

On 22/04/2025 15.17, Janosch Frank wrote:

On 4/17/25 2:37 PM, Gautam Gala wrote:

Extend DIAG308 subcode 10 to return the UVC RC, RRC and command code
in bit positions 32-47, 16-31, and 0-15 of register R1 + 1 if the
function does not complete successfully (in addition to the
previously returned diag response code in bit position 47-63).

Signed-off-by: Gautam Gala 
---


[...]


+void s390_pv_inject_reset_error(CPUState *cs,
+    struct S390PVResponse pv_resp)
  {
  int r1 = (cs->kvm_run->s390_sieic.ipa & 0x00f0) >> 4;
  CPUS390XState *env = &S390_CPU(cs)->env;
+    union {
+    struct {
+    uint16_t pv_cmd;
+    uint16_t pv_rrc;
+    uint16_t pv_rc;
+    uint16_t diag_rc;
+    };
+    uint64_t regs;
+    } resp = {.pv_cmd = pv_resp.cmd,
+  .pv_rrc = pv_resp.rrc,
+  .pv_rc = pv_resp.rc,
+  .diag_rc = DIAG_308_RC_INVAL_FOR_PV};
+


@Thomas: Is the formatting of the assignments correct or should there be no 
assignment on lines containing "{}"?


Checkpatch is happy, though personally I find it hard to read.


I think I'd rather have the ".pv_cmd = ..." start on the next line.

 Thanks
  Thomas





Re: [PATCH v4 3/3] target/s390x: Return UVC cmd code, RC and RRC value when DIAG 308 Subcode 10 fails to enter secure mode

2025-04-22 Thread Janosch Frank

On 4/17/25 2:37 PM, Gautam Gala wrote:

Extend DIAG308 subcode 10 to return the UVC RC, RRC and command code
in bit positions 32-47, 16-31, and 0-15 of register R1 + 1 if the
function does not complete successfully (in addition to the
previously returned diag response code in bit position 47-63).

Signed-off-by: Gautam Gala 
---


[...]


+void s390_pv_inject_reset_error(CPUState *cs,
+struct S390PVResponse pv_resp)
  {
  int r1 = (cs->kvm_run->s390_sieic.ipa & 0x00f0) >> 4;
  CPUS390XState *env = &S390_CPU(cs)->env;
  
+union {

+struct {
+uint16_t pv_cmd;
+uint16_t pv_rrc;
+uint16_t pv_rc;
+uint16_t diag_rc;
+};
+uint64_t regs;
+} resp = {.pv_cmd = pv_resp.cmd,
+  .pv_rrc = pv_resp.rrc,
+  .pv_rc = pv_resp.rc,
+  .diag_rc = DIAG_308_RC_INVAL_FOR_PV};
+


@Thomas: Is the formatting of the assignments correct or should there be 
no assignment on lines containing "{}"?


Checkpatch is happy, though personally I find it hard to read.

Once that's clear or fixed:
Reviewed-by: Janosch Frank