Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp735588pxb; Mon, 25 Oct 2021 17:46:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtG17BAbLb/OF9vMsqWMRkUKY6RKhJ7Pcql4jdqnMTGKLRMgWpLAS8BQynOiyyF+XOXLOn X-Received: by 2002:a65:6a4b:: with SMTP id o11mr15903323pgu.278.1635209190487; Mon, 25 Oct 2021 17:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635209190; cv=none; d=google.com; s=arc-20160816; b=xrrKC5FW8ZUjCzHm3xj1KBaZlrkXT6VJgWIyqEESfzRPZ5h+nliibK9rwjaz3NXFaZ LqYsrkH0y2BsKcQ3ixBEtXkC0VQjWpcU1MEzKXs28I1sWbuK3jxutJrh8IiiE8hmnJgz 64ymrGv7Dgr/QUKc1vo9Y/+xAuC4g+w8PncqFb8A7rTB6t95TzSv525EyvDMtfUqdwWm ZZTylfWzhdL51KZpDfRauPryJ8zSf5vlsbzrzK6YWqwuOQfts33Keoippg9rJoaQoCI1 63InZwWhtdBazJh19Pl401ncR6QFwIapobSBgT0Y3s7u361D2lEQWQuE3Xz5VQPHayTj 6TvA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=bXAvp7QpdDv3aNtHZM1e7PUxc4tHwLNwyfh/FWeQJ+o=; b=kSjIUZDKFLZiWUbRGcHfqh0DqSqa1Tv7gVdp3SnJpeeu1K6+T7mpPcN89GroEJz1gm rz15/RPDpW6wg9qJOtUxDUIwMuDGkpb/GT6PTLW99w7nWzTqoi4sz+ddMa6rjy3B8mb6 AYVKQvtXDdMLJ6hp8QISqQQU4b9HcM0kKHJJm98h5/kMLPIauLaArIMNA7CLXTt4hvkN jWMysfo5cfaJ62px8RoHeX7EZfIfg1mPH8FGs3UDJyQluBXZpuEi51EdFWS8sOaO2oSq vchXbrCxh0UPgywnf4qmV7vpRh8ooCcY/7aIDUlknH8KiFcmvVKEUHU6fRf7TVYZZ5lN DXjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jFTAu23j; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si11886032pfc.84.2021.10.25.17.46.18; Mon, 25 Oct 2021 17:46:30 -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=@linuxfoundation.org header.s=korg header.b=jFTAu23j; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237729AbhJYT4N (ORCPT + 99 others); Mon, 25 Oct 2021 15:56:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237218AbhJYTvA (ORCPT ); Mon, 25 Oct 2021 15:51:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C98A66115B; Mon, 25 Oct 2021 19:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635190975; bh=x7FdPGNgdlQfZVlHo+wv44F7iyvy7qD7oVU94eQ3Bmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFTAu23jz8/nddCLyY0FzIiNdIQKD3umwpYE1CMM6gX6UiRUnRsWYL6FIbAisbDo3 8g4Y/YjJtdsRbhaiZrKNRN5kz4AkeCqWY+bLIjK56pd+PtjkS784qXGiyGelMFxUfy bFGFwKUIc1Yg4E/iuO8t/nkCL8BHBJbX6Fw2aqpw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Levitsky , Paolo Bonzini Subject: [PATCH 5.14 115/169] KVM: x86: remove unnecessary arguments from complete_emulator_pio_in Date: Mon, 25 Oct 2021 21:14:56 +0200 Message-Id: <20211025191032.536826293@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025191017.756020307@linuxfoundation.org> References: <20211025191017.756020307@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Bonzini commit 6b5efc930bbc8c97e4a1fe2ccb9a6f286365a56d upstream. complete_emulator_pio_in can expect that vcpu->arch.pio has been filled in, and therefore does not need the size and count arguments. This makes things nicer when the function is called directly from a complete_userspace_io callback. No functional change intended. Cc: stable@vger.kernel.org Fixes: 7ed9abfe8e9f ("KVM: SVM: Support string IO operations for an SEV-ES guest") Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6936,11 +6936,12 @@ static int __emulator_pio_in(struct kvm_ return emulator_pio_in_out(vcpu, size, port, count, true); } -static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, int size, - unsigned short port, void *val) +static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, void *val) { - memcpy(val, vcpu->arch.pio_data, size * vcpu->arch.pio.count); - trace_kvm_pio(KVM_PIO_IN, port, size, vcpu->arch.pio.count, vcpu->arch.pio_data); + int size = vcpu->arch.pio.size; + unsigned count = vcpu->arch.pio.count; + memcpy(val, vcpu->arch.pio_data, size * count); + trace_kvm_pio(KVM_PIO_IN, vcpu->arch.pio.port, size, count, vcpu->arch.pio_data); vcpu->arch.pio.count = 0; } @@ -6958,7 +6959,7 @@ static int emulator_pio_in(struct kvm_vc } WARN_ON(count != vcpu->arch.pio.count); - complete_emulator_pio_in(vcpu, size, port, val); + complete_emulator_pio_in(vcpu, val); return 1; }