Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp378018pxf; Thu, 25 Mar 2021 06:20:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfFSrugthdh+CTGFcfVZANbK02jecliPfYoo+9XNVtWxYIjPjAHMl8Tnj8cuKLvgEfgdZo X-Received: by 2002:a5d:4688:: with SMTP id u8mr8928540wrq.39.1616678420007; Thu, 25 Mar 2021 06:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616678419; cv=none; d=google.com; s=arc-20160816; b=JFy/3ytc2R89s1b3SWKrkPpxiqCf0jlWgCgrK0KQ3LXSadQ7WSXrkOZy8Eialj587H wwHuvem+VCxmber5dv2bJUQ4E+ckvi4aCBwh+C6Amq80J5B2HNIIugPmazxW1tssguJv RXmGvuQo7FnG3UlUN9FUrYLhP/6qSRU+Mb4Bd9zQJSSzEQnrh4xXcyuD8ehoHoXhnMVE sKP+Hb0mnnAiAH0iuQKrhT/DqT3zECc51q5T2b71tiHIvkZKCKpZDkoUsABW0hjhr+su 0HJ61nMPKpL9o9L7tVXbG6PmF0P4aSVUcQTBlSvo4ht1wDuUn1nAbdQiSHiOo+FgKJDZ itzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Kn6Rs3ZyKaxJyTUe4ToXQORRNUfNJ+kfvLe6bzjFTIE=; b=LdQXYaCowMbIy0PlK96L5uynL+YbOE42h9qCkvG7H5WZTGENCbo0TKGSAJ0zfNNskd wNwUVr5dJ6pqeNZFUWUNXwjOGZ0gWDZDTWVC+laQVHaoxyXIuFUxd7Btc8ai908Rfm4v B7k8Td56SnsDCgGXvfZXSeVM2dwK9Du6aG7HR6InNuvH2+2b4d56FxP5h5GqBdsIRcfk jlab+rsO7wIeIti69IVSxvlrtPON63Q/bibzz273FM2Z7PjryDkiysoRv/aaosuQhhjC ZrYiGJTEh5zi772TcEPg5F05g28gSAlCtcyB6Z/OrIpV/1rk7o4b6tenALM4mJttJSYT 6tjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OlJjwEdr; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si4217864edw.62.2021.03.25.06.19.55; Thu, 25 Mar 2021 06:20:19 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=OlJjwEdr; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbhCYNSY (ORCPT + 99 others); Thu, 25 Mar 2021 09:18:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbhCYNSH (ORCPT ); Thu, 25 Mar 2021 09:18:07 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17F76C06174A; Thu, 25 Mar 2021 06:18:07 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id ce10so2846680ejb.6; Thu, 25 Mar 2021 06:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kn6Rs3ZyKaxJyTUe4ToXQORRNUfNJ+kfvLe6bzjFTIE=; b=OlJjwEdru1gspB1qdTLRNVSVcJeyyzS6kRz8jBHMSI9K9lUKfpZlM01XZuQYLcKL5C UdCe7mAu29/pNA71F7ovXhAIFCVGa3X63cujZ/Q9dJyEre4pJnhvg++cPLXYek9CtodV rubxkx1PpToPgs3cQAs2GKuN5T7Z4WYINm+bvGxoDhZ0m500JBqEWacCPoW0jn7EFJNH 28XephHeO7cErYSW8/kH1t2nHXNgvwKq/Ov+4g43PZjZ0tj68CYu66iFF86+PZzD87q7 uIRS2QIwIZnxEzJpdYVk/p+jxmIxHK7vSMGtp7QqHiSZqOoK1kMmBXBr4MK7bXZZh1n6 ncig== 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=Kn6Rs3ZyKaxJyTUe4ToXQORRNUfNJ+kfvLe6bzjFTIE=; b=WzYcHanXln9M0AzctcM7FjrxM3jBbToYmEwncAs45vtOLU13dYdWnA4qCb6sxkxa4U RUoULU90iA7iPHTMTjU8ojiTPIZVzmRwMFqQpMedELPa5bkWIt8phNB6sM7/mHguXqCE aLVi7cFliYYtQynO4TdIxcaDa/O6XcuOtC6L+cfYTwXc4HzI1UOWN2o1kJOW81otGUyA oZ9/c0ODUH6/SREFL/YC4V2Yi76Cbkl78ku5Kq9KnztYP1pLvTLgjgL0n/MSh/MDEc+D 1Yf31ZOTt93JgA0jXsefav+8VPQXlrYVYL0tgV1ZLTd7OXlupx/k87hZ0taAbRmVEEFu zebw== X-Gm-Message-State: AOAM532Z4Q5vLFRy7LTBzXNDQhookURgrw1wZ42Qe21468Q6Kj8xLpIf 8gKP/ccOSpOWNaHuxMWUHT7ALTCay4qFuALLAA== X-Received: by 2002:a17:906:3c46:: with SMTP id i6mr9567894ejg.80.1616678285828; Thu, 25 Mar 2021 06:18:05 -0700 (PDT) MIME-Version: 1.0 References: <20210313051032.4171-1-lihaiwei.kernel@gmail.com> <4b51bbfd-66f6-1593-3718-9789f9179a2f@huawei.com> In-Reply-To: <4b51bbfd-66f6-1593-3718-9789f9179a2f@huawei.com> From: Haiwei Li Date: Thu, 25 Mar 2021 21:17:27 +0800 Message-ID: Subject: Re: [PATCH] KVM: clean up the unused argument To: Keqian Zhu Cc: LKML , kvm list , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Haiwei Li Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kindly ping. :) On Mon, Mar 15, 2021 at 12:40 PM Keqian Zhu wrote: > > > This looks OK. The use of vcpu argument is removed in commit d383b3146d80 (KVM: x86: Fix NULL dereference at kvm_msr_ignored_check()) > > Reviewed-by: Keqian Zhu > > On 2021/3/13 13:10, lihaiwei.kernel@gmail.com wrote: > > From: Haiwei Li > > > > kvm_msr_ignored_check function never uses vcpu argument. Clean up the > > function and invokers. > > > > Signed-off-by: Haiwei Li > > --- > > arch/x86/kvm/x86.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > index 012d5df..27e9ee8 100644 > > --- a/arch/x86/kvm/x86.c > > +++ b/arch/x86/kvm/x86.c > > @@ -271,8 +271,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { > > * When called, it means the previous get/set msr reached an invalid msr. > > * Return true if we want to ignore/silent this failed msr access. > > */ > > -static bool kvm_msr_ignored_check(struct kvm_vcpu *vcpu, u32 msr, > > - u64 data, bool write) > > +static bool kvm_msr_ignored_check(u32 msr, u64 data, bool write) > > { > > const char *op = write ? "wrmsr" : "rdmsr"; > > > > @@ -1447,7 +1446,7 @@ static int do_get_msr_feature(struct kvm_vcpu *vcpu, unsigned index, u64 *data) > > if (r == KVM_MSR_RET_INVALID) { > > /* Unconditionally clear the output for simplicity */ > > *data = 0; > > - if (kvm_msr_ignored_check(vcpu, index, 0, false)) > > + if (kvm_msr_ignored_check(index, 0, false)) > > r = 0; > > } > > > > @@ -1613,7 +1612,7 @@ static int kvm_set_msr_ignored_check(struct kvm_vcpu *vcpu, > > int ret = __kvm_set_msr(vcpu, index, data, host_initiated); > > > > if (ret == KVM_MSR_RET_INVALID) > > - if (kvm_msr_ignored_check(vcpu, index, data, true)) > > + if (kvm_msr_ignored_check(index, data, true)) > > ret = 0; > > > > return ret; > > @@ -1651,7 +1650,7 @@ static int kvm_get_msr_ignored_check(struct kvm_vcpu *vcpu, > > if (ret == KVM_MSR_RET_INVALID) { > > /* Unconditionally clear *data for simplicity */ > > *data = 0; > > - if (kvm_msr_ignored_check(vcpu, index, 0, false)) > > + if (kvm_msr_ignored_check(index, 0, false)) > > ret = 0; > > } > > > >