From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E7EFC433C1 for ; Thu, 25 Mar 2021 18:51:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9442B61963 for ; Thu, 25 Mar 2021 18:51:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9442B61963 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPV4r-0003no-IZ for qemu-devel@archiver.kernel.org; Thu, 25 Mar 2021 14:51:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPV1v-0002HV-LP for qemu-devel@nongnu.org; Thu, 25 Mar 2021 14:48:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:44644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPV1t-0002Ph-6a for qemu-devel@nongnu.org; Thu, 25 Mar 2021 14:48:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id ECB30ACBF; Thu, 25 Mar 2021 18:48:21 +0000 (UTC) Subject: Re: [RFC v11 45/55] target/arm: cpu-sve: new module To: Richard Henderson , Peter Maydell , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , =?UTF-8?Q?Alex_Benn=c3=a9e?= References: <20210323151749.21299-1-cfontana@suse.de> <20210323154639.23477-38-cfontana@suse.de> <724c86f8-2275-833b-d4e1-4729c0ca2e80@linaro.org> From: Claudio Fontana Message-ID: <143fde2e-6c88-8fef-10ff-523c574e0db4@suse.de> Date: Thu, 25 Mar 2021 19:48:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <724c86f8-2275-833b-d4e1-4729c0ca2e80@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=195.135.220.15; envelope-from=cfontana@suse.de; helo=mx2.suse.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Roman Bolshakov , qemu-devel@nongnu.org, Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 3/25/21 7:40 PM, Richard Henderson wrote: > On 3/23/21 9:46 AM, Claudio Fontana wrote: >> extract the SVE-related cpu object properties and functions, >> and move them to a separate module. >> >> Disentangle SVE from pauth that is a separate, TCG-only feature. >> >> Signed-off-by: Claudio Fontana >> --- >> target/arm/cpu-sve.h | 40 +++++ >> target/arm/cpu.h | 22 +-- >> target/arm/cpu-sve.c | 360 +++++++++++++++++++++++++++++++++++++++ >> target/arm/cpu.c | 5 +- >> target/arm/cpu64.c | 333 +----------------------------------- >> target/arm/kvm/kvm-cpu.c | 2 +- >> target/arm/meson.build | 1 + >> 7 files changed, 417 insertions(+), 346 deletions(-) >> create mode 100644 target/arm/cpu-sve.h >> create mode 100644 target/arm/cpu-sve.c >> >> diff --git a/target/arm/cpu-sve.h b/target/arm/cpu-sve.h >> new file mode 100644 >> index 0000000000..b1be575265 >> --- /dev/null >> +++ b/target/arm/cpu-sve.h >> @@ -0,0 +1,40 @@ >> +/* >> + * QEMU AArch64 CPU SVE Extensions for TARGET_AARCH64 >> + * >> + * Copyright (c) 2013 Linaro Ltd >> + * >> + * This program is free software; you can redistribute it and/or >> + * modify it under the terms of the GNU General Public License >> + * as published by the Free Software Foundation; either version 2 >> + * of the License, or (at your option) any later version. >> + * >> + * This program is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> + * GNU General Public License for more details. >> + * >> + * You should have received a copy of the GNU General Public License >> + * along with this program; if not, see >> + * >> + */ >> + >> +#ifndef CPU_SVE_H >> +#define CPU_SVE_H >> + >> +/* note: SVE is an AARCH64-only option, only include this for TARGET_AARCH64 */ >> + >> +/* called by arm_cpu_finalize_features in realizefn */ >> +void cpu_sve_finalize_features(ARMCPU *cpu, Error **errp); >> + >> +/* add the CPU SVE properties */ >> +void cpu_sve_add_props(Object *obj); >> + >> +/* add the CPU SVE properties specific to the "MAX" CPU */ >> +void cpu_sve_add_props_max(Object *obj); >> + >> +/* In AArch32 mode, predicate registers do not exist at all. */ >> +typedef struct ARMPredicateReg { >> + uint64_t p[DIV_ROUND_UP(2 * ARM_MAX_VQ, 8)] QEMU_ALIGNED(16); >> +} ARMPredicateReg; > > I don't agree with moving this out of cpu.h, next to the rest of the vector > definitions. > > I agree that we should be using more files, but if we're going to have an > cpu-sve.c, why did some of the sve functions go into cpu-common.c? maybe cpu-sve-props.c would be a better name, it really contains only cpu sve properties code. > > I don't agree with moving functions and renaming them simultaneously. I'm not > even sure why you're renaming them, or why you've suddenly chosen "cpu_sve_*" > as the prefix to use. > > > r~ > I think the idea was trying to create a cpu_sve module handling everything related to sve, and consistently using the name of the module as the prefix. It might be too early to attempt that anyway; as you noted, there is other SVE-related functionality all over the place, so better to revisit this. I'd suggest renaming this to cpu_sve_props, and moving everything not props related out of it. Thanks, Claudio