From patchwork Tue Jun 7 20:32:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 579355 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp5517877max; Tue, 7 Jun 2022 14:16:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmc0vzHDdg/PjP+KqLR9n+0idyzEnDNNMPOXp1THc9HHLlq+gIzJM0Tvxa8PK80Wxpyct4 X-Received: by 2002:ad4:5ba7:0:b0:46b:8813:878b with SMTP id 7-20020ad45ba7000000b0046b8813878bmr12056276qvq.96.1654636561827; Tue, 07 Jun 2022 14:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654636561; cv=none; d=google.com; s=arc-20160816; b=YArPlWFT7oh0EeU/C7JpcLKKGgT2RFOKtC1zdkTnz7B6MZW0vE/TEv4UZI3Zw3HI9x +R3dxmqTzIC2DSWAe2zxabjGFvWiU7EzUlxsVzabuCdiv6hGK347LK767TYd4lUrwkWM MlTnhGHv1/wO42DytyLEiAArEXFGMBAJhjYS6JiqI0351hAUMEn6FdTsW8tzLSjtq9Zm DUhMCLObU8IxLTGvtum/vD6Z0Yay7Hj1uJZsVlotn21XsHWULpx8DYbDi0nFXMHuyGGt 2pKrUtkZtotHClSi3EYll/A2XT84Gmzvh6Dko42Z2wpEA554zp0PP4IMN075nTEaALWs mFLw== 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:cc:to :from:dkim-signature; bh=7xdazpoc98KTxU+Hkap6hV74hgs0EjjQuCmdWfoKk1g=; b=i4SsVTpR7v5iSP/jKrdTSbqC3d0kvxEA0+irGMwJSzzqtbny0NzWqpWEA2o6Rx19h0 rIsW96u7K7E+F+E0R7RG6cJTaQ/gR3bYFBj6xPon7m+PkhlWY04JmwBVP6qXuktHwD1u Ag2ODTUdLe2Eor+Ag66yieOFxNRpZroj3dWV23Ij+D2KCaOiq9FhOsy2d2nongjdxIrF D19iLk4SeggDO2nvE+fPPZxQzgEu51kQtAVoLBwjzCjAt5/vvEQalsbBHFd0lwtZ2Mxv APg9MQOwZzaClA9iVBY7cEOTh1if6G9UUkC6DfUYBa10I4KCakDrBb6FgZm4XGWMGYAv 1vUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="uHv8x/Nf"; 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 ke1-20020a056214300100b004624a3164c2si10489379qvb.221.2022.06.07.14.16.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jun 2022 14:16:01 -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="uHv8x/Nf"; 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]:44720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nygYT-0003Gt-EK for patch@linaro.org; Tue, 07 Jun 2022 17:16:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyftc-0000E9-3o for qemu-devel@nongnu.org; Tue, 07 Jun 2022 16:33:48 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:40825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyftU-0007Gf-0X for qemu-devel@nongnu.org; Tue, 07 Jun 2022 16:33:47 -0400 Received: by mail-pg1-x52d.google.com with SMTP id f65so6752127pgc.7 for ; Tue, 07 Jun 2022 13:33:39 -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=7xdazpoc98KTxU+Hkap6hV74hgs0EjjQuCmdWfoKk1g=; b=uHv8x/Nf/neIA93S+wbDDYJYsPsV/MqtVTAQmTlIjXJiapyq7dFbfboMwxhIW827Y4 zQrm8DKH+1VqIjniD92OQjvoUddABJrw7B0rOC5bne6gsrwvPrALbPETZhDKBUoDeYgc T77DDXDUWI5ebZlsUPT4xrWrahIX6BgEYaqkPQ+9OExvG4MARHI3TKr99BhlijmBdsFH b6oOelGO/QptVsLP2zlPKPKvcsZrIX0ZhV90LbFaJJkb6nIUQ91tXeVQGOR1fRGJ90w/ oletdaoLZeMQmxlHyMbEJEKUiQPl9XjKXGeSSt1OhAJDp14niW24dP6NYcv4Cr9wqyxx Mi+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7xdazpoc98KTxU+Hkap6hV74hgs0EjjQuCmdWfoKk1g=; b=6IHTh22HWPrl9LbURcxEFLEkQ5j2ORwc7JxMCNDi1x6856UN0ONgemNizePIRZJ2vG H6AJLl+oQdujmoYJwcx3Gv0/CxMZk8Wct8S7en2FJ7AtgwF+82YBAdaVyKCBViBDdEjZ MAiliKEgWcAl78CsJcGQFI74bweaGzwnwd9KrSesxi45TPoSipAqFVOUCoVXcuOSU3jY 8zVKt/xJ/FWgcBrCEv5QS3P7JJxdPbpU6/RkkTz2g62LN/hTi+b7pomZx3k6qCQ4aLJ1 gaGKStww8KREasf6nvxdqdPEiUxHHEJ7B5ifE0w0cXjcMsjYR3ACdFILR6N8TgcxbnzC J8FQ== X-Gm-Message-State: AOAM533d7a+szqVoAni4Ge0f05U1mPrsm5PhKsAfrtxHs7hj0M3j3uYA MyKkQBLhUbcVx7kY0Fn6qpVWhRle0m0pxQ== X-Received: by 2002:a63:b55:0:b0:3fd:a384:bd10 with SMTP id a21-20020a630b55000000b003fda384bd10mr12291615pgl.534.1654634019154; Tue, 07 Jun 2022 13:33:39 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:3cf2:c634:5b19:25f6]) by smtp.gmail.com with ESMTPSA id s22-20020a17090aba1600b001d9780b7779sm4227856pjr.15.2022.06.07.13.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 13:33:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Subject: [PATCH v2 34/71] target/arm: Generalize cpu_arm_{get, set}_default_vec_len Date: Tue, 7 Jun 2022 13:32:29 -0700 Message-Id: <20220607203306.657998-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220607203306.657998-1-richard.henderson@linaro.org> References: <20220607203306.657998-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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" Rename from cpu_arm_{get,set}_sve_default_vec_len, and take the pointer to default_vq from opaque. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/cpu64.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index dcec0a6559..c5bfc3d082 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -638,11 +638,11 @@ static void cpu_arm_set_sve(Object *obj, bool value, Error **errp) #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ -static void cpu_arm_set_sve_default_vec_len(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void cpu_arm_set_default_vec_len(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { - ARMCPU *cpu = ARM_CPU(obj); + uint32_t *ptr_default_vq = opaque; int32_t default_len, default_vq, remainder; if (!visit_type_int32(v, name, &default_len, errp)) { @@ -651,7 +651,7 @@ static void cpu_arm_set_sve_default_vec_len(Object *obj, Visitor *v, /* Undocumented, but the kernel allows -1 to indicate "maximum". */ if (default_len == -1) { - cpu->sve_default_vq = ARM_MAX_VQ; + *ptr_default_vq = ARM_MAX_VQ; return; } @@ -675,15 +675,15 @@ static void cpu_arm_set_sve_default_vec_len(Object *obj, Visitor *v, return; } - cpu->sve_default_vq = default_vq; + *ptr_default_vq = default_vq; } -static void cpu_arm_get_sve_default_vec_len(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) +static void cpu_arm_get_default_vec_len(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) { - ARMCPU *cpu = ARM_CPU(obj); - int32_t value = cpu->sve_default_vq * 16; + uint32_t *ptr_default_vq = opaque; + int32_t value = *ptr_default_vq * 16; visit_type_int32(v, name, &value, errp); } @@ -706,8 +706,9 @@ void aarch64_add_sve_properties(Object *obj) #ifdef CONFIG_USER_ONLY /* Mirror linux /proc/sys/abi/sve_default_vector_length. */ object_property_add(obj, "sve-default-vector-length", "int32", - cpu_arm_get_sve_default_vec_len, - cpu_arm_set_sve_default_vec_len, NULL, NULL); + cpu_arm_get_default_vec_len, + cpu_arm_set_default_vec_len, NULL, + &cpu->sve_default_vq); #endif }