From patchwork Tue May 7 14:16:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 242373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 21E9D2C017D for ; Wed, 8 May 2013 01:43:42 +1000 (EST) Received: from localhost ([::1]:60738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZk3I-0002r9-Dh for incoming@patchwork.ozlabs.org; Tue, 07 May 2013 11:43:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZish-0002Yp-1M for qemu-devel@nongnu.org; Tue, 07 May 2013 10:28:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZisf-0001AN-4k for qemu-devel@nongnu.org; Tue, 07 May 2013 10:28:38 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:55146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZii6-0005lP-Or for qemu-devel@nongnu.org; Tue, 07 May 2013 10:17:42 -0400 Received: by mail-we0-f169.google.com with SMTP id x54so570921wes.14 for ; Tue, 07 May 2013 07:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=S7dDiNhbYcZjablhXA1Q5Dnm5/8T7borKtO7Q4RAQP8=; b=I5Z6WT0KyyTFg12MXw7SYL+coy0qJn+hvDM3UPmIcmIT/1+fWZYdtK97i0ruZhdHiN 6m5IfUr1iDcnjWvCIHFo2WaGbOlkYnRCnV3vJmjpQUV5U6/+u+zwU/cXb41XVW3M2IiD s6AcMozgYYzfMccTQkWES6Mkp/RCnIJrHv+nVXCvMNlfRZX2ejHULEieADD3uGst7mN6 319e4LAsL1gu2BiD6rMQId2elrYuR9Zn/ZXSGEGSP+PL6q9MebZk/Z2bmGBNMKV+fxbV Qx6AJz4BiR579JOzc5+d4oVTzxExGfWirdv1tbWQ084qYLF11JNRFQMGv9SZW+diaD1M N6jg== X-Received: by 10.194.77.146 with SMTP id s18mr3865779wjw.16.1367936262078; Tue, 07 May 2013 07:17:42 -0700 (PDT) Received: from localhost.localdomain (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPSA id ge7sm3335978wib.6.2013.05.07.07.17.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 May 2013 07:17:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 7 May 2013 16:16:39 +0200 Message-Id: <1367936238-12196-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1367936238-12196-1-git-send-email-pbonzini@redhat.com> References: <1367936238-12196-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::229 Cc: aik@ozlabs.ru, jan.kiszka@siemens.com, qemulist@gmail.com, stefanha@redhat.com, david@gibson.dropbear.id.au Subject: [Qemu-devel] [PATCH 01/40] memory: assert that PhysPageEntry's ptr does not overflow 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 Signed-off-by: Paolo Bonzini --- exec.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index 19725db..2e5b89a 100644 --- a/exec.c +++ b/exec.c @@ -719,6 +719,8 @@ static void destroy_all_mappings(AddressSpaceDispatch *d) static uint16_t phys_section_add(MemoryRegionSection *section) { + assert(phys_sections_nb < TARGET_PAGE_SIZE); + if (phys_sections_nb == phys_sections_nb_alloc) { phys_sections_nb_alloc = MAX(phys_sections_nb_alloc * 2, 16); phys_sections = g_renew(MemoryRegionSection, phys_sections,