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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 C6C9AC2B9F4 for ; Thu, 17 Jun 2021 11:09:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5B7761209 for ; Thu, 17 Jun 2021 11:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232372AbhFQLL1 (ORCPT ); Thu, 17 Jun 2021 07:11:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48049 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232361AbhFQLLY (ORCPT ); Thu, 17 Jun 2021 07:11:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623928156; 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: in-reply-to:in-reply-to:references:references; bh=7qWZzuA2Y1bo+JLlFd2CD8tH7SKYj99Hgs/TVPOjKEo=; b=P/0vOQ1OFiu0q5gW14dJE/OJ/qzHlOPk0O/dssyfqMWwvr6okBHAVdiEzughrBnIndlb7m J1bM1YjQWE4l+udkBuYbw9b12V6aKO6EIwbd6udTjl8EbWmQ44+hVmFFKCT7KwqrSfWhj/ K0Ovl6q/uMMAd6On2AwgdtRsqXfqWC4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-GDFr9j2-PsCsyLCXOTrHDQ-1; Thu, 17 Jun 2021 07:09:13 -0400 X-MC-Unique: GDFr9j2-PsCsyLCXOTrHDQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6A7C6100CF71; Thu, 17 Jun 2021 11:09:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-104.ams2.redhat.com [10.36.112.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A9271002D71; Thu, 17 Jun 2021 11:09:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0E24113865F; Thu, 17 Jun 2021 13:09:08 +0200 (CEST) From: Markus Armbruster To: Valeriy Vdovin Cc: qemu-devel@nongnu.org, Eduardo Habkost , Marcel Apfelbaum , Eric Blake , Paolo Bonzini , Marcelo Tosatti , Richard Henderson , Thomas Huth , Laurent Vivier , kvm@vger.kernel.org, Denis Lunev , Vladimir Sementsov-Ogievskiy Subject: Re: [PATCH v9] qapi: introduce 'query-kvm-cpuid' action References: <20210603090753.11688-1-valeriy.vdovin@virtuozzo.com> <87im2d6p5v.fsf@dusky.pond.sub.org> <20210617074919.GA998232@dhcp-172-16-24-191.sw.ru> Date: Thu, 17 Jun 2021 13:09:08 +0200 In-Reply-To: <20210617074919.GA998232@dhcp-172-16-24-191.sw.ru> (Valeriy Vdovin's message of "Thu, 17 Jun 2021 10:49:19 +0300") Message-ID: <87a6no3fzf.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Valeriy Vdovin writes: > On Thu, Jun 17, 2021 at 07:22:36AM +0200, Markus Armbruster wrote: >> Valeriy Vdovin writes: >> >> > Introducing new qapi method 'query-kvm-cpuid'. This method can be used to >> >> It's actually a QMP command. There are no "qapi methods". >> >> > get virtualized cpu model info generated by QEMU during VM initialization in >> > the form of cpuid representation. >> > >> > Diving into more details about virtual cpu generation: QEMU first parses '-cpu' >> >> virtual CPU >> >> > command line option. From there it takes the name of the model as the basis for >> > feature set of the new virtual cpu. After that it uses trailing '-cpu' options, >> > that state if additional cpu features should be present on the virtual cpu or >> > excluded from it (tokens '+'/'-' or '=on'/'=off'). >> > After that QEMU checks if the host's cpu can actually support the derived >> > feature set and applies host limitations to it. >> > After this initialization procedure, virtual cpu has it's model and >> > vendor names, and a working feature set and is ready for identification >> > instructions such as CPUID. >> > >> > Currently full output for this method is only supported for x86 cpus. >> >> Not sure about "currently": the interface looks quite x86-specific to me. >> > Yes, at some point I was thinking this interface could become generic, > but does not seem possible, so I'll remove this note. > >> The commit message doesn't mention KVM except in the command name. The >> schema provides the command only if defined(CONFIG_KVM). >> >> Can you explain why you need the restriction to CONFIG_KVM? >> > This CONFIG_KVM is used as a solution to a broken build if --disable-kvm > flag is set. I was choosing between this and writing empty implementation into > kvm-stub.c If the command only makes sense for KVM, then it's named correctly, but the commit message lacks a (brief!) explanation why it only makes for KVM. If it just isn't implemented for anything but KVM, then putting "kvm" into the command name is a bad idea. Also, the commit message should briefly note the restriction to KVM. Pick one :) [...] 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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 7779DC2B9F4 for ; Thu, 17 Jun 2021 11:10:17 +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 EB9D361209 for ; Thu, 17 Jun 2021 11:10:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB9D361209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltpuZ-0004J9-Ud for qemu-devel@archiver.kernel.org; Thu, 17 Jun 2021 07:10:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltptl-0003cg-M4 for qemu-devel@nongnu.org; Thu, 17 Jun 2021 07:09:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltptb-0002k5-JR for qemu-devel@nongnu.org; Thu, 17 Jun 2021 07:09:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623928154; 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: in-reply-to:in-reply-to:references:references; bh=7qWZzuA2Y1bo+JLlFd2CD8tH7SKYj99Hgs/TVPOjKEo=; b=NBXVVirzZRo2EsjjqAUf5kU+FdbjhQkw3iGO89u0cuiBRWf9L3vSmbR7aeluYVifAK1cFd bShLjNeOdMCVQZkKfRTKLAU6BGQffIPDsm8HOTmYACmvvn03ejDqzz2VlUS2MASxpkH3zO cEgvdClT3dpQ3XjIyw2qx2hOwlKqIpE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-GDFr9j2-PsCsyLCXOTrHDQ-1; Thu, 17 Jun 2021 07:09:13 -0400 X-MC-Unique: GDFr9j2-PsCsyLCXOTrHDQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6A7C6100CF71; Thu, 17 Jun 2021 11:09:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-104.ams2.redhat.com [10.36.112.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A9271002D71; Thu, 17 Jun 2021 11:09:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0E24113865F; Thu, 17 Jun 2021 13:09:08 +0200 (CEST) From: Markus Armbruster To: Valeriy Vdovin Subject: Re: [PATCH v9] qapi: introduce 'query-kvm-cpuid' action References: <20210603090753.11688-1-valeriy.vdovin@virtuozzo.com> <87im2d6p5v.fsf@dusky.pond.sub.org> <20210617074919.GA998232@dhcp-172-16-24-191.sw.ru> Date: Thu, 17 Jun 2021 13:09:08 +0200 In-Reply-To: <20210617074919.GA998232@dhcp-172-16-24-191.sw.ru> (Valeriy Vdovin's message of "Thu, 17 Jun 2021 10:49:19 +0300") Message-ID: <87a6no3fzf.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Received-SPF: pass client-ip=216.205.24.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.197, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: Laurent Vivier , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , kvm@vger.kernel.org, Marcelo Tosatti , Richard Henderson , qemu-devel@nongnu.org, Denis Lunev , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Valeriy Vdovin writes: > On Thu, Jun 17, 2021 at 07:22:36AM +0200, Markus Armbruster wrote: >> Valeriy Vdovin writes: >> >> > Introducing new qapi method 'query-kvm-cpuid'. This method can be used to >> >> It's actually a QMP command. There are no "qapi methods". >> >> > get virtualized cpu model info generated by QEMU during VM initialization in >> > the form of cpuid representation. >> > >> > Diving into more details about virtual cpu generation: QEMU first parses '-cpu' >> >> virtual CPU >> >> > command line option. From there it takes the name of the model as the basis for >> > feature set of the new virtual cpu. After that it uses trailing '-cpu' options, >> > that state if additional cpu features should be present on the virtual cpu or >> > excluded from it (tokens '+'/'-' or '=on'/'=off'). >> > After that QEMU checks if the host's cpu can actually support the derived >> > feature set and applies host limitations to it. >> > After this initialization procedure, virtual cpu has it's model and >> > vendor names, and a working feature set and is ready for identification >> > instructions such as CPUID. >> > >> > Currently full output for this method is only supported for x86 cpus. >> >> Not sure about "currently": the interface looks quite x86-specific to me. >> > Yes, at some point I was thinking this interface could become generic, > but does not seem possible, so I'll remove this note. > >> The commit message doesn't mention KVM except in the command name. The >> schema provides the command only if defined(CONFIG_KVM). >> >> Can you explain why you need the restriction to CONFIG_KVM? >> > This CONFIG_KVM is used as a solution to a broken build if --disable-kvm > flag is set. I was choosing between this and writing empty implementation into > kvm-stub.c If the command only makes sense for KVM, then it's named correctly, but the commit message lacks a (brief!) explanation why it only makes for KVM. If it just isn't implemented for anything but KVM, then putting "kvm" into the command name is a bad idea. Also, the commit message should briefly note the restriction to KVM. Pick one :) [...]