From patchwork Mon Dec 17 15:01:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 154000 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2565569ljp; Mon, 17 Dec 2018 07:01:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/V04cogNR9eYmn74XIy1MX9HA6Faf94uGLI3hHX5sWCx7aVMPbpxq1WcLrwJYGLDuvgnn5/ X-Received: by 2002:ac8:36ba:: with SMTP id a55mr13467299qtc.236.1545058918893; Mon, 17 Dec 2018 07:01:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545058918; cv=none; d=google.com; s=arc-20160816; b=boVw8PLlswoc3bVFfwr+70iXkk0eJwxrepv3c+TJCYQFI+fB2pFkjxxkvhkqXvgXgn 44DVQ22e8g0lUx59XYLN9+oGGZuEFIvFaHWnWMJcVMZ3sOpgdBWWz10LBQXxLi73jPTj k0tMSaR7danLGhe4fsgjrN8dA+rg1Nm+vJToAvXDdnwvFNry8C9ZPV6fQNv53xb3bqQ3 WUmpoRX/R6pTXtLFBO+gA6WkDg5uX9tSvwG+CQxT73IRFso4/yTtkJlyhui06PaD1B3o PlF0RvOJPKQZaNBoK0nYrkR/nbNZeP5w6BbiO0tNg5neoMSroJXp+x9x0etoQpPXU3dD kNpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=27/FB81GdHmJNf6tIRTZBoPUJ2kQ0dZVx7C5EDrLRuk=; b=p4krUAJbzULHbMiB6v0u70tXEe7IWcItKnbNHAo3Nj1YrtFcAXdOWYUhGqs/6sGFla zm/OQoAyJdP+SvXsItQ4eF71BK7pkGtLR1JYVoGLe7lwYIMJCWEj3zS8L39fXfMn1qDG tplhZEOVLXDQLOfvtI+S5C0O3oDIZ+0cQQ6Dk7KiWan58+pX671oduw0nvv5JOhcN8mR 9wYJd86bMS1p3QbSRPpoEPpaThCmtHhEuEw2gVsIXG6I1Fa3V70fBUkkAQ7au/mfZYDq guEBBiUpWvWnH2JD2eJzJ0mKyK8siM6YX1+WG4e2tBdeqHydj0pYHu9I306ivdfzMuOb Ix9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A5RlX4ZN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e127si1880078qkc.256.2018.12.17.07.01.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 07:01:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A5RlX4ZN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYuP8-0005W5-1v for patch@linaro.org; Mon, 17 Dec 2018 10:01:58 -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) 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-Received: by 2002:a1c:ae15:: with SMTP id x21mr11737600wme.146.1545058877691; Mon, 17 Dec 2018 07:01:17 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=C3=A9e?= , Peter Crosthwaite Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée --- accel/tcg/cputlb.c | 21 +++++++++++---------- accel/tcg/cputlb.h | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 accel/tcg/cputlb.h -- 2.17.1 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_nofail(void *ptr) return ram_addr; } -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 = ENV_GET_CPU(env); hwaddr mr_offset; @@ -743,10 +744,10 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, return val; } -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 = ENV_GET_CPU(env); hwaddr mr_offset; @@ -809,8 +810,8 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, /* 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; 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