qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, pmorel@linux.ibm.com, cohuck@redhat.com,
	borntraeger@de.ibm.com, qemu-s390x@nongnu.org,
	mihajlov@linux.ibm.com
Subject: Re: [PATCH v2 01/13] s390x: protvirt: Add diag308 subcodes 8 - 10
Date: Fri, 29 Nov 2019 12:18:56 +0100	[thread overview]
Message-ID: <46d14db9-f7cc-adce-df1c-d35cd26dc546@linux.ibm.com> (raw)
In-Reply-To: <d12fe27e-fcce-1704-8ac3-5dca18627422@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 3994 bytes --]

On 11/29/19 11:09 AM, David Hildenbrand wrote:
> [...]
>>  
>> +struct IPLBlockPVComp {
>> +    uint64_t tweak_pref;
>> +    uint64_t addr;
>> +    uint64_t size;
>> +} QEMU_PACKED;
> 
> QEMU_PACKED  should not be needed.
> 
>> +typedef struct IPLBlockPVComp IPLBlockPVComp;
>> +
>> +struct IPLBlockPV {
>> +    uint8_t  reserved[84];
> 
> "reserved0"
> 
>> +    uint8_t  reserved67[3];
> 
> Where does that magic 67 come from? (84 dec is 54 hex)
> 
>> +    uint8_t  version;
> 
> So, to this point we spent 88 bytes == 11 * uint64_t.

I'll have a look

> 
>> +    uint32_t num_comp;
> 
> ... so after this, all uint64_t (and components) are mis-aligned by
> 32bit - is that correct?
> 
>> +    uint64_t pv_header_addr;
>> +    uint64_t pv_header_len;
>> +    struct IPLBlockPVComp components[];
>> +} QEMU_PACKED;
>> +typedef struct IPLBlockPV IPLBlockPV;
>> +
>>  struct IplBlockCcw {
>>      uint8_t  reserved0[85];
>>      uint8_t  ssid;
>> @@ -71,6 +89,7 @@ union IplParameterBlock {
>>          union {
>>              IplBlockCcw ccw;
>>              IplBlockFcp fcp;
>> +            IPLBlockPV pv;
>>              IplBlockQemuScsi scsi;
>>          };
>>      } QEMU_PACKED;
>> @@ -84,9 +103,11 @@ union IplParameterBlock {
>>  typedef union IplParameterBlock IplParameterBlock;
>>  
>>  int s390_ipl_set_loadparm(uint8_t *loadparm);
>> +int s390_ipl_pv_check_comp(IplParameterBlock *iplb);
>>  void s390_ipl_update_diag308(IplParameterBlock *iplb);
>>  void s390_ipl_prepare_cpu(S390CPU *cpu);
>>  IplParameterBlock *s390_ipl_get_iplb(void);
>> +IplParameterBlock *s390_ipl_get_iplb_secure(void);
>>  
>>  enum s390_reset {
>>      /* default is a reset not triggered by a CPU e.g. issued by QMP */
>> @@ -94,6 +115,7 @@ enum s390_reset {
>>      S390_RESET_REIPL,
>>      S390_RESET_MODIFIED_CLEAR,
>>      S390_RESET_LOAD_NORMAL,
>> +    S390_RESET_PV,
> 
> I do wonder if that should be called S390_RESET_PV_START

I have no strong feelings for the name, whatever floats you boat(s)

> 
>>  };
>>  void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type);
>>  void s390_ipl_get_reset_request(CPUState **cs, enum s390_reset *reset_type);
>> @@ -133,6 +155,7 @@ struct S390IPLState {
>>      /*< private >*/
>>      DeviceState parent_obj;
>>      IplParameterBlock iplb;
>> +    IplParameterBlock iplb_pbt5;
>>      QemuIplParameters qipl;
>>      uint64_t start_addr;
>>      uint64_t compat_start_addr;
>> @@ -140,6 +163,7 @@ struct S390IPLState {
>>      uint64_t compat_bios_start_addr;
>>      bool enforce_bios;
>>      bool iplb_valid;
>> +    bool iplb_valid_pbt5;
>>      bool netboot;
>>      /* reset related properties don't have to be migrated or reset */
>>      enum s390_reset reset_type;
>> @@ -161,9 +185,11 @@ QEMU_BUILD_BUG_MSG(offsetof(S390IPLState, iplb) & 3, "alignment of iplb wrong");
>>  
>>  #define S390_IPL_TYPE_FCP 0x00
>>  #define S390_IPL_TYPE_CCW 0x02
>> +#define S390_IPL_TYPE_PV 0x05
>>  #define S390_IPL_TYPE_QEMU_SCSI 0xff
>>  
>>  #define S390_IPLB_HEADER_LEN 8
>> +#define S390_IPLB_MIN_PV_LEN 148
>>  #define S390_IPLB_MIN_CCW_LEN 200
>>  #define S390_IPLB_MIN_FCP_LEN 384
>>  #define S390_IPLB_MIN_QEMU_SCSI_LEN 200
>> @@ -185,4 +211,11 @@ static inline bool iplb_valid_fcp(IplParameterBlock *iplb)
>>             iplb->pbt == S390_IPL_TYPE_FCP;
>>  }
>>  
>> +static inline bool iplb_valid_se(IplParameterBlock *iplb)
> 
> s/_se/_pv/ ? Or was that intended?

Not intended, the rename in the middle of the project took some tolls.

> 
>> +{
>> +    return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_PV_LEN &&
>> +           iplb->pbt == S390_IPL_TYPE_PV;
>> +}
>> +
>> +
> 
> Maybe drop one empty line

Sure

> 
>>  #endif
>> diff --git a/target/s390x/diag.c b/target/s390x/diag.c
>> index b5aec06d6b..112a6c92e0 100644
>> --- a/target/s390x/diag.c
>> +++ b/target/s390x/diag.c
> [...]
> 
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 829 bytes --]

  reply	other threads:[~2019-11-29 11:30 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29  9:47 [PATCH v2 00/13] s390x: Protected Virtualization support Janosch Frank
2019-11-29  9:47 ` [PATCH v2 01/13] s390x: protvirt: Add diag308 subcodes 8 - 10 Janosch Frank
2019-11-29 10:09   ` David Hildenbrand
2019-11-29 11:18     ` Janosch Frank [this message]
2019-11-29 11:41       ` Cornelia Huck
2019-11-29 12:40   ` Thomas Huth
2019-11-29 14:08     ` Janosch Frank
2019-12-02  9:20       ` Cornelia Huck
2019-11-29  9:47 ` [PATCH v2 02/13] Header sync protvirt Janosch Frank
2019-11-29  9:47 ` [PATCH v2 03/13] s390x: protvirt: Support unpack facility Janosch Frank
2019-11-29 10:19   ` David Hildenbrand
2019-12-04 10:48   ` Thomas Huth
2019-12-04 11:32     ` Janosch Frank
2019-12-04 11:34       ` Thomas Huth
2019-12-04 11:46         ` Janosch Frank
2019-11-29  9:48 ` [PATCH v2 04/13] s390x: protvirt: Handle diag 308 subcodes 0,1,3,4 Janosch Frank
2019-11-29 10:23   ` David Hildenbrand
2019-11-29  9:48 ` [PATCH v2 05/13] s390x: protvirt: Add pv state to cpu env Janosch Frank
2019-11-29 10:30   ` David Hildenbrand
2019-11-29 11:22     ` Janosch Frank
2019-12-06  9:50     ` Janosch Frank
2019-12-06  9:56       ` David Hildenbrand
2019-11-29  9:48 ` [PATCH v2 06/13] s390x: protvirt: KVM intercept changes Janosch Frank
2019-11-29 10:34   ` David Hildenbrand
2019-12-05 17:15   ` Cornelia Huck
2019-12-05 17:34     ` Janosch Frank
2019-12-05 17:46       ` Cornelia Huck
2019-12-06  7:44         ` Janosch Frank
2019-12-06  8:29           ` Cornelia Huck
2019-12-06  8:45             ` Janosch Frank
2019-12-06  9:08               ` Cornelia Huck
2019-12-06  9:30                 ` Janosch Frank
2019-11-29  9:48 ` [PATCH v2 07/13] s390x: protvirt: SCLP interpretation Janosch Frank
2019-11-29 10:43   ` David Hildenbrand
2019-11-29 11:15     ` Janosch Frank
2019-11-29 11:27       ` David Hildenbrand
2019-11-29  9:48 ` [PATCH v2 08/13] s390x: protvirt: Add new VCPU reset functions Janosch Frank
2019-11-29 10:47   ` David Hildenbrand
2019-11-29 11:21     ` Janosch Frank
2019-11-29 11:24       ` David Hildenbrand
2019-12-04 11:58   ` Thomas Huth
2019-12-04 12:44     ` Janosch Frank
2019-11-29  9:48 ` [PATCH v2 09/13] s390x: Exit on vcpu reset error Janosch Frank
2019-11-29  9:48 ` [PATCH v2 10/13] s390x: protvirt: Set guest IPL PSW Janosch Frank
2019-11-29 11:30   ` David Hildenbrand
2019-11-29 11:47   ` David Hildenbrand
2019-11-29  9:48 ` [PATCH v2 11/13] s390x: protvirt: Move diag 308 data over SIDAD Janosch Frank
2019-11-29 11:34   ` David Hildenbrand
2019-11-29  9:48 ` [PATCH v2 12/13] s390x: protvirt: Disable address checks for PV guest IO emulation Janosch Frank
2019-11-29 11:42   ` David Hildenbrand
2019-12-04 12:16   ` Thomas Huth
2019-12-05 17:44   ` Cornelia Huck
2019-11-29  9:48 ` [PATCH v2 13/13] s390x: protvirt: Handle SIGP store status correctly Janosch Frank
2019-11-29 11:04   ` Thomas Huth
2019-11-29 11:08     ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46d14db9-f7cc-adce-df1c-d35cd26dc546@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=mihajlov@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).