From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754460AbbFSQ0g (ORCPT ); Fri, 19 Jun 2015 12:26:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44383 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752960AbbFSQ0b (ORCPT ); Fri, 19 Jun 2015 12:26:31 -0400 Message-ID: <558442B3.2020900@redhat.com> Date: Fri, 19 Jun 2015 18:26:27 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Michael S. Tsirkin" CC: Igor Mammedov , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, andrey@xdel.ru Subject: Re: [PATCH 3/5] vhost: support upto 509 memory regions References: <20150618164559-mutt-send-email-mst@redhat.com> <5582EBA6.1080607@redhat.com> <20150619095515-mutt-send-email-mst@redhat.com> <5583CB62.6030405@redhat.com> <20150619100409-mutt-send-email-mst@redhat.com> <5583D85F.7090200@redhat.com> <20150619120734-mutt-send-email-mst@redhat.com> <5583F28A.9080206@redhat.com> <20150619153248-mutt-send-email-mst@redhat.com> <55843310.50403@redhat.com> <20150619181845-mutt-send-email-mst@redhat.com> In-Reply-To: <20150619181845-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/06/2015 18:20, Michael S. Tsirkin wrote: > > We could, but I/O is just an example. It can be I/O, a network ring, > > whatever. We cannot audit all address_space_map uses. > > > > No need to audit them all: defer device_add using an hva range until > address_space_unmap drops using hvas in range drops reference count to > 0. That could be forever. You certainly don't want to lockup the monitor forever just because a device model isn't too friendly to memory hot-unplug. That's why you need to audit them (also, it's perfectly in the device model's right to use address_space_unmap this way: it's the guest that's buggy and leaves a dangling reference to a region before unplugging it). Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 3/5] vhost: support upto 509 memory regions Date: Fri, 19 Jun 2015 18:26:27 +0200 Message-ID: <558442B3.2020900@redhat.com> References: <20150618164559-mutt-send-email-mst@redhat.com> <5582EBA6.1080607@redhat.com> <20150619095515-mutt-send-email-mst@redhat.com> <5583CB62.6030405@redhat.com> <20150619100409-mutt-send-email-mst@redhat.com> <5583D85F.7090200@redhat.com> <20150619120734-mutt-send-email-mst@redhat.com> <5583F28A.9080206@redhat.com> <20150619153248-mutt-send-email-mst@redhat.com> <55843310.50403@redhat.com> <20150619181845-mutt-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Igor Mammedov , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, andrey@xdel.ru To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20150619181845-mutt-send-email-mst@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 19/06/2015 18:20, Michael S. Tsirkin wrote: > > We could, but I/O is just an example. It can be I/O, a network ring, > > whatever. We cannot audit all address_space_map uses. > > > > No need to audit them all: defer device_add using an hva range until > address_space_unmap drops using hvas in range drops reference count to > 0. That could be forever. You certainly don't want to lockup the monitor forever just because a device model isn't too friendly to memory hot-unplug. That's why you need to audit them (also, it's perfectly in the device model's right to use address_space_unmap this way: it's the guest that's buggy and leaves a dangling reference to a region before unplugging it). Paolo