From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5hsw-0002lq-3W for qemu-devel@nongnu.org; Fri, 11 Jul 2014 16:57:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5hsm-0005Ej-Sj for qemu-devel@nongnu.org; Fri, 11 Jul 2014 16:57:38 -0400 Received: from mail-qa0-x233.google.com ([2607:f8b0:400d:c00::233]:61625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5hsm-0005Db-PG for qemu-devel@nongnu.org; Fri, 11 Jul 2014 16:57:28 -0400 Received: by mail-qa0-f51.google.com with SMTP id k15so1344081qaq.24 for ; Fri, 11 Jul 2014 13:57:28 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53C04FB4.2040705@redhat.com> Date: Fri, 11 Jul 2014 22:57:24 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140708140447.7314.87628.stgit@3820> In-Reply-To: <20140708140447.7314.87628.stgit@3820> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] vhost-user fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: snabb-devel@googlegroups.com, qemu-devel@nongnu.org, mst@redhat.com Cc: tech@virtualopensystems.com, n.nikolaev@virtualopensystems.com Il 08/07/2014 16:05, Nikolay Nikolaev ha scritto: > The latest vhost-user changes changed the VHOST_SET_MEM_TABLE handling. > Now the memory regions are mapped from dev->mem. The BIOS is registered > at address 0xfffc0000 which is out of memory boundaries for guests with > less than 4G RAM. Calling qemu_get_ram_fd with this address causes abort() > in qemu_get_ram_block with "Bad ram offset". > > To prevent this situation we introduce a new function to check if the address > maps to any RAMBlock - qemu_is_ram_block. This is used in VHOST_SET_MEM_TABLE > handling to revent the aborting call to qemu_get_ram_fd. > > The related vhost-user qtest is also updated to reflect the changes in > vhost-user message structures. Patch 3 seems okay. Patches 1 and 2 are not but the actual fix is similarly simple. Paolo