Re: [PATCH 2/2] x86:kvm:hyperv: guest->host event signaling via eventfd

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

 



On Wed, Dec 06, 2017 at 10:28:33AM -0500, Konrad Rzeszutek Wilk wrote:
> .snip..
> > +static u16 hvcall_sigevent_param(struct kvm_vcpu *vcpu, gpa_t gpa, u32 *conn_id)
> > +{
> > +	struct page *page;
> > +	void *pg;
> > +	struct hv_input_signal_event *msg;
> > +
> > +	if ((gpa & (__alignof__(*msg) - 1)) ||
> > +	    offset_in_page(gpa) + sizeof(*msg) > PAGE_SIZE)
> > +		return HV_STATUS_INVALID_ALIGNMENT;
> > +
> > +	page = kvm_vcpu_gfn_to_page(vcpu, gpa >> PAGE_SHIFT);
> > +	if (is_error_page(page))
> > +		return HV_STATUS_INSUFFICIENT_MEMORY;
> > +
> > +	pg = kmap_atomic(page);
> > +	msg = pg + offset_in_page(gpa);
> > +	*conn_id = msg->connectionid.u.id + msg->flag_number;
> 
> Here it is u32..
> 
> > +	kunmap_atomic(pg);
> > +	return HV_STATUS_SUCCESS;
> > +}
> > +
> .. snip..
> 
> > +static int kvm_hv_eventfd_assign(struct kvm *kvm, int conn_id, int fd)
> 
> It is uint32 in the hypercall, but here you are making it an 'int'.
> 
> Is that intentional?  Or could it be the same type?

Yes it should have been u32 everywhere.  Thanks for spotting!
(The actual values allowed there are 24bit wide, nonetheless different
types are confusing indeed so I'd better make them consistent.)

Thanks,
Roman.



[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