From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLYjE-00054Z-J1 for qemu-devel@nongnu.org; Fri, 08 Jul 2016 12:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLYjA-0008F0-7z for qemu-devel@nongnu.org; Fri, 08 Jul 2016 12:34:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLYjA-0008Ew-2n for qemu-devel@nongnu.org; Fri, 08 Jul 2016 12:34:08 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B01A47AE85 for ; Fri, 8 Jul 2016 16:34:07 +0000 (UTC) References: <1467990099-27853-1-git-send-email-dgilbert@redhat.com> <1467990099-27853-6-git-send-email-dgilbert@redhat.com> From: Paolo Bonzini Message-ID: Date: Fri, 8 Jul 2016 18:34:03 +0200 MIME-Version: 1.0 In-Reply-To: <1467990099-27853-6-git-send-email-dgilbert@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 5/5] x86: Set physical address bits based on host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org, ehabkost@redhat.com, marcel@redhat.com, mst@redhat.com, kraxel@redhat.com On 08/07/2016 17:01, Dr. David Alan Gilbert (git) wrote: > + uint32_t host_phys_bits = x86_host_phys_bits(); > + static bool warned; > + > + if (cpu->host_phys_bits) { > + /* The user asked for us to use the host physical bits */ > + cpu->phys_bits = host_phys_bits; > + } > + > + /* Print a warning if the user set it to a value that's not the > + * host value. > + */ > + if (cpu->phys_bits != host_phys_bits && cpu->phys_bits != 0 && > + !warned) { > + error_report("Warning: Host physical bits (%u)" > + " does not match phys-bits property (%u)", > + host_phys_bits, cpu->phys_bits); > + warned = true; > + } > + > + if (cpu->phys_bits && > + (cpu->phys_bits > TARGET_PHYS_ADDR_SPACE_BITS || > + cpu->phys_bits < 32)) { > error_setg(errp, "phys-bits should be between 32 and %u " > " (but is %u)", > TARGET_PHYS_ADDR_SPACE_BITS, cpu->phys_bits); Michael Tsirkin suggested a way to support guest-phys-bits < host-phys-bits in KVM. I plan to implement it soonish. In the meanwhile I guess this patch is fine, we can refine it later. Paolo