RE: [Qemu-devel] [PATCH v3 4/4] target-arm: Add the GICv2m to the virt board

2015-05-25 Thread Pavel Fedin
tral like msi_phandle ? It will also be used by GICv3 ITS implementation. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [Qemu-devel] [PATCH v3 4/4] target-arm: Add the GICv2m to the virt board

2015-05-25 Thread Pavel Fedin
ller. Yes, exactly. In my implementation being developed i actually reused first patch from this set, and indeed 'v2m_handle' appeared to be useful for ITS. My code flow is something like: if (gicv3) create_its() else create_v2m() Kind regards, Pavel Fedin Expert Engineer Samsu

RE: [Qemu-devel] [PATCH v3 4/4] target-arm: Add the GICv2m to the virt board

2015-05-26 Thread Pavel Fedin
arm in increasing v2m area. P.S. And yes, VIRT_GIC_DIST_SPI should be VIRT_GIC_DIST_MBI instead (Reviewed-by: Eric Auger ), just this fragment is from my old integration branch, which i currently don't work on, because my new test environment doesn't use GICv2 at all. Kind regar

RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation

2015-06-07 Thread Pavel Fedin
d to implement ITS in qemu while leaving LPI handling to kernel. In this case my qemu would have everything needed. By the way, why did you decide to put everything into kernel? Yes, in-kernel emulation is faster, but ITS is not accessed frequently. Kind regards, Pavel Fedin Expert Engineer Samsung

RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation

2015-06-08 Thread Pavel Fedin
nother concern > would be the support of GICv4, which relies on the command queue > handling to be handled in the kernel Wow, i didn't know about GICv4. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia _

IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Pavel Fedin
o an LPI and get collection ID from there. However, yes, i agree, this approach has the same performance drawback as my suggested approach 2. Any thoughts / ideas ? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Pavel Fedin
st and fastest thing to do. If someone is interested, i could prepare an RFC patch series for this, which would apply on top of Andre's ITS implementation. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-10 Thread Pavel Fedin
. In this case raising an MSI by GSI would not differ from what i currently do. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH 13/13] KVM: arm64: enable ITS emulation as a virtual MSI controller

2015-06-18 Thread Pavel Fedin
Hello! > But that fails compilation on ARM (which uses this file as well), > because we have a dummy fail function in the header if > CONFIG_HAVE_KVM_MSI is not defined. May be then remove that fail function too? Too many #ifdef's are not good... Kind regards, Pavel Fedin E

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-18 Thread Pavel Fedin
erfectly work because SPI signaling is used with GICv2m, and MSI with GICv3(+), which cannot be used at the same time. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@li

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Pavel Fedin
. No allocation is done. Allocation is done only on x86, with routing. They just allocate GSI numbers starting from zero and route them to something (either irqchip or MSI). Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Pavel Fedin
x27;s and route them to irqchip explicitly, don't we ? Sorry for being perhaps ignorant, i haven't studied x86 qemu code too much. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kv

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-24 Thread Pavel Fedin
t? By default all GSIs would be SPIs, then this can be changed by userspace, or reverted back... Who cares? When using direct mapping qemu never calls routing functions, so it's OK. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia _

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-25 Thread Pavel Fedin
t we have now by default, for backwards compatibility. But by design we were never obliged to stick to this. Well, it's just MHO... Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmar

RE: [PATCH 0/3] KVM: arm: Implement software vGICv2 emulation

2015-06-30 Thread Pavel Fedin
Pi-2 with a little more hacking. Fourth, there is at least of one ARM64 machine with broken vGICv3. And you can buy it. I have it here. And it would also benefit from this code (yes, with GICv3 CPU interface emulation added, which becomes trivial). Kind regards

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-02 Thread Pavel Fedin
struct kvm_irq_routing_msi msi; > -- > 1.9.1 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH 7/7] KVM: arm: implement kvm_set_msi by gsi direct mapping

2015-07-02 Thread Pavel Fedin
> To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-02 Thread Pavel Fedin
else schedule_work(&irqfd->inject); --- cut --- You apparently missed KVM_IRQ_ROUTING_EXTENDED_MSI here, as well as in irqfd_update(). But, if you accept my API proposal, this becomes irrelevant. Kind regards, Pavel Fedin Expert Engineer Samsung Electron

