Re: [kvm-unit-tests PATCH 6/8] lib: s390: sie: Add PV guest register handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Nov 2021 10:39:54 +0000
Janosch Frank <frankja@xxxxxxxxxxxxx> wrote:

> Protected guests have their registers stored to / loaded from offset 0x380
> of the sie control block. So we need to copy over the GRs to/from that
> offset for format 4 (PV) guests before and after we enter SIE.
> 
> Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>

Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>

> ---
>  lib/s390x/sie.c | 8 ++++++++
>  lib/s390x/sie.h | 2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/lib/s390x/sie.c b/lib/s390x/sie.c
> index 51d3b94e..00aff713 100644
> --- a/lib/s390x/sie.c
> +++ b/lib/s390x/sie.c
> @@ -44,6 +44,10 @@ void sie_handle_validity(struct vm *vm)
>  
>  void sie(struct vm *vm)
>  {
> +	if (vm->sblk->sdf == 2)
> +		memcpy(vm->sblk->pv_grregs, vm->save_area.guest.grs,
> +		       sizeof(vm->save_area.guest.grs));
> +
>  	/* Reset icptcode so we don't trip over it below */
>  	vm->sblk->icptcode = 0;
>  
> @@ -53,6 +57,10 @@ void sie(struct vm *vm)
>  	}
>  	vm->save_area.guest.grs[14] = vm->sblk->gg14;
>  	vm->save_area.guest.grs[15] = vm->sblk->gg15;
> +
> +	if (vm->sblk->sdf == 2)
> +		memcpy(vm->save_area.guest.grs, vm->sblk->pv_grregs,
> +		       sizeof(vm->save_area.guest.grs));
>  }
>  
>  void sie_guest_sca_create(struct vm *vm)
> diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
> index 6d209793..de91ea5a 100644
> --- a/lib/s390x/sie.h
> +++ b/lib/s390x/sie.h
> @@ -198,6 +198,8 @@ union {
>  	uint64_t	itdba;			/* 0x01e8 */
>  	uint64_t   	riccbd;			/* 0x01f0 */
>  	uint64_t	gvrd;			/* 0x01f8 */
> +	uint64_t	reserved200[48];	/* 0x0200 */
> +	uint64_t	pv_grregs[16];		/* 0x0380 */
>  } __attribute__((packed));
>  
>  struct vm_uv {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux