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=-17.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 AC68DC433EF for ; Tue, 14 Sep 2021 17:20:43 +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 27E43610D1 for ; Tue, 14 Sep 2021 17:20:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 27E43610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:56336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQC6s-0008Ly-9s for qemu-devel@archiver.kernel.org; Tue, 14 Sep 2021 13:20:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQC1x-000893-NX for qemu-devel@nongnu.org; Tue, 14 Sep 2021 13:15:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQC1u-0000Ud-Ki for qemu-devel@nongnu.org; Tue, 14 Sep 2021 13:15:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631639734; 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=jJ9xWZMiWsz/BwXwvXZIrZr6DPdm4UKto1ksF+WrM54=; b=YRjkoSY3LNboPQwwcuvPPmgESPQGT3RgdHjZ8iL7/ZC8qYg24VtMTGhfAQFM/j5iFQkDxb D8XULY5SmVKgMcTjiAj4RquXmPBpIpW+tWlkyn6SytYTu3BHoo4iSThQ5jHwzmgjQPzKPC B+Nx6rrYBN/e5joYy3C3QDqWhKweNKo= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-sj3ywjIXOR-DDlffkDm-ag-1; Tue, 14 Sep 2021 13:15:32 -0400 X-MC-Unique: sj3ywjIXOR-DDlffkDm-ag-1 Received: by mail-wr1-f69.google.com with SMTP id i16-20020adfded0000000b001572ebd528eso4209356wrn.19 for ; Tue, 14 Sep 2021 10:15:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jJ9xWZMiWsz/BwXwvXZIrZr6DPdm4UKto1ksF+WrM54=; b=2MR8+OnGYH+VcFyP4w7FImW6jrYEsv6moJm8DmwnQqNZLTjBuSwQwHwmWqyRvrW6Og we3+EzzCOs3PVDKz+lJl3e2mFNsKL6gwhrCwZSUoGsM3aVxurQnPqdW8AOuA6rgE646S dufadfeG/+WaWqhjKgbXwiN14F/RBUtk5CRS8/BVYu82saxhh1tHPb/jcCHe8j1bTvL/ GGqn8RumBzXRvBVm5jnekDqPX4jZ/t1pIffpeetGDthypyjgZnxAwi+hpU8Wj349O1fq lmm45pX+hU6mhTDFQJAAgsnlMo2OAny3PzzeQQX2DXfXjNSJKA5PqLOqXUNBVRs7/pwE 8BdA== X-Gm-Message-State: AOAM531YkR3Y0chw4o+qMDJnYXk8M8SF6lxLeABySuRG2aXqjUEnNmF4 0Xqm90IVojG6L5S7ZXsQedTVTzafXazcJ6YgIGIH7TQ7KCZq9z8xtag1Qo/l7aUaO3VHTp8oL4W 13omY5769QKe3UCc= X-Received: by 2002:adf:fe0e:: with SMTP id n14mr291531wrr.236.1631639731650; Tue, 14 Sep 2021 10:15:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Kr/8qQoTmiiiNbyu3jw0TeHX3VQKL48jKzR/XffTD8L8JRg9QzQSCWnqkZnqUzkH+CYqRQ== X-Received: by 2002:adf:fe0e:: with SMTP id n14mr291478wrr.236.1631639731319; Tue, 14 Sep 2021 10:15:31 -0700 (PDT) Received: from [192.168.1.36] (14.red-83-35-25.dynamicip.rima-tde.net. [83.35.25.14]) by smtp.gmail.com with ESMTPSA id j27sm1554808wms.6.2021.09.14.10.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 10:15:30 -0700 (PDT) Subject: Re: [PATCH v2 29/53] qapi: introduce x-query-registers QMP command To: Eric Blake , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , Markus Armbruster , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= References: <20210914142042.1655100-1-berrange@redhat.com> <20210914142042.1655100-30-berrange@redhat.com> <20210914160416.tmk5nuhch2yhfb27@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Tue, 14 Sep 2021 19:15:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210914160416.tmk5nuhch2yhfb27@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -51 X-Spam_score: -5.2 X-Spam_bar: ----- X-Spam_report: (-5.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.969, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: Peter Maydell , Cornelia Huck , David Hildenbrand , Bin Meng , Mark Cave-Ayland , qemu-devel@nongnu.org, Peter Xu , Max Filippov , Taylor Simpson , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Marek Vasut , Yoshinori Sato , Halil Pasic , Christian Borntraeger , qemu-ppc@nongnu.org, Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , Yuval Shaia , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Michael Rolnik , "Dr. David Alan Gilbert" , Stafford Horne , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Chris Wulff , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aleksandar Rikalo , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/14/21 6:04 PM, Eric Blake wrote: > On Tue, Sep 14, 2021 at 03:20:18PM +0100, Daniel P. Berrangé wrote: >> This is a counterpart to the HMP "info registers" command. It is being >> added with an "x-" prefix because this QMP command is intended as an >> ad hoc debugging tool and will thus not be modelled in QAPI as fully >> structured data, nor will it have long term guaranteed stability. >> The existing HMP command is rewritten to call the QMP command. >> >> Signed-off-by: Daniel P. Berrangé >> --- >> +## >> +# @HumanReadableText: >> +# >> +# @human-readable-text: Formatted output intended for humans. >> +# >> +# Since: 6.2.0 > > Should be '6.2', not '6.2.0', to match... > >> +# >> +## >> +{ 'struct': 'HumanReadableText', >> + 'data': { 'human-readable-text': 'str' } } >> diff --git a/qapi/machine.json b/qapi/machine.json >> index 157712f006..8737efa865 100644 >> --- a/qapi/machine.json >> +++ b/qapi/machine.json >> @@ -1312,3 +1312,18 @@ >> '*cores': 'int', >> '*threads': 'int', >> '*maxcpus': 'int' } } >> + >> +## >> +# @x-query-registers: >> +# >> +# @cpu: the CPU number to query. If omitted, queries all CPUs >> +# >> +# Query information on the CPU registers >> +# >> +# Returns: CPU state in an architecture-specific format >> +# >> +# Since: 6.2 > > ...the prevailing style. > > If it were likely that someone might backport just some (but not all) > added x- commands, it may be wise to separate the creation of > HumanReadableText into its own patch to backport that but not > x-query-registers. But I rather suspect anyone backporting this will > take the series wholesale, so the coupling in this patch is not worth > worrying about. IIUC the problem is this breaks bisection, as you get a QAPI error: qapi/qapi-commands-machine.c:123:13: error: ‘qmp_marshal_output_HumanReadableText’ defined but not used [-Werror=unused-function] 123 | static void qmp_marshal_output_HumanReadableText(HumanReadableText *ret_in, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors See the comment added in commit 1f7b9f3181e ("qapi/commands: add #if conditions to commands"). > >> +## >> +{ 'command': 'x-query-registers', >> + 'data': {'*cpu': 'int' }, >> + 'returns': 'HumanReadableText' } >> -- >> 2.31.1 >> > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mQC23-0008DI-4l for mharc-qemu-riscv@gnu.org; Tue, 14 Sep 2021 13:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQC1x-000891-N2 for qemu-riscv@nongnu.org; Tue, 14 Sep 2021 13:15:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQC1u-0000Uc-LF for qemu-riscv@nongnu.org; Tue, 14 Sep 2021 13:15:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631639733; 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=jJ9xWZMiWsz/BwXwvXZIrZr6DPdm4UKto1ksF+WrM54=; b=V+cgSux0MUJazvZtFNstZipVqfwK3qGFPlz0t5YlkyqIyCaJHxTRMDxE7F1m2+ejVxI5fV JV+hDuG8Y81IPoIVkGYFrL2avlIaMtc0f6NAcjxLsXG5y8sqMo8PO3YMuKKCPtXqqxlAH3 d143347qbQ8ibVNhcLcMAIrg2DVX5mM= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-V31eemCOMT2LSs7u8fitRA-1; Tue, 14 Sep 2021 13:15:32 -0400 X-MC-Unique: V31eemCOMT2LSs7u8fitRA-1 Received: by mail-wr1-f69.google.com with SMTP id q14-20020a5d574e000000b00157b0978ddeso4216441wrw.5 for ; Tue, 14 Sep 2021 10:15:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jJ9xWZMiWsz/BwXwvXZIrZr6DPdm4UKto1ksF+WrM54=; b=sZUg0y0/Wi4M/KTIdkvhW0PFERGz2whN+OW6pHb7PIEcV9PP8mqdE+F5Hcut02Gqt/ GJ13OlwJD1bcD4lWXKrzUov484zVnaGqMaioxSWxp+DszsdPFRvYmHG4k7g+J7puKYDk MfB92GXqGWfGZu8kp8YTwaPPSgQ3fwDAsOqlZ7ZXlXlNFXu3Re9JoXiZQfmACQ6bsamN sfvAQM6r4SGoyH9SKd39CizBd9E6hq9tBAA+4ucHBf4f0A++fUWCenNKD2tyr5Lk3i2v AfjJShY4/p2+M2wQmYDOyHHmkN+oeVjcx3WTatNPX9MKnMLwKijQKc4265pHTtcKVNnk ohQg== X-Gm-Message-State: AOAM5312JwjWuAJWYhfm4UWoJV4CeSNe+UuxNxF5+Ajg6FJTIP0wr4It EYHY6a8PrG14RoUrHOD51uXRwNxe5flM9Cn7hF7b62aFUhqDQ00h1MrMC1McSiah9ROZ8Gel/pI Htcu4WgRfg+yVeeY= X-Received: by 2002:adf:fe0e:: with SMTP id n14mr291536wrr.236.1631639731652; Tue, 14 Sep 2021 10:15:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Kr/8qQoTmiiiNbyu3jw0TeHX3VQKL48jKzR/XffTD8L8JRg9QzQSCWnqkZnqUzkH+CYqRQ== X-Received: by 2002:adf:fe0e:: with SMTP id n14mr291478wrr.236.1631639731319; Tue, 14 Sep 2021 10:15:31 -0700 (PDT) Received: from [192.168.1.36] (14.red-83-35-25.dynamicip.rima-tde.net. [83.35.25.14]) by smtp.gmail.com with ESMTPSA id j27sm1554808wms.6.2021.09.14.10.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 10:15:30 -0700 (PDT) Subject: Re: [PATCH v2 29/53] qapi: introduce x-query-registers QMP command To: Eric Blake , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , Markus Armbruster , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Peter Maydell , Chris Wulff , David Hildenbrand , Bin Meng , Mark Cave-Ayland , qemu-devel@nongnu.org, Laurent Vivier , Max Filippov , Taylor Simpson , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Marek Vasut , Yoshinori Sato , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , Yuval Shaia , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Michael Rolnik , Peter Xu , Stafford Horne , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , qemu-ppc@nongnu.org, Aurelien Jarno , Paolo Bonzini , Aleksandar Rikalo , "Dr. David Alan Gilbert" References: <20210914142042.1655100-1-berrange@redhat.com> <20210914142042.1655100-30-berrange@redhat.com> <20210914160416.tmk5nuhch2yhfb27@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Tue, 14 Sep 2021 19:15:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210914160416.tmk5nuhch2yhfb27@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.969, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 17:15:39 -0000 On 9/14/21 6:04 PM, Eric Blake wrote: > On Tue, Sep 14, 2021 at 03:20:18PM +0100, Daniel P. Berrangé wrote: >> This is a counterpart to the HMP "info registers" command. It is being >> added with an "x-" prefix because this QMP command is intended as an >> ad hoc debugging tool and will thus not be modelled in QAPI as fully >> structured data, nor will it have long term guaranteed stability. >> The existing HMP command is rewritten to call the QMP command. >> >> Signed-off-by: Daniel P. Berrangé >> --- >> +## >> +# @HumanReadableText: >> +# >> +# @human-readable-text: Formatted output intended for humans. >> +# >> +# Since: 6.2.0 > > Should be '6.2', not '6.2.0', to match... > >> +# >> +## >> +{ 'struct': 'HumanReadableText', >> + 'data': { 'human-readable-text': 'str' } } >> diff --git a/qapi/machine.json b/qapi/machine.json >> index 157712f006..8737efa865 100644 >> --- a/qapi/machine.json >> +++ b/qapi/machine.json >> @@ -1312,3 +1312,18 @@ >> '*cores': 'int', >> '*threads': 'int', >> '*maxcpus': 'int' } } >> + >> +## >> +# @x-query-registers: >> +# >> +# @cpu: the CPU number to query. If omitted, queries all CPUs >> +# >> +# Query information on the CPU registers >> +# >> +# Returns: CPU state in an architecture-specific format >> +# >> +# Since: 6.2 > > ...the prevailing style. > > If it were likely that someone might backport just some (but not all) > added x- commands, it may be wise to separate the creation of > HumanReadableText into its own patch to backport that but not > x-query-registers. But I rather suspect anyone backporting this will > take the series wholesale, so the coupling in this patch is not worth > worrying about. IIUC the problem is this breaks bisection, as you get a QAPI error: qapi/qapi-commands-machine.c:123:13: error: ‘qmp_marshal_output_HumanReadableText’ defined but not used [-Werror=unused-function] 123 | static void qmp_marshal_output_HumanReadableText(HumanReadableText *ret_in, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors See the comment added in commit 1f7b9f3181e ("qapi/commands: add #if conditions to commands"). > >> +## >> +{ 'command': 'x-query-registers', >> + 'data': {'*cpu': 'int' }, >> + 'returns': 'HumanReadableText' } >> -- >> 2.31.1 >> >