Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp708715pxm; Fri, 25 Feb 2022 17:55:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwGJwWJwip/YxSP7fE1F3czPERkETSjigQO4pNRop0/YbgUP9JVq+LdKPEwmvzcq69vpS/ X-Received: by 2002:a65:5347:0:b0:374:87b6:549b with SMTP id w7-20020a655347000000b0037487b6549bmr8545778pgr.537.1645840521888; Fri, 25 Feb 2022 17:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645840521; cv=none; d=google.com; s=arc-20160816; b=JHFPGJdqOIeCAnSL+SyoR6UZkzFap3YwAbmEtCg7xuthwi3g6dO3/beRTbxVsMITAI Z32NsQy4cOrXvEsblYoi69zmrv1diOg2EVelFAQapa7t8resqYq4l9oKjx1IFKSPlJBe C2M27eIV5gH6GTqQKcWUAnHS9o2T1Pr/Aab1fVX+sCArojWEHpzWEkWwdXxyRNqLAzsl /fy3euTed52m0vPY8F2DcpzcWVg1mbM2F14NPhWMRG0L5bwOX0Ta7wsW8Qm5C6yOgkB2 noh3/M3HZLA4gFLbPFFLvTUxQBLqtRA7zXzDbCNV5BtTYrKPv0IrFistqAovOpmXB4H8 4VOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=S1NmdYyRDaBXoSCp03484hlz5eKqc7q4f9y/0Zo2bME=; b=phn4gLv/jaPYc3pMEDy48w65aM6OU38ypLCgfl+z0ZZ2mc+ry5tcyogbnFKCYySuQO PnYJeToFu/f9k/3uO6VWl5vzFfL0bBvpNdHT8DHKpwj0/XHCj1dNiXkhkTa8t/2viMYR yNPQdHk4MCbiyx6IpVxNhlgQS61HaMCcuFTttcimGfGlgNgruwdJssRQFRFyeTY7TLb1 wvL5itoiJsqhTJoCI+a8XqasLwMxpFOxr12UVHdhSWN62f2Pn+cnbL+L4mOXtTngY9HL jOXMpWqoPK1UvaXWOjXMovQ0/y+RZpXFWt96C2hBbgQrDpTGnoagQU+SpcfVphl+caJI hGyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YikD8Nri; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c10-20020a634e0a000000b0034d3d6c31e1si3140765pgb.794.2022.02.25.17.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 17:55:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YikD8Nri; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4730F271DD9; Fri, 25 Feb 2022 17:39:13 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233100AbiBYSYK (ORCPT + 99 others); Fri, 25 Feb 2022 13:24:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233040AbiBYSYC (ORCPT ); Fri, 25 Feb 2022 13:24:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C778F1A39EF for ; Fri, 25 Feb 2022 10:23:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645813400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S1NmdYyRDaBXoSCp03484hlz5eKqc7q4f9y/0Zo2bME=; b=YikD8NrimmYR5y1ZVym4TRzPR9SYmZQRG73ELAqHKAD+T6B2mulUeFcvGvsXFHubkapefX bxllPw2wu7+PTb98REIPovTEQAab8YCKgDflGUpSjZjUZh/7pw5kqjzXYflD4u7JA2f7E7 UZJjpmSnXvQRH2As2ctUrEnTgqM+5Pg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-5VQhx3J0PUGYCSKJ_C8OoQ-1; Fri, 25 Feb 2022 13:23:16 -0500 X-MC-Unique: 5VQhx3J0PUGYCSKJ_C8OoQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39CC0FC80; Fri, 25 Feb 2022 18:23:15 +0000 (UTC) Received: from starship (unknown [10.40.195.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4021786C33; Fri, 25 Feb 2022 18:22:53 +0000 (UTC) Message-ID: Subject: Re: [PATCH 2/4] KVM: x86: hyper-v: Drop redundant 'ex' parameter from kvm_hv_flush_tlb() From: Maxim Levitsky To: Vitaly Kuznetsov , kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Siddharth Chandrasekaran , linux-kernel@vger.kernel.org Date: Fri, 25 Feb 2022 20:22:52 +0200 In-Reply-To: <20220222154642.684285-3-vkuznets@redhat.com> References: <20220222154642.684285-1-vkuznets@redhat.com> <20220222154642.684285-3-vkuznets@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-02-22 at 16:46 +0100, Vitaly Kuznetsov wrote: > 'struct kvm_hv_hcall' has all the required information already, > there's no need to pass 'ex' additionally. > > No functional change intended. > > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/kvm/hyperv.c | 23 ++++++----------------- > 1 file changed, 6 insertions(+), 17 deletions(-) > > diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c > index 15b6a7bd2346..714af3b94f31 100644 > --- a/arch/x86/kvm/hyperv.c > +++ b/arch/x86/kvm/hyperv.c > @@ -1750,7 +1750,7 @@ struct kvm_hv_hcall { > sse128_t xmm[HV_HYPERCALL_MAX_XMM_REGISTERS]; > }; > > -static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool ex) > +static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc) > { > int i; > gpa_t gpa; > @@ -1765,7 +1765,8 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool > int sparse_banks_len; > bool all_cpus; > > - if (!ex) { > + if (hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST || > + hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE) { > if (hc->fast) { > flush.address_space = hc->ingpa; > flush.flags = hc->outgpa; > @@ -2247,32 +2248,20 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) > kvm_hv_hypercall_complete_userspace; > return 0; > case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST: > - if (unlikely(!hc.rep_cnt || hc.rep_idx)) { > - ret = HV_STATUS_INVALID_HYPERCALL_INPUT; > - break; > - } > - ret = kvm_hv_flush_tlb(vcpu, &hc, false); > - break; > - case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: > - if (unlikely(hc.rep)) { > - ret = HV_STATUS_INVALID_HYPERCALL_INPUT; > - break; > - } > - ret = kvm_hv_flush_tlb(vcpu, &hc, false); > - break; > case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX: > if (unlikely(!hc.rep_cnt || hc.rep_idx)) { > ret = HV_STATUS_INVALID_HYPERCALL_INPUT; > break; > } > - ret = kvm_hv_flush_tlb(vcpu, &hc, true); > + ret = kvm_hv_flush_tlb(vcpu, &hc); > break; > + case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE: > case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX: > if (unlikely(hc.rep)) { > ret = HV_STATUS_INVALID_HYPERCALL_INPUT; > break; > } > - ret = kvm_hv_flush_tlb(vcpu, &hc, true); > + ret = kvm_hv_flush_tlb(vcpu, &hc); > break; > case HVCALL_SEND_IPI: > if (unlikely(hc.rep)) { Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky