From patchwork Thu Sep 5 17:17:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 272915 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 807DD2C00A8 for ; Fri, 6 Sep 2013 03:18:23 +1000 (EST) Received: from localhost ([::1]:32917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHdCH-0001a7-Jm for incoming@patchwork.ozlabs.org; Thu, 05 Sep 2013 13:18:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHdBo-0001VS-1o for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHdBi-0000wc-Pi for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:17:51 -0400 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:56509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHdBi-0000tx-IU; Thu, 05 Sep 2013 13:17:46 -0400 Received: by mail-ee0-f43.google.com with SMTP id e52so1063240eek.16 for ; Thu, 05 Sep 2013 10:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ie0mcIBTWs6GzoVSBB6dgMtTnjm1bVDJu2SDAEH8Q5U=; b=cv6VE3OnwNfgzO1aj7kK9otWw4vTVO+9pP7sAmW98TLbA5vjQyjj97L+alKM8i6SWA mLVRwHOVpFiCjoXJNTtgloWAQIXSaJMmLqF5qmQElYywFibNukXep73XHTdxn/q5q5Fu erSKtrDcUhDtckY7BHPLBcf48qURvYNc92jmKjqhqBP2xewmNJoYiOUi83PzO7b5vmBi WB3vAcU1l38VJ8KJx0cPj7xqbVSlnsWjd0IfaUlHomaoVKPWbpKgniydhOUePB8LukLc RWIQKa3AkA/9F/Qg4yVOemmk8hBoZ0hxfiaYuTThvTbJylRC5tlCooUnPTRwHQaKjRaP o9AQ== X-Received: by 10.14.216.132 with SMTP id g4mr4848491eep.62.1378401465646; Thu, 05 Sep 2013 10:17:45 -0700 (PDT) Received: from playground.lan (net-37-117-144-28.cust.dsl.vodafone.it. [37.117.144.28]) by mx.google.com with ESMTPSA id x47sm50345071eea.16.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Sep 2013 10:17:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 5 Sep 2013 19:17:32 +0200 Message-Id: <1378401455-583-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378401455-583-1-git-send-email-pbonzini@redhat.com> References: <1378401455-583-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22b Cc: Peter Maydell , Hu Tao , qemu-stable@nongnu.org, Blue Swirl , anthony@codemonkey.ws, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PULL 2/5] exec: check offset_within_address_space for register subpage 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 From: Hu Tao If offset_within_address_space falls in a page, then we register a subpage. So check offset_within_address_space rather than offset_within_region. Cc: qemu-stable@nongnu.org Cc: Paolo Bonzini Cc: Richard Henderson Cc: "Andreas Färber" Cc: Peter Maydell Cc: Blue Swirl Signed-off-by: Hu Tao Signed-off-by: Paolo Bonzini --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index b52ec80..e6f04d8 100644 --- a/exec.c +++ b/exec.c @@ -854,7 +854,7 @@ static void mem_add(MemoryListener *listener, MemoryRegionSection *section) now = remain; if (int128_lt(remain.size, page_size)) { register_subpage(d, &now); - } else if (remain.offset_within_region & ~TARGET_PAGE_MASK) { + } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) { now.size = page_size; register_subpage(d, &now); } else {