From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6Fs4-00035k-25 for qemu-devel@nongnu.org; Mon, 14 Nov 2016 06:56:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6Fs1-00005n-0I for qemu-devel@nongnu.org; Mon, 14 Nov 2016 06:56:20 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33270) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6Fs0-00005P-Pv for qemu-devel@nongnu.org; Mon, 14 Nov 2016 06:56:16 -0500 Received: by mail-wm0-x244.google.com with SMTP id u144so14620705wmu.0 for ; Mon, 14 Nov 2016 03:56:16 -0800 (PST) Sender: Paolo Bonzini References: From: Paolo Bonzini Message-ID: <9475a3dd-68b0-570a-4681-05c01cbf3497@redhat.com> Date: Mon, 14 Nov 2016 12:56:13 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 5/5] Plumb the HAXM-based hardware acceleration support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincent Palatin , qemu-devel On 11/11/2016 12:28, Vincent Palatin wrote: > + /* > + * In Hax, the qemu allocate the virtual address, and HAX kernel > + * populate the memory with physical memory. Currently we have no > + * paging, so user should make sure enough free memory in advance > + */ > + if (hax_enabled()) { > + int ret; > + ret = hax_populate_ram((uint64_t)(uintptr_t)new_block->host, > + new_block->max_length); > + if (ret < 0) { > + error_setg(errp, "Hax failed to populate ram"); > + return; > + } > + } > + > if (!new_block->host) { > error_setg_errno(errp, errno, > "cannot set up guest memory '%s'", The hax_enabled() check should be after the "if (!new_block->host)" block. Paolo