From patchwork Tue Jun 23 19:36:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191517 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp2282885ile; Tue, 23 Jun 2020 12:52:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnypXQDFc7pxSqz4nK88fenfVq7DypzZ9TrK0IP0YXAmArr19IFrDzQR5tLxL8BnT4r9pA X-Received: by 2002:a25:e795:: with SMTP id e143mr39772198ybh.181.1592941975029; Tue, 23 Jun 2020 12:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592941975; cv=none; d=google.com; s=arc-20160816; b=q29DkulslNfO2b2/CiyBI8YkXNXU6XG/KNuy9pw2moV+0APYm+2I65OZlIZuwoPJRl 1HpvacSks+0XAVj3RHld5H2mHg9pxEQghwjHEDm2QrueklxmNDk6broqjkaRssPZ0jHm DOdnXjEhYZCBllPA3swwEH1JWPQfteK8NW4i9WFOIKX9P2wALnqJJwz60pmtY/T36gbN 6dBYSSm86/C6BnwwFdLDnhuECPhgWe45GcK7+ruVDdLc2ije5bh/VH1epS9/6DXWTa7a +NRwNpP0zICJf/VQFNffPGG4zkpOWLSQCDZac7iG+gPsSC8EWGyWsHkYSIKJ0qe53Obc QG0A== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HSjBCHwavjNr37NIxaEpavJpEI8ou/nda9kEqEE9VlM=; b=CpwCNC0FnX2jpsr+cuab/y+jl3XH6G1l8PsP5PWdq1feI6J93gOEcioytVGS8BpELm GRqb4WLMZ7JneQZ+BDAHjJbreG2M04mQjv/kDpe0xPqjgFrQ/R/Yf6L5KS6hTn0jQj5N h+D+syVw/j0uIkv760sxwVR1u2s2bKu1nl/QTBrlHiNtg3pU7H3HSdrNBqKb741d1wbU XQJk6dRu4Uidsc1BwtrVDgtlmvYKLSLqc0y6N2pVHcOWCZrkvvuw8RnVJ3yBgKwSSQ4M 2GkKsbHZ3d5pZQzdB/V+5VmixO4O3hQKmpA85aJ8ZHnQnWqIXFqqa9S7D6tn/n1kYNNc ipug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HEqhd9bm; 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=fail (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 n7si20534618ybn.229.2020.06.23.12.52.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jun 2020 12:52:55 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=HEqhd9bm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnoyU-0006dA-Da for patch@linaro.org; Tue, 23 Jun 2020 15:52:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnojc-00045K-CP for qemu-devel@nongnu.org; Tue, 23 Jun 2020 15:37:32 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:42047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnoja-0005kC-La for qemu-devel@nongnu.org; Tue, 23 Jun 2020 15:37:32 -0400 Received: by mail-pg1-x542.google.com with SMTP id e9so10832pgo.9 for ; Tue, 23 Jun 2020 12:37:30 -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=HSjBCHwavjNr37NIxaEpavJpEI8ou/nda9kEqEE9VlM=; b=HEqhd9bmGtMldVUa0JQn7/9DY2gz5OhgH9UvqeVRYPgmX+BE0q3bzOu+cYSbWGHrSo EgnAW9nmMBAtMZ5RgHeR5BBXP+tqZ71YgtmDXVIn/H+WSfHxNI6DPUg8Q8bQ+Ry0mKoS Ub/SWE/7fDyVJZ3JD1YEPOjzN3nYKcVJGpcSmsf0AU19estMucFqKX4Keo0/8k/ab6lZ NBIINbZQVbdejfmOOs4nKDMXSbtFUL9k+yUxp7HAeELQl2BtEShZ2M5xZ6P4CDFCIWg6 PiHC07YjLmZchn1ioBp6tE5+GKV7ZlswhJBpGi3ZfP+ui4PqwgDwuPRGPg3zmph3IVmA eTaQ== 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=HSjBCHwavjNr37NIxaEpavJpEI8ou/nda9kEqEE9VlM=; b=GJsOHPaciTZIWs9yevKF2Coj15Y8JQ31xdhk6Skb+vMpYGM9D+qc0FonkI6BD5VP/9 tarocgq23r7ryRUPl4wrMWKvmh95/wjLqNxQ2hTwgqB+JC/XWoLokYb4kk4K8yEXoKtQ zYniA5Q29rMoOh2rSozZBSqoN220G0wBGJm91u8B56QdS9DZkbTqbphJ8etEOEgHb4SW 7UBEZLk0UKu45R/3Zzu6GbKeghO6j28IZVLX7rf0QgsAOHhOEJSMma5UQYfweTtSZqhm 5qzylkOfV7vBCpyJM3/2n0PPda5WXq9XDtlh8zchVVDZSz2DiwHIQMYzge4sICy7mvI6 c0NA== X-Gm-Message-State: AOAM533g5Bn7Fn7FcKKwamunhz/9eC+UvXyIb1SNZfPG/uova4sUH3hT osERrVSjyLIKwrNwp15yOKTfryUZXbY= X-Received: by 2002:aa7:84cf:: with SMTP id x15mr26135847pfn.214.1592941048926; Tue, 23 Jun 2020 12:37:28 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id p12sm17927642pfq.69.2020.06.23.12.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 12:37:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v8 20/45] target/arm: Implement the access tag cache flushes Date: Tue, 23 Jun 2020 12:36:33 -0700 Message-Id: <20200623193658.623279-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200623193658.623279-1-richard.henderson@linaro.org> References: <20200623193658.623279-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, david.spickett@linaro.org, steplong@quicinc.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Like the regular data cache flushes, these are nops within qemu. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v6: Split out and handle el0 cache ops properly. --- target/arm/helper.c | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) -- 2.25.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index 2c6ec244af..d8c31d03da 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6929,6 +6929,32 @@ static const ARMCPRegInfo mte_reginfo[] = { .opc0 = 3, .opc1 = 3, .crn = 4, .crm = 2, .opc2 = 7, .type = ARM_CP_NO_RAW, .access = PL0_RW, .readfn = tco_read, .writefn = tco_write }, + { .name = "DC_IGVAC", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 6, .opc2 = 3, + .type = ARM_CP_NOP, .access = PL1_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_IGSW", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 6, .opc2 = 4, + .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_tsw }, + { .name = "DC_IGDVAC", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 6, .opc2 = 5, + .type = ARM_CP_NOP, .access = PL1_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_IGDSW", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 6, .opc2 = 6, + .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_tsw }, + { .name = "DC_CGSW", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 10, .opc2 = 4, + .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_tsw }, + { .name = "DC_CGDSW", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 10, .opc2 = 6, + .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_tsw }, + { .name = "DC_CIGSW", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 14, .opc2 = 4, + .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_tsw }, + { .name = "DC_CIGDSW", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 0, .crn = 7, .crm = 14, .opc2 = 6, + .type = ARM_CP_NOP, .access = PL1_W, .accessfn = access_tsw }, REGINFO_SENTINEL }; @@ -6938,6 +6964,43 @@ static const ARMCPRegInfo mte_tco_ro_reginfo[] = { .type = ARM_CP_CONST, .access = PL0_RW, }, REGINFO_SENTINEL }; + +static const ARMCPRegInfo mte_el0_cacheop_reginfo[] = { + { .name = "DC_CGVAC", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 10, .opc2 = 3, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CGDVAC", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 10, .opc2 = 5, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CGVAP", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 12, .opc2 = 3, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CGDVAP", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 12, .opc2 = 5, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CGVADP", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 13, .opc2 = 3, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CGDVADP", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 13, .opc2 = 5, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CIGVAC", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 14, .opc2 = 3, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + { .name = "DC_CIGDVAC", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 3, .crn = 7, .crm = 14, .opc2 = 5, + .type = ARM_CP_NOP, .access = PL0_W, + .accessfn = aa64_cacheop_poc_access }, + REGINFO_SENTINEL +}; + #endif static CPAccessResult access_predinv(CPUARMState *env, const ARMCPRegInfo *ri, @@ -8071,8 +8134,10 @@ void register_cp_regs_for_features(ARMCPU *cpu) */ if (cpu_isar_feature(aa64_mte, cpu)) { define_arm_cp_regs(cpu, mte_reginfo); + define_arm_cp_regs(cpu, mte_el0_cacheop_reginfo); } else if (cpu_isar_feature(aa64_mte_insn_reg, cpu)) { define_arm_cp_regs(cpu, mte_tco_ro_reginfo); + define_arm_cp_regs(cpu, mte_el0_cacheop_reginfo); } #endif