From patchwork Mon Jun 27 10:22:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 585276 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2948808mab; Mon, 27 Jun 2022 03:30:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sf4xmpGS6s+qL3uKwf3BVJS2TvFE2CzEW399rJsvAJ89rN0AnZGEXSdXL3V9NQVwrURM33 X-Received: by 2002:ac8:7e86:0:b0:304:fe0a:8050 with SMTP id w6-20020ac87e86000000b00304fe0a8050mr8384080qtj.112.1656325804539; Mon, 27 Jun 2022 03:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656325804; cv=none; d=google.com; s=arc-20160816; b=BPMrR5TlDhswMuxLYNyD318fvXdiJZPZbrvRclqe0uLHhMw2pN5jylen8a/nVEoHlS 5UWguKqCTXrgviNlY+bREyEGwwGdDqkrTwGH/8jUwzhiaOmePKAGRl6PT4nowYxqqNMZ 7CMzQde25orpfKNpRjD2rnnpZ/8EYAIqgzpLmQo2+Rryk6A3rmqsuSJ8xxaWrM8S4ckA iDpeqVLKHyYBsgxPROWYJWwo8y5+nSyJyMYkvPl5X4tVtne5U5GY9RKHJpBtACIwMUbx pkVFk8nqHiN1oYeS0ZjwWuQvHsD6VkRxFV4cZcmbigfK2S/61Q4ByoDRhIOKwSpC3Rjs 1D1A== 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=UTv8wcV/DPc1kqXdo7thfBSpvl/+DZKxa8gDxsT5bAo=; b=ph2agoPY74RxGble7WHSBUIxxbNczfQ2Gm/xcoWAJJggJLI5mwGVvv4gVTqXyJwByl wYkRHOknsAoZO3UASfkjZ4KOS4uGHaCC8Mi8QR3cpYRpQBYJ5zpKHVq8xMviSSdyzcby aRMCc8gZ+pfWLvbIOpkGZj+qI+hoqayGvq1bffNP9G9BSUoAHxCfTm89N+E0MqVn+7EO 4q84af1sT89frw1vokizCc8MRIGNf+8GmsPeo+07/PE7X4QuBlzyOCzXxvJJFzR/eEbx nmHwjXg0k7ivXvDhFDZDHa89L+UO7qhz0fLUPxVBMiS/x5nibyw43pODzOeYsZYpUMpN 2ziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TneaXHkM; 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 g18-20020ac85812000000b00304def15cb0si5423676qtg.221.2022.06.27.03.30.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 03:30:04 -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=pass header.i=@linaro.org header.s=google header.b=TneaXHkM; 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]:35124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5m0K-00014i-3M for patch@linaro.org; Mon, 27 Jun 2022 06:30:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5ltJ-0002Ja-Ni for qemu-devel@nongnu.org; Mon, 27 Jun 2022 06:22:50 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:33879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5ltH-0004sk-88 for qemu-devel@nongnu.org; Mon, 27 Jun 2022 06:22:49 -0400 Received: by mail-wm1-x335.google.com with SMTP id m6-20020a05600c3b0600b003a0489f412cso1151907wms.1 for ; Mon, 27 Jun 2022 03:22:46 -0700 (PDT) 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=UTv8wcV/DPc1kqXdo7thfBSpvl/+DZKxa8gDxsT5bAo=; b=TneaXHkM0fXpTarEfQI31y/ee0jSB/jVfAHkfjIosObO2/4CocUTQMR1TuR8OlDeZP YuLocisOt5J/NrSxWU1zJ4FoHouf301ZLK+UUPs0WvkXEge69OF+vWG0Pgic0KEcTpiH x/JtPbLPej/g0LLIBW3delR+nVxRRKex+xh7UzrmVrzJobIvwhK5qwNLWvXqX+wG61ag b+HK/0vO92DcJKP4tbRWuTATHgPANeLIh4FSdyC3GhtIn5Oohos7/G0cSZa6DRrNBiEE H7mQqqZEzoadhH9IfN+F2LZnSXV8NYThJL6VD1tM8x9MgslRUv5+x0pxMjvQ4GFCILr+ GGxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UTv8wcV/DPc1kqXdo7thfBSpvl/+DZKxa8gDxsT5bAo=; b=ZfLSeIT4alN0Qz7HuIZ8V16+apDinlptjnrA15mJWWojqtPCifv25fQMnRQhut/m73 1Z5uzaUotPCjhx+cQBMQd1VXh6HZstbVRsg+FrjHsEWNn+tfooWOlaXvPrysoixcO+Ve /s/+S/pIA12kc/eCgVqqG/gn6TdvlnNVoPw4q/keRPG+P7DvY4ebg05MrGVXnJJ5XrMw 8+06WggOpCRh6hZwGQvMJY66XfA2eWoimNPQNsm2j7FeUCqzvxqGUfpBOhjwfZRVYI/O hfMBM5hWDWCjrBE+cGbaVvruLqrRdApQFYJaPUT5ABSjFYZBmLuV+9UasjG7oMUfmZQ5 bEng== X-Gm-Message-State: AJIora+ELsM6KdDaghS87xp5i6Nv0B1WlXtV+oPML9HBtfufAFbusEJA 9BkX/KMoMbVA3AyUJU0Q5g1AYp4yIQfLOQ== X-Received: by 2002:a1c:7719:0:b0:3a0:31a6:4469 with SMTP id t25-20020a1c7719000000b003a031a64469mr14404228wmi.20.1656325365869; Mon, 27 Jun 2022 03:22:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id d11-20020a5d6dcb000000b0020e6ce4dabdsm9754335wrz.103.2022.06.27.03.22.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 03:22:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/25] target/arm: Add SMIDR_EL1, SMPRI_EL1, SMPRIMAP_EL2 Date: Mon, 27 Jun 2022 11:22:21 +0100 Message-Id: <20220627102236.3097629-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627102236.3097629-1-peter.maydell@linaro.org> References: <20220627102236.3097629-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 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" From: Richard Henderson Implement the streaming mode identification register, and the two streaming priority registers. For QEMU, they are all RES0. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220620175235.60881-8-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 2072f2a550e..bbd04fbd67b 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6351,6 +6351,18 @@ static CPAccessResult access_tpidr2(CPUARMState *env, const ARMCPRegInfo *ri, return CP_ACCESS_OK; } +static CPAccessResult access_esm(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) +{ + /* TODO: FEAT_FGT for SMPRI_EL1 but not SMPRIMAP_EL2 */ + if (arm_current_el(env) < 3 + && arm_feature(env, ARM_FEATURE_EL3) + && !FIELD_EX64(env->cp15.cptr_el[3], CPTR_EL3, ESM)) { + return CP_ACCESS_TRAP_EL3; + } + return CP_ACCESS_OK; +} + static void svcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -6408,6 +6420,27 @@ static const ARMCPRegInfo sme_reginfo[] = { .access = PL3_RW, .type = ARM_CP_SME, .fieldoffset = offsetof(CPUARMState, vfp.smcr_el[3]), .writefn = smcr_write, .raw_writefn = raw_write }, + { .name = "SMIDR_EL1", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 1, .crn = 0, .crm = 0, .opc2 = 6, + .access = PL1_R, .accessfn = access_aa64_tid1, + /* + * IMPLEMENTOR = 0 (software) + * REVISION = 0 (implementation defined) + * SMPS = 0 (no streaming execution priority in QEMU) + * AFFINITY = 0 (streaming sve mode not shared with other PEs) + */ + .type = ARM_CP_CONST, .resetvalue = 0, }, + /* + * Because SMIDR_EL1.SMPS is 0, SMPRI_EL1 and SMPRIMAP_EL2 are RES 0. + */ + { .name = "SMPRI_EL1", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 0, .crn = 1, .crm = 2, .opc2 = 4, + .access = PL1_RW, .accessfn = access_esm, + .type = ARM_CP_CONST, .resetvalue = 0 }, + { .name = "SMPRIMAP_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 2, .opc2 = 5, + .access = PL2_RW, .accessfn = access_esm, + .type = ARM_CP_CONST, .resetvalue = 0 }, }; #endif /* TARGET_AARCH64 */