From nobody Fri Dec 19 04:32:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1582908704; cv=none; d=zohomail.com; s=zohoarc; b=hvL89XOiMrWYZZIX9DIY9zSzm//M53zOxJvYVhCMdTRr8JJ8UFWP43nHcnX/Y8vw+DAigIETvHv1quX47UOBbbAv7iw24235+iVGX1jnBBob10Z8UzpkX3i350scUvPyariyjxUbneBgidk4mC8sDzJmWGi1oyYCxyeJPRGRNYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582908704; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zxcAJSx6I1dBt0++qxyzNQdup6sZi0n4/zNIAaI5fJc=; b=GA/MPEN5EGxAqmDBgUKistUiqCWkLVm9wvDCqn2Khaiw83BWPoe3T2ATMiC8LVbbS6QLuuA/cfLt0m6lxLadXed5jUCEegxpH6EnEdHaoFZhjKM8iFk/Ks0wkDn86WtnyfWZul1S4Da/xq8OByOJlVQLZixJ+ZWlQ2EItYGW0tE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582908704736281.3343244317675; Fri, 28 Feb 2020 08:51:44 -0800 (PST) Received: from localhost ([::1]:50636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7irX-0005Im-80 for importer@patchew.org; Fri, 28 Feb 2020 11:51:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56766) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7ifX-0008Hy-E2 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:39:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7ifW-000272-5k for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:39:19 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7ifV-00026P-VB for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:39:18 -0500 Received: by mail-wr1-x42e.google.com with SMTP id r7so3700178wro.2 for ; Fri, 28 Feb 2020 08:39:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c9sm13335214wrq.44.2020.02.28.08.39.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 08:39:16 -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=zxcAJSx6I1dBt0++qxyzNQdup6sZi0n4/zNIAaI5fJc=; b=a8izAkQ+LahKJLwJkFwoQH2ql7SBI0sxUA6t2hCxx85lkFKE6x/iASCVu310eO1u36 pN//E3hTlLi0Eg5RtnjOSaGVTf/WdufwrCAUjJRdOqo0dPIlDo93CDDYNUY0rWhmQh5w 9PAu4oC83AI++SU9Twq026YeCX5k0IfHLlkXDMEuU05jQR+L+ud2AaLLy1z9TdIQCm4k 0ykJM0A3P24SKBaOfoAu5GHH6dz29fOWc+tsTXjkFHoDfyfQ0CKop4XzkdRZ0gIRUWPu e5BBvw0jQ6YWBangLOUkA4N3mFS6jg+qqunRvpthzDnxZWBqRp3FJe8ayxyJxGgZLVk0 cVFA== 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=zxcAJSx6I1dBt0++qxyzNQdup6sZi0n4/zNIAaI5fJc=; b=K/clyhASe7gZyo/i85EoQ4+cTjhczHP23KLZKLe4uWtBNDBeJQ0iZNBpzl4TDRDl4y tHVroaQ7jyjxajouo1HemN588ngbt8jKz7+fZC+sJIerVw/MXrvUI/YbujadnRUlamm4 1XGOwpTU1ZgGT8lM+Bx1cLkkeU6zaSHwLVTnBJAU8EUJZ7vSjJvg6I5NOUDt0Fg080QN 6DJPnuN7fFIhMN2jHzT7h6qDiC36NtTzogq8FOWGC/P+0iSvmXs93KUCbaYnYcbh5b3n tRD7KvzWdpXnGxWcfKgrX1lYymWoV+sbWEbj/RurOzYVcELQiMzsi3kfMbiYvTvqXiu9 AGTQ== X-Gm-Message-State: APjAAAVLFfmkrjK4eJ7DLoXVSh9SCByNqPXV/m+VrMWbuxBl/x6Q/Jst wiMd55f0MqfYzuH+cgeCB82Y4Cpfv9K3zQ== X-Google-Smtp-Source: APXvYqz0mZm6uzXMTYmEEvkxRXVUia+nsICpj+tbEFEW1PTOCBNhp6SV8X2dxgR1/gWfcCFvYOFeFA== X-Received: by 2002:adf:f012:: with SMTP id j18mr5551363wro.314.1582907956619; Fri, 28 Feb 2020 08:39:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/33] target/arm: Implement v8.3-RCPC Date: Fri, 28 Feb 2020 16:38:37 +0000 Message-Id: <20200228163840.23585-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200228163840.23585-1-peter.maydell@linaro.org> References: <20200228163840.23585-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" The v8.3-RCPC extension implements three new load instructions which provide slightly weaker consistency guarantees than the existing load-acquire operations. For QEMU we choose to simply implement them with a full LDAQ barrier. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20200224172846.13053-3-peter.maydell@linaro.org --- target/arm/cpu.h | 5 +++++ linux-user/elfload.c | 1 + target/arm/cpu64.c | 1 + target/arm/translate-a64.c | 24 ++++++++++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 6013287f623..ff30985ead4 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3774,6 +3774,11 @@ static inline bool isar_feature_aa64_pmu_8_4(const A= RMISARegisters *id) FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) !=3D 0xf; } =20 +static inline bool isar_feature_aa64_rcpc_8_3(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) !=3D 0; +} + /* * Feature tests for "does this exist in either 32-bit or 64-bit?" */ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 86cda127b78..d76b828a789 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -661,6 +661,7 @@ static uint32_t get_elf_hwcap(void) GET_FEATURE_ID(aa64_sb, ARM_HWCAP_A64_SB); GET_FEATURE_ID(aa64_condm_4, ARM_HWCAP_A64_FLAGM); GET_FEATURE_ID(aa64_dcpop, ARM_HWCAP_A64_DCPOP); + GET_FEATURE_ID(aa64_rcpc_8_3, ARM_HWCAP_A64_LRCPC); =20 return hwcaps; } diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 8f2a43c938a..18c7b40f98c 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -654,6 +654,7 @@ static void aarch64_max_initfn(Object *obj) t =3D FIELD_DP64(t, ID_AA64ISAR1, SB, 1); t =3D FIELD_DP64(t, ID_AA64ISAR1, SPECRES, 1); t =3D FIELD_DP64(t, ID_AA64ISAR1, FRINTTS, 1); + t =3D FIELD_DP64(t, ID_AA64ISAR1, LRCPC, 1); /* ARMv8.3-RCPC */ cpu->isar.id_aa64isar1 =3D t; =20 t =3D cpu->isar.id_aa64pfr0; diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 596bf4cf734..7a066fb7cb2 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -3142,6 +3142,8 @@ static void disas_ldst_atomic(DisasContext *s, uint32= _t insn, int rs =3D extract32(insn, 16, 5); int rn =3D extract32(insn, 5, 5); int o3_opc =3D extract32(insn, 12, 4); + bool r =3D extract32(insn, 22, 1); + bool a =3D extract32(insn, 23, 1); TCGv_i64 tcg_rs, clean_addr; AtomicThreeOpFn *fn; =20 @@ -3177,6 +3179,13 @@ static void disas_ldst_atomic(DisasContext *s, uint3= 2_t insn, case 010: /* SWP */ fn =3D tcg_gen_atomic_xchg_i64; break; + case 014: /* LDAPR, LDAPRH, LDAPRB */ + if (!dc_isar_feature(aa64_rcpc_8_3, s) || + rs !=3D 31 || a !=3D 1 || r !=3D 0) { + unallocated_encoding(s); + return; + } + break; default: unallocated_encoding(s); return; @@ -3186,6 +3195,21 @@ static void disas_ldst_atomic(DisasContext *s, uint3= 2_t insn, gen_check_sp_alignment(s); } clean_addr =3D clean_data_tbi(s, cpu_reg_sp(s, rn)); + + if (o3_opc =3D=3D 014) { + /* + * LDAPR* are a special case because they are a simple load, not a + * fetch-and-do-something op. + * The architectural consistency requirements here are weaker than + * full load-acquire (we only need "load-acquire processor consist= ent"), + * but we choose to implement them as full LDAQ. + */ + do_gpr_ld(s, cpu_reg(s, rt), clean_addr, size, false, false, + true, rt, disas_ldst_compute_iss_sf(size, false, 0), tru= e); + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_LDAQ); + return; + } + tcg_rs =3D read_cpu_reg(s, rs, true); =20 if (o3_opc =3D=3D 1) { /* LDCLR */ --=20 2.20.1