From patchwork Fri Dec 13 17:32:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850184 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1641502wry; Fri, 13 Dec 2024 09:41:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWX7+j+4xDj+A++/fjB7GM4iymFdf3FL0MVxVp7sVu/l9D7opKNCmAW7Jx8jOFbqylHMB2hTQ==@linaro.org X-Google-Smtp-Source: AGHT+IE8bbj+hUJvQp4WS7r2pgQU3OfgBwTVBfIhMBFc8i+JMU4RgYoyYBJ9AGP35VK97NJWgYw1 X-Received: by 2002:a05:600c:cc7:b0:434:a386:6ae with SMTP id 5b1f17b1804b1-4362aa14685mr30152895e9.7.1734111677255; Fri, 13 Dec 2024 09:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111677; cv=none; d=google.com; s=arc-20240605; b=f9P9qQ9rDjfZET5772QoVUSdMF8pwjvqNrbn2cpUV3pZfF6sLKwOEEb/YvzekMvZCL tHQJpZG+XzV/Zob6N6BWWuOflYg5m5VgiyjQ94vfIHJc3pITl9pZi0vDmixAEdry72fK FvKirpEKBjGA3o5YMcqTA5aMJZvx6CuzOurQ7g3UtQ2q4qUIltS6W5L17N/dj1u7sn9E guSp3mREH3q+muNxmVHKhIU6H2wOLd26bsG7f81Vg9Q0QFpPL1CuquZ1QvtQMS8no8Mw GSqnDnFQ7CLLkJPEQ57c9zGd6NTLWqOAS/LzGn4XkmUHvOUFL2/H8KctMWpaRgkcvnob tMTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=xaMbB8kjdY13l6QcFYXNfjRvMJl7ExJkmBH2Rljo9ow=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=NiSTJviAkUTsH2G4muMhnjgWDzvbg6rbqEa9CD6sE6CEa2MWAlpLiUpnPTzFb8pJSu j2u88ExYgx/TqQmJtEN9EYrQvhoZ9BIeFnSGCw6blrf3hFwmxU1lM8gSjxkLZcNZpWzk UgjkGPTBu5fnfqqh9/JmhrPWlXEYftQR4sP/uSiHP8/HovJ+IiIFZQ1IskCivQ5PSpck yiFZ24coblwKHBDPDg6AqE6QI7dLRJFEOeniSVdp6rWZfuDOeJrkoufTOPFW1NUDJ1p0 Ml4Bbp2ZxfE7ktL4MxKeaxY9EKcWyyPn6sRzlL2/9C73WintGMK2vIuxwrIxUUVxy36s BLlQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ko8djdGu; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 5b1f17b1804b1-4361ec85f41si22677755e9.2.2024.12.13.09.41.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:41:17 -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=Ko8djdGu; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tM9ax-0002Qb-4H; Fri, 13 Dec 2024 12:36:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tM9YG-0000rY-8O for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:08 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9YB-0001nJ-PM for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:34:07 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3862f32a33eso985899f8f.3 for ; Fri, 13 Dec 2024 09:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111241; x=1734716041; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xaMbB8kjdY13l6QcFYXNfjRvMJl7ExJkmBH2Rljo9ow=; b=Ko8djdGuUGoJcndE+rLSX5JkgffULpJ5AgjNW+X0qhcNpRDq/+ZDyiOGWUKVC9X1yu a0BGLveJQmay1zoQHRB/pX0ke5jJF92vbJPMdiKklpq9AOgbun9gQY9OpDB4KIbgFyYk 4atq2pgW/UZzHS1OIx2ngilQL2PsvH/WFtBch4FPkrg8cceYfHQDpOUpqrGsEWjWN7IR UKbycEHZYU8W03QZI9LJNg2je15HG20kz94lvi20eyDb4hfJaZMxJndZE1vONbkcWdWc QrS2rfh1UFcus0NB4ykZ5AOz4Rw/u/9/YsucJjAZoPRuL24b8fGyW/yxorJ9FneCsBrI K09Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111241; x=1734716041; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xaMbB8kjdY13l6QcFYXNfjRvMJl7ExJkmBH2Rljo9ow=; b=aHX5Mi48W//CsztejoBXuG74Ywao9Fb40LdzDCXpnn6+rx5QkVKCFl0jU4Nt1+mBd6 ZCoomYQ99njneaUAPP/CT0sASJFosCUKiQ+XlJW/HbZB5svUznC90W/Gt87+sVypUVxE tz5GHactk1jZGMLVgdVyNHK0Q3V3NyUUZtgCZVwots3yFq2kjT0CrV0VEQQLukHli/T+ DyKkHpXd5w5ol0F2EGHsHVerwD2uwbGX29P75G4XLU39vzkYGpU9KzS6kgoX5LcSUa4Q nwYQmX77iN3AfIImYNd8qbE8BLq/xKdXmvxp3iMpF13eWACtY978fVgW6XH7Nj4pcb6f hmyQ== X-Gm-Message-State: AOJu0Yya1E/yfRsV7pp/cVwhfF0BKb58o6MwJ4VJrUQEGLObn1YfLwuO 69UXK3cKd4K+I/fCDc6CeVzUjoXT3/5NWwyBN+m/y1uYc79gIbKc9kR3gFPBfc4pfbNpQ2bTTTZ p X-Gm-Gg: ASbGnct1v39V245MNwbjBIDMFupijTtxl+IWygPkRCIeJaXCcBd1mpBj21KzB/Sx/qx HEUJ6oZFvyvoCEeQemWRrHG/lB3HGdXxN+jEW/R+HiAkcUYC2a+dXAvXyyzQONeKGbdUIi4kZ9d W3Mu9WqXXL0ZdI0KqXg8n0U+ONsbAmX01JvCQ+fXxb+2yew0YQ3An8avnIuvmc0qCYbq90hoTht CSCe2S2yGl9XpkgRrbk+tk0P3gQZTa5wMkJFmUvgp3bF1Pf6L4JiQaHRk4n7A== X-Received: by 2002:a5d:6d8f:0:b0:385:e43a:4dd8 with SMTP id ffacd0b85a97d-38880af1458mr2824172f8f.4.1734111240716; Fri, 13 Dec 2024 09:34:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 84/85] target/arm: Move RME TLB insns to tlb-insns.c Date: Fri, 13 Dec 2024 17:32:28 +0000 Message-Id: <20241213173229.3308926-85-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.google.com 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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org Move the FEAT_RME specific TLB insns across to tlb-insns.c. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241210160452.2427965-10-peter.maydell@linaro.org --- target/arm/helper.c | 38 -------------------------------- target/arm/tcg/tlb-insns.c | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index cd9f8650316..910ae62c476 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6525,14 +6525,6 @@ static const ARMCPRegInfo sme_reginfo[] = { .type = ARM_CP_CONST, .resetvalue = 0 }, }; -static void tlbi_aa64_paall_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush(cs); -} - static void gpccr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -6550,14 +6542,6 @@ static void gpccr_reset(CPUARMState *env, const ARMCPRegInfo *ri) env_archcpu(env)->reset_l0gptsz); } -static void tlbi_aa64_paallos_write(CPUARMState *env, const ARMCPRegInfo *ri, - uint64_t value) -{ - CPUState *cs = env_cpu(env); - - tlb_flush_all_cpus_synced(cs); -} - static const ARMCPRegInfo rme_reginfo[] = { { .name = "GPCCR_EL3", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 6, .crn = 2, .crm = 1, .opc2 = 6, @@ -6569,28 +6553,6 @@ static const ARMCPRegInfo rme_reginfo[] = { { .name = "MFAR_EL3", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 6, .crn = 6, .crm = 0, .opc2 = 5, .access = PL3_RW, .fieldoffset = offsetof(CPUARMState, cp15.mfar_el3) }, - { .name = "TLBI_PAALL", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 4, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paall_write }, - { .name = "TLBI_PAALLOS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 4, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paallos_write }, - /* - * QEMU does not have a way to invalidate by physical address, thus - * invalidating a range of physical addresses is accomplished by - * flushing all tlb entries in the outer shareable domain, - * just like PAALLOS. - */ - { .name = "TLBI_RPALOS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 7, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paallos_write }, - { .name = "TLBI_RPAOS", .state = ARM_CP_STATE_AA64, - .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 3, - .access = PL3_W, .type = ARM_CP_NO_RAW, - .writefn = tlbi_aa64_paallos_write }, { .name = "DC_CIPAPA", .state = ARM_CP_STATE_AA64, .opc0 = 1, .opc1 = 6, .crn = 7, .crm = 14, .opc2 = 1, .access = PL3_W, .type = ARM_CP_NOP }, diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c index 51b4756e31e..d20d32624da 100644 --- a/target/arm/tcg/tlb-insns.c +++ b/target/arm/tcg/tlb-insns.c @@ -1181,6 +1181,48 @@ static const ARMCPRegInfo tlbios_reginfo[] = { .access = PL3_W, .type = ARM_CP_NO_RAW, .writefn = tlbi_aa64_vae3is_write }, }; + +static void tlbi_aa64_paall_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush(cs); +} + +static void tlbi_aa64_paallos_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + CPUState *cs = env_cpu(env); + + tlb_flush_all_cpus_synced(cs); +} + +static const ARMCPRegInfo tlbi_rme_reginfo[] = { + { .name = "TLBI_PAALL", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 7, .opc2 = 4, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paall_write }, + { .name = "TLBI_PAALLOS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 1, .opc2 = 4, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paallos_write }, + /* + * QEMU does not have a way to invalidate by physical address, thus + * invalidating a range of physical addresses is accomplished by + * flushing all tlb entries in the outer shareable domain, + * just like PAALLOS. + */ + { .name = "TLBI_RPALOS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 7, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paallos_write }, + { .name = "TLBI_RPAOS", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 6, .crn = 8, .crm = 4, .opc2 = 3, + .access = PL3_W, .type = ARM_CP_NO_RAW, + .writefn = tlbi_aa64_paallos_write }, +}; + #endif void define_tlb_insn_regs(ARMCPU *cpu) @@ -1219,5 +1261,8 @@ void define_tlb_insn_regs(ARMCPU *cpu) if (cpu_isar_feature(aa64_tlbios, cpu)) { define_arm_cp_regs(cpu, tlbios_reginfo); } + if (cpu_isar_feature(aa64_rme, cpu)) { + define_arm_cp_regs(cpu, tlbi_rme_reginfo); + } #endif }