RE: [PATCH 7/7] KVM: arm: implement kvm_set_msi by gsi direct mapping

2015-07-02 Thread Pavel Fedin
I think to keep using the type for homogeneity. Homogeneity is perfect IMHO. If that would be simpler for you, i could post a patch for this which i made on top of your series. Sorry, i don't have time to respin the whole thing, busy with qemu GICv3 fight :) Kind regards, Pavel Fedin Expert

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-02 Thread Pavel Fedin
Hello! > OK thanks for sharing. I need some more time to study qemu code too. I am currently working on supporting this in qemu. Not ready yet, need some time. But, with API i suggest, things are really much-much simpler. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Resea

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-03 Thread Pavel Fedin
Hi! > OK so both of you say the same thing. Will respin accordingly You may also want to add this: Tested-by: Pavel Fedin Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvm

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-05 Thread Pavel Fedin
my modified qemu now has kvm_msi_flags global variable which defaults to 0. ITS code, then, if activated, changes it to KVM_MSI_VALID_DEVID, and qemu starts supplying device IDs to the related calls. Kind regards, Pavel Fedin Expert Engineer Samsung Electroni

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-06 Thread Pavel Fedin
_MSI_VALID_DEVID; kvm_gsi_routing_allowed = true; kvm_msi_via_irqfd_allowed = true; } --- cut --- I can post my sets as RFCs to qemu mailing list, if you want to take a look at the whole change set. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia _

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-06 Thread Pavel Fedin
> Just so I'm sure I understand: The way the kernel differentiates between > no-devid and devid==0, is whether or not the devid flag is set, correct? Yes, exactly. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research ce

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-07 Thread Pavel Fedin
ID_DEVID and we already have 'flags' field. Using them would just make the API more consistent because KVM_SIGNAL_MSI already uses them in absolutely the same manner. That's my point and nothing more. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-07 Thread Pavel Fedin
ld throw it away completely and invent KVM_SIGNAL_EXT_MSI ioctl for sending MSIs with device ID. This would also be consistent IMO. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists

[PATCH 1/2] Fix NULL pointer dereferences if KVM is used without in-kernel irqchip

2015-07-07 Thread Pavel Fedin
Makes qemu working again with kernel-irqchip=off option Signed-off-by: Pavel Fedin --- virt/kvm/arm/vgic.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 78fb820..3420657 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm

[PATCH 2/2] Detect vGIC presence at runtime

2015-07-07 Thread Pavel Fedin
Allows to use KVM on hardware without vGIC. Interrupt controller has to be emulated in userspace in this case. Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index

[PATCH 0/2] Allow to use KVM without in-kernel irqchip

2015-07-07 Thread Pavel Fedin
om in-kernel virtual timer to the interrupt controller emulated in userspace. Pavel Fedin (2): Fix NULL pointer dereferences if KVM is used without in-kernel irqchip Detect vGIC presence at runtime arch/arm/kvm/arm.c | 19 ++- virt/kvm/arm/vgic.c | 5 - 2 files change

RE: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi

2015-07-07 Thread Pavel Fedin
c code, which > returns -EINVAL atm. So I plan to introduce this capability already with > the ITS emulation series, so we can just pick it up in the IRQ routing > series. Then may be you follow https://lkml.org/lkml/2015/7/7/115 and replace flag with something like KVM_SIGNAL_EXT_MSI io

RE: [PATCH 2/2] Detect vGIC presence at runtime

2015-07-09 Thread Pavel Fedin
l(), because userland can choose just not to use vGIC for some reason (testing for example). Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH 2/2] Detect vGIC presence at runtime

2015-07-09 Thread Pavel Fedin
a function which you suggest. Then: 1. Situation with missing vGIC is just considered to be normal; it's not a to-be-ignored error any more. 2. "vGIC present" situation is automatically determined by vgic_ops != NULL; this means that probe function completely worked and vGIC implementati

RE: [PATCH v2 0/7] KVM: arm/arm64: gsi routing support

