From patchwork Mon Jun 20 17:51:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583176 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp922276mab; Mon, 20 Jun 2022 11:04:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tWQEhcXlSDD0PHouPsvMeN6xZdYCqx++FGX6DOexJCnGW4Fy1ARG7R9qQGyaw5mgwwQHwL X-Received: by 2002:a05:620a:2450:b0:6a6:d264:2b88 with SMTP id h16-20020a05620a245000b006a6d2642b88mr16816735qkn.25.1655748290672; Mon, 20 Jun 2022 11:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655748290; cv=none; d=google.com; s=arc-20160816; b=TR6oR7f9byru29msyCYY1Pq2DV1dHGpYC/q8wTZpOgzDt5NnJk2YVNt9t4YDGcrUAG T9j4DuIoQi2hw5FGaoHlBhrco9Uc/1VbkigRpSvt+aIrRs7l3dCEdqlx4M4bE/0OnoV6 P1+IOaNNIjsHrHEsx4RvBsOa7rtl72jSawOpYAf6tkRx9GnqPK1oawasP8Eio6LBzTgL bIoBnSy22WEYrvlgM1xrQfTftFNb1kOFNZAZje4Ba+bndL2QiZl0bX9K8GnUxuQUZrhs L4ykcnSkeHhJfPGvFuwsRS/VKfMaCEYEfPuZkVbyjmi2Eukpkh2RZdtJ3FkXQoy37yda dgRA== 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=WLkeQFDvx/m8IfCirAHMxhWxYjRgdVfqGmeTPsUXyEA=; b=W+Iu+L5nteoASxMxIG4IdYQP6MxtnLw+h2rJ+wIJLno0W42Nr3KyNNGFcqGc3gms4K 4J3D5mxQH+DhdpG42iO3PHhJr9Sr4sborwO7Ix8DsMatT62B/n+BuzaxpnbHJYIZjzUC m93F4IQSy1DhTFKp3vGqM1vAj7AYDchMIJSYR0Qpq0X4wdGuK/orC+0/hOR5xnbbpn2F tJQrOiFy9/66U1l8Y0x2Yp/0/t7bouPrg3rrKDNenlWkEmufdp8vBwYUTFngyAWQz/LG 7917LuEKHKXn0McdLSNNmjn75kBWWuMFX6SaduRAIk4Sxs5UuArja0BwfUKFL6QUOqdV 8qPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uYkkGA7c; 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 l2-20020a0cd6c2000000b004703d3ed546si3242315qvi.236.2022.06.20.11.04.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jun 2022 11:04:50 -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=uYkkGA7c; 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]:43350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3Lla-0000bb-7V for patch@linaro.org; Mon, 20 Jun 2022 14:04:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3LZy-0005pv-U9 for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:50 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:38873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3LZx-0001Qu-Ch for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:50 -0400 Received: by mail-pf1-x430.google.com with SMTP id w6so3702213pfw.5 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=WLkeQFDvx/m8IfCirAHMxhWxYjRgdVfqGmeTPsUXyEA=; b=uYkkGA7c64MLwKsN3UBMlAdZtaf3BJ7eA/J+mHWDNwkHG5Zvo+MVoMn+l2a+na27K+ 1C+G+T3w8vkHFdOJsxpYTtxKOt2Mx2nb0DBrr4/FABFjlOFNWDiyvjbG03HhTwq9YZno lPwC0kdwntBjc0E4QnhohuVg/6Ewc4gpiC4D8zdRJhrhxzrv1ShqoFkhzBRFRKiWNNn5 negfmetQDiIe+HKN4qoMDT6TlE2ZCfj3Qk0nabVk++l2xncEfKRDO5dgbMp6XiJBHLgZ QjsLre8kkkBpPPapeA5u9FSbeKIPG/5sIyHc05qVtcnZXTY9oW/K/yT2GBTAfVChTxz2 Mplw== 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=WLkeQFDvx/m8IfCirAHMxhWxYjRgdVfqGmeTPsUXyEA=; b=xdNiosBhl0Er6B2H4xCoELOT6iUfSVjMvlbc7FS7AOSewjn3azCi8X5hLlEWX+xelJ 6EKzfoyKs5SFYkAuWHS9RMRH6sQumuH9RfcX9ZPEXEheu3iKAi7IZdBrS3BqPpqANxOu /ZkkVsHG+6W9wq2y2d+XyO2r4N8b6HsYmRvG7RWbvlo3IizcXC7qPDGBPr8ztwsnrkrs H3t68PTNXKH4qF0VT88eZ2pw72BAoYU0i8PhvpEe+7fkvtzOtzfM45Vvm8vWUzUGsuua B20MdfunwKDJ3auNAOxM/HKV39pWgdVw4i9HVEYwqpSXqoXsDPqFhullS2UvAncLjNjT /ZZw== X-Gm-Message-State: AJIora95eieV8v7dULl6ciw773BR0bKXc5MbabHH7sVHwK9cLUHwB3MH VcHBQA3niDmn3HGQlj+Ik6L2ExQcrYRRxw== X-Received: by 2002:a63:4854:0:b0:3fd:696e:b48f with SMTP id x20-20020a634854000000b003fd696eb48fmr22693549pgk.281.1655747568125; 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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:52:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 13/51] target/arm: Generalize cpu_arm_{get,set}_vq Date: Mon, 20 Jun 2022 10:51:57 -0700 Message-Id: <20220620175235.60881-14-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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_vq, and take the ARMVQMap as the opaque parameter. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu64.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index cadc401c7e..1a3cb953bf 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -579,15 +579,15 @@ static void cpu_max_set_sve_max_vq(Object *obj, Visitor *v, const char *name, } /* - * Note that cpu_arm_get/set_sve_vq cannot use the simpler - * object_property_add_bool interface because they make use - * of the contents of "name" to determine which bit on which - * to operate. + * Note that cpu_arm_{get,set}_vq cannot use the simpler + * object_property_add_bool interface because they make use of the + * contents of "name" to determine which bit on which to operate. */ -static void cpu_arm_get_sve_vq(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void cpu_arm_get_vq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { ARMCPU *cpu = ARM_CPU(obj); + ARMVQMap *vq_map = opaque; uint32_t vq = atoi(&name[3]) / 128; bool value; @@ -595,15 +595,15 @@ static void cpu_arm_get_sve_vq(Object *obj, Visitor *v, const char *name, if (!cpu_isar_feature(aa64_sve, cpu)) { value = false; } else { - value = extract32(cpu->sve_vq.map, vq - 1, 1); + value = extract32(vq_map->map, vq - 1, 1); } visit_type_bool(v, name, &value, errp); } -static void cpu_arm_set_sve_vq(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) +static void cpu_arm_set_vq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) { - ARMCPU *cpu = ARM_CPU(obj); + ARMVQMap *vq_map = opaque; uint32_t vq = atoi(&name[3]) / 128; bool value; @@ -611,8 +611,8 @@ static void cpu_arm_set_sve_vq(Object *obj, Visitor *v, const char *name, return; } - cpu->sve_vq.map = deposit32(cpu->sve_vq.map, vq - 1, 1, value); - cpu->sve_vq.init |= 1 << (vq - 1); + vq_map->map = deposit32(vq_map->map, vq - 1, 1, value); + vq_map->init |= 1 << (vq - 1); } static bool cpu_arm_get_sve(Object *obj, Error **errp) @@ -691,6 +691,7 @@ static void cpu_arm_get_sve_default_vec_len(Object *obj, Visitor *v, void aarch64_add_sve_properties(Object *obj) { + ARMCPU *cpu = ARM_CPU(obj); uint32_t vq; object_property_add_bool(obj, "sve", cpu_arm_get_sve, cpu_arm_set_sve); @@ -698,8 +699,8 @@ void aarch64_add_sve_properties(Object *obj) for (vq = 1; vq <= ARM_MAX_VQ; ++vq) { char name[8]; sprintf(name, "sve%d", vq * 128); - object_property_add(obj, name, "bool", cpu_arm_get_sve_vq, - cpu_arm_set_sve_vq, NULL, NULL); + object_property_add(obj, name, "bool", cpu_arm_get_vq, + cpu_arm_set_vq, NULL, &cpu->sve_vq); } #ifdef CONFIG_USER_ONLY