From patchwork Tue Jun 7 20:32:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 579341 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp5502797max; Tue, 7 Jun 2022 13:54:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFNtdnV0+uwSWe8YSz+5cBXvgToT8FzEkSERXHKjBhPIoGC/lhL5xSBpq2I2x4L+XJs7eu X-Received: by 2002:a05:622a:50e:b0:304:fda0:5ac0 with SMTP id l14-20020a05622a050e00b00304fda05ac0mr3258903qtx.279.1654635299435; Tue, 07 Jun 2022 13:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654635299; cv=none; d=google.com; s=arc-20160816; b=P5heMzEkZJ/HsxI21EBcyO92YHvFsr6mtkCE4b7u8Jw24dXt1E2CoDkhoeXxezAGpQ vqTpv3E6nECIWRCTDXPjwjq4BTNtPbN580XwfGr1F3xGSGaEtDWBzQuRnM80PseUwHw9 r8h/rEQcDxFohWGHrbuXT6Vd4HafLk3AqXj9ofK5zMEws+GFiZJ+BqdVhWuQJhpbAiuq IX8mfPmN8KdpjdibGmz+QyTD+vYDAL9aERqw9yutm/pCGqzzKsxrv02qJUyZ52mDkvEx muQGzJihr3xK+9fGJOZImvbrmWTrwg0JJumfmZ4z+3YhEdkO7BFJPYvyPM5nNQ6IdeMV exlg== 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=fwPtvhYNG8jCnQ1cI9YW7usJn3JNHfnrq4zhCHsHE5Y=; b=ztvvufkEOEgZrnYGHYoirukroogoAQjrtVCUEtv/Llo0NGeetFevXJUVLFpIbOYhuG 3e9hD2YsCCupoCtN5RKXmH3fqdacN12qQWlHC/9jHBqPAuqqDIKBuL4O8SMBxWtrz2x3 sWgBna6GVl1LMrPLoVkf28rB51gWWZ/IZe4o0Sy/S5snhUQ08r/sULXtQk34TRzeRMBY 8CPlmkM0ksvGeSXLPlsYx+sYKXrSOjN0X0rclEzXPoKH/BBxfrfOYbS99VLlhyqlq/Ox oPPKE5IEqtJpZEkYwjl+C6bCRpQBMaw14ctx/pCWrlcjlX1FU9CBLjmpvM7/ETxXIKnn GCgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MxzIYGce; 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 x14-20020a05620a258e00b0069f385e76a6si10245606qko.256.2022.06.07.13.54.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jun 2022 13:54:59 -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=MxzIYGce; 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]:34272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nygE7-0000ws-1U for patch@linaro.org; Tue, 07 Jun 2022 16:54:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyfta-0000AP-Ow for qemu-devel@nongnu.org; Tue, 07 Jun 2022 16:33:47 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:33553) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyftT-0007Ms-3S for qemu-devel@nongnu.org; Tue, 07 Jun 2022 16:33:46 -0400 Received: by mail-pl1-x630.google.com with SMTP id f9so5339118plg.0 for ; Tue, 07 Jun 2022 13:33:38 -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=fwPtvhYNG8jCnQ1cI9YW7usJn3JNHfnrq4zhCHsHE5Y=; b=MxzIYGceoED1CJ08IWUi6OjSG25mVg4ylwRQhErbf9lLok8srKuaPxpeep2mrZdbIr NrI7c9+IH5VpWUm0JhAYtT3lEE0SaUhwYUalsivPofNKAjr8m/VueWx+uRjt+P1jJ/yW BL7oZ6JuMWy8qvUXdRSUib/taHgPQ4cTHtoqO+XIF0VI4yh0JCs1aFVhpNGl0qyMCXdY kFxMir93dEooyb2fIUEIvST+x4QbtSwYJywO/Bi0/767uRksw9SLMta9hfWTct7tQJBD /cb+BKaO+WY7U+p6DVNEkW3Wr3fAGy8t1veCwPibG2dsPURqmGmhoqUQN8bpPCRDNIoO x1Fg== 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=fwPtvhYNG8jCnQ1cI9YW7usJn3JNHfnrq4zhCHsHE5Y=; b=msklAAKdEOcIfJryGzKj8XenwxeOwJGB6Ok7/RmNww7pqDbvVHSXijGJ0uSJPNO2s7 FRsSQrN5VYSZaEywrXi9c9Zx+rS3b+EzmR1xCyi3OdVBeCeB6Mnh+nQVr/jU0cj5rEpP 2Mns+petXHerO4vDex8f84TXC/XFlh1CVnlhHLxQFnGE04R+o+zU9hhM3r6BhxbdAW7C voLabpN7UorvCkZc8PA8JZL9XG8VD+bisRA1Lh61IhCHdP/dkSLe3unT0UYC4KznaFp5 +X1iLKDMqZgMul/sU9yFHDwq9XylSZgyevmxPcH/cI2u3IQPX873hSKBYCnbAGdLxC1C fN7Q== X-Gm-Message-State: AOAM532XE4KRRK+PBbFOJ7yHGMmPReiSRqQq/NbHSUU0T1OnHq5gJTHL xI1VLBLEJFs3Sg5ooT5wxGkoYOWQ9gTSBg== X-Received: by 2002:a17:902:efcc:b0:163:f35b:2a99 with SMTP id ja12-20020a170902efcc00b00163f35b2a99mr29975966plb.42.1654634018260; Tue, 07 Jun 2022 13:33:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 13:33:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Subject: [PATCH v2 33/71] target/arm: Generalize cpu_arm_{get,set}_vq Date: Tue, 7 Jun 2022 13:32:28 -0700 Message-Id: <20220607203306.657998-34-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::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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 0a2f4f3170..dcec0a6559 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