2015-07-09 Thread Pavel Fedin
nce we agreed on not using flags, i would suggest to have KVM_SIGNAL_EXTENDED_MSI counterpart, which also doesn't use flags. I know, we were already talking about it, so, if this gets ignored for the second time, i assume the Architects decided that fancy APIs are cool, and i promise to stop t

RE: [PATCH v2 0/7] KVM: arm/arm64: gsi routing support

2015-07-09 Thread Pavel Fedin
ddress_lo = (uint32_t)msg.address; kroute.u.msi.address_hi = msg.address >> 32; kroute.u.msi.data = le32_to_cpu(msg.data); kroute.flags = kvm_msi_flags; --- cut --- Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH v2 0/7] KVM: arm/arm64: gsi routing support

2015-07-09 Thread Pavel Fedin
of context switches have impact. Actually, the problem is very poor vhost-net throughput, which jumps up when i start the profiler and goes back down when i stop it. Just to note... I'm off since now for a small vacation, will be back on monday or tuesday. See you guys! Kind regards,

RE: Extensions for KVM MSI related ioctls

2015-07-13 Thread Pavel Fedin
e can reuse existing ones. IMHO using flag would make an API more consistent. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailm

[PATCH v2 2/3] KVM: arm: Detect vGIC presence at runtime

2015-07-14 Thread Pavel Fedin
urces. Normally this means that vGIC hardware is defunct. Any other code is still treated as full stop because it might mean some really serious problems. Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/ar

[PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-14 Thread Pavel Fedin
have complete implementation of API which allows to emulate GIC in userspace by qemu, and now i can run any virtual machine, including generic timer, on vGIC-less machine. RasPI-2 is expected to benefit too. Pavel Fedin (3): KVM: arm: Fix NULL pointer dereference if KVM is used without in-kernel

[PATCH v2 1/3] KVM: arm: Fix NULL pointer dereference if KVM is used without in-kernel irqchip

2015-07-14 Thread Pavel Fedin
Makes qemu working again with kernel-irqchip=off option Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index d9631ec..5668c4e 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c

[PATCH v2 3/3] KVM: arm64: Introduce default dummy save/restore functions

2015-07-14 Thread Pavel Fedin
Necessary for KVM without irqchip to function on ARM64. Allows to use software GICv2 emulation where hardware acceleration is not available. Signed-off-by: Pavel Fedin --- arch/arm/include/asm/kvm_host.h | 5 + arch/arm64/include/asm/kvm_asm.h | 1 + arch/arm64/include/asm/kvm_host.h | 8

RE: [PATCH v2 3/3] KVM: arm64: Introduce default dummy save/restore functions

2015-07-14 Thread Pavel Fedin
That was the problem. Ok, this is 64-bit-specific, i can fix this up later. My patch set can be used without 0003, in this case it will fix only ARM32 architecture. So if you would like to accept the rest, you can do it. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research c

RE: [PATCH v2 3/3] KVM: arm64: Introduce default dummy save/restore functions

2015-07-14 Thread Pavel Fedin
Hello! > You may want to check commit 8a14849, which makes this whole patch > irrelevant. I have tested, the new code just works without patch No 0003. Simply throw it away from the set. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center

RE: [PATCH v2 4/7] KVM: arm/arm64: enable irqchip routing

2015-07-15 Thread Pavel Fedin
s at it later is > the ITS emulation anyway, any other code path simply ignores that. Sorry for delayed reply, i'm a bit busy so cannot check all the emails in time... This is one more reason for using KVM_MSI_VALID_DEVID flag with KVM_IRQ_ROUTING_MSI. In this case you don't have to

RE: [PATCH v2 15/15] KVM: arm64: enable ITS emulation as a virtual MSI controller

2015-07-15 Thread Pavel Fedin
Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Andre Przywara > Sent: Friday, July 10, 2015 5:22 PM > To: marc.zyng...@arm.com

RE: [PATCH v2 15/15] KVM: arm64: enable ITS emulation as a virtual MSI controller

2015-07-15 Thread Pavel Fedin
2M or ITS emulation), I think it is acceptable to > require a late, per-VM capability check in userland in that case. Well, agree, and formally this is more correct. Just it would require slightly more additions to qemu. But it's not a real p

