From patchwork Thu Dec 12 04:00:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 181417 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp390142ile; Wed, 11 Dec 2019 20:06:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyID2Ty/c/bd2LWn2HK7O5HHnx31mIb0f9UEHqB7SJFu9tXDFn7dhMjXkvxuNUSAm9AloL1 X-Received: by 2002:aed:2926:: with SMTP id s35mr5996998qtd.220.1576123600436; Wed, 11 Dec 2019 20:06:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576123600; cv=none; d=google.com; s=arc-20160816; b=Y+BZOllWwNY24wihK/JEIz5yBx1rIbyIxaNboPdplasfL1KMGL6MeaXzUwfm54HyBL WjL1JO3bpBSPU430QKpV4RDihGIE5y40g0KptIyeELHJZS3gulfZisBRm2meL94oCkPg tmL8WqAozngJjGt5PEPtxTjVXBzM0ILdVKM0/LpM9q8i2OTb1PuEowAozqniq5mSrODJ YKbAno1g6yvPxvJMmLowdQfHwbF7kfKjoI2lP3+XvEhCMJrDu1H7DPng9UYbElboOVqu 8kIt4vhvVkblvHeymwJRAKV/qbO99O2pmUvGpc4DPvo/ZsU5iYdxymwhxIHetBbu3Qja XNyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8YMOjliCdpjOfsXyx7R7DH1pWxj9O80SkuA3OFxkquc=; b=wOrYaqbSAwvaTwbqESo7smRM+7W4rkctN2M/Aj5Kk0YQigD5t/Xh1PZ1kntqJ6rlfR lOLEq6VMsAntIN6Kuy2Ly0qp78+qiiRxys+wChio9ZQNumwhzLMH4++vSRCJhkV8/k+g GguodcRC/9eCMWTqg/Xxh5XgUS5XiBdgPaoNy5HjGY4Fr0Emd+vHLNwMGzfJgnp0FjQl Y22MtJaSoaHw4/KuAlttCVxGmcNWUZJhjKzHEwkcBj41afFX5R15YUGtwu3/2XjUyWWJ Mn40Ay3NWfQMqIaFBdqQSCkQgy8unZ9uMyyn1MGZ7pwgdb5YtRpmvCrEhrYZ2bfZspf5 k/8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tyjPcK4E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 17si2271357qvy.69.2019.12.11.20.06.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2019 20:06:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tyjPcK4E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifFkN-00086t-8f for patch@linaro.org; Wed, 11 Dec 2019 23:06:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48328) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifFes-0000r7-2q for qemu-devel@nongnu.org; Wed, 11 Dec 2019 23:00:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifFem-000403-VF for qemu-devel@nongnu.org; Wed, 11 Dec 2019 23:00:56 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:40123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifFem-0003y5-KK for qemu-devel@nongnu.org; Wed, 11 Dec 2019 23:00:52 -0500 Received: by mail-pl1-x644.google.com with SMTP id g6so756plp.7 for ; Wed, 11 Dec 2019 20:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=8YMOjliCdpjOfsXyx7R7DH1pWxj9O80SkuA3OFxkquc=; b=tyjPcK4EFLmW4s+b3elPuua40KFJijxOyeA6E5hA1BAYioHoNY790aDeH1P67cRI6t BoXTERpaltgtSKLsBFVYpBBca6lgV1OoEi9uGaMx9c9D5tiEvnfoM1eD2CUCzuOwgBJs oNoafO1AaPTjyDNBiENr+ySt/m3AYaL4IURpp8vcISjYt4uqS569dYmkZR9ZcX4n9Yp/ AG9IuahqnjxQ2REjWNQhbYJ0tGDNNJJhuhq0ZptEE6bCtOzWzAwa21J1JJgMd90/Ype5 77TafLuolcsbuiqr2L6X/W3tk4a5eX726q6wzFTy8cLgiK1fWl9lli9VBXVjPpQoRE45 wvmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8YMOjliCdpjOfsXyx7R7DH1pWxj9O80SkuA3OFxkquc=; b=CUJVF93UcHW1ZIrrGWLjXoJVQEHgce9cqOtDRcwngTXB9xUABi3h7cOMqiU+LPh5C7 545cSeSaolU82q5l2/ys/l91jy02WBMKwkVFYV63JzXDqJrcBis3ko+If/3zMjyXVqGM 0E7a02BaonE313Ve5hONPrA3kQY+7GI8MrnuzzZ10raI4oeSYBueCNI1fi9afQzdYpsr /ydW7ITbjAhbZsYtHuNi3IpPx1f0B/Hse54+DPj704u3yJt2CRIBt23RWhGL5UamvhcE QDq+ixPMSAr1L3QaDVZOIH9+06hzT7z84hh4drG/GNQSwEYnt+/o7+aouqkSOdZHIAKI CTHA== X-Gm-Message-State: APjAAAWHLVQf2tmTnQ6tGL+3RaWjscLpgk27P0xMyUcHjeMOm0Iwa6sm FYzEHKXDrikQUAGqzzxq8m0x9KHmkUw= X-Received: by 2002:a17:902:7287:: with SMTP id d7mr7181068pll.17.1576123250094; Wed, 11 Dec 2019 20:00:50 -0800 (PST) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id z130sm4666391pgz.6.2019.12.11.20.00.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 20:00:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/28] cputlb: Provide cpu_(ld,st}*_mmuidx_ra for user-only Date: Wed, 11 Dec 2019 20:00:18 -0800 Message-Id: <20191212040039.26546-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191212040039.26546-1-richard.henderson@linaro.org> References: <20191212040039.26546-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This finishes the new interface began with the previous patch. Document the interface and deprecate MMU_MODE_SUFFIX. Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 84 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index ef59ed61e4..3b2c46bdf4 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -25,9 +25,13 @@ * * The syntax for the accessors is: * - * load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr) + * load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr) + * cpu_ld{sign}{size}_{mmusuffix}_ra(env, ptr, retaddr) + * cpu_ld{sign}{size}_mmuidx_ra(env, ptr, mmu_idx, retaddr) * - * store: cpu_st{sign}{size}_{mmusuffix}(env, ptr, val) + * store: cpu_st{size}_{mmusuffix}(env, ptr, val) + * cpu_st{size}_{mmusuffix}_ra(env, ptr, val, retaddr) + * cpu_st{size}_mmuidx_ra(env, ptr, val, mmu_idx, retaddr) * * sign is: * (empty): for 32 and 64 bit sizes @@ -40,9 +44,14 @@ * l: 32 bits * q: 64 bits * - * mmusuffix is one of the generic suffixes "data" or "code", or - * (for softmmu configs) a target-specific MMU mode suffix as defined - * in target cpu.h. + * mmusuffix is one of the generic suffixes "data" or "code", or "mmuidx". + * The "mmuidx" suffix carries an extra mmu_idx argument that specifies + * the index to use; the "data" and "code" suffixes take the index from + * cpu_mmu_index(). + * + * Deprecated: for softmmu configs, mmusuffix may be a target-specific MMU + * mode suffix as defined in target cpu.h. These should be replaced by + * one of the "mmuidx" functions. */ #ifndef CPU_LDST_H #define CPU_LDST_H @@ -145,6 +154,71 @@ static inline void clear_helper_retaddr(void) #undef MEMSUFFIX #undef CODE_ACCESS +/* + * Provide the same *_mmuidx_ra interface as for softmmu. + * The mmu_idx argument is ignored. + */ + +static inline uint32_t cpu_ldub_mmuidx_ra(CPUArchState *env, abi_ptr addr, + int mmu_idx, uintptr_t ra) +{ + return cpu_ldub_data_ra(env, addr, ra); +} + +static inline uint32_t cpu_lduw_mmuidx_ra(CPUArchState *env, abi_ptr addr, + int mmu_idx, uintptr_t ra) +{ + return cpu_lduw_data_ra(env, addr, ra); +} + +static inline uint32_t cpu_ldl_mmuidx_ra(CPUArchState *env, abi_ptr addr, + int mmu_idx, uintptr_t ra) +{ + return cpu_ldl_data_ra(env, addr, ra); +} + +static inline uint64_t cpu_ldq_mmuidx_ra(CPUArchState *env, abi_ptr addr, + int mmu_idx, uintptr_t ra) +{ + return cpu_ldq_data_ra(env, addr, ra); +} + +static inline int cpu_ldsb_mmuidx_ra(CPUArchState *env, abi_ptr addr, + int mmu_idx, uintptr_t ra) +{ + return cpu_ldsb_data_ra(env, addr, ra); +} + +static inline int cpu_ldsw_mmuidx_ra(CPUArchState *env, abi_ptr addr, + int mmu_idx, uintptr_t ra) +{ + return cpu_ldsw_data_ra(env, addr, ra); +} + +static inline void cpu_stb_mmuidx_ra(CPUArchState *env, abi_ptr addr, + uint32_t val, int mmu_idx, uintptr_t ra) +{ + cpu_stb_data_ra(env, addr, val, ra); +} + +static inline void cpu_stw_mmuidx_ra(CPUArchState *env, abi_ptr addr, + uint32_t val, int mmu_idx, uintptr_t ra) +{ + cpu_stw_data_ra(env, addr, val, ra); +} + +static inline void cpu_stl_mmuidx_ra(CPUArchState *env, abi_ptr addr, + uint32_t val, int mmu_idx, uintptr_t ra) +{ + cpu_stl_data_ra(env, addr, val, ra); +} + +static inline void cpu_stq_mmuidx_ra(CPUArchState *env, abi_ptr addr, + uint64_t val, int mmu_idx, uintptr_t ra) +{ + cpu_stq_data_ra(env, addr, val, ra); +} + #else /* Needed for TCG_OVERSIZED_GUEST */