From: Wei Huang <wei@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
christoffer.dall@linaro.org, marc.zyngier@arm.com,
hanjun.guo@linaro.org, a.spyridakis@virtualopensystems.com
Subject: Re: [PATCH V1 4/5] kvm: arm64: Implement ACPI probing code for GICv2
Date: Fri, 29 May 2015 09:34:43 -0500 [thread overview]
Message-ID: <55687903.9090205@redhat.com> (raw)
In-Reply-To: <20150529140658.GC2749@localhost.localdomain>
On 05/29/2015 09:06 AM, Andrew Jones wrote:
> On Thu, May 28, 2015 at 01:34:33AM -0400, Wei Huang wrote:
>> This patches enables ACPI support for KVM virtual GICv2. KVM parses
>> ACPI table for virt GIC related information and initializes resources.
>>
>> Signed-off-by: Alexander Spyridaki <a.spyridakis@virtualopensystems.com>
>> Signed-off-by: Wei Huang <wei@redhat.com>
>> ---
>> virt/kvm/arm/vgic-v2.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 48 insertions(+), 1 deletion(-)
>>
>> diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c
>> index 711de82..01ce8a3 100644
>> --- a/virt/kvm/arm/vgic-v2.c
>> +++ b/virt/kvm/arm/vgic-v2.c
>> @@ -264,6 +264,53 @@ int vgic_v2_acpi_probe(struct acpi_madt_generic_interrupt *vgic_acpi,
>> const struct vgic_ops **ops,
>> const struct vgic_params **params)
>> {
>> - return -EINVAL;
>> + struct vgic_params *vgic = &vgic_v2_params;
>> + int irq_mode, ret;
>> +
>> + /* IRQ trigger mode */
>> + irq_mode = (vgic_acpi->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
>> + ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
>> + vgic->maint_irq = acpi_register_gsi(NULL, vgic_acpi->vgic_interrupt,
>> + irq_mode, ACPI_ACTIVE_HIGH);
>> + if (!vgic->maint_irq) {
>> + kvm_err("Cannot register VGIC ACPI maintenance irq\n");
>> + ret = -ENXIO;
>> + goto out;
>> + }
>> +
>> + /* GICH resource */
>> + vgic->vctrl_base = ioremap(vgic_acpi->gich_base_address, SZ_8K);
>> + if (!vgic->vctrl_base) {
>> + kvm_err("cannot ioremap GICH memory\n");
>> + ret = -ENOMEM;
>> + goto out;
>> + }
>> +
>> + vgic->nr_lr = readl_relaxed(vgic->vctrl_base + GICH_VTR);
>> + vgic->nr_lr = (vgic->nr_lr & 0x3f) + 1;
>> +
>> + ret = create_hyp_io_mappings(vgic->vctrl_base,
>> + vgic->vctrl_base + SZ_8K,
>> + vgic_acpi->gich_base_address);
>> + if (ret) {
>> + kvm_err("Cannot map GICH into hyp\n");
>> + goto out;
>> + }
>> +
>> + vgic->vcpu_base = vgic_acpi->gicv_base_address;
>> + vgic->can_emulate_gicv2 = true;
>> + kvm_register_device_ops(&kvm_arm_vgic_v2_ops, KVM_DEV_TYPE_ARM_VGIC_V2);
>> +
>> + kvm_info("GICH base=0x%llx, GICV base=0x%llx, IRQ=%d\n",
>> + (unsigned long long)vgic_acpi->gich_base_address,
>> + (unsigned long long)vgic_acpi->gicv_base_address,
>> + vgic->maint_irq);
>> +
>> + vgic->type = VGIC_V2;
>
> we're missing max_gic_vcpus here
>
> vgic->max_gic_vcpus = VGIC_V2_MAX_CPUS;
Yes. Will fix in the next spin.
-Wei
>
>> + *ops = &vgic_v2_ops;
>> + *params = vgic;
>> +
>> +out:
>> + return ret;
>> }
>> #endif /* CONFIG_ACPI */
>> --
>> 1.8.3.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-05-29 14:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 5:34 [PATCH V1 0/5] Enable ACPI support for KVM ARM Wei Huang
2015-05-28 5:34 ` [PATCH V1 1/5] kvm: arm64: Enable ACPI support for virt arch timer Wei Huang
2015-05-28 5:34 ` [PATCH V1 2/5] kvm: arm64: Dispatch virt GIC probing to device tree and ACPI Wei Huang
2015-05-28 5:34 ` [PATCH V1 3/5] kvm: arm64: Detect GIC version for proper ACPI vGIC probing Wei Huang
2015-05-28 5:34 ` [PATCH V1 4/5] kvm: arm64: Implement ACPI probing code for GICv2 Wei Huang
2015-05-29 14:06 ` Andrew Jones
2015-05-29 14:34 ` Wei Huang [this message]
2015-05-28 5:34 ` [PATCH V1 5/5] kvm: arm64: Implement ACPI probing code for GICv3 Wei Huang
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=55687903.9090205@redhat.com \
--to=wei@redhat.com \
--cc=a.spyridakis@virtualopensystems.com \
--cc=christoffer.dall@linaro.org \
--cc=drjones@redhat.com \
--cc=hanjun.guo@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=marc.zyngier@arm.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).