RE: [PATCH v2 00/15] KVM: arm64: GICv3 ITS emulation

2015-07-15 Thread Pavel Fedin
Hello! > this respin tries to address all comments I got so far from the list. > Thanks to Eric, Pavel and Christoffer for the review! Tested-by: Pavel Fedin Works fine. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center

RE: [PATCH v2 3/7] KVM: irqchip: convey devid to kvm_set_msi

2015-07-17 Thread Pavel Fedin
t set */ > + > route.msi.address_lo = msi->address_lo; > route.msi.address_hi = msi->address_hi; > route.msi.data = msi->data; > -- > 1.9.1 Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH v2 3/7] KVM: irqchip: convey devid to kvm_set_msi

2015-07-17 Thread Pavel Fedin
Hello! > >> > +} else if (!msi->flags) > >> > +return -EINVAL; > > Did you mean "if (msg->flags)" here (inverted condition)? > > Indeed, and also you need { } around the return for the QEMU coding > standard.

RE: [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-19 Thread Pavel Fedin
addresses this scenario too, just needs some extra bits on vtimer side (ability to init KVM without it). Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH v2 1/3] KVM: arm: Fix NULL pointer dereference if KVM is used without in-kernel irqchip

2015-07-19 Thread Pavel Fedin
estore this functionality. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-22 Thread Pavel Fedin
without both vGIC and vTimer ? It will be an emulator's problem how to handle them then. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-24 Thread Pavel Fedin
n manipulations with ARCH_TIMER_CTRL_IT_MASK. Without it i'm going to get multiple interrupts instead of only one. It would be possible to signal the interrupt as real level-sensitive (since we will be tracking active state), but... it's not possible to know when to deactivate the line, har

RE: [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-26 Thread Pavel Fedin
nd vTimer, and that's all we do? It will be userland's problem how to handle them. I need to tweak my first patchset a very small bit in order to do this. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___

RE: [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-27 Thread Pavel Fedin
der to do this. > > I I'll repeat what I already said: "Show me the patches". > > I'll only give you an answer once I exactly know what you're up to. You have already seen them, it is the very same patchset we are discussing in this thread. Kind regards,

RE: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-02 Thread Pavel Fedin
), just for simplicity. Ignoring would happen automatically, because IIRC older kernels do not explicitly check 'pad' for being zero, do they? And indeed in this case the userland can supply devid unconditionally, making things even simpler. Kind regards, Pavel Fedin Ex

RE: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-03 Thread Pavel Fedin
devIDs. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH v2 14/15] KVM: arm64: implement MSI injection in ITS emulation

2015-08-03 Thread Pavel Fedin
despite it's indeed a small bit redundant. But i see that kernel's policy is to have insurance against all possible and impossible bad inputs, and the flag really fits into the concept. Kind regards, Pavel Fedin Expert Engineer Samsung El

[PATCH v3 3/3] Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-08-05 Thread Pavel Fedin
Now at least ARM is able to determine whether the machine has virtualization support for irqchip or not at runtime. Obviously, irqfd requires irqchip. Signed-off-by: Pavel Fedin --- This has to be verified with PowerPC and S390 maintainers. I've got an impression that KVM_CAP_IRQCH

