Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2415105pxu; Mon, 7 Dec 2020 06:08:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqmMrvNH+8jBdubgFWNcLVfxzwZBqq6tZMCl1UwYasmg8rOYUPBVeaIeZfr2d4HLETV45U X-Received: by 2002:a17:906:351a:: with SMTP id r26mr4066715eja.409.1607350135023; Mon, 07 Dec 2020 06:08:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607350135; cv=none; d=google.com; s=arc-20160816; b=zQudoTNq/Ylvha5+dyRS3hMeJdW1Ywzok1RQSETIus2n1ZnkhNtynfXr3iqa7lAIaJ d6kjc1eB2SJpNJFK6bpgmtrnXqQ7pM7zaUz+n93CIi0ptk3BriDtE/8L2dCnaeg1fiM2 cih6j5BCwCWYSwA+XIyci4YHKa1uDS7ROvqseWIppBQbw4qitaPY6QPmjMhMNns3JvBF PeZoYTOPY/oacsuWJJwfIhp6QNQx0R13uZ5hoimAGdFSbKgwuxUxpmucHK6AUsz0BKds g6aMwcPTryX31azXb+WseTOuELEUq2dy8Gznvc4al3OKq8rgMqHFxupdnMYiqUQEDY8/ sDBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=VXJ2WV+3oLwe/kgu65fZ3NuyXn0BmMomcXwcCXAMr2w=; b=1FCR0rjSeHWK8JF6S/Fo6YDzpVK4GlKBOraGtV26wSi7mXT4JP0OTb4OCHdUoZ/FDF GUIn62PwpWM0DV/YlM/pJbMUNWlAhSBV6nCNChZ59rRGdexsskBNql8aFPKJsOFKKjUt HJBjMDQPaf6kfPzMrt0lbv5y2gHvDdautUtUElh0AJvI1dq8DGz3SqjNK1n1YW7OqF+0 UncFZcS6aF2tQWjxiWFLnOOIB0CQbtThsBLoxVKTlVo0oCA+AxkTWeiUliP4qpGy1dHx ToApxIihE5oijPkp9BlBWJpODgkRLJ8AWbBZt/y+UO0LK5LkEIl26RHkdJLK0ITVRc4A HCZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=eJY4echN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l34si7873735ede.416.2020.12.07.06.08.30; Mon, 07 Dec 2020 06:08:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=eJY4echN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgLGOEv (ORCPT + 99 others); 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.