Re: [PATCH v11 4/7] x86/kvm/hyper-v: Add support for synthetic debugger capability

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

 



On 29/05/20 14:08, Vitaly Kuznetsov wrote:
>> On 24/04/20 13:37, Jon Doron wrote:
>>> +static int syndbg_get_msr(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata, bool host)
>>> +{
>>> +	struct kvm_hv_syndbg *syndbg = vcpu_to_hv_syndbg(vcpu);
>>> +
>>> +	if (!syndbg->active && !host)
>>> +		return 1;
>>> +
>> One small thing: is the ENABLE_CAP and active field needed?  Can you
>> just check if the guest has the syndbg CPUID bits set?
>>
> Yes, we can probably get away with a static capability (so userspace
> knows that the interface is supported and CPUID bit can be set) and
> check guest_cpuid_has() here but we don't have Hyper-V feature leaves
> exposed as X86_FEATURE_* (yet). It is probably possible to implement an
> interim solution by open coding the check with kvm_find_cpuid_entry() or
> something like that.

Yes, that would be fine if you just abstract it in its own function.

Paolo




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux