Re: [kvm-unit-tests PATCH 1/5] lib: s390x: vm: Add kvm and lpar vm queries

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

 



On Fri, 14 Jan 2022 13:28:19 +0100
Janosch Frank <frankja@xxxxxxxxxxxxx> wrote:

> On 1/14/22 12:18, Claudio Imbrenda wrote:
> > On Fri, 14 Jan 2022 10:02:41 +0000
> > Janosch Frank <frankja@xxxxxxxxxxxxx> wrote:
> >   
> >> This patch will likely (in parts) be replaced by Pierre's patch from
> >> his topology test series.
> >>
> >> Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>  
> > 
> > Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
> > 
> > although I think there is some room for improvement, but nothing too
> > serious, I'll probably fix it myself later  
> 
> I think I should add this to clean up the checks in the following patches:
> 
> bool vm_is_qemu(void)
> {
> 	return vm_is_kvm() || vm_is_tcg();
> }
> 
> That of course also isn't a 100% correct, we could have KVM + non-QEMU 
> but I'll cross that bridge when I get there.
> 
> And as I already mentioned in Pierre's patch, the STSI values are a bit 
> of a mystery to me since AFAIK we store KVM/Linux even if we run under TCG.

I was actually thinking of a generic detection function that will call
STSI only once and set all the necessary flags. 

then the various vm_is_* functions can become something like this:

bool vm_is_${TYPE}()
{
	if (vm_type == VM_TYPE_NOT_INITIALIZED)
		do_vm_detection();
	return vm_type == VM_${TYPE};
}

and then have all the magic hidden in the one do_vm_detection, which
will call STSI once and try to find out what we are running on.




[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