From: Christoffer Dall <christoffer.dall@linaro.org> To: Vijay Kilari <vijay.kilari@gmail.com> Cc: Marc Zyngier <marc.zyngier@arm.com>, Vijaya Kumar K <Vijaya.Kumar@cavium.com>, kvmarm@lists.cs.columbia.edu, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> Subject: Re: [RFC PATCH v3 5/5] arm/arm64: vgic-new: Implement KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO ioctl Date: Tue, 6 Sep 2016 21:20:32 +0200 [thread overview] Message-ID: <20160906192032.GN23592@cbox> (raw) In-Reply-To: <CALicx6scWWykb9Zc45gVkKDo71nVMDRGoa0vo54xDC2FoLJZRg@mail.gmail.com> On Tue, Sep 06, 2016 at 07:42:19PM +0530, Vijay Kilari wrote: > On Tue, Aug 30, 2016 at 7:30 PM, Christoffer Dall > <christoffer.dall@linaro.org> wrote: > > > > On Wed, Aug 24, 2016 at 04:50:09PM +0530, vijay.kilari@gmail.com wrote: > > > From: Vijaya Kumar K <Vijaya.Kumar@cavium.com> > > > } > > > diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c > > > index 61abea0..fde1472 100644 > > > --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c > > > +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c > > > @@ -789,3 +789,22 @@ int vgic_v3_redist_uaccess(struct kvm_vcpu *vcpu, bool is_write, > > > > > > return vgic_v3_uaccess(vcpu, dev, is_write, offset, val); > > > } > > > + > > > +int vgic_v3_line_level_info_uaccess(struct kvm_vcpu *vcpu, bool is_write, > > > + u32 intid, u32 *val) > > > +{ > > > + unsigned int len = 4; > > > + u8 buf[4]; > > > + int ret; > > > + > > > + if (is_write) { > > > + vgic_data_host_to_mmio_bus(buf, len, *val); > > > > why do you involve the mmio bus in this? > > This is doing LE conversion. This is being done by vgic_uaccess function. > IRC, This sys register access in not following vgic_uaccess path. Hence > added it here. See my e-mail on the other patch. I think this is all just legacy from the time where we didn't distinguish between uaccess and mmio dispatches. > > > > > > > + ret = vgic_write_irq_line_level_info(vcpu, intid, len, buf); > > > + } else { > > > + ret = vgic_read_irq_line_level_info(vcpu, intid, len, buf); > > > + if (!ret) > > > + *val = vgic_data_mmio_bus_to_host(buf, len); > > > + } > > > + > > > + return ret; > > > +} > > > diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c > > > index 38f2c75..74d0449 100644 > > > --- a/virt/kvm/arm/vgic/vgic-mmio.c > > > +++ b/virt/kvm/arm/vgic/vgic-mmio.c > > > @@ -391,6 +391,40 @@ void vgic_mmio_write_config(struct kvm_vcpu *vcpu, > > > } > > > } > > > > > > +int vgic_read_irq_line_level_info(struct kvm_vcpu *vcpu, u32 intid, > > > + unsigned int len, void *val) > > > +{ > > > + unsigned long data = 0; > > > + int i; > > > + > > > + for (i = 0; i < len * 8; i++) { > > > + struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); > > > + > > > + if (irq->line_level) > > > + data |= (1U << i); > > > + } > > > + vgic_data_host_to_mmio_bus(val, len, data); > > > > why??? > > Same as above reason > > > > > > > + > > > + return 0; > > > +} > > > + > > > +int vgic_write_irq_line_level_info(struct kvm_vcpu *vcpu, u32 intid, > > > + unsigned int len, const void *val) > > > +{ > > > + int i; > > > + unsigned long data = vgic_data_mmio_bus_to_host(val, len); > > > > why??? > > Same as above reason Thanks, -Christoffer
WARNING: multiple messages have this Message-ID (diff)
From: christoffer.dall@linaro.org (Christoffer Dall) To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v3 5/5] arm/arm64: vgic-new: Implement KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO ioctl Date: Tue, 6 Sep 2016 21:20:32 +0200 [thread overview] Message-ID: <20160906192032.GN23592@cbox> (raw) In-Reply-To: <CALicx6scWWykb9Zc45gVkKDo71nVMDRGoa0vo54xDC2FoLJZRg@mail.gmail.com> On Tue, Sep 06, 2016 at 07:42:19PM +0530, Vijay Kilari wrote: > On Tue, Aug 30, 2016 at 7:30 PM, Christoffer Dall > <christoffer.dall@linaro.org> wrote: > > > > On Wed, Aug 24, 2016 at 04:50:09PM +0530, vijay.kilari at gmail.com wrote: > > > From: Vijaya Kumar K <Vijaya.Kumar@cavium.com> > > > } > > > diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c > > > index 61abea0..fde1472 100644 > > > --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c > > > +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c > > > @@ -789,3 +789,22 @@ int vgic_v3_redist_uaccess(struct kvm_vcpu *vcpu, bool is_write, > > > > > > return vgic_v3_uaccess(vcpu, dev, is_write, offset, val); > > > } > > > + > > > +int vgic_v3_line_level_info_uaccess(struct kvm_vcpu *vcpu, bool is_write, > > > + u32 intid, u32 *val) > > > +{ > > > + unsigned int len = 4; > > > + u8 buf[4]; > > > + int ret; > > > + > > > + if (is_write) { > > > + vgic_data_host_to_mmio_bus(buf, len, *val); > > > > why do you involve the mmio bus in this? > > This is doing LE conversion. This is being done by vgic_uaccess function. > IRC, This sys register access in not following vgic_uaccess path. Hence > added it here. See my e-mail on the other patch. I think this is all just legacy from the time where we didn't distinguish between uaccess and mmio dispatches. > > > > > > > + ret = vgic_write_irq_line_level_info(vcpu, intid, len, buf); > > > + } else { > > > + ret = vgic_read_irq_line_level_info(vcpu, intid, len, buf); > > > + if (!ret) > > > + *val = vgic_data_mmio_bus_to_host(buf, len); > > > + } > > > + > > > + return ret; > > > +} > > > diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c > > > index 38f2c75..74d0449 100644 > > > --- a/virt/kvm/arm/vgic/vgic-mmio.c > > > +++ b/virt/kvm/arm/vgic/vgic-mmio.c > > > @@ -391,6 +391,40 @@ void vgic_mmio_write_config(struct kvm_vcpu *vcpu, > > > } > > > } > > > > > > +int vgic_read_irq_line_level_info(struct kvm_vcpu *vcpu, u32 intid, > > > + unsigned int len, void *val) > > > +{ > > > + unsigned long data = 0; > > > + int i; > > > + > > > + for (i = 0; i < len * 8; i++) { > > > + struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); > > > + > > > + if (irq->line_level) > > > + data |= (1U << i); > > > + } > > > + vgic_data_host_to_mmio_bus(val, len, data); > > > > why??? > > Same as above reason > > > > > > > + > > > + return 0; > > > +} > > > + > > > +int vgic_write_irq_line_level_info(struct kvm_vcpu *vcpu, u32 intid, > > > + unsigned int len, const void *val) > > > +{ > > > + int i; > > > + unsigned long data = vgic_data_mmio_bus_to_host(val, len); > > > > why??? > > Same as above reason Thanks, -Christoffer
next prev parent reply other threads:[~2016-09-06 19:09 UTC|newest] Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-08-24 11:20 [RFC PATCH v3 0/5] arm/arm64: vgic-new: Implement API for vGICv3 live migration vijay.kilari 2016-08-24 11:20 ` vijay.kilari at gmail.com 2016-08-24 11:20 ` [RFC PATCH v3 1/5] arm/arm64: vgic-new: Implement support for userspace access vijay.kilari 2016-08-24 11:20 ` vijay.kilari at gmail.com 2016-08-30 10:31 ` Christoffer Dall 2016-08-30 10:31 ` Christoffer Dall 2016-08-30 10:49 ` Christoffer Dall 2016-08-30 10:49 ` Christoffer Dall 2016-08-30 10:50 ` Christoffer Dall 2016-08-30 10:50 ` Christoffer Dall 2016-08-24 11:20 ` [RFC PATCH v3 2/5] arm/arm64: vgic-new: Add distributor and redistributor access vijay.kilari 2016-08-24 11:20 ` vijay.kilari at gmail.com 2016-08-30 12:31 ` Christoffer Dall 2016-08-30 12:31 ` Christoffer Dall 2016-09-06 13:47 ` Vijay Kilari 2016-09-06 14:14 ` Vijay Kilari 2016-09-06 14:14 ` Vijay Kilari 2016-09-06 17:09 ` Christoffer Dall 2016-09-06 17:09 ` Christoffer Dall 2016-08-24 11:20 ` [RFC PATCH v3 3/5] arm/arm64: vgic-new: Introduce find_reg_by_id() vijay.kilari 2016-08-24 11:20 ` vijay.kilari at gmail.com 2016-08-30 12:41 ` Christoffer Dall 2016-08-30 12:41 ` Christoffer Dall 2016-08-24 11:20 ` [RFC PATCH v3 4/5] arm/arm64: vgic-new: Implement VGICv3 CPU interface access vijay.kilari 2016-08-24 11:20 ` vijay.kilari at gmail.com 2016-08-30 13:45 ` Christoffer Dall 2016-08-30 13:45 ` Christoffer Dall 2016-09-06 13:48 ` Vijay Kilari 2016-09-06 14:13 ` Vijay Kilari 2016-09-06 14:13 ` Vijay Kilari 2016-09-06 19:19 ` Christoffer Dall 2016-09-06 19:19 ` Christoffer Dall 2016-09-07 13:49 ` Vijay Kilari 2016-09-07 13:49 ` Vijay Kilari 2016-09-07 14:15 ` Christoffer Dall 2016-09-07 14:15 ` Christoffer Dall 2016-09-06 17:10 ` Christoffer Dall 2016-09-06 17:10 ` Christoffer Dall 2016-08-24 11:20 ` [RFC PATCH v3 5/5] arm/arm64: vgic-new: Implement KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO ioctl vijay.kilari 2016-08-24 11:20 ` vijay.kilari at gmail.com 2016-08-30 14:00 ` Christoffer Dall 2016-08-30 14:00 ` Christoffer Dall 2016-08-30 14:07 ` Christoffer Dall 2016-08-30 14:07 ` Christoffer Dall 2016-09-06 14:12 ` Vijay Kilari 2016-09-06 14:12 ` Vijay Kilari 2016-09-06 19:20 ` Christoffer Dall [this message] 2016-09-06 19:20 ` Christoffer Dall
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20160906192032.GN23592@cbox \ --to=christoffer.dall@linaro.org \ --cc=Vijaya.Kumar@cavium.com \ --cc=kvmarm@lists.cs.columbia.edu \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=marc.zyngier@arm.com \ --cc=vijay.kilari@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.