From patchwork Fri Apr 20 15:50:40 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: 133899 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp439132ljf; Fri, 20 Apr 2018 08:53:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49P8G5Yo791CZ+6QcFbKM6Utv1cpwuGifMiiPmUOduZyFwRu20148qFkL7+ryI0V6uUJ0ez X-Received: by 2002:a25:2185:: with SMTP id h127-v6mr6557307ybh.206.1524239624132; Fri, 20 Apr 2018 08:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524239624; cv=none; d=google.com; s=arc-20160816; b=jrnqaxr31LrjCqEWf7iD7YdPzm8z2TulaJnrp8IS8I76FQJJ7L7ENxTjLejo4HP713 F/ZpW9J15z5hXNXA6pit86HihJRkuupjVSOm2uUuDiDY1Sr1m3DTWF0UXeWiredhkpuj JaF0xUqxaO4oxcCNVjU3D842dfx0vmAzYkkDvGyuWD/IsrMV21npVfT4s2yaTsWGEOiY SmddcizukG5VNuQ6AdFgowv42ZrOTn4KlSjVI64qxXxrL97DHnGDMo7KumdIqNLyuGBf nB9+BmkKuAp229COkpRnnU6bCq9wAD6qPihrYeeDyDaxuJFpsvG27s0LPSE49I3BLruQ SXkg== 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:arc-authentication-results; bh=NKRTWPx9XJvd8tXI8smZeEGIKMjvBcvS6l3yK5hH9tM=; b=L7CY4oMDWZ6ECoP7ZQUe6c/emrnknRVHB4G8hcjDAcaVxxXL8OtMh2qsD8sS5y/ij3 ifHJijzgL8JDO7fGMc1znT17BJfxbCkj8NW5ObZq8ZXNFDAb6ZEJyVYdLSCgVYLPn3OJ T6ggNclHUtvpxM3id+nttND7NLcDUvUK2qFlm03UhOzp8uGM5IDSb251ev5hRsFADQAZ Z47td4YvqqAjvzhVGFlAei3ta9+3VSFo3kJINx1HGS26JtL0dPTTWp+uybNZrsQnz9f7 /sKbol1tZy6+a/tFepk2ePvLQWxl+FUap23fCyWVPUPuzrpoVrX0ATd4BKHm8lEvjPHc FBHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Jvh4DbHp; 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 129si2669260vkv.336.2018.04.20.08.53.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 20 Apr 2018 08:53:44 -0700 (PDT) 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=Jvh4DbHp; 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]:39043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9YM3-00076n-HS for patch@linaro.org; Fri, 20 Apr 2018 11:53:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9YJH-0005v7-Ka for qemu-devel@nongnu.org; Fri, 20 Apr 2018 11:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9YJG-0005qL-7S for qemu-devel@nongnu.org; Fri, 20 Apr 2018 11:50:51 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:37852) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9YJG-0005pY-0y for qemu-devel@nongnu.org; Fri, 20 Apr 2018 11:50:50 -0400 Received: by mail-wr0-x241.google.com with SMTP id f14-v6so24222140wre.4 for ; Fri, 20 Apr 2018 08:50:49 -0700 (PDT) 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=NKRTWPx9XJvd8tXI8smZeEGIKMjvBcvS6l3yK5hH9tM=; b=Jvh4DbHp9TUmR3rg9sSVDaKbOx2Mo5lR2YwtHF34LrS/W2rXNIyp+EDNex0wjbjZsB OdeOl+WqbfJXB9IVHsBJPZr7VLOE2YjZKf7vOsjJWqZHfU+ewj7ky01HgMCf5AILxV6m qY5FYC7+i9dqaig8uPG1xXbpO7C78YK9yfg24= 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=NKRTWPx9XJvd8tXI8smZeEGIKMjvBcvS6l3yK5hH9tM=; b=ALF+heuznChuNbYkJ0v9SXRH8HWk+nab8mVUYAAaVSdPPjxz0gQoyucyI30F/pZ5Ip Melc82b0zcPV+qqTvaUDDJl2rqJW54aDHPj9E0cvszeBdjXY3untwC9q50DXZcpL5HFt m1aAnbpVYQd8AViDO8gWkp0ReOT+7BtNCNouKdcmOjEfe0/gR1dkpiwigxWyTwNog4WL NbTfg9dvpVda7FPm/uswSydR5QKhJs8sAdKKJKzTMglE0tr4CtUZSLUXN9jTZh3NLnUW Zs8xYCLq/3XeBPlOIl1sSWB25i+GxbEmQZYC9QpBoS8B7b6rGEBArLFSKHKlGdn+mHnU CS/g== X-Gm-Message-State: ALQs6tDxsdaJgUSHAyHgaHEi+haQsfKUPtyZLRahBmAxhCUajZGnTMC3 Mm9HFWzV/0enk4GRYq/4Cze7Xw== X-Received: by 10.28.184.21 with SMTP id i21mr2432119wmf.94.1524239448798; Fri, 20 Apr 2018 08:50:48 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v111-v6sm7825434wrb.30.2018.04.20.08.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 08:50:46 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 391553E0321; Fri, 20 Apr 2018 16:50:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 20 Apr 2018 16:50:40 +0100 Message-Id: <20180420155045.18862-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180420155045.18862-1-alex.bennee@linaro.org> References: <20180420155045.18862-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:400c:c0c::241 Subject: [Qemu-devel] [RFC PATCH 1/6] 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: peter.maydell@linaro.org, Peter Crosthwaite , richard.henderson@linaro.org, pbonzini@redhat.com, =?utf-8?q?Alex_Ben?= =?utf-8?q?n=C3=A9e?= , Richard Henderson 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 | 19 ++++++++++--------- accel/tcg/cputlb.h | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 accel/tcg/cputlb.h -- 2.17.0 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 05439039e9..43a89d3010 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" @@ -760,9 +761,9 @@ 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, int size) +uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + target_ulong addr, uintptr_t retaddr, int size) { CPUState *cpu = ENV_GET_CPU(env); hwaddr physaddr = iotlbentry->addr; @@ -796,10 +797,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, int size) +void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + uint64_t val, target_ulong addr, + uintptr_t retaddr, int size) { CPUState *cpu = ENV_GET_CPU(env); hwaddr physaddr = iotlbentry->addr; @@ -831,8 +832,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; for (vidx = 0; vidx < CPU_VTLB_SIZE; ++vidx) { diff --git a/accel/tcg/cputlb.h b/accel/tcg/cputlb.h new file mode 100644 index 0000000000..4645693eb5 --- /dev/null +++ b/accel/tcg/cputlb.h @@ -0,0 +1,20 @@ +/* + * CPU TLB Helperss + */ + +#ifndef CPUTLB_H +#define CPUTBL_H + +uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + target_ulong addr, uintptr_t retaddr, int size); + +void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, + int mmu_idx, + uint64_t val, target_ulong addr, + uintptr_t retaddr, int size); + +bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, + size_t elt_ofs, target_ulong page); + +#endif