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=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 9C800C4338F for ; Wed, 28 Jul 2021 13:25:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 812946101B for ; Wed, 28 Jul 2021 13:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235324AbhG1NZN (ORCPT ); Wed, 28 Jul 2021 09:25:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28026 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235346AbhG1NZL (ORCPT ); Wed, 28 Jul 2021 09:25:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627478709; 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=T2QVUgSAbCZQgRX2hiiGLyxOUXhXDucaWcjRj1g48i8=; b=MMlQdrenJW2K3ym/on0GQxuXeeo631opvreukGQY9TjO6dDOPdwqC/O4ZS1lmvhoUbmwtM fONqqT+d2N9zkMXMAWIgcoVFb+Aj2iZAqmp0TeP4t5JxBYjJosH41J0X4xtj+NUcT7oEp3 igtDxrxZVT7iwmrXMlhh2+cNJwrMwdA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-H1VN7M9lO9SDzunYGqJPaw-1; Wed, 28 Jul 2021 09:25:06 -0400 X-MC-Unique: H1VN7M9lO9SDzunYGqJPaw-1 Received: by mail-wm1-f70.google.com with SMTP id o26-20020a05600c511ab0290252d0248251so949892wms.1 for ; Wed, 28 Jul 2021 06:25:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=T2QVUgSAbCZQgRX2hiiGLyxOUXhXDucaWcjRj1g48i8=; b=ssr7Qa1pTBPT5uoV13EPHkESywW198HeIDaZoCoGBfbkSTLvTH72C2EYyaOG0Hucmn lNN9XXuGAAoddpTCxJfrVJJ1azfkU21tatyKmjQGmnJkFWNfAKtUG9t1DLsK1BXObuc6 8E9oiqej0WsmnT6SZJlpIxYVkf+Qk9tMJudtrRSHpZ77vBySGSyvYECgLERVzCL+jfL5 lT+g0Xv0y2tH9ehufI833z8RT7nj938EBs0BXFP6vfqgKr9gh1oIi2syBciTRfEfyRnp t5OSBZAkW13i5CM+6vLfy4OYQ4wqyReDlinjV+9OD45dMJdGAHsVcYHliSIXRU1GV24U bc2Q== X-Gm-Message-State: AOAM530OyVv9ofuTIL5zYWierD6/3QdfJxTVw6BynwRRsfnS6NkyzShJ k5sxvj+7eGMdlYV9FhMK7eF9RFYo7586xQOorq7HEIozH3OPI55tE87ys2RfOXobecKeosJa4iU Q0p8fhUSEGTs2 X-Received: by 2002:a7b:ce10:: with SMTP id m16mr9081773wmc.75.1627478705178; Wed, 28 Jul 2021 06:25:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrkK+x/0SUpP1RX01qa1UdRsqt6PGPUfl+Mv0QvXAc2I4j6RaXUCVx8xwN//SplTE8fpSQCA== X-Received: by 2002:a7b:ce10:: with SMTP id m16mr9081752wmc.75.1627478704954; Wed, 28 Jul 2021 06:25:04 -0700 (PDT) Received: from [192.168.1.36] (122.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.122]) by smtp.gmail.com with ESMTPSA id q5sm6848793wrx.33.2021.07.28.06.25.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jul 2021 06:25:04 -0700 (PDT) Subject: Re: [PATCH-for-6.2 v12] qapi: introduce 'query-x86-cpuid' QMP command. To: Valeriy Vdovin , qemu-devel@nongnu.org Cc: Eduardo Habkost , Marcel Apfelbaum , Eric Blake , Markus Armbruster , Paolo Bonzini , Marcelo Tosatti , Richard Henderson , Thomas Huth , Laurent Vivier , kvm@vger.kernel.org, Denis Lunev , Vladimir Sementsov-Ogievskiy References: <20210728125402.2496-1-valeriy.vdovin@virtuozzo.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <718458b1-cae1-02d2-c605-e9a31d971af1@redhat.com> Date: Wed, 28 Jul 2021 15:25:03 +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: <20210728125402.2496-1-valeriy.vdovin@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 7/28/21 2:54 PM, Valeriy Vdovin wrote: > Introducing new QMP command 'query-x86-cpuid'. This command can be used to > 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' > 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. > > To learn exactly how virtual CPU is presented to the guest machine via CPUID > instruction, new QMP command can be used. By calling 'query-x86-cpuid' > command, one can get a full listing of all CPUID leaves with subleaves which are > supported by the initialized virtual CPU. > > Other than debug, the command is useful in cases when we would like to > utilize QEMU's virtual CPU initialization routines and put the retrieved > values into kernel CPUID overriding mechanics for more precise control > over how various processes perceive its underlying hardware with > container processes as a good example. > > The command is specific to x86. It is currenly only implemented for KVM acceleator. > > Output format: > The output is a plain list of leaf/subleaf argument combinations, that > return 4 words in registers EAX, EBX, ECX, EDX. > ... > +## > +# @query-x86-cpuid: > +# > +# Returns raw data from the emulated CPUID table for the first VCPU. > +# The emulated CPUID table defines the response to the CPUID > +# instruction when executed by the guest operating system. > +# > +# Returns: a list of CpuidEntry > +# > +# Since: 6.1 > +## Unfortunately too late for 6.1, so you'll have to update that to "6.2" (also in @CpuidEntry). 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.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 467AAC4338F for ; Wed, 28 Jul 2021 13:26:57 +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 D891360EC0 for ; Wed, 28 Jul 2021 13:26:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D891360EC0 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]:49670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8jaK-0007f6-0b for qemu-devel@archiver.kernel.org; Wed, 28 Jul 2021 09:26:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8jYi-0005sP-Er for qemu-devel@nongnu.org; Wed, 28 Jul 2021 09:25:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8jYc-0006sY-Sg for qemu-devel@nongnu.org; Wed, 28 Jul 2021 09:25:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627478707; 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=T2QVUgSAbCZQgRX2hiiGLyxOUXhXDucaWcjRj1g48i8=; b=Kx9pYJSdSljpCA98i56/5X6SikohPrg0Me5P/whsulAg0xP3zmUT2nbCS5RIaRISvhhHMB 8NjhnH9DsncNWCK0OFwyf53uekI4Kx+Qgf2iRDGbM6CMjLErckb52SbtB+/iVNWilI3hZs GO9b4L3/TiQcC8Z12qzdFmNIQsGDzgU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-CWDXcwxzNlaH0khiMlwyBQ-1; Wed, 28 Jul 2021 09:25:06 -0400 X-MC-Unique: CWDXcwxzNlaH0khiMlwyBQ-1 Received: by mail-wm1-f70.google.com with SMTP id q188-20020a1ca7c50000b0290241f054d92aso224494wme.5 for ; Wed, 28 Jul 2021 06:25:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=T2QVUgSAbCZQgRX2hiiGLyxOUXhXDucaWcjRj1g48i8=; b=mvsojs0Vdxg5E8O4ommgVYWTjXZVt99AQSfV9JMlqwkYHI3FXIQDhhklftx+E7uWkz 3hOV2STgUbG4bg60pKJ8h942Gl6e7b8+UYYD+YTawSKIlRzdAGypuqDprUssnsuGl2As l6Ht/n3DnhNcq7/0xqNS5WpJ13NF6dA6cThMasAh1k7+x1Ph29vFR9SwVq1Um88TUgch ufHmT3UrtkRwAM4sxoo0IigQnDjlhFIJbEPV7AmNbAVp4upAlpOQJfSPyI9ZbZo5fdtD pupoXcBaBWHcXIsJiag4IJc20eikzu5+V75kE4R7UgkfWHlEiArWciUekEiOn4xY0viG py/g== X-Gm-Message-State: AOAM530fGmpsaqWNQomDXq+EgoAfY04E3AdUUKH+5mpyYCgXgDolldXH JlhI4N5sJrJPQKBNLe2fFWoGaw99sT0G+9pqRE65dHawNLwm2Q0pRfjYF1NazoLw6BruUBOSp9u bgshxw52BJGPIlqE= X-Received: by 2002:a7b:ce10:: with SMTP id m16mr9081770wmc.75.1627478705177; Wed, 28 Jul 2021 06:25:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrkK+x/0SUpP1RX01qa1UdRsqt6PGPUfl+Mv0QvXAc2I4j6RaXUCVx8xwN//SplTE8fpSQCA== X-Received: by 2002:a7b:ce10:: with SMTP id m16mr9081752wmc.75.1627478704954; Wed, 28 Jul 2021 06:25:04 -0700 (PDT) Received: from [192.168.1.36] (122.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.122]) by smtp.gmail.com with ESMTPSA id q5sm6848793wrx.33.2021.07.28.06.25.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jul 2021 06:25:04 -0700 (PDT) Subject: Re: [PATCH-for-6.2 v12] qapi: introduce 'query-x86-cpuid' QMP command. To: Valeriy Vdovin , qemu-devel@nongnu.org References: <20210728125402.2496-1-valeriy.vdovin@virtuozzo.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <718458b1-cae1-02d2-c605-e9a31d971af1@redhat.com> Date: Wed, 28 Jul 2021 15:25:03 +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: <20210728125402.2496-1-valeriy.vdovin@virtuozzo.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: 7bit 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: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.719, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.277, 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 , Markus Armbruster , Denis Lunev , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/28/21 2:54 PM, Valeriy Vdovin wrote: > Introducing new QMP command 'query-x86-cpuid'. This command can be used to > 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' > 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. > > To learn exactly how virtual CPU is presented to the guest machine via CPUID > instruction, new QMP command can be used. By calling 'query-x86-cpuid' > command, one can get a full listing of all CPUID leaves with subleaves which are > supported by the initialized virtual CPU. > > Other than debug, the command is useful in cases when we would like to > utilize QEMU's virtual CPU initialization routines and put the retrieved > values into kernel CPUID overriding mechanics for more precise control > over how various processes perceive its underlying hardware with > container processes as a good example. > > The command is specific to x86. It is currenly only implemented for KVM acceleator. > > Output format: > The output is a plain list of leaf/subleaf argument combinations, that > return 4 words in registers EAX, EBX, ECX, EDX. > ... > +## > +# @query-x86-cpuid: > +# > +# Returns raw data from the emulated CPUID table for the first VCPU. > +# The emulated CPUID table defines the response to the CPUID > +# instruction when executed by the guest operating system. > +# > +# Returns: a list of CpuidEntry > +# > +# Since: 6.1 > +## Unfortunately too late for 6.1, so you'll have to update that to "6.2" (also in @CpuidEntry).