Re: [PATCH 2/3] s390/kvm: handle diagnose 318 instruction call

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

 



On 09/04/2018 05:52 AM, Thomas Huth wrote:
> On 2018-08-31 18:51, Collin Walling wrote:
>> The diagnose 318 instruction is a privileged instruction that must be
>> interpreted by SIE and handled via KVM.
>>
>> The control program name and version codes (CPNC and CPVC) set by this
>> instruction are saved to the kvm->arch struct. The CPNC is also set in
>> the SIE control block of all VCPUs. The new kvm_s390_set_misc interface
>> is introduced for migration.
>>
>> Signed-off-by: Collin Walling <walling@xxxxxxxxxxxxx>
>> Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
>> ---
>>  arch/s390/include/asm/kvm_host.h       |  6 ++-
>>  arch/s390/include/uapi/asm/kvm.h       |  5 ++
>>  arch/s390/kvm/diag.c                   | 16 ++++++
>>  arch/s390/kvm/kvm-s390.c               | 90 ++++++++++++++++++++++++++++++++++
>>  arch/s390/kvm/kvm-s390.h               |  1 +
>>  tools/arch/s390/include/uapi/asm/kvm.h |  1 +
>>  6 files changed, 118 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
>> index 29c940b..fabeb32 100644
>> --- a/arch/s390/include/asm/kvm_host.h
>> +++ b/arch/s390/include/asm/kvm_host.h
>> @@ -227,7 +227,8 @@ struct kvm_s390_sie_block {
>>  	__u32	scaol;			/* 0x0064 */
>>  	__u8	reserved68;		/* 0x0068 */
>>  	__u8    epdx;			/* 0x0069 */
>> -	__u8    reserved6a[2];		/* 0x006a */
>> +	__u8    cpnc;			/* 0x006a */
>> +	__u8	reserved6b;		/* 0x006b */
>>  	__u32	todpr;			/* 0x006c */
>>  #define GISA_FORMAT1 0x00000001
>>  	__u32	gd;			/* 0x0070 */
>> @@ -383,6 +384,7 @@ struct kvm_vcpu_stat {
>>  	u64 diagnose_9c;
>>  	u64 diagnose_258;
>>  	u64 diagnose_308;
>> +	u64 diagnose_318;
>>  	u64 diagnose_500;
>>  	u64 diagnose_other;
>>  };
>> @@ -829,6 +831,8 @@ struct kvm_arch{
>>  	/* subset of available cpu features enabled by user space */
>>  	DECLARE_BITMAP(cpu_feat, KVM_S390_VM_CPU_FEAT_NR_BITS);
>>  	struct kvm_s390_gisa *gisa;
>> +	u8 cpnc;
>> +	u64 cpvc;
>>  };
> 
> <bikeshedding>
> Note sure if it's worth the effort, but maybe merge the two struct
> members into one 64 bit value?
> 
>  struct {
>    u64 cpnc:8;
>    u64 cpvc:56;
>  }
> 
> ?
> 
> Or maybe move the new lonely u8 field next to the other lonely u8 field
> in that struct?
> </bikeshedding>

I had a similar thought. I think having a struct will look nicer.
(I wish I did this for the TOD-Clock stuff, too).

> 
> The other parts of the patch look fine to me.
> 
>  Thomas
> 

Thanks!

-- 
Respectfully,
- Collin Walling




[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