From: "Stephen C. Tweedie" Subject: TLB flushing in blktap kernel driver? Date: Wed, 27 Sep 2006 14:17:06 +0100 Message-ID: <1159363026.6276.4.camel@sisko.scot.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: Julian Chesterfield , Andrew Warfield List-Id: xen-devel@lists.xenproject.org Hi all, I've been fixing blktap to build as a kernel module, and have come across one un-exported symbol that blktap needs: flush_tlb_all(), used in static unsigned int blktap_poll(struct file *file, poll_table *wait) { ... poll_wait(file, &info->wait, wait); if (info->ufe_ring.req_prod_pvt != info->ufe_ring.sring->req_prod) { flush_tlb_all(); RING_PUSH_REQUESTS(&info->ufe_ring); return POLLIN | POLLRDNORM; } return 0; } However, I can't understand right now why we need the tlb flush here. If we're doing any grant table operations between dom0 and domU, then the HV should be doing the tlb flushes for us, shouldn't it? And mere SMP synchronisation on a ring buffer requires a physical memory barrier, not a TLB synchronisation (and RING_PUSH_REQUESTS already does a wmb.) --Stephen