From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [Query] [GUEST PAGE HINTING] How to handle virtqueue_kick from the guest in QEMU Date: Fri, 18 Aug 2017 04:32:23 +0300 Message-ID: <20170818043043-mutt-send-email-mst@kernel.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Nitesh Narayan Lal , kvm@vger.kernel.org, pagupta@redhat.com, wei.w.wang@intel.com, yang.zhang.wz@gmail.com, riel@redhat.com, david@redhat.com To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41432 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753482AbdHRBc2 (ORCPT ); Thu, 17 Aug 2017 21:32:28 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Aug 17, 2017 at 06:53:31PM +0200, Paolo Bonzini wrote: > On 11/08/2017 23:00, Nitesh Narayan Lal wrote: > > One way to go about > > this is to have my own function pointer pointing a to a function > > qemu_page_hinting() in virtio-balloon.c under QEMU. Now the part where I > > am not sure is how exactly I will ensure that when virtqueue_kick > > arrives in QEMU this function is invoked. (I am planning to use the same > > deflate_vq for my use-case). > > You can use a separate virtq as Michael mentioned. > > Another possibility is to extend virtio-balloon to support 64-bit values > in the virtqueues. Then when shifting PFNs right you have bits 52-63 > free, and you can put flags in there (e.g. bit 52=0 means deflate, bit > 52=1 means page hint). > > Of course, if your action is going to be MADV_DONTNEED, you don't need > to do anything special. > > Paolo Forgot to say: when you discuss virtio host/guest interface changes, please copy virtio-dev@lists.oasis-open.org. (Subscriber only, sorry about that). -- MST