diff mbox series

[kvm-unit-tests,4/5] lib: s390x: uv: Add offset comments to uv_query and extend it

Message ID 20210629133322.19193-5-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: sie and uv cleanups | expand

Commit Message

Janosch Frank June 29, 2021, 1:33 p.m. UTC
The struct is getting longer, let's add offset comments so we know
where we change things when we add struct members.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 lib/s390x/asm/uv.h | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

Comments

Cornelia Huck June 30, 2021, 9:06 a.m. UTC | #1
On Tue, Jun 29 2021, Janosch Frank <frankja@linux.ibm.com> wrote:

> The struct is getting longer, let's add offset comments so we know
> where we change things when we add struct members.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/asm/uv.h | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
> index 96a2a7e..5ff98b8 100644
> --- a/lib/s390x/asm/uv.h
> +++ b/lib/s390x/asm/uv.h
> @@ -86,22 +86,23 @@ struct uv_cb_init {
>  } __attribute__((packed))  __attribute__((aligned(8)));
>  
>  struct uv_cb_qui {
> -	struct uv_cb_header header;
> -	uint64_t reserved08;
> -	uint64_t inst_calls_list[4];
> -	uint64_t reserved30[2];
> -	uint64_t uv_base_stor_len;
> -	uint64_t reserved48;
> -	uint64_t conf_base_phys_stor_len;
> -	uint64_t conf_base_virt_stor_len;
> -	uint64_t conf_virt_var_stor_len;
> -	uint64_t cpu_stor_len;
> -	uint32_t reserved70[3];
> -	uint32_t max_num_sec_conf;
> -	uint64_t max_guest_stor_addr;
> -	uint8_t  reserved88[158 - 136];
> -	uint16_t max_guest_cpus;
> -	uint8_t  reserveda0[200 - 160];
> +	struct uv_cb_header header;		/* 0x0000 */
> +	uint64_t reserved08;			/* 0x0008 */
> +	uint64_t inst_calls_list[4];		/* 0x0010 */
> +	uint64_t reserved30[2];			/* 0x0030 */
> +	uint64_t uv_base_stor_len;		/* 0x0040 */
> +	uint64_t reserved48;			/* 0x0048 */
> +	uint64_t conf_base_phys_stor_len;	/* 0x0050 */
> +	uint64_t conf_base_virt_stor_len;	/* 0x0058 */
> +	uint64_t conf_virt_var_stor_len;	/* 0x0060 */
> +	uint64_t cpu_stor_len;			/* 0x0068 */
> +	uint32_t reserved70[3];			/* 0x0070 */
> +	uint32_t max_num_sec_conf;		/* 0x007c */
> +	uint64_t max_guest_stor_addr;		/* 0x0080 */
> +	uint8_t  reserved88[158 - 136];		/* 0x0088 */
> +	uint16_t max_guest_cpus;		/* 0x009e */
> +	uint64_t uv_feature_indications;	/* 0x00a0 */
> +	uint8_t  reserveda0[200 - 168];		/* 0x00a8 */

Should this rather be reserveda8? The other reserveds encode their
position properly.
Janosch Frank June 30, 2021, 9:43 a.m. UTC | #2
On 6/30/21 11:06 AM, Cornelia Huck wrote:
> On Tue, Jun 29 2021, Janosch Frank <frankja@linux.ibm.com> wrote:
> 
>> The struct is getting longer, let's add offset comments so we know
>> where we change things when we add struct members.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  lib/s390x/asm/uv.h | 33 +++++++++++++++++----------------
>>  1 file changed, 17 insertions(+), 16 deletions(-)
>>
>> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
>> index 96a2a7e..5ff98b8 100644
>> --- a/lib/s390x/asm/uv.h
>> +++ b/lib/s390x/asm/uv.h
>> @@ -86,22 +86,23 @@ struct uv_cb_init {
>>  } __attribute__((packed))  __attribute__((aligned(8)));
>>  
>>  struct uv_cb_qui {
>> -	struct uv_cb_header header;
>> -	uint64_t reserved08;
>> -	uint64_t inst_calls_list[4];
>> -	uint64_t reserved30[2];
>> -	uint64_t uv_base_stor_len;
>> -	uint64_t reserved48;
>> -	uint64_t conf_base_phys_stor_len;
>> -	uint64_t conf_base_virt_stor_len;
>> -	uint64_t conf_virt_var_stor_len;
>> -	uint64_t cpu_stor_len;
>> -	uint32_t reserved70[3];
>> -	uint32_t max_num_sec_conf;
>> -	uint64_t max_guest_stor_addr;
>> -	uint8_t  reserved88[158 - 136];
>> -	uint16_t max_guest_cpus;
>> -	uint8_t  reserveda0[200 - 160];
>> +	struct uv_cb_header header;		/* 0x0000 */
>> +	uint64_t reserved08;			/* 0x0008 */
>> +	uint64_t inst_calls_list[4];		/* 0x0010 */
>> +	uint64_t reserved30[2];			/* 0x0030 */
>> +	uint64_t uv_base_stor_len;		/* 0x0040 */
>> +	uint64_t reserved48;			/* 0x0048 */
>> +	uint64_t conf_base_phys_stor_len;	/* 0x0050 */
>> +	uint64_t conf_base_virt_stor_len;	/* 0x0058 */
>> +	uint64_t conf_virt_var_stor_len;	/* 0x0060 */
>> +	uint64_t cpu_stor_len;			/* 0x0068 */
>> +	uint32_t reserved70[3];			/* 0x0070 */
>> +	uint32_t max_num_sec_conf;		/* 0x007c */
>> +	uint64_t max_guest_stor_addr;		/* 0x0080 */
>> +	uint8_t  reserved88[158 - 136];		/* 0x0088 */
>> +	uint16_t max_guest_cpus;		/* 0x009e */
>> +	uint64_t uv_feature_indications;	/* 0x00a0 */
>> +	uint8_t  reserveda0[200 - 168];		/* 0x00a8 */
> 
> Should this rather be reserveda8? The other reserveds encode their
> position properly.
> 


Oops
Claudio Imbrenda July 23, 2021, 5:22 p.m. UTC | #3
On Tue, 29 Jun 2021 13:33:21 +0000
Janosch Frank <frankja@linux.ibm.com> wrote:

> The struct is getting longer, let's add offset comments so we know
> where we change things when we add struct members.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

with reserveda0 fixed:

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> ---
>  lib/s390x/asm/uv.h | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
> index 96a2a7e..5ff98b8 100644
> --- a/lib/s390x/asm/uv.h
> +++ b/lib/s390x/asm/uv.h
> @@ -86,22 +86,23 @@ struct uv_cb_init {
>  } __attribute__((packed))  __attribute__((aligned(8)));
>  
>  struct uv_cb_qui {
> -	struct uv_cb_header header;
> -	uint64_t reserved08;
> -	uint64_t inst_calls_list[4];
> -	uint64_t reserved30[2];
> -	uint64_t uv_base_stor_len;
> -	uint64_t reserved48;
> -	uint64_t conf_base_phys_stor_len;
> -	uint64_t conf_base_virt_stor_len;
> -	uint64_t conf_virt_var_stor_len;
> -	uint64_t cpu_stor_len;
> -	uint32_t reserved70[3];
> -	uint32_t max_num_sec_conf;
> -	uint64_t max_guest_stor_addr;
> -	uint8_t  reserved88[158 - 136];
> -	uint16_t max_guest_cpus;
> -	uint8_t  reserveda0[200 - 160];
> +	struct uv_cb_header header;		/* 0x0000 */
> +	uint64_t reserved08;			/* 0x0008 */
> +	uint64_t inst_calls_list[4];		/* 0x0010 */
> +	uint64_t reserved30[2];			/* 0x0030 */
> +	uint64_t uv_base_stor_len;		/* 0x0040 */
> +	uint64_t reserved48;			/* 0x0048 */
> +	uint64_t conf_base_phys_stor_len;	/* 0x0050 */
> +	uint64_t conf_base_virt_stor_len;	/* 0x0058 */
> +	uint64_t conf_virt_var_stor_len;	/* 0x0060 */
> +	uint64_t cpu_stor_len;			/* 0x0068 */
> +	uint32_t reserved70[3];			/* 0x0070 */
> +	uint32_t max_num_sec_conf;		/* 0x007c */
> +	uint64_t max_guest_stor_addr;		/* 0x0080 */
> +	uint8_t  reserved88[158 - 136];		/* 0x0088 */
> +	uint16_t max_guest_cpus;		/* 0x009e */
> +	uint64_t uv_feature_indications;	/* 0x00a0 */
> +	uint8_t  reserveda0[200 - 168];		/* 0x00a8 */
>  }  __attribute__((packed))  __attribute__((aligned(8)));
>  
>  struct uv_cb_cgc {
diff mbox series

Patch

diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index 96a2a7e..5ff98b8 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -86,22 +86,23 @@  struct uv_cb_init {
 } __attribute__((packed))  __attribute__((aligned(8)));
 
 struct uv_cb_qui {
-	struct uv_cb_header header;
-	uint64_t reserved08;
-	uint64_t inst_calls_list[4];
-	uint64_t reserved30[2];
-	uint64_t uv_base_stor_len;
-	uint64_t reserved48;
-	uint64_t conf_base_phys_stor_len;
-	uint64_t conf_base_virt_stor_len;
-	uint64_t conf_virt_var_stor_len;
-	uint64_t cpu_stor_len;
-	uint32_t reserved70[3];
-	uint32_t max_num_sec_conf;
-	uint64_t max_guest_stor_addr;
-	uint8_t  reserved88[158 - 136];
-	uint16_t max_guest_cpus;
-	uint8_t  reserveda0[200 - 160];
+	struct uv_cb_header header;		/* 0x0000 */
+	uint64_t reserved08;			/* 0x0008 */
+	uint64_t inst_calls_list[4];		/* 0x0010 */
+	uint64_t reserved30[2];			/* 0x0030 */
+	uint64_t uv_base_stor_len;		/* 0x0040 */
+	uint64_t reserved48;			/* 0x0048 */
+	uint64_t conf_base_phys_stor_len;	/* 0x0050 */
+	uint64_t conf_base_virt_stor_len;	/* 0x0058 */
+	uint64_t conf_virt_var_stor_len;	/* 0x0060 */
+	uint64_t cpu_stor_len;			/* 0x0068 */
+	uint32_t reserved70[3];			/* 0x0070 */
+	uint32_t max_num_sec_conf;		/* 0x007c */
+	uint64_t max_guest_stor_addr;		/* 0x0080 */
+	uint8_t  reserved88[158 - 136];		/* 0x0088 */
+	uint16_t max_guest_cpus;		/* 0x009e */
+	uint64_t uv_feature_indications;	/* 0x00a0 */
+	uint8_t  reserveda0[200 - 168];		/* 0x00a8 */
 }  __attribute__((packed))  __attribute__((aligned(8)));
 
 struct uv_cb_cgc {