Received: by 2002:a05:7022:629e:b0:68:46be:293d with SMTP id e30csp2688989dle; Thu, 13 Jul 2023 05:43:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXbBYI/EADK5IZ1uiOXOLOMFoY7+jWX2nIamWnsZHUsRuTB0xf4DhWbjZ/kz1kanGYD2XB X-Received: by 2002:a05:6870:4626:b0:1b7:14bb:66fe with SMTP id z38-20020a056870462600b001b714bb66femr2122767oao.16.1689252218303; Thu, 13 Jul 2023 05:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689252218; cv=none; d=google.com; s=arc-20160816; b=JBa/aAUwohDPUS1CuVI1h51eHqx1dscjqV41l1Gq0o4Y1RtMWL9Lo0b0oyHVj4uWTc UyCCo6x9WVRf0XzAIKACr30/Nomu7EHoG6pVnvxJwAQrvf2qvG8BG4X72DyyTcJzLOfE NcgAczgrvoAgmEp+FXJxZLWjLnxYLzuzp1LqBRnJpmQbD8/BaVKhXXNhjJCpFVq62dHh IUKL3Rlqmqj6E2zAvFn+Od3KD6X56Esr9qedhqaXjNHtCLFmRqdZ4dbj3LRxNXuZ6pjd +stAJ0JXg4l+GTX7ryWs1ivkb8s7XUaFhYOs9aw0OmOrZr71YtI/FD8b9WnA7qvLAwU1 scGQ== 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 :content-language:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=NVgw3E/WrgewRYmyVCLpW8vORIcS2V+7DSFXSdXabwA=; fh=byp2tQv/zN7RRmcv3pTYXUc1uhFaViprR2I36m1RR+k=; b=htMrBHuVdKw2OnnbFm7KHnaAc04saSskG+gNYrTCp1yBfpwWcraJpQDoWZodofITaz UEsWpIWdLyEdXuAb+l05O8Xms9lJJq90wqZbH7xrJmIukzRv4IQ/nJx5oeiPYDRniA8P WJ7RzgdtnNEAOrLYzCY76VIWpfJXfLhGP7E5TFIo4MAQ7mv09+f1bqytG0Ml9fKvIq64 OYTrj+2joC77bwAv5eTM4ZDolWVf+L3wnNhPRG3ieF7NGHZowQQbJtlrxd7NPlNhl7at c7q36UxBXnVM7HNiaxQWBr20YFryfXWMzsjkr34XugIcnfrsiO9JHBvQTOBtKMRyTzwp YUQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UqQUZ2yU; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g14-20020a05620a218e00b00767d0d016b2si2937467qka.581.2023.07.13.05.43.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2023 05:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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=@redhat.com header.s=mimecast20190719 header.b=UqQUZ2yU; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJvfA-0004pm-HT; Thu, 13 Jul 2023 08:43:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJvf8-0004p9-DG for qemu-arm@nongnu.org; Thu, 13 Jul 2023 08:43:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJvf5-00089e-6n for qemu-arm@nongnu.org; Thu, 13 Jul 2023 08:43:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689252189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NVgw3E/WrgewRYmyVCLpW8vORIcS2V+7DSFXSdXabwA=; b=UqQUZ2yUmjW35T9oW+bZBuap7D7IQauVnWuotQvSH7yvno/0KKDi8u9QIjGMV5mYzb0xdW H73sGVGy0mweXa3bTVJjuyi3qiOpe9DfMWzI7aAbRNAspknf90m/JxLGZwkO52eq2Gb8md JeCUJ8Jf7DuoAI+S3t3SFrWuHS0jyd4= Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-539-w8UfxcJXMwCjYSn6iCvhnw-1; Thu, 13 Jul 2023 08:43:05 -0400 X-MC-Unique: w8UfxcJXMwCjYSn6iCvhnw-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-1b773df6216so1100724fac.1 for ; Thu, 13 Jul 2023 05:43:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689252184; x=1691844184; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NVgw3E/WrgewRYmyVCLpW8vORIcS2V+7DSFXSdXabwA=; b=cwI3RKHArr8PwWYFB17+aDfjcn9GrdCtX4UmVyIGwSLZSSDtX4leg8avaSv4u+hgLA JoIoKQntCllteg6N0MpvUptVqalNRuLfijnLvcPchHPMOdcP5p42UfXXkHQPC9V3uyVb +R2kElX6YqlAguomugGeLq0b0Rd0WjogZD5jVHaeM1AluGDvULqmvkJj0vDbPY+UwCnr 8rW3syHfADvOIjYCASPHxuevozqlt/rVavLFSduttFdsZRR9d0qnHIlToaAtouIWTkQE g73G8Hgt1LnLEKZKtnGz81j5Bfjo/HKIPdJZ184EH22poO5rWdasihvP3tfMUsEBO44w 9O2g== X-Gm-Message-State: ABy/qLbDd4CeJpb7UbtB4i/iUh/k2Sx9Tb2uTxpWQXTK7zWOyLv1ISH3 +vTP/zIsiGQPVUqVy//hyYLdXD9jwvMfGqwwLoaMPlomWS5ovBSAU5y7nzNE8muMfgrlfupPTMS qb9jerhcMpfv9 X-Received: by 2002:a05:6871:1cd:b0:1b7:4b56:fe68 with SMTP id q13-20020a05687101cd00b001b74b56fe68mr2060693oad.3.1689252184526; Thu, 13 Jul 2023 05:43:04 -0700 (PDT) X-Received: by 2002:a05:6871:1cd:b0:1b7:4b56:fe68 with SMTP id q13-20020a05687101cd00b001b74b56fe68mr2060678oad.3.1689252184270; Thu, 13 Jul 2023 05:43:04 -0700 (PDT) Received: from ?IPV6:2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5? ([2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5]) by smtp.gmail.com with ESMTPSA id s24-20020a17090aba1800b0026302348ee4sm11911677pjr.30.2023.07.13.05.43.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 05:43:03 -0700 (PDT) Message-ID: <08a313fd-ddf8-538d-df51-03e28aee0d97@redhat.com> Date: Thu, 13 Jul 2023 22:42:57 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 0/3] hw/arm/virt: Use generic CPU invalidation To: Peter Maydell Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, pbonzini@redhat.com, eduardo@habkost.net, marcel.apfelbaum@gmail.com, philmd@linaro.org, wangyanan55@huawei.com, shan.gavin@gmail.com References: <20230713054502.410911-1-gshan@redhat.com> From: Gavin Shan In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=gshan@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.096, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: Bj3peIqJKame Hi Peter, On 7/13/23 21:44, Peter Maydell wrote: > On Thu, 13 Jul 2023 at 06:45, Gavin Shan wrote: >> >> There is a generic CPU type invalidation in machine_run_board_init() >> and we needn't a same and private invalidation for hw/arm/virt machines. >> This series intends to use the generic CPU type invalidation on the >> hw/arm/virt machines. >> >> PATCH[1] factors the CPU type invalidation logic in machine_run_board_init() >> to a helper validate_cpu_type(). >> PATCH[2] uses the generic CPU type invalidation for hw/arm/virt machines >> PATCH[3] support "host-arm-cpu" CPU type only when KVM or HVF is visible >> >> Testing >> ======= >> >> With the following command lines, the output messages are varied before >> and after the series is applied. >> >> /home/gshan/sandbox/src/qemu/main/build/qemu-system-aarch64 \ >> -accel tcg -machine virt,gic-version=3,nvdimm=on \ >> -cpu cortex-a8 -smp maxcpus=2,cpus=1 \ >> : >> >> Before the series is applied: >> >> qemu-system-aarch64: mach-virt: CPU type cortex-a8-arm-cpu not supported >> >> After the series is applied: >> >> qemu-system-aarch64: Invalid CPU type: cortex-a8-arm-cpu >> The valid types are: cortex-a7-arm-cpu, cortex-a15-arm-cpu, \ >> cortex-a35-arm-cpu, cortex-a55-arm-cpu, cortex-a72-arm-cpu, \ >> cortex-a76-arm-cpu, a64fx-arm-cpu, neoverse-n1-arm-cpu, \ >> neoverse-v1-arm-cpu, cortex-a53-arm-cpu, cortex-a57-arm-cpu, \ >> max-arm-cpu > > I see this isn't a change in this patch, but given that > what the user specifies is not "cortex-a8-arm-cpu" but > "cortex-a8", why do we include the "-arm-cpu" suffix in > the error messages? It's not valid syntax to say > "-cpu cortex-a8-arm-cpu", so it's a bit misleading... > Good point. Right, the complete CPU type names are provided by board (hw/arm/virt). The compelte CPU type names are used in hw/core/machine.c to search the object class. In the error messages in the same source file, the complete CPU type names are also used. Actually, we need 'internal' names like 'cortex-a8' to be shown in the error messages. For the solution, I've suggested to split the MachineClass::valid_cpu_types to two fields (valid_cpu_types and valid_cpu_type_suffix). Their combination is the complete CPU type name and 'valid_cpu_types[i]' corresponds to the 'internal' name, to be used in the error messages. Please take a look on that thread and reply to it. Thanks, Gavin