Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3644009pxb; Wed, 13 Oct 2021 09:59:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf7oNG9bfGSmBBiZC1t4EwDtji5jqI4bDp6kOR8qVZkl5/Q4H1tCkrWeb23LMvmKkLblWm X-Received: by 2002:a05:6402:694:: with SMTP id f20mr786014edy.100.1634144378314; Wed, 13 Oct 2021 09:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634144378; cv=none; d=google.com; s=arc-20160816; b=gAKLgil6hAq3YyxFWLjhUagpkpFWZwrA5b6u+9PiGGzEXAN7+4aGBimwtWKtMLTD90 j6e764BMZPopez70oENbxEL+S/kB231xA4H9hnVxrfSfkEgbWrGPDXLrnXt2OsNYFmRJ jc34piCKUZi1pqFogzjrT94GdTz3a2SDVpxa+xitTt8CGqUo2PndtXYiI56lLR2OZVM+ sk816Mnm2QhDsdX9HgaKNHlyXErn+F4uOo3Klkdn2czRJ2PG18W0kOPt8xalVjs7J3J8 SlU8xAMu/4xM/dAkPm3T7yxRBohN2fvme3JTFnmB+i00N2AjzZ1AwYIFeLsTXjrNU3xB gzLw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H1uFuI95xCbXZqroGKfU5sZPjH+dwkNh8g0Jei6O968=; b=jQ3jR56IOeGFMOuP+zYUP91D1sDIUqvJ2NDd6472cKoRGLge4WXb1R4QRY2/MRPN5Y h5N7R7869N7wSBiD08raSSngwmWmz1IE8avYX8bynqdBVNCf5WqZ1SnROHYrCihaCfRC bVuakQkgh31ED3KjoZWiUoIFkaThrbU1reoOFitKTsDccg4qk7XOusWFZ2OuDvzWmdrC o917IokW9/DvcI1ohlGlwpGhf0nirmNth79fzWC3Z+0wJ6pryHFDKiO6sGwI0jzbdp5y o5OVRi8WO1sxvNEHDHkLLiEtZoHi5/NFRdCGaCHY76fZKFGb/8q1bpAPtuxT1yaE4PBL yo9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d32RY2Q+; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c19si59251edj.149.2021.10.13.09.59.14; Wed, 13 Oct 2021 09:59:38 -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=@redhat.com header.s=mimecast20190719 header.b=d32RY2Q+; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238122AbhJMQ6s (ORCPT + 99 others); Wed, 13 Oct 2021 12:58:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59633 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237893AbhJMQ6b (ORCPT ); Wed, 13 Oct 2021 12:58:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634144187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H1uFuI95xCbXZqroGKfU5sZPjH+dwkNh8g0Jei6O968=; b=d32RY2Q+1my3/851i3qXTe46p9CtuMivr3JMrJuN4f9sJ+xPwXTSFbrPeABNZRDOfisAmo ryUBwzCPcz4XrCuCsPJEXYI2HwgyDyP6mAVgSACgHXO/cCYetxZXss5J+7+TXh5LqDtNuY SahQ1BVgCG9/kCADienLyM7KPMoRtBg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-14-D6l_WEy4O0KOr3iDjXSYLQ-1; Wed, 13 Oct 2021 12:56:22 -0400 X-MC-Unique: D6l_WEy4O0KOr3iDjXSYLQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A73D80365C; Wed, 13 Oct 2021 16:56:21 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B19B15DA60; Wed, 13 Oct 2021 16:56:20 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: fwilhelm@google.com, seanjc@google.com, oupton@google.com, stable@vger.kernel.org Subject: [PATCH 6/8] KVM: x86: remove unnecessary arguments from complete_emulator_pio_in Date: Wed, 13 Oct 2021 12:56:14 -0400 Message-Id: <20211013165616.19846-7-pbonzini@redhat.com> In-Reply-To: <20211013165616.19846-1-pbonzini@redhat.com> References: <20211013165616.19846-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Paolo Bonzini --- arch/x86/kvm/x86.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 07d9533b471d..ef4d6a0de4d8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6935,11 +6935,12 @@ static int __emulator_pio_in(struct kvm_vcpu *vcpu, int size, 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) { + int size = vcpu->arch.pio.size; 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); + trace_kvm_pio(KVM_PIO_IN, vcpu->arch.pio.port, size, + vcpu->arch.pio.count, vcpu->arch.pio_data); vcpu->arch.pio.count = 0; } @@ -6950,7 +6951,7 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size, return 0; WARN_ON(count != vcpu->arch.pio.count); - complete_emulator_pio_in(vcpu, size, port, val); + complete_emulator_pio_in(vcpu, val); return 1; } -- 2.27.0