[PATCH v3 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-08-05 Thread Pavel Fedin
M ends in a HYP crash because of unset vGIC save/restore function pointers Pavel Fedin (3): Fix NULL pointer dereference if KVM is used without in-kernel irqchip Detect vGIC presence at runtime Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP arch/arm/kvm/arm.c | 19 --- vi

[PATCH v3 1/3] Fix NULL pointer dereference if KVM is used without in-kernel irqchip

2015-08-05 Thread Pavel Fedin
kvm_vgic_map_resources() call without vGIC instantiation attempts to call vm_ops.map_resources == NULL The bug was introduced in b26e5fdac43c1b7c394502917e42e3b91f3aa1a3 Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kvm

[PATCH v3 2/3] Detect vGIC presence at runtime

2015-08-05 Thread Pavel Fedin
timer which can be emulated in userspace. Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 199a50a..1039161 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/

RE: [PATCH v3 0/7] KVM: arm/arm64: gsi routing support

2015-08-06 Thread Pavel Fedin
Tested-by: Pavel Fedin Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -Original Message- > From: Eric Auger [mailto:eric.au...@linaro.org] > Sent: Monday, August 03, 2015 6:31 PM > To: eric.au...@st.com; eric.au...@linaro.org; >

RE: KVM Live migration with GICv3

2015-08-10 Thread Pavel Fedin
ll. I would love to go there, and my company wanted to send me there. But it appears to be extremely difficult for a tech specialist from Russia to get a US visa. They are still considering me and the time is running out, so i'm unlikely to attend, unfortunately. Kind regards, Pavel Fedin

[PATCH] KVM: arm64: Decode basic HYP fault information

2015-08-11 Thread Pavel Fedin
Print exception vector name, exception class and PC translated to EL1 virtual address. Significantly aids debugging HYP crashes without special means like JTAG. Signed-off-by: Pavel Fedin --- arch/arm64/kvm/handle_exit.c | 30 + arch/arm64/kvm/hyp.S | 46

RE: KVM Live migration with GICv3

2015-08-11 Thread Pavel Fedin
space > similar to gicv2 in QEMU for gicv3. This thing is optional and can be missing. It is for backwards compatibility only, it allows to run GICv2 guests on GICv3. You should not use this API for accessing system registers. Kind regards, Pavel Fedin Expert Engineer Samsung Electr

PING: [PATCH v3 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-08-14 Thread Pavel Fedin
PING Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Pavel Fedin > Sent: Wednesday, August 05, 2015 1:54 PM > To: kvmarm@lists.

RE: [PATCH v3 2/3] Detect vGIC presence at runtime

2015-08-14 Thread Pavel Fedin
missing CP15 (or system in case of ARM64) registers. So, this timer issue is not grave, just i postpone implementing it until GIC issues are settled down. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm ma

RE: [PATCH v3 2/3] Detect vGIC presence at runtime

2015-08-14 Thread Pavel Fedin
hen we apparently don't have vGIC, and since we know that vGIC and vTimer are paired, we know that there is no vTimer too. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists

[PATCH v4 2/3] Detect vGIC presence at runtime

2015-08-17 Thread Pavel Fedin
timer which can be emulated in userspace. Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index fddaa2e..b44e53c 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/

[PATCH v4 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-08-17 Thread Pavel Fedin
dling in correct place v1 => v2: - Do not use defensive approach in patch 0001. Use correct conditions in callers instead - Added ARM64-specific code, without which attempt to run a VM ends in a HYP crash because of unset vGIC save/restore function pointers Pavel Fedin (3): Fix NULL pointer

[PATCH v4 1/3] Fix NULL pointer dereference if KVM is used without in-kernel irqchip

2015-08-17 Thread Pavel Fedin
kvm_vgic_map_resources() call without vGIC instantiation attempts to call vm_ops.map_resources == NULL The bug was introduced in b26e5fdac43c1b7c394502917e42e3b91f3aa1a3 Signed-off-by: Pavel Fedin --- arch/arm/kvm/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kvm

[PATCH v4 3/3] Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-08-17 Thread Pavel Fedin
Now at least ARM is able to determine whether the machine has virtualization support for irqchip or not at runtime. Obviously, irqfd requires irqchip. Signed-off-by: Pavel Fedin --- virt/kvm/kvm_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/virt/kvm/kvm_main.c

PING: [PATCH] KVM: arm64: Decode basic HYP fault information

2015-08-19 Thread Pavel Fedin
PING Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Pavel Fedin > Sent: Tuesday, August 11, 2015 10:34 AM > To: kvmarm@lists.cs.

RE: PING: [PATCH] KVM: arm64: Decode basic HYP fault information

2015-08-19 Thread Pavel Fedin
Hello! > Please be more patient. For example, if a month or more passes without > you hearing anything, then it's ok to ask what the plans are. Ok, sorry, i didn't know about recommended turnaround times here. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics

RE: KVM Live migration with GICv3

2015-08-25 Thread Pavel Fedin
Hello! Where are you? I'd like to take a look at your code. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -Original Message- > From: Vijay Kilari [mailto:vijay.kil...@gmail.com] > Sent: Tuesday, August 11, 2015 6:16 PM > To:

[PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
t will not get this interrupt. This patch fixes the problem by bringing back unconditional setting of LR_STATE_PENDING bit. The bug was caught on Cavium ThunderX machine, kernel v4.1.6, running qemu "virt" guest, where it affected pl011 driver. Signed-off-by: Pavel Fedin --- vir

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
FIFO. Could this be some bug in kernel's pl011 driver itself, which does something wrong and does not handle interrupts in a proper way during output? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia __

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
-- Alex, are you reading us? Can you explain, why you introduced that extra check? > And what you're suggesting is to actually introduce a bug. Why would that be a bug, if it was not a bug in kernel 4.0? Kind regards, Pavel Fedin Expert Engine

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
is queued. Can we say that this is wrong? If you agree, may be do something else instead? May be we should cancel such "ghost" interrupts early, avoiding immediate and completely unnecessary maintenance interrupts upon guest entry? Kind regards, Pavel Fedin Expert Engineer Samsun

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
an alternate solution like this, i will test it, and adjust if needed. My "bad codebase, broken HW and buggy userspace" appears to be particulary prone to finding these problems, i think it's going to be a nice testbed. :) Kind regards, Pavel Fedin Expert Engineer Samsung Electro

[PATCH] KVM: arm/arm64: BUG FIX: Do not inject spurious interrupts

2015-08-27 Thread Pavel Fedin
nning qemu "virt" guest, where it was caused by emulated pl011. Signed-off-by: Pavel Fedin --- virt/kvm/arm/vgic.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 34dad3c..bf155e3 100644 --- a/virt/kvm/arm/vgic.

RE: [PATCH] KVM: arm/arm64: BUG FIX: Do not inject spurious interrupts

2015-08-28 Thread Pavel Fedin
eans that we are going to lose everything. An alternate would be: clear the bit, THEN call vgic_update_state() which would set it back if necessary. But does this extra bit of complexity worth anything, given one paragraph above? Kind regards, Pavel Fedin Ex

[PATCH 2/3] KVM: arm64: Allow to use accessors in KVM_SET_ONE_REG and KVM_GET_ONE_REG

2015-08-28 Thread Pavel Fedin
Call accessor functions if the register is defined in the list but does not have accociated cell in CPU context. This allows to implement accessors for vGIC CPU interface, necessary for live migration. Signed-off-by: Pavel Fedin --- arch/arm64/kvm/sys_regs.c | 47

[PATCH 0/3] KVM: arm64: Implement API for vGICv3 live migration

2015-08-28 Thread Pavel Fedin
This patchset adds necessary userspace API in order to support vGICv3 live migration. This includes accessing GIC distributor and redistributor memory regions using device attribute ioctls, and system registers of CPU interface using register get/set ioctls. Pavel Fedin (3): KVM: arm64

[PATCH 1/3] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-08-28 Thread Pavel Fedin
The access is done similar to GICv2, using KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_REDIST_REGS with KVM_SET_DEVICE_ATTR and KVM_GET_DEVICE_ATTR ioctls. Registers are always assumed to be of their native size, 4 or 8 bytes. Signed-off-by: Pavel Fedin --- arch/arm64/include/uapi

[PATCH 3/3] KVM: arm64: Implement accessors for vGIC CPU interface registers

2015-08-28 Thread Pavel Fedin
This commit adds accessors for all registers, being part of saved vGIC context in the form of ICH_VMCR_EL2. This is necessary for enabling vGICv3 live migration. Signed-off-by: Pavel Fedin --- arch/arm64/kvm/sys_regs.c | 176 + include/linux/irqchip

RE: [PATCH] KVM: arm64: Decode basic HYP fault information

2015-08-31 Thread Pavel Fedin
atch helped a lot to find out what was wrong. The main missing information was vector number, and translated PC is also useful. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.c

RE: [PATCH 3/3] KVM: arm64: Implement accessors for vGIC CPU interface registers

2015-08-31 Thread Pavel Fedin
d implementing this as device attribute would, i guess, give no difference from code's point of view. We would have to encode system register numbers into attribute, then perform table lookup, actually duplicating our system register access code. Does it worth that? Kind regards, Pavel Fedi

RE: [PATCH 1/3] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-08-31 Thread Pavel Fedin
ed on. By the way, handling it in userspace would also be simpler. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

RE: [PATCH] KVM: arm64: Decode basic HYP fault information

2015-08-31 Thread Pavel Fedin
ad HYP_PAGE_OFFSET >> -.quad PAGE_OFFSET > why can you get rid of this? Because i was used only to translate base address of text message, which moved to C code. > I'll think about it. Ok. Kind regards, Pavel Fedin Expert

RE: [PATCH v4 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-08-31 Thread Pavel Fedin
Hello! Two weeks has passed, i have fixed up Marc's notes, so PING... Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Pave

RE: [PATCH 3/3] KVM: arm64: Implement accessors for vGIC CPU interface registers

2015-08-31 Thread Pavel Fedin
t difficult to deal with CPU fd's. Because anyway you have to iterate through all VCPUs in order to save state correctly. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing list kvmarm@lis

RE: [PATCH 3/3] KVM: arm64: Implement accessors for vGIC CPU interface registers

2015-09-01 Thread Pavel Fedin
tate of any other vCPUs. And, since i am getting/setting its registers, i assume that the vCPU is not running. Well, i added the check. What next? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia ___ kvmarm mailing

RE: [PATCH 1/3] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-09-01 Thread Pavel Fedin
y. I thought about it too, it's inconvenient. In the userland you would have to do two accesses and merge the result. It's just tedious. After all this API is not emulating guest behavior, it's just for reading/writing GIC state. So on next respin i'll add size bit. Kind

[PATCH v2 2/5] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-09-02 Thread Pavel Fedin
full 64-bit accesses. Signed-off-by: Pavel Fedin --- Documentation/virtual/kvm/devices/arm-vgic.txt | 34 - arch/arm64/include/uapi/asm/kvm.h | 2 + virt/kvm/arm/vgic-v3-emul.c| 96 ++ 3 files changed, 115 insertions(+), 17 deletions

[PATCH v2 0/5] KVM: arm64: Implement API for vGICv3 live migration

2015-09-02 Thread Pavel Fedin
for distributor and redistributor register accesses, do not assume size any more. - Lots of refactor and reusable code extraction. - Added forgotten documentation Pavel Fedin (5): KVM: arm/arm64: Refactor vGIC attributes handling code KVM: arm64: Implement vGICv3 distributor and redistribu

[PATCH v2 3/5] KVM: arm64: Refactor system register handlers

2015-09-02 Thread Pavel Fedin
Replace Rt with data pointer in struct sys_reg_params. This will allow to reuse system register handling code in implementation of vGICv3 CPU interface access API. Additionally, got rid of "massive hack" in kvm_handle_cp_64(). Signed-off-by: Pavel Fedin --- arch/arm64/kvm/

[PATCH v2 1/5] KVM: arm/arm64: Refactor vGIC attributes handling code

2015-09-02 Thread Pavel Fedin
Separate all implementation-independent code in vgic_attr_regs_access() and move it to vgic.c. This will allow to reuse this code for vGICv3 implementation. Signed-off-by: Pavel Fedin --- virt/kvm/arm/vgic-v2-emul.c | 126 +--- virt/kvm/arm/vgic.c

[PATCH v2 5/5] Implement vGICv3 CPU interface access

2015-09-02 Thread Pavel Fedin
running. Signed-off-by: Pavel Fedin --- Documentation/virtual/kvm/devices/arm-vgic.txt | 38 +++- arch/arm64/include/uapi/asm/kvm.h | 7 + include/linux/irqchip/arm-gic-v3.h | 18 +- virt/kvm/arm/vgic-v3-emul.c| 246 + 4 files

[PATCH v2 4/5] KVM: arm64: Introduce find_reg_by_id()

2015-09-02 Thread Pavel Fedin
In order to implement vGICv3 CPU interface access, we will need to perform table lookup of system registers. We would need both index_to_params() and find_reg() exported for that purpose, but instead we export a single function which combines them both. Signed-off-by: Pavel Fedin --- arch/arm64

  1   2   3   >