From patchwork Mon Jun 20 17:51:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583180 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp924722mab; Mon, 20 Jun 2022 11:07:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vlDdQDu5x7ki90VbQ1z0WE1XyeGos25InEGVwfFXwu2DO+hfU7g0Gqry9ffTqMRi7h0UCG X-Received: by 2002:a05:620a:254c:b0:6a9:9011:3090 with SMTP id s12-20020a05620a254c00b006a990113090mr17145443qko.441.1655748471113; Mon, 20 Jun 2022 11:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655748471; cv=none; d=google.com; s=arc-20160816; b=dktvOLrs2y789475yl9xNVuaMpufc79fUgaI8GQjk7HBTQB2iJiloSUYk/FPJwCFpN o7N29kkr7AYikennwiBqfrqpqFzX8yC5U+BZrTSoie2JmPG8EKP9R0FyZf0uMP1A4FWa d7p31e/xJXKZHBTojSQCY7rVbjN3W/td+Rh4kjgberayYVgTYMALRdQboBSHoRAexuVP ciSV/tqTrHbxG6zwHyQmHQ3q9J1bozjI+N33H0qMWJWHOWjOh/yGlkmDj0WdXpAJjiMr 75KKH2nV6WFxKV76GYxdhN9+ajUMYtyaVtc/43IuHfRm1fZexN34P2rcbBy1r6d+kji0 M2lw== 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=Kt/+0I2W9Iyl7ik9o33CGdHvTPzExmpXuGF2jcQJGAs=; b=H+bgy6auYDUuxI26T4DIUZo510atgxqOh6Z5v8IYdEANpdLkUNaciJ+NwvkvvSB0A8 VwsN6ClnfVF/1GdNVunhCdnSJOsIOFrgRJoiJvbPZgnw8yb3+UfHG+ISAHgjdq5J6gYs kj4HKiISO7Gb/rKbXb6OieHJf3bvhfcH8vahfOwaQihnC+haoU0uA6lvpF3fk0i6X/L1 HTw7Vn8CuoCPxoXR0NODofqI8AO6CA0hwbvbK7xysCvq1QwSuwiD0PEn/NEHUgxHOOLB V9HuHZk7TbLGBjZWIookPR/+xjlc41Did8qvediPbF2Rk9nL7jpBkm7o3OVypIIg639z 2NFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=krn508Go; 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 v9-20020a05620a440900b006a6ccaece60si9284292qkp.637.2022.06.20.11.07.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jun 2022 11:07:51 -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=krn508Go; 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]:51960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3LoU-0006Wv-FP for patch@linaro.org; Mon, 20 Jun 2022 14:07:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3La0-0005st-5Q for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:52 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:35641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3LZy-0001RQ-6L for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:51 -0400 Received: by mail-pg1-x52e.google.com with SMTP id r66so4938311pgr.2 for ; Mon, 20 Jun 2022 10:52:49 -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=Kt/+0I2W9Iyl7ik9o33CGdHvTPzExmpXuGF2jcQJGAs=; b=krn508Go521nhRrHcKoZyg/WiRY3SnxWCQa7aamxv1fUnzP3G9UeC2C3uojBMNlqRY fCEGNtfO6MArseW/+I4OXEJ7BvAEBBpPPL+XWI74jPQ+/jJpro3KAQMnBvd3W8NSQYek kVWYkiJtzW2AEV8Aqj7uwcnPA4GcdzFx+nn5UEk2/SUyHdmvbFC4lHTUlb5cYt0KUTqr 8ZYJzUM2L0IlGGmW4101br3d0UYaJSWyyEcTATEe18OjfAw3FXcrksXchURNp1hMgGu6 AVf3Slvq1z3yGXnFhcyBDkLmsSojncw2tF4c9k8XcPqhwbqiu/IPYBKimGFOpKMH7hA4 4VMA== 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=Kt/+0I2W9Iyl7ik9o33CGdHvTPzExmpXuGF2jcQJGAs=; b=iyxEi6Kkcpo+LTwz956HdNbCPny6Od4ynv3fpkKjfHXFbcoy1TKeIoWiC+r6GnTOID L4EbJ+BLmqnbUC1AXQCeZC3n0LsLdfBTfc6BMvdVEPguVqBZd9J/L9VApDn2SeSd2+L5 26OZ/Ue70F5EFFtzNWP3mYxy/S5E6GAZnH22QC+2XzbRZo0fPT8DWV7uSmbAXj8qsYWZ 3yPteKA5r7QT/yW1fS+vbrqHXsa6B4Tq3HI6PNG7YOpNLamzyF3Clv5WFmo+qr9JjAuQ CNeeyuxrTBC4acvCC06+s03jW6lRWI/cLfxAnyX/tDzzrTFlg0WMG9Se3TyUEdncfLwR 38sA== X-Gm-Message-State: AJIora/YUoFxkk94Mni2drJXO/5PEE3Eva4n15A3IMnrpep1QI/6Jxk0 eACudt+JaILt0GOBEu+3mWzy/39pQg9CNw== X-Received: by 2002:a63:34cc:0:b0:40c:a7f7:bc6 with SMTP id b195-20020a6334cc000000b0040ca7f70bc6mr6930892pga.617.1655747568853; Mon, 20 Jun 2022 10:52:48 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:a3e0:8a80:7b85:aea6]) by smtp.gmail.com with ESMTPSA id j14-20020aa7928e000000b00525133f98adsm5138138pfa.146.2022.06.20.10.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:52:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 14/51] target/arm: Generalize cpu_arm_{get, set}_default_vec_len Date: Mon, 20 Jun 2022 10:51:58 -0700 Message-Id: <20220620175235.60881-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220620175235.60881-1-richard.henderson@linaro.org> References: <20220620175235.60881-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- 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 1a3cb953bf..b15a0d398a 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 }