Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2377443pxu; Mon, 14 Dec 2020 00:15:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJymgcfMbpqOZ7wlH6+K2wMjqsMtLcS6RipPeseUCpDn8oLM/BWYZnJfzYmBNbMt6d+1fXf6 X-Received: by 2002:a50:e0c9:: with SMTP id j9mr23586995edl.380.1607933710513; Mon, 14 Dec 2020 00:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607933710; cv=none; d=google.com; s=arc-20160816; b=ggQBArUA7QLFd2/wpXkR6Lci7/ZHvwLflqFI5qZhtZ1MR1JSYBY8fuKFXARpyegEe/ AZQW0VT3l2US8S6OQqOxNFrA06Xghr6eAnFByTlsx7mqt+OwKwcWuoZm1mbDKZ3IuXLO C54s0xH+PLzeDbWjx44Dr8em9nV2FSRsUZVnirtDopgENL0PZ0GVHkVGbFvgtN2DGdO+ 0/i6KHxKeE5RWhHviwJCHsALtSphqwS+9kQxkV5Zm5AYsr1Qsfk2g/MyEusg8Cmm2lTM YyqDjRwRJv5cn46G02/1G8vccZd8KLCixUYK2rWRVS3pdKwf6CoA0zwqszW3nbkFiXf+ 9Odg== 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=NlbOv5ii6grQlFjgIBY+uOK3pf0pS/ezgT4J4s7SvgU=; b=r4oFHjtZ4zlKAoZmuBLq/jMnS/Ismh4UaBz8+2O2nqYz2qLJtWakxi2B13MG88NBTf UtBiIZojx8BMARJkmIRLNC30ZNpB2IaILuncjR/QAEOA+wl2cjVB0ROuS84sq+YuY+xw C1B6dznWC1OBntDhMFWqbQI2FIkSF8jCQ/EtQ/IWXk9LLVdjE2gFxaRPgcu83OKw907Z lRKLySCpUt59ANHm6K0StDr4j5zYOjL+TUH8rtLeXwRL2CpsMYGS8J9U7tdOchcl6vcC pDv1StM5rIvd2kCFCHiBHDkDF7aZonBZBPv/Hzpf/2JLSQWI15DrrRNFcSk70kX0sf+N 2gHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gwHB8pmr; 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 no7si9061249ejb.586.2020.12.14.00.14.48; Mon, 14 Dec 2020 00:15:10 -0800 (PST) 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=gwHB8pmr; 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 S2407763AbgLLSzY (ORCPT + 99 others); Sat, 12 Dec 2020 13:55:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27766 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407762AbgLLSwX (ORCPT ); Sat, 12 Dec 2020 13:52:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607799057; 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=NlbOv5ii6grQlFjgIBY+uOK3pf0pS/ezgT4J4s7SvgU=; b=gwHB8pmrvj9YDNwZkbtBbkMZJ53z9oSWeuN/dbmqnenFBl1Do4gOTwd0dnYWZlTFl+rVat qPn5d+hVoyYdJfubpeVc+fLxYGrPvdvbPSJMRsZAtN8cha/lUHsoeNG+NDHbgs2yY2g2EQ 9FZaALo/xWzdKz4WWnjFfecRbTrE49U= 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-109-8mLKiPbROjeUz8Ab6OySaQ-1; Sat, 12 Dec 2020 13:50:55 -0500 X-MC-Unique: 8mLKiPbROjeUz8Ab6OySaQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF599107ACE3; Sat, 12 Dec 2020 18:50:53 +0000 (UTC) Received: from laptop.redhat.com (ovpn-115-41.ams2.redhat.com [10.36.115.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFA9F1F069; Sat, 12 Dec 2020 18:50:48 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, maz@kernel.org, drjones@redhat.com Cc: alexandru.elisei@arm.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, shuah@kernel.org, pbonzini@redhat.com Subject: [PATCH 7/9] KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write] Date: Sat, 12 Dec 2020 19:50:08 +0100 Message-Id: <20201212185010.26579-8-eric.auger@redhat.com> In-Reply-To: <20201212185010.26579-1-eric.auger@redhat.com> References: <20201212185010.26579-1-eric.auger@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of converting the vgic_io_device handle to a kvm_io_device handled and then do the oppositive, pass a vgic_io_device pointer all along the call chain. Signed-off-by: Eric Auger --- arch/arm64/kvm/vgic/vgic-mmio.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic-mmio.c b/arch/arm64/kvm/vgic/vgic-mmio.c index b2d73fc0d1ef..48c6067fc5ec 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio.c +++ b/arch/arm64/kvm/vgic/vgic-mmio.c @@ -938,10 +938,9 @@ vgic_get_mmio_region(struct kvm_vcpu *vcpu, struct vgic_io_device *iodev, return region; } -static int vgic_uaccess_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, +static int vgic_uaccess_read(struct kvm_vcpu *vcpu, struct vgic_io_device *iodev, gpa_t addr, u32 *val) { - struct vgic_io_device *iodev = kvm_to_vgic_iodev(dev); const struct vgic_register_region *region; struct kvm_vcpu *r_vcpu; @@ -960,10 +959,9 @@ static int vgic_uaccess_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, return 0; } -static int vgic_uaccess_write(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, +static int vgic_uaccess_write(struct kvm_vcpu *vcpu, struct vgic_io_device *iodev, gpa_t addr, const u32 *val) { - struct vgic_io_device *iodev = kvm_to_vgic_iodev(dev); const struct vgic_register_region *region; struct kvm_vcpu *r_vcpu; @@ -986,9 +984,9 @@ int vgic_uaccess(struct kvm_vcpu *vcpu, struct vgic_io_device *dev, bool is_write, int offset, u32 *val) { if (is_write) - return vgic_uaccess_write(vcpu, &dev->dev, offset, val); + return vgic_uaccess_write(vcpu, dev, offset, val); else - return vgic_uaccess_read(vcpu, &dev->dev, offset, val); + return vgic_uaccess_read(vcpu, dev, offset, val); } static int dispatch_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, -- 2.21.3