diff mbox series

[kvm-unit-tests,3/8] s390x: sie: Add UV information into VM struct

Message ID 20211123103956.2170-4-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: sie: Add PV snippet support | expand

Commit Message

Janosch Frank Nov. 23, 2021, 10:39 a.m. UTC
We need to save the handles for the VM and the VCPU so we can retrieve
them easily after their creation. Since the SIE lib is single guest
cpu only we only save one vcpu handle.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 lib/s390x/sie.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Claudio Imbrenda Nov. 23, 2021, 10:54 a.m. UTC | #1
On Tue, 23 Nov 2021 10:39:51 +0000
Janosch Frank <frankja@linux.ibm.com> wrote:

> We need to save the handles for the VM and the VCPU so we can retrieve
> them easily after their creation. Since the SIE lib is single guest

multiple guest CPUs will be needed for testing some functions, but I
guess that's something for me to do :)

> cpu only we only save one vcpu handle.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

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

> ---
>  lib/s390x/sie.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
> index c6eb6441..1a12faa7 100644
> --- a/lib/s390x/sie.h
> +++ b/lib/s390x/sie.h
> @@ -200,6 +200,11 @@ union {
>  	uint64_t	gvrd;			/* 0x01f8 */
>  } __attribute__((packed));
>  
> +struct vm_uv {
> +	uint64_t vm_handle;
> +	uint64_t vcpu_handle;
> +};
> +
>  struct vm_save_regs {
>  	uint64_t grs[16];
>  	uint64_t fprs[16];
> @@ -220,6 +225,7 @@ struct vm {
>  	struct vm_save_area save_area;
>  	void *sca;				/* System Control Area */
>  	uint8_t *crycb;				/* Crypto Control Block */
> +	struct vm_uv uv;			/* PV UV information */
>  	/* Ptr to first guest page */
>  	uint8_t *guest_mem;
>  };
Janosch Frank Nov. 23, 2021, 12:49 p.m. UTC | #2
On 11/23/21 11:54, Claudio Imbrenda wrote:
> On Tue, 23 Nov 2021 10:39:51 +0000
> Janosch Frank <frankja@linux.ibm.com> wrote:
> 
>> We need to save the handles for the VM and the VCPU so we can retrieve
>> them easily after their creation. Since the SIE lib is single guest
> 
> multiple guest CPUs will be needed for testing some functions, but I
> guess that's something for me to do :)

I would be happy if someone picks this up. Just let me know if you do so 
I can plan accordingly.

> 
>> cpu only we only save one vcpu handle.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> 
> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

Thanks!

> 
>> ---
>>   lib/s390x/sie.h | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
>> index c6eb6441..1a12faa7 100644
>> --- a/lib/s390x/sie.h
>> +++ b/lib/s390x/sie.h
>> @@ -200,6 +200,11 @@ union {
>>   	uint64_t	gvrd;			/* 0x01f8 */
>>   } __attribute__((packed));
>>   
>> +struct vm_uv {
>> +	uint64_t vm_handle;
>> +	uint64_t vcpu_handle;
>> +};
>> +
>>   struct vm_save_regs {
>>   	uint64_t grs[16];
>>   	uint64_t fprs[16];
>> @@ -220,6 +225,7 @@ struct vm {
>>   	struct vm_save_area save_area;
>>   	void *sca;				/* System Control Area */
>>   	uint8_t *crycb;				/* Crypto Control Block */
>> +	struct vm_uv uv;			/* PV UV information */
>>   	/* Ptr to first guest page */
>>   	uint8_t *guest_mem;
>>   };
>
diff mbox series

Patch

diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
index c6eb6441..1a12faa7 100644
--- a/lib/s390x/sie.h
+++ b/lib/s390x/sie.h
@@ -200,6 +200,11 @@  union {
 	uint64_t	gvrd;			/* 0x01f8 */
 } __attribute__((packed));
 
+struct vm_uv {
+	uint64_t vm_handle;
+	uint64_t vcpu_handle;
+};
+
 struct vm_save_regs {
 	uint64_t grs[16];
 	uint64_t fprs[16];
@@ -220,6 +225,7 @@  struct vm {
 	struct vm_save_area save_area;
 	void *sca;				/* System Control Area */
 	uint8_t *crycb;				/* Crypto Control Block */
+	struct vm_uv uv;			/* PV UV information */
 	/* Ptr to first guest page */
 	uint8_t *guest_mem;
 };