From patchwork Thu Nov 7 10:41:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 289280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8793F2C00BB for ; Thu, 7 Nov 2013 21:45:01 +1100 (EST) Received: from localhost ([::1]:39497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeN58-0001oW-Rq for incoming@patchwork.ozlabs.org; Thu, 07 Nov 2013 05:44:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeN4d-0001i4-AI for qemu-devel@nongnu.org; Thu, 07 Nov 2013 05:44:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeN4U-0007uo-5n for qemu-devel@nongnu.org; Thu, 07 Nov 2013 05:44:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeN4T-0007ug-U3 for qemu-devel@nongnu.org; Thu, 07 Nov 2013 05:44:18 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA7AiEwq012979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Nov 2013 05:44:15 -0500 Received: from localhost.localdomain.com (vpn-200-52.tlv.redhat.com [10.35.200.52]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rA7Ai5qV015341; Thu, 7 Nov 2013 05:44:11 -0500 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 7 Nov 2013 12:41:17 +0200 Message-Id: <1383820884-29596-2-git-send-email-marcel.a@redhat.com> In-Reply-To: <1383820884-29596-1-git-send-email-marcel.a@redhat.com> References: <1383820884-29596-1-git-send-email-marcel.a@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, agraf@suse.de, lcapitulino@redhat.com, aliguori@amazon.com, pbonzini@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH for-1.7 v2 1/8] exec: declare TARGET_PHYS_ADDR_SPACE_MAX to limit memory regions rendered by exec X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The page table logic in exec.c assumes that memory addresses are at most TARGET_PHYS_ADDR_SPACE_BITS. Use TARGET_PHYS_ADDR_SPACE_MAX as max size for memory regions rendered by exec. Signed-off-by: Marcel Apfelbaum --- include/exec/address-spaces.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/exec/address-spaces.h b/include/exec/address-spaces.h index 3d12cdd..174cc05 100644 --- a/include/exec/address-spaces.h +++ b/include/exec/address-spaces.h @@ -23,6 +23,10 @@ #ifndef CONFIG_USER_ONLY +#define TARGET_PHYS_ADDR_SPACE_MAX \ + (TARGET_PHYS_ADDR_SPACE_BITS == 64 ? \ + UINT64_MAX : (0x1ULL << TARGET_PHYS_ADDR_SPACE_BITS)) + /* Get the root memory region. This interface should only be used temporarily * until a proper bus interface is available. */