Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2458612ybf; Mon, 2 Mar 2020 09:03:40 -0800 (PST) X-Google-Smtp-Source: ADFU+vsHPCrDAy709E6H9kXyqEzpH4fAxNhRjqwnCiLawnqIvzGRXsz7E5K7qPF9NUyxRBE3E0FL X-Received: by 2002:aca:4c02:: with SMTP id z2mr52459oia.9.1583168620260; Mon, 02 Mar 2020 09:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583168620; cv=none; d=google.com; s=arc-20160816; b=SqbPfLq5Cw+wfZQxGbnJTbXqydR+2syYhqFoEhTfkGnQzu/FePEO/HH77H2Yvps2DN s22h9v2oTJwLqzS4hCytRH7sTn2uTq/a/SKFegNlvJ77A4JlMSgdbEhXFmK4eqmtFjN8 sKc492JceWmEgApcCffxkS3cXYJaFQld/VMZpWd1sYDceXoHk8ehylryufSfuOQLvPDP 4qn/+w6PXOtUn6oSzNNFctO/Dh8V1vtUzyiUorUxWyfkW6QQ/goaouz5CGfOWN6MSyYb oCvaOIcnH9MPeky8xRE7QxWDH2t/Jb/pZNUoqSSR1Ivfcw4xsK8N/8/7U7NIzBniI+3x Rq3w== 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=qxBd2/UPs5vf4LaxUj5TjDTWVmNZ1aU9EeZ4ieRPNr0=; b=gDMqQZx7Jhinj3H293+/7hbyxvc5D0vHhM0zZt+xHM5Dk7H5jbiJOp3CK3kj8ZpaLZ r0kS5zLs/w9/aZSVZsjLEFgtEg91GIggcar6BY0gwYl1Jfm4s49hKf8VBcccpfnTsOUd 0x61XuTkdWFTNR16EmIjQMFexWzggm3EvOPFoPUptU4rSO/zhV+Zn/ic9gzljIbvAfV+ zZSod8Ed2hjUz/s12bFB2Dz0lrLmZ7XdklfxRSXrUGsfYqkLQG3kXJr6WsDEVVfZyifn ZkNxrecGog6ftrsS6nmEUfcPV/a89vdsBrX5eBTEtYDjKzvRsT7pBzPR5t5hYyVXA2a+ WNdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vRxxEZHP; 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 m16si6872914otf.74.2020.03.02.09.03.27; Mon, 02 Mar 2020 09:03:40 -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=vRxxEZHP; 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 S1727403AbgCBRBk (ORCPT + 99 others); Mon, 2 Mar 2020 12:01:40 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:33771 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbgCBRBj (ORCPT ); Mon, 2 Mar 2020 12:01:39 -0500 Received: by mail-il1-f194.google.com with SMTP id r4so153782iln.0 for ; Mon, 02 Mar 2020 09:01:39 -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=qxBd2/UPs5vf4LaxUj5TjDTWVmNZ1aU9EeZ4ieRPNr0=; b=vRxxEZHP+PcGuqWY+XHCm6VavLlu2hAfuoiI+iQedKrK7r1wdvYqIJljxbhdgYvyY9 DCqy+lZCJdDxI9h+Uk+JYi1Nlceqz94RVdcbdcrvbKfCuN9ZrEGzXZ9JxZ4JB4Iwh63L 3vsaWFiF7k+8i0nJCGrU6w+TjAqwKSOE60vDaNM1FJdZDgWX+jWkiNunAjwRzh8F7g0q oFFt27a4qbZbUoHpkCZBwMDjVdKzUcVl37nOju2Ou6/OzSskvFPHie07cLsvxlcEDuBt 0q1WftFL6RFvB6SDj5Cg1cQsMkm9eLUlTKCOqbUWGy12kVGwD0E1/CqNwQzEg9ic1Xr7 /yYA== 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=qxBd2/UPs5vf4LaxUj5TjDTWVmNZ1aU9EeZ4ieRPNr0=; b=bfFp0wgur7WDfNulAKEjopJNfoozU5jW3D4qIfLbgCIwwb7/T+Rgsx3mAKiklVwXqE ABmXiVoKYi2MXUSAS2yv8e0iOUbkgEhsVsoL/h8wGeAvicnPpzPGbf5AbVMwkkT5ZPie FPkILTPKxLD9KEFCBpYcrWTU8OyLG8sPrPPEU/uOPs+/WME8XQn+DbQV1yIkfhFCRCBo ///PqLNII1vM+Cu196mPdPmWtCu0kAgnbeBaShzZ0nHQ5WKhBz8yZJYVIkPrJWPLC/pu KjvJY2krgswzl8S49jguqif/jVlKDU1uIbi6f2ccJRb9SN73tpdpQAPgRlh2idSA2O2r NsRQ== X-Gm-Message-State: ANhLgQ3iXaQPc2dCu1kWWBsPvrV6IHtpdsQvNEydbW1fkfbuEmJ/x5fy +H9y7hs+BZyEXya1qlWCx0U5XJ7BuEp94lJ+eur1Yw== X-Received: by 2002:a92:8547:: with SMTP id f68mr616024ilh.26.1583168498999; Mon, 02 Mar 2020 09:01:38 -0800 (PST) MIME-Version: 1.0 References: <1582773688-4956-1-git-send-email-linmiaohe@huawei.com> In-Reply-To: <1582773688-4956-1-git-send-email-linmiaohe@huawei.com> From: Jim Mattson Date: Mon, 2 Mar 2020 09:01:27 -0800 Message-ID: Subject: Re: [PATCH v2] KVM: X86: deprecate obsolete KVM_GET_CPUID2 ioctl To: linmiaohe Cc: Paolo Bonzini , =?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 Wed, Feb 26, 2020 at 7:20 PM linmiaohe wrote: > > From: Miaohe Lin > > When kvm_vcpu_ioctl_get_cpuid2() fails, we set cpuid->nent to the value of > vcpu->arch.cpuid_nent. But this is in vain as cpuid->nent is not copied to > userspace by copy_to_user() from call site. Also cpuid->nent is not updated > to indicate how many entries were retrieved on success case. So this ioctl > is straight up broken. 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.