From nobody Fri Dec 19 08:15:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545061022241591.732373093269; Mon, 17 Dec 2018 07:37:02 -0800 (PST) Received: from localhost ([::1]:47295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYuQe-0006aW-GK for importer@patchew.org; Mon, 17 Dec 2018 10:03:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYuOe-0005Sb-1n for qemu-devel@nongnu.org; Mon, 17 Dec 2018 10:01:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYuOZ-0006nc-H4 for qemu-devel@nongnu.org; Mon, 17 Dec 2018 10:01:27 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:34359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gYuOX-0006jZ-Hq for qemu-devel@nongnu.org; Mon, 17 Dec 2018 10:01:22 -0500 Received: by mail-wm1-x341.google.com with SMTP id y185so4937245wmd.1 for ; Mon, 17 Dec 2018 07:01:19 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g67sm17615303wmd.38.2018.12.17.07.01.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 07:01:16 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 8006B3E051A; Mon, 17 Dec 2018 15:01:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=27/FB81GdHmJNf6tIRTZBoPUJ2kQ0dZVx7C5EDrLRuk=; b=A5RlX4ZNXTnsf6BskgBSckdqHQPAgc0q7+ADnfSg7Ho8QBel8Sn6k12XaoINpX0F7Z FcspVJz20aCPyaY368Et0TA33ukJtiDTOG9S4EjVYOUSZZ9oEVZdOkoE0dqyVMZRnKvQ BjYMPiIv28y+QNpvZRLReE1Q7oo1HEBdDgBMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=27/FB81GdHmJNf6tIRTZBoPUJ2kQ0dZVx7C5EDrLRuk=; b=lbX8L9DnszBZONm4NA9J0BaapAG1Ska/PAKLIw+hKG6ySqswvrNfBCThWb64jWpEMb jo1SJnWt7kngRKBnlVcnEDOz9pSMIhN0tuHY3368vMzbPFHgCbPvvEsfNiroBERgCoLk tk/qF2EMTkXvBQAG9avTJMT6AIyMzmGjRmcsh0UlK1hk9jr/jawXaBfXEiivUKYiVKML CEshIkjrUaxVpmxnjyqnHJI/OUA+YVmlVLVxvA70iF/Hkiaf3jraxY96ks6CQ/f/WbzC 3BhzuKrUSBZOxb5RD723FCyBI8d160tDPpdZEd9X2WAhmX48eDmHGoPUJf1JpjciVc7P GfUw== X-Gm-Message-State: AA+aEWYXEQyog1fYvQmIHH935rX6bYPpXUrMqmc2QnW2Ooo36kYC8flp /fVAuCw+hBKb2kelxjLPHa8cmg== X-Google-Smtp-Source: AFSGD/WhfWkOM18agHWQgmL5wFA6FoWV4+6Y81xKokuHeLKm/NntCWGo8BnbTe4H26k8ktAVl+xEdw== X-Received: by 2002:a1c:ae15:: with SMTP id x21mr11737600wme.146.1545058877691; Mon, 17 Dec 2018 07:01:17 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 15:01:13 +0000 Message-Id: <20181217150116.10446-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181217150116.10446-1-alex.bennee@linaro.org> References: <20181217150116.10446-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH v1 1/4] accel/tcg: export some cputlb functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Crosthwaite Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) In preparation for having softmmu helpers in their own file rather than generated as part of softmmu-template.h we need to make a couple of helper functions public outside of cputlb. Signed-off-by: Alex Benn=C3=A9e --- accel/tcg/cputlb.c | 21 +++++++++++---------- accel/tcg/cputlb.h | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 accel/tcg/cputlb.h diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index af6bd8ccf9..3cae7335d0 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "cpu.h" +#include "cputlb.h" #include "exec/exec-all.h" #include "exec/memory.h" #include "exec/address-spaces.h" @@ -675,10 +676,10 @@ static inline ram_addr_t qemu_ram_addr_from_host_nofa= il(void *ptr) return ram_addr; } =20 -static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, - int mmu_idx, - target_ulong addr, uintptr_t retaddr, - bool recheck, MMUAccessType access_type, int size) +uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + target_ulong addr, uintptr_t retaddr, + bool recheck, MMUAccessType access_type, int size) { CPUState *cpu =3D ENV_GET_CPU(env); hwaddr mr_offset; @@ -743,10 +744,10 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBE= ntry *iotlbentry, return val; } =20 -static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, - int mmu_idx, - uint64_t val, target_ulong addr, - uintptr_t retaddr, bool recheck, int size) +void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + uint64_t val, target_ulong addr, + uintptr_t retaddr, bool recheck, int size) { CPUState *cpu =3D ENV_GET_CPU(env); hwaddr mr_offset; @@ -809,8 +810,8 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry = *iotlbentry, =20 /* Return true if ADDR is present in the victim tlb, and has been copied back to the main tlb. */ -static bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, - size_t elt_ofs, target_ulong page) +bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, + size_t elt_ofs, target_ulong page) { size_t vidx; =20 diff --git a/accel/tcg/cputlb.h b/accel/tcg/cputlb.h new file mode 100644 index 0000000000..da09f45b86 --- /dev/null +++ b/accel/tcg/cputlb.h @@ -0,0 +1,21 @@ +/* + * CPU TLB Helpers + */ + +#ifndef CPUTLB_H +#define CPUTBL_H + +uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + target_ulong addr, uintptr_t retaddr, + bool recheck, MMUAccessType access_type, int size); + +void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + uint64_t val, target_ulong addr, + uintptr_t retaddr, bool recheck, int size); + +bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, + size_t elt_ofs, target_ulong page); + +#endif --=20 2.17.1