Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2532790ybf; Mon, 2 Mar 2020 10:30:49 -0800 (PST) X-Google-Smtp-Source: ADFU+vtT7N54e3KKD9NsBPMjd1ZnVc4SD8ew78uNYdRwaHttaJnF3TjSTsrpkSNw+spRa4zQcmSO X-Received: by 2002:a05:6830:1284:: with SMTP id z4mr352827otp.291.1583173849017; Mon, 02 Mar 2020 10:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583173849; cv=none; d=google.com; s=arc-20160816; b=vEYf7F+wvSZjBvgfWc8c6Fs+bygngoGFIwHSwauIehZccyLFLr0ZumwYpIzszZZ8tL aVzJMYTahhPM9K0NelmGPW4f/trJ1QJBH4F+hI0L15ZUCyaOe6OPb56lIyub2LHfeYbO hB4TrdbqQMvbY3qUq+xif/pg+EDZ0FEtc2ORIC2Kski355RXdZazCOqiQQwWbLklSIo/ eEY73oQS6JO5OAdtX833R5/MU6o5kTzM5RXESuSJ5JShYkkPWI/oO9RGerVl9JWblV0/ M8gSDThuB+geuZD2mRZ17Pe+cMlmUacNDehcE9CFvnhD6fTm6jpv5n9QrMMb9wAHpJAM GIaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=c9N8pmiznJwsvAz0Mn6RIRQBpDbT8QYW9ssTcn5Srt0=; b=AeeQopjrU9DCgvdi8LiwonPQfQOm+p++mEuapkk4gLdZvWTydeetKxnRZ4lnF3WeuM N+nO09ojt9TIqjSpaIxuVe5SSGWOG89O35KYLIAFIsgbnoYZWlarvjjDUVAajwHp/gpw r7gP9sHd8vU1XN5qalCG6Umpqw0CylmaVUsnabVouTa9Cw7M6Vth9LKAAGKprD9z6bMX dZlmCq4W0vTFYmuqS7cmzGBamrAPZvyPd5rFglPeEt01lJ3ACuMRvPN1NqiGtt3w0dfT QkWZHW30puVkVBdDdZWDQvI/01xZ5JkHP6t3PXdXPqKASyKWarBolJXSCaLw/FxbLR71 CrAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ofrDh/W0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20si986879otk.258.2020.03.02.10.30.37; Mon, 02 Mar 2020 10:30:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ofrDh/W0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727432AbgCBSaf (ORCPT + 99 others); Mon, 2 Mar 2020 13:30:35 -0500 Received: from mail-il1-f196.google.com ([209.85.166.196]:43062 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbgCBSae (ORCPT ); Mon, 2 Mar 2020 13:30:34 -0500 Received: by mail-il1-f196.google.com with SMTP id o18so353202ilg.10 for ; Mon, 02 Mar 2020 10:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c9N8pmiznJwsvAz0Mn6RIRQBpDbT8QYW9ssTcn5Srt0=; b=ofrDh/W03+qXgcSrm3KyNkAyQydWdBRXEXFaC9ZchLmfzEVU1Y60uEB3nFcuG7bgJE +Z6e5pb9O93lPOefpvXtL85n8V3UhvZmr4hxaKsvf53treihjwahZH6t5cQrwZHUDEl6 gZhEGy5ZG9qzRUf/4W8I3f2w3G2NKzmf01J6xyd2jottQIPjMYgYuSoQGuqfSRtKjvmE 07hYHcN8TjXtTAE2BvqPIdSOtRvhkmrXJ4GwZeKtmuAH1YSRA6vlSXYp9Hsz86kJPPjl cOnbrQyg9ijriyRgciuxqarlh4bzlG28g0N3DuIdHVZwU6SX40gRznJheV22kpJvu8fs zL3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c9N8pmiznJwsvAz0Mn6RIRQBpDbT8QYW9ssTcn5Srt0=; b=uBmhKY+W4B/yMxZwcPQ3P71rM4bOFRYPEnvLjHlL9jSQZlUb+9rDI6J1BFzYLAA2AF e6hiKidwxqetoTl/UJ17qBig/r5IcmahnzyQ2C81UT6UT71gxdpYEnOkY9PCRnF1TFHr tgo4/md/Du+kwpkE0JCGj7qo8qTGphln85ZLBFAYxjovovTOJw5MpqMTrPIEZ3wU4gbQ mZQKctQHHaSD3pNC0Jx7Cd+u7W4g9/7itpdu1/7HvVvghpRtGq3rPtFqFdCuurtuTrdK m+LQ5dGwz/u6vTp+IympGZlPNvUbw6tZshro+xQRtPA/lzxqRwj1OomUP9cCMGf7DleN ZuDQ== X-Gm-Message-State: ANhLgQ3LX72LrcQNMKVEPIo0laCxYHp28A1tWkARd0nV1EI4AU/ArZB6 kTN/XQJ1oTeEOS6XyNiTnamIWDvoW50j7VyJ/KHMYg== X-Received: by 2002:a92:8547:: with SMTP id f68mr976871ilh.26.1583173833493; Mon, 02 Mar 2020 10:30:33 -0800 (PST) MIME-Version: 1.0 References: <1582773688-4956-1-git-send-email-linmiaohe@huawei.com> In-Reply-To: From: Jim Mattson Date: Mon, 2 Mar 2020 10:30:22 -0800 Message-ID: Subject: Re: [PATCH v2] KVM: X86: deprecate obsolete KVM_GET_CPUID2 ioctl To: Paolo Bonzini Cc: linmiaohe , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , kvm list , LKML , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 2, 2020 at 10:02 AM Paolo Bonzini wrote: > > On 02/03/20 18:44, Jim Mattson wrote: > > On Mon, Mar 2, 2020 at 9:09 AM Paolo Bonzini wrote: > >> > >> On 02/03/20 18:01, Jim Mattson wrote: > >>>> And in fact, it's not used anywhere. So it should be > >>>> deprecated. > >>> I don't know how you can make the assertion that this ioctl is not > >>> used anywhere. For instance, I see a use of it in Google's code base. > >> > >> Right, it does not seem to be used anywhere according to e.g. Debian > >> code search but of course it can have users. > >> > >> What are you using it for? It's true that cpuid->nent is never written > >> back to userspace, so the ioctl is basically unusable unless you already > >> know how many entries are written. Or unless you fill the CPUID entries > >> with garbage before calling it, I guess; is that what you are doing? > > > > One could use GET_CPUID2 after SET_CPUID2, to see what changes kvm > > made to the requested guest CPUID information without telling you. > > Yeah, I think GET_CPUID2 with the same number of leaves that you have > passed to SET_CPUID2 should work. Having said that, it doesn't look like the method that invokes this ioctl (in Google's code base) gets called from anywhere.