Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3018435pxf; Sun, 14 Mar 2021 21:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8M+y3SYhbSbT9UHUMexHodmgbCNNMgOYYkWAHpdmwR60eS5S7rcojPW5CgG5nOJGOgXyN X-Received: by 2002:a17:906:dbd0:: with SMTP id yc16mr21536655ejb.71.1615783448017; Sun, 14 Mar 2021 21:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615783448; cv=none; d=google.com; s=arc-20160816; b=aTbHspHnImmj1KgGAlIOlRq9lW8UpC7HVO6W6LJHS/VdyvZy9W2TIs8iSEu1eeb0hb FDrBRqWs4BqxL5XNoVKIFbyajbNKz+gTUUTPZFmbLfi0Q5ytxFv6CaIaEg/ELsRddafE GTDgQxcMmrEl+qM/SBfxJgZdOzkMMNgzQeC5q2sf4+U93kDlV97d7H5AxRLmKl0XZKnL zZmcaZhI1WyPW6LgEjZ0VWSaGi6Ooke7sEXkl5K04ApeNJOsSTI01i74mypJUFyvKS09 hYnLQeCeUEssFeWqqcDfSX2r8AzmBknYz3uqU3qzIjkPD5A7mgiaqe1hVRetfG/sUzxP AQQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=UyHf3cN0bA99TIZ5S7hq89jGhCW8OoHyo71B+vKIcJ8=; b=JEm3f1Q8itXjLCgdhvO4djGXg7VBfRe3Z9S1EPQ+ZxKea1hL0SnZNf1gbOa3UDpX+k f1fpTqX7h8epCU0+DWJzHIXVylQr9vDa0y7aterNI1Fotmci58LP08jcEokzgM8mCFdy 0SLI/FN/SQYFCZ4QVUOlJClUBbVIYqeaGjpH159JFdUHWMrq1j+7ALGuprPj9Bj4+Kap pFOcSPr9Rc8cCJiTLlYUJBeT90GdXxZE9MOpJccTiHmTWe/87b7m1RRa2bkdnIhpLrzm u3156SP09XVi5LBeYg+GGPciGy8Asn6L5jF5iSSSwNZ8eM9jhcW01Hoy27T+TbwVpsSl YF7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si7154368edp.303.2021.03.14.21.43.46; Sun, 14 Mar 2021 21:44:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbhCOEkt (ORCPT + 99 others); Mon, 15 Mar 2021 00:40:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13952 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbhCOEkl (ORCPT ); Mon, 15 Mar 2021 00:40:41 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DzNwR0YzyzrWX6; Mon, 15 Mar 2021 12:38:47 +0800 (CST) Received: from [10.174.184.42] (10.174.184.42) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Mon, 15 Mar 2021 12:40:34 +0800 Subject: Re: [PATCH] KVM: clean up the unused argument To: , , References: <20210313051032.4171-1-lihaiwei.kernel@gmail.com> CC: , , , , , , Haiwei Li From: Keqian Zhu Message-ID: <4b51bbfd-66f6-1593-3718-9789f9179a2f@huawei.com> Date: Mon, 15 Mar 2021 12:40:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20210313051032.4171-1-lihaiwei.kernel@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.184.42] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; > } > >