Re: [PATCH 3/3] KVM: Add KVM_VCPU_GET_REG_LIST/KVM_CAP_REG_LIST.

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

 



Marcelo Tosatti <mtosatti@xxxxxxxxxx> writes:
> On Wed, Sep 05, 2012 at 05:28:46PM +0930, Rusty Russell wrote:
...
>> +struct kvm_reg_list {
>> +	__u64 n; /* number of registers in reg[] */
>> +	__u64 reg[0];
>> +};
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 169a001..453fe93 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -2082,6 +2082,23 @@ out_free2:
>>  		break;
>>  	}
>>  #endif
>> +#ifdef KVM_HAVE_REG_LIST
>> +	case KVM_VCPU_GET_REG_LIST: {
>> +		struct kvm_reg_list __user *user_list = argp;
>> +		struct kvm_reg_list reg_list;
>> +		unsigned n;
>> +
>> +		if (copy_from_user(&reg_list, user_list, sizeof reg_list))
>> +			return -EFAULT;
>> +		n = reg_list.n;
>> +		reg_list.n = kvm_arch_num_regs(vcpu);
>
> The code does not actually support more than 2^32 registers, does it?
> Why "__u64 n" ?

Well, the interface is simpler, and the alignment issues vanish.

kvm_arch_num_regs could return a 64-bit number in future if we want to
get completely insane :)

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux