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=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 9C219C433FE for ; Mon, 7 Dec 2020 14:05:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6872B235DD for ; Mon, 7 Dec 2020 14:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbgLGOEv (ORCPT ); Mon, 7 Dec 2020 09:04:51 -0500 Received: from forward100o.mail.yandex.net ([37.140.190.180]:48485 "EHLO forward100o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbgLGOEu (ORCPT ); Mon, 7 Dec 2020 09:04:50 -0500 X-Greylist: delayed 8191 seconds by postgrey-1.27 at vger.kernel.org; Mon, 07 Dec 2020 09:04:49 EST Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:c03:7aa:0:640:45d7:caab]) by forward100o.mail.yandex.net (Yandex) with ESMTP id CF4B04AC127F; Mon, 7 Dec 2020 17:04:07 +0300 (MSK) Received: from iva5-057a0d1fbbd8.qloud-c.yandex.net (iva5-057a0d1fbbd8.qloud-c.yandex.net [2a02:6b8:c0c:7f1c:0:640:57a:d1f]) by mxback7g.mail.yandex.net (mxback/Yandex) with ESMTP id pJAP5gGgmz-46fKf9Xm; Mon, 07 Dec 2020 17:04:07 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1607349847; bh=VXJ2WV+3oLwe/kgu65fZ3NuyXn0BmMomcXwcCXAMr2w=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID:Cc; b=eJY4echNoHLad24zI5CP/ahAx3mrc73JIzGocX6iKLjJqoKf85I6IEj0Nukcnzyzh vMflNyfmNCDHMv+OqMW4geZLAIo+3gkEIx1V8p+xKptfrlqguoH1yOQVLvnYen1/OQ 282CPmgsHL2emMqad0JolKr0guiao+lV1M6AO4PQ= Authentication-Results: mxback7g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva5-057a0d1fbbd8.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id VLMtVEr4V8-46m4olwu; Mon, 07 Dec 2020 17:04:06 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup) To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201007014417.29276-1-sean.j.christopherson@intel.com> <99334de1-ba3d-dfac-0730-e637d39b948f@yandex.ru> <20201008175951.GA9267@linux.intel.com> <7efe1398-24c0-139f-29fa-3d89b6013f34@yandex.ru> <20201009040453.GA10744@linux.intel.com> <5dfa55f3-ecdf-9f8d-2d45-d2e6e54f2daa@yandex.ru> <20201009153053.GA16234@linux.intel.com> From: stsp Message-ID: <9201e8ac-68d2-2bb3-1ef3-efd698391955@yandex.ru> Date: Mon, 7 Dec 2020 17:03:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 07.12.2020 16:35, Paolo Bonzini пишет: > > > Il lun 7 dic 2020, 12:47 stsp > ha scritto: > > So am I right that KVM_SET_CPUID only "lowers" > the supported bits? In which case I don't need to > call it at all, but instead just call KVM_GET_SUPPORTED_CPUID > and see if the needed bits are supported, and > exit otherwise, right? > > > You always have to call KVM_SET_CPUID2, but you can just pass in > whatever you got from KVM_GET_SUPPORTED_CPUID. OK, done that, thanks. (after checking that KVM_GET_SUPPORTED_CPUID actually has the needed features itself, otherwise exit). Perhaps it would be good if guest cpuid to have a default values of KVM_GET_SUPPORTED_CPUID, so that the user doesn't have to do the needless calls to just copy host features to guest cpuid.