Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3175490pxb; Tue, 12 Jan 2021 08:06:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfSvjheUG1RFRc2kuZIkazNLuffgFrGkljjQQ2jhbiNrx3q2hbhVEwYAHJGmua9LS5a409 X-Received: by 2002:a17:906:1f8e:: with SMTP id t14mr3745227ejr.350.1610467616450; Tue, 12 Jan 2021 08:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610467616; cv=none; d=google.com; s=arc-20160816; b=GbIJfyzpIzfeyV89Q14FzEN3zW6Ss6/41W2fCcUyy/WClEw0I7nStGeJS2C4jnPozF W9xQ6YN+zu/eVK85vr8U8AfriY2olKDMV5pZ0LIj96/oCC2bvRGEmOUtEo3NXIksTIAT 22sjMqF9NnbQOJLIykSzpZzyfOmhIfsMS7qf+TEsDsQlofqQVfuFim2Acrh/F6rv3kq7 PG4FvDktdm5fh5fouzaQrnRgmaFti8oGRZEVN0AMhY33CCiiSVJVIqGvv8YOJhuoUDSS Z2X+blc0dIVHIkiycmaHARYUVb5aP5jN3J//qiSjYiufoqHGRpbfrwRNTptS0+rkPp1u dgiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=D02UtUZOOttTKFCRNF1JraNzRd1LsEVJsKRiozop/kU=; b=j6cl2Sw2rb9A/jUq/wbpm9SzTTUQTbEjgiq+U93EXDR9XYOq2VHga1xc2dLLdZx2jk Y8FH5fj738mrwEZVgh59Rtu1U+RtfqztONCwMbew6vIULEG3K/68PS02cvNtea888COy Sd2UTnlM/UAVwba4TSs1oU3biKpACDRZXccnCIU/QiOAj3ct/3vKS/vvfhP0IdDQqhh/ Bj+lPSQfQ75Asn9CwUJRDtO4qyNZAhy/JVBBjBZzZTGYDlu/AkfeLB7KqNlH5sIdy0UA Ll5LvxeDAjMX0Tfs2qu5azVRRSgosSVwGo6LVV20luqMRha66DVvH6yWLhV1yw7oRknz StEw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si1300771ejv.36.2021.01.12.08.06.32; Tue, 12 Jan 2021 08:06:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392192AbhALQFF (ORCPT + 99 others); Tue, 12 Jan 2021 11:05:05 -0500 Received: from foss.arm.com ([217.140.110.172]:48980 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392027AbhALQFF (ORCPT ); Tue, 12 Jan 2021 11:05:05 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A1DD51FB; Tue, 12 Jan 2021 08:04:19 -0800 (PST) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29ADD3F719; Tue, 12 Jan 2021 08:04:18 -0800 (PST) Subject: Re: [PATCH 7/9] KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write] To: Eric Auger , eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, maz@kernel.org, drjones@redhat.com Cc: james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, shuah@kernel.org, pbonzini@redhat.com References: <20201212185010.26579-1-eric.auger@redhat.com> <20201212185010.26579-8-eric.auger@redhat.com> From: Alexandru Elisei Message-ID: Date: Tue, 12 Jan 2021 16:04:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201212185010.26579-8-eric.auger@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, On 12/12/20 6:50 PM, Eric Auger wrote: > 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. To me, it looks like the commit message describes what the patch does instead of why it does it. What are "vgic_io_device handle" and "kvm_io_device handled"? Thanks, Alex > > 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,