linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vladimir.murzin@arm.com (Vladimir Murzin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 32/54] KVM: arm/arm64: vgic-new: Add GICv3 MMIO handling framework
Date: Fri, 29 Apr 2016 15:22:51 +0100	[thread overview]
Message-ID: <57236E3B.2000501@arm.com> (raw)
In-Reply-To: <572369F0.20704@arm.com>

On 29/04/16 15:04, Vladimir Murzin wrote:
> Hi Andre,
> 
> On 28/04/16 17:45, Andre Przywara wrote:
>> +int vgic_register_redist_iodevs(struct kvm *kvm, gpa_t redist_base_address)
>> +{
>> +	int nr_vcpus = atomic_read(&kvm->online_vcpus);
>> +	struct kvm_vcpu *vcpu;
>> +	struct vgic_io_device *devices, *device;
>> +	int c, ret = 0;
>> +
>> +	devices = kmalloc(sizeof(struct vgic_io_device) * nr_vcpus * 2,
>> +			  GFP_KERNEL);
>> +	if (!devices)
>> +		return -ENOMEM;
>> +
>> +	device = devices;
>> +	kvm_for_each_vcpu(c, vcpu, kvm) {
>> +		kvm_iodevice_init(&device->dev, &kvm_io_gic_ops);
>> +		device->base_addr = redist_base_address;
>> +		device->regions = vgic_v3_redist_registers;
>> +		device->nr_regions = ARRAY_SIZE(vgic_v3_redist_registers);
>> +		device->redist_vcpu = vcpu;
>> +
>> +		mutex_lock(&kvm->slots_lock);
>> +		ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS,
>> +					      redist_base_address,
>> +					      SZ_64K, &device->dev);
>> +		mutex_unlock(&kvm->slots_lock);
>> +
>> +		if (ret)
>> +			break;
>> +
>> +		device++;
>> +		kvm_iodevice_init(&device->dev, &kvm_io_gic_ops);
>> +		device->base_addr = redist_base_address + SZ_64K;
>> +		device->regions = vgic_v3_private_registers;
>> +		device->nr_regions = ARRAY_SIZE(vgic_v3_private_registers);
>> +		device->redist_vcpu = vcpu;
>> +
>> +		mutex_lock(&kvm->slots_lock);
>> +		ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS,
>> +					      redist_base_address + SZ_64K,
>> +					      SZ_64K, &device->dev);
>> +		mutex_unlock(&kvm->slots_lock);
>> +		if (ret) {
>> +			kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS,
>> +						  &devices[c * 2].dev);
>> +			break;
>> +		}
>> +		device++;
>> +		redist_base_address += 2 * SZ_64K;
>> +	}
> 
> Can we put cond_resched() somewhere in kvm_for_each_vcpu to avoid

Apologies, it seems to come from kvm_io_bus infrastructure.

Vladimir

> complains with CONFIG_PREEMPT_NONE=y and many many cpus been used?
> 
>>   # lkvm run -k gic-test.flat.a64 -m 316 -c 255 --name guest-727
>>   Info: Loaded kernel to 0x80080000 (69624 bytes)
>>   Info: Placing fdt at 0x8fe00000 - 0x8fffffff
>>   # Warning: The maximum recommended amount of VCPUs is 4
>>   Info: virtio-mmio.devices=0x200 at 0x10000:36
>>
>>   Info: virtio-mmio.devices=0x200 at 0x10200:37
>>
>>   Info: virtio-mmio.devices=0x200 at 0x10400:38
>>
>>   Info: virtio-mmio.devices=0x200 at 0x10600:39
>>
>> INFO: rcu_sched self-detected stall on CPU
>>  0-...: (5249 ticks this GP) idle=589/140000000000001/0 softirq=393/393 fqs=5244 
>>   (t=5250 jiffies g=-166 c=-167 q=0)
>> Task dump for CPU 0:
>> kvm-vcpu-0      R  running task        0   735      1 0x00000002
>> Call trace:
>> [<ffffff8008088cc4>] dump_backtrace+0x0/0x194
>> [<ffffff8008088e6c>] show_stack+0x14/0x1c
>> [<ffffff80080d4dd0>] sched_show_task+0xa4/0xe8
>> [<ffffff80080d6ddc>] dump_cpu_task+0x40/0x4c
>> [<ffffff80080fd398>] rcu_dump_cpu_stacks+0xa8/0xdc
>> [<ffffff8008100214>] rcu_check_callbacks+0x28c/0x7a4
>> [<ffffff80081034a8>] update_process_times+0x3c/0x68
>> [<ffffff8008111820>] tick_sched_handle.isra.15+0x50/0x60
>> [<ffffff8008111874>] tick_sched_timer+0x44/0x7c
>> [<ffffff8008103bf8>] __hrtimer_run_queues+0xc8/0x150
>> [<ffffff8008104110>] hrtimer_interrupt+0x9c/0x1b0
>> [<ffffff80083b8b74>] arch_timer_handler_phys+0x2c/0x38
>> [<ffffff80080f6d14>] handle_percpu_devid_irq+0x78/0x98
>> [<ffffff80080f2a2c>] generic_handle_irq+0x24/0x38
>> [<ffffff80080f2d98>] __handle_domain_irq+0x84/0xa8
>> [<ffffff80080825e0>] gic_handle_irq+0x74/0x178
>> Exception stack(0xffffffc0173e3830 to 0xffffffc0173e3950)
>> 3820:                                   ffffffc0165ac038 ffffffc0165ac080
>> 3840: 0000000000000018 0000000000000004 0000000000000014 000000000000003f
>> 3860: ffffffc0165aeea8 ffffffc000010000 ffffffc017ef5af0 ffffffc0173ecd28
>> 3880: 000000003fef0000 cfdfdfdf00010000 ffffffc0173ecd50 000000003ff00000
>> 38a0: cfdfdfdf00010000 0000000000000000 ffffff80081acaf0 0000000000000000
>> 38c0: 0000000000000000 00000000000000f0 ffffffc0165ac008 0000000000000018
>> 38e0: ffffff80080992e8 0000000000000078 ffffff8008276b54 0000000000002970
>> 3900: 0000000000000018 ffffffc0165ac080 ffffffc0165ac038 ffffffc0173e3950
>> 3920: ffffff8008276d8c ffffffc0173e3950 ffffff8008276b58 0000000020000145
>> 3940: 0000000000000000 0000000000000001
>> [<ffffff8008084f20>] el1_irq+0xa0/0x100
>> [<ffffff8008276b58>] generic_swap+0x4/0x28
>> [<ffffff800809e108>] kvm_io_bus_register_dev+0xc8/0x110
>> [<ffffff80080ab054>] vgic_register_redist_iodevs+0xd8/0x20c
>> [<ffffff80080a98f8>] vgic_v3_map_resources+0x98/0xec
>> [<ffffff80080a8cd8>] kvm_vgic_map_resources+0x4c/0x6c
>> [<ffffff80080a06d4>] kvm_arch_vcpu_ioctl_run+0x68/0x424
>> [<ffffff800809bc98>] kvm_vcpu_ioctl+0x1b4/0x6f8
>> [<ffffff80081aca98>] do_vfs_ioctl+0x708/0x760
>> [<ffffff80081acb4c>] SyS_ioctl+0x5c/0x8c
>> [<ffffff8008085630>] el0_svc_naked+0x24/0x28
> 
> Cheers
> Vladimir
> _______________________________________________
> kvmarm mailing list
> kvmarm at lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
> 
> 

  reply	other threads:[~2016-04-29 14:22 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 16:45 [PATCH v2 00/54] KVM: arm/arm64: Rework virtual GIC emulation Andre Przywara
2016-04-28 16:45 ` [PATCH v2 01/54] KVM: arm/arm64: vgic: streamline vgic_update_irq_pending() interface Andre Przywara
2016-04-28 16:45 ` [PATCH v2 02/54] KVM: arm/arm64: vgic: avoid map in kvm_vgic_inject_mapped_irq() Andre Przywara
2016-04-28 16:45 ` [PATCH v2 03/54] KVM: arm/arm64: vgic: avoid map in kvm_vgic_map_is_active() Andre Przywara
2016-04-28 16:45 ` [PATCH v2 04/54] KVM: arm/arm64: vgic: avoid map in kvm_vgic_unmap_phys_irq() Andre Przywara
2016-04-28 16:45 ` [PATCH v2 05/54] KVM: arm/arm64: Remove the IRQ field from struct irq_phys_map Andre Przywara
2016-05-03 12:15   ` Marc Zyngier
2016-04-28 16:45 ` [PATCH v2 06/54] KVM: arm/arm64: arch_timer: Remove irq_phys_map Andre Przywara
2016-05-02 16:44   ` Eric Auger
2016-05-04 10:37     ` Andre Przywara
2016-04-28 16:45 ` [PATCH v2 07/54] KVM: arm/arm64: vgic: Remove irq_phys_map from interface Andre Przywara
2016-05-03 22:22   ` Tom Hanson
2016-04-28 16:45 ` [PATCH v2 08/54] KVM: arm/arm64: Get rid of vgic_cpu->nr_lr Andre Przywara
2016-04-28 16:45 ` [PATCH v2 09/54] KVM: arm/arm64: Fix MMIO emulation data handling Andre Przywara
2016-04-28 16:45 ` [PATCH v2 10/54] KVM: arm/arm64: Export mmio_read/write_bus Andre Przywara
2016-04-28 16:45 ` [PATCH v2 11/54] KVM: arm/arm64: pmu: abstract access to number of SPIs Andre Przywara
2016-04-28 16:45 ` [PATCH v2 12/54] KVM: arm/arm64: vgic-new: Add data structure definitions Andre Przywara
2016-04-28 16:45 ` [PATCH v2 13/54] KVM: arm/arm64: vgic-new: Add acccessor to new struct vgic_irq instance Andre Przywara
2016-04-28 16:45 ` [PATCH v2 14/54] KVM: arm/arm64: vgic-new: Implement virtual IRQ injection Andre Przywara
2016-05-03 23:46   ` Tom Hanson
2016-05-05 11:24     ` Andre Przywara
2016-05-05 14:43       ` Marc Zyngier
2016-05-05 16:34       ` Tom Hanson
2016-04-28 16:45 ` [PATCH v2 15/54] KVM: arm/arm64: vgic-new: Add IRQ sorting Andre Przywara
2016-04-28 16:45 ` [PATCH v2 16/54] KVM: arm/arm64: vgic-new: Add IRQ sync/flush framework Andre Przywara
2016-05-05 16:23   ` Tom Hanson
2016-05-05 16:44     ` Tom Hanson
2016-04-28 16:45 ` [PATCH v2 17/54] KVM: arm/arm64: vgic-new: Add GICv2 world switch backend Andre Przywara
2016-05-02 12:16   ` Marc Zyngier
2016-05-03  8:26     ` Andre Przywara
2016-04-28 16:45 ` [PATCH v2 18/54] KVM: arm/arm64: vgic-new: Add GICv3 " Andre Przywara
2016-05-03 16:16   ` Marc Zyngier
2016-05-04 13:30     ` Andre Przywara
2016-05-04 13:54       ` Marc Zyngier
2016-05-04 14:21         ` [PATCH] KVM: arm/arm64: move GICv2 emulation defines into arm-gic-v3.h Andre Przywara
2016-05-04 14:28           ` Marc Zyngier
2016-05-05 17:04   ` [PATCH v2 18/54] KVM: arm/arm64: vgic-new: Add GICv3 world switch backend Tom Hanson
2016-04-28 16:45 ` [PATCH v2 19/54] KVM: arm/arm64: vgic-new: Implement Andre Przywara
2016-05-02 12:24   ` Eric Auger
2016-05-03  8:26     ` Andre Przywara
2016-04-28 16:45 ` [PATCH v2 20/54] KVM: arm/arm64: vgic-new: Add MMIO handling framework Andre Przywara
2016-04-28 16:45 ` [PATCH v2 21/54] KVM: arm/arm64: vgic-new: Add GICv2 " Andre Przywara
2016-05-03 15:32   ` Marc Zyngier
2016-04-28 16:45 ` [PATCH v2 22/54] KVM: arm/arm64: vgic-new: Export register access interface Andre Przywara
2016-04-28 16:45 ` [PATCH v2 23/54] KVM: arm/arm64: vgic-new: Add CTLR, TYPER and IIDR handlers Andre Przywara
2016-04-28 16:45 ` [PATCH v2 24/54] KVM: arm/arm64: vgic-new: Add ENABLE registers handlers Andre Przywara
2016-04-28 16:45 ` [PATCH v2 25/54] KVM: arm/arm64: vgic-new: Add PENDING " Andre Przywara
2016-04-28 16:45 ` [PATCH v2 26/54] KVM: arm/arm64: vgic-new: Add ACTIVE " Andre Przywara
2016-05-05 16:48   ` Tom Hanson
2016-04-28 16:45 ` [PATCH v2 27/54] KVM: arm/arm64: vgic-new: Add PRIORITY " Andre Przywara
2016-04-28 16:45 ` [PATCH v2 28/54] KVM: arm/arm64: vgic-new: Add CONFIG " Andre Przywara
2016-04-28 16:45 ` [PATCH v2 29/54] KVM: arm/arm64: vgic-new: Add TARGET " Andre Przywara
2016-04-28 16:45 ` [PATCH v2 30/54] KVM: arm/arm64: vgic-new: Add SGIR register handler Andre Przywara
2016-04-28 16:45 ` [PATCH v2 31/54] KVM: arm/arm64: vgic-new: Add SGIPENDR register handlers Andre Przywara
2016-04-28 16:45 ` [PATCH v2 32/54] KVM: arm/arm64: vgic-new: Add GICv3 MMIO handling framework Andre Przywara
2016-04-29 14:04   ` Vladimir Murzin
2016-04-29 14:22     ` Vladimir Murzin [this message]
2016-05-02  8:38       ` Christoffer Dall
2016-05-02 16:13   ` Eric Auger
2016-05-05 17:55     ` Andre Przywara
2016-05-03 15:34   ` Marc Zyngier
2016-04-28 16:45 ` [PATCH v2 33/54] KVM: arm/arm64: vgic-new: Add GICv3 CTLR, IIDR, TYPER handlers Andre Przywara
2016-04-28 16:45 ` [PATCH v2 34/54] KVM: arm/arm64: vgic-new: Add GICv3 redistributor IIDR and TYPER handler Andre Przywara
2016-04-28 16:45 ` [PATCH v2 35/54] KVM: arm/arm64: vgic-new: Add GICv3 IDREGS register handler Andre Przywara
2016-04-28 16:45 ` [PATCH v2 36/54] KVM: arm/arm64: vgic-new: Add GICv3 IROUTER register handlers Andre Przywara
2016-04-28 16:45 ` [PATCH v2 37/54] KVM: arm/arm64: vgic-new: Add GICv3 SGI system register trap handler Andre Przywara
2016-04-28 16:45 ` [PATCH v2 38/54] KVM: arm/arm64: vgic-new: vgic_kvm_device: KVM device ops registration Andre Przywara
2016-04-28 16:45 ` [PATCH v2 39/54] KVM: arm/arm64: vgic-new: vgic_kvm_device: KVM_DEV_ARM_VGIC_GRP_NR_IRQS Andre Przywara
2016-04-28 16:45 ` [PATCH v2 40/54] KVM: arm/arm64: vgic-new: vgic_kvm_device: KVM_DEV_ARM_VGIC_GRP_CTRL Andre Przywara
2016-04-28 16:46 ` [PATCH v2 41/54] KVM: arm/arm64: vgic-new: vgic_kvm_device: KVM_DEV_ARM_VGIC_GRP_ADDR Andre Przywara
2016-04-28 16:46 ` [PATCH v2 42/54] KVM: arm/arm64: vgic-new: vgic_kvm_device: access to VGIC registers Andre Przywara
2016-05-03  9:59   ` Marc Zyngier
2016-05-03 10:09     ` Andre Przywara
2016-05-03 10:12       ` Marc Zyngier
2016-05-03 10:16       ` Marc Zyngier
2016-05-03 16:07         ` [PATCH] KVM: arm/arm64: new-vgic: add proper GICv2 CPU interface userland access Andre Przywara
2016-05-03 17:00           ` Marc Zyngier
2016-05-03 17:59             ` Marc Zyngier
2016-04-28 16:46 ` [PATCH v2 43/54] KVM: arm/arm64: vgic-new: vgic_kvm_device: implement kvm_vgic_addr Andre Przywara
2016-04-28 16:46 ` [PATCH v2 44/54] KVM: arm/arm64: vgic-new: Add userland access to VGIC dist registers Andre Przywara
2016-04-28 16:46 ` [PATCH v2 45/54] KVM: arm/arm64: vgic-new: Add GICH_VMCR accessors Andre Przywara
2016-04-28 16:46 ` [PATCH v2 46/54] KVM: arm/arm64: vgic-new: Add userland GIC CPU interface access Andre Przywara
2016-05-03 10:21   ` Marc Zyngier
2016-04-28 16:46 ` [PATCH v2 47/54] KVM: arm/arm64: vgic-new: vgic_init: implement kvm_vgic_hyp_init Andre Przywara
2016-05-03 15:02   ` Marc Zyngier
2016-05-03 15:35   ` Marc Zyngier
2016-04-28 16:46 ` [PATCH v2 48/54] KVM: arm/arm64: vgic-new: vgic_init: implement vgic_create Andre Przywara
2016-04-28 16:46 ` [PATCH v2 49/54] KVM: arm/arm64: vgic-new: vgic_init: implement vgic_init Andre Przywara
2016-04-28 16:46 ` [PATCH v2 50/54] KVM: arm/arm64: vgic-new: vgic_init: implement map_resources Andre Przywara
2016-05-03 10:47   ` Marc Zyngier
2016-04-28 16:46 ` [PATCH v2 51/54] KVM: arm/arm64: vgic-new: Add vgic_v2/v3_enable Andre Przywara
2016-04-28 16:46 ` [PATCH v2 52/54] KVM: arm/arm64: vgic-new: Wire up irqfd injection Andre Przywara
2016-04-28 16:46 ` [PATCH v2 53/54] KVM: arm/arm64: vgic-new: implement mapped IRQ handling Andre Przywara
2016-04-28 16:46 ` [PATCH v2 54/54] KVM: arm/arm64: vgic-new: enable build Andre Przywara

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=57236E3B.2000501@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).