From patchwork Mon Apr 9 22:48:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 151494 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 C8B28B700C for ; Tue, 10 Apr 2012 08:49:25 +1000 (EST) Received: from localhost ([::1]:57097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHNOl-0000t1-Km for incoming@patchwork.ozlabs.org; Mon, 09 Apr 2012 18:49:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHNOQ-0000nS-An for qemu-devel@nongnu.org; Mon, 09 Apr 2012 18:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHNOO-0001Y1-NK for qemu-devel@nongnu.org; Mon, 09 Apr 2012 18:49:01 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:53726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHNOO-0001Xr-Dt for qemu-devel@nongnu.org; Mon, 09 Apr 2012 18:49:00 -0400 Received: by bkcjg9 with SMTP id jg9so4317432bkc.4 for ; Mon, 09 Apr 2012 15:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ZWVSyflwiz0KUn+zD24/OEUom7E/pAIyFU2PbvLSwoI=; b=ZlOJ2IV7nuYY/JIzczsdZzsQODVecGomuL5Z8Zb4cAaVJ3m3Cg0izGmgHDYtPw14La cplbNn7FURucpF/hyVhEcRf3M6APaSK1Tu+MGHMDhoK1fLmCm+9aK6YZ+wEICB5MRAMI Na60JjkPeQ/073bMDO/UEyA8hJZbKBa0OB8s79JwfmC0rE9OD5DtQz/J6Np+Rf2SkqzO 2OQ9BtAb+cWqsdYs883uBFBRnRoxj2Tw26lcBxDiDMPPxCt8rx0T/W1V654Eb4Tnx0FT djegBP/+Cz2VSQ08cNWZKJ9brovEmu6djPpAFqfFhlbDSNIBzrOoT6V0ZpPab12dlGaO j3bw== Received: by 10.204.9.205 with SMTP id m13mr3794011bkm.68.1334011738307; Mon, 09 Apr 2012 15:48:58 -0700 (PDT) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPS id c4sm32043101bkh.0.2012.04.09.15.48.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Apr 2012 15:48:57 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2012 02:48:17 +0400 Message-Id: <1334011700-32425-2-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1334011700-32425-1-git-send-email-jcmvbkbc@gmail.com> References: <1334011700-32425-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.45 Cc: Peter Maydell , Anthony Liguori , Stefan Weil , Alexander Graf , Blue Swirl , Max Filippov , Avi Kivity , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PATCH 1/4] exec: provide tb_invalidate_phys_addr function 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 Allow TB invalidation by its physical address, extract implementation from the breakpoint_invalidate function. Signed-off-by: Max Filippov --- exec-all.h | 1 + exec.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/exec-all.h b/exec-all.h index fa7bdfe..39f1dc4 100644 --- a/exec-all.h +++ b/exec-all.h @@ -102,6 +102,7 @@ void tlb_flush(CPUArchState *env, int flush_global); void tlb_set_page(CPUArchState *env, target_ulong vaddr, target_phys_addr_t paddr, int prot, int mmu_idx, target_ulong size); +void tb_invalidate_phys_addr(target_phys_addr_t addr); #endif #define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */ diff --git a/exec.c b/exec.c index 03d3a6b..661259b 100644 --- a/exec.c +++ b/exec.c @@ -1463,13 +1463,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) tb_invalidate_phys_page_range(pc, pc + 1, 0); } #else -static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) +void tb_invalidate_phys_addr(target_phys_addr_t addr) { - target_phys_addr_t addr; ram_addr_t ram_addr; MemoryRegionSection *section; - addr = cpu_get_phys_page_debug(env, pc); section = phys_page_find(addr >> TARGET_PAGE_BITS); if (!(memory_region_is_ram(section->mr) || (section->mr->rom_device && section->mr->readable))) { @@ -1479,6 +1477,11 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) + section_addr(section, addr); tb_invalidate_phys_page_range(ram_addr, ram_addr + 1, 0); } + +static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) +{ + tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc)); +} #endif #endif /* TARGET_HAS_ICE */