RE: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-28 Thread Pavel Fedin
at all. It would rely only on drivers' ability to communicate with each other (i guess it should be possible in Windows, isn't it?) c) does not need to steal resources (BARs, IRQs, etc) from the actual devices. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia

RE: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-12-22 Thread Pavel Fedin
IMHO safe to just know that SynIC MSRs have some extra handling in kernel. And i believe this has no direct impact on userland's behavior. But, you better know the details. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: se

RE: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-12-22 Thread Pavel Fedin
gested an extra exit_reason, > and I think .handled field can be used to pass that information instead. [skip] > But the proposed use of .handled costs basically nothing, and it may > prove useful in general (as a conisistency proof, if anything). Well... May be... So, i'm OK with

RE: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-21 Thread Pavel Fedin
se? > but could we replace Hyper-V VMBus hypercall and it's parameters > by KVM_EXIT_REG_IO/MSR_IO too? It depends. Can i read about these hypercalls somewhere? Is there any documentation? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To

RE: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-12-21 Thread Pavel Fedin
define KVM_EXIT_MSR_UNHANDLED 0 > +#define KVM_EXIT_MSR_HANDLED 1 > + __u8 handled; /* in */ > + } msr; > /* Fix the size of the union. */ > char padding[256]; > }; > @@ -849,6 +864,9 @@ struct kvm_ppc_smmu_info { > #define KVM_CAP_SPLIT_IRQCHIP 121 > #define KVM_CAP_IOEVENTFD_ANY_LENGTH 122 > #define KVM_CAP_HYPERV_SYNIC 123 > +#define KVM_CAP_MSR_EXITS 124 > +#define KVM_CAP_DISABLE_MSR_EXITS 125 > +#define KVM_CAP_ENABLE_MSR_EXITS 126 > > #ifdef KVM_CAP_IRQ_ROUTING Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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

RE: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-21 Thread Pavel Fedin
ation. I guess your hypercalls to be introduced using KVM_EXIT_HYPERV are also not used inside qemu so require implementation :) Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a

RE: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-20 Thread Pavel Fedin
xit(synic, msr); break; So, every time one of these thee MSRs is written, we get a vmexit with values of all three registers, and that's all. We could easily have 'synic_exit(synic, msr, data)' in all three cases, and i think the userspace could easily deal with proposed KVM_EXIT_R

RE: [PATCH v6] arm/arm64: KVM: Detect vGIC presence at runtime

2015-12-18 Thread Pavel Fedin
Either drop it or just say "The > architectured timers are not supported without the in-kernel vGIC." Ok, i'll repost with changed message. But, just to let you know, with this (http://www.spinics.net/lists/kvm/msg124539.html) the notice about architected timer loses its relevan

RE: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-18 Thread Pavel Fedin
CP15 timer. And it would require exactly the same capability - process some trapped system register accesses in userspace. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" i

RE: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Pavel Fedin
t; need to add it as a regression test, unless others disagree and would > like to see it added. Considering how difficult it was to find this problem, and how tricky and unobvious it is, i would ask to add this test. Especially considering you've already written it. At least it will serve as a reminder

RE: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Pavel Fedin
cts/kvm-unit-tests/arm/xzr-test.c:13: undefined reference to `mmu_disable' --- cut --- Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.ker

RE: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Pavel Fedin
quot;memory"); Then check for res == some_nonzero_val. If they are equal, you've got the bug :) Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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

RE: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Pavel Fedin
, and i just don't want to bother for a single small fix. :) Will do as a "Reported-by:". Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord

[PATCH v7 2/6] KVM: arm/arm64: Move endianness conversion out of vgic_attr_regs_access()

2015-12-07 Thread Pavel Fedin
of endianness conversion and masking. Masking is not used here (the mask is set to ~0), so we just move out the remaining endianness conversion. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- virt/kvm/arm/vgic-v2-emul.c | 20 1 file changed, 8 insertions(+), 12 deletions(-)

[PATCH v7 5/6] KVM: arm64: Introduce find_reg_by_id()

2015-12-07 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 <p

[PATCH v7 3/6] KVM: arm/arm64: Refactor vGIC attributes handling code

2015-12-07 Thread Pavel Fedin
differently. Also, vcpu pointer has backpointer to kvm, so 'dev' was replaced with 'vcpu'. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- virt/kvm/arm/vgic-v2-emul.c | 120 +++- virt/kvm/arm/vgic.c | 57 + virt/kvm/arm/

[PATCH v7 1/6] KVM: arm/arm64: Add VGICv3 save/restore API documentation

2015-12-07 Thread Pavel Fedin
eter.mayd...@linaro.org> Acked-by: Marc Zyngier <marc.zyng...@arm.com> Signed-off-by: Christoffer Dall <christoffer.d...@linaro.org> Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 116 ++ Documentation/vi

[PATCH v7 6/6] KVM: arm64: Implement vGICv3 CPU interface access

2015-12-07 Thread Pavel Fedin
Access size is always 64 bits. Since CPU interface state actually affects only a single vCPU, no vGIC locking is done in order to avoid code duplication. Just made sure that the vCPU is not running. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/include/uapi/asm/kvm.h

[PATCH v7 4/6] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-12-07 Thread Pavel Fedin
ould normally be 0), for read operations this would cause duplication of the same word in both halves. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/include/uapi/asm/kvm.h | 1 + include/linux/irqchip/arm-gic-v3.h | 1 + virt/kvm/arm/vgic-v3-emul.c

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

2015-12-07 Thread Pavel Fedin
e extraction. - Added forgotten documentation Christoffer Dall (1): KVM: arm/arm64: Add VGICv3 save/restore API documentation Pavel Fedin (5): KVM: arm/arm64: Move endianness conversion out of vgic_attr_regs_access() KVM: arm/arm64: Refactor vGIC attributes handling code KVM: arm64: Impleme

[PATCH v3 1/4] KVM: arm64: Correctly handle zero register during MMIO

2015-12-04 Thread Pavel Fedin
are also added to ARM32 code. This patch fixes setting MMIO register to a random value (actually SP) instead of zero by something like: *((volatile int *)reg) = 0; compilers tend to generate "str wzr, [xx]" here Signed-off-by: Pavel Fedin <p.fe...@samsung.com> Reviewed-

[PATCH v3 3/4] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-04 Thread Pavel Fedin
context structure, we introduce a dedicated storage for it in struct sys_reg_params. This refactor also gets rid of "massive hack" in kvm_handle_cp_64(). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/kvm/sys_regs.c| 88 ++--

[PATCH v3 2/4] KVM: arm64: Remove const from struct sys_reg_params

2015-12-04 Thread Pavel Fedin
Further rework is going to introduce a dedicated storage for transfer register value in struct sys_reg_params. Before doing this we have to remove 'const' modifiers from it in all accessor functions and their callers. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/kvm/sys_

[PATCH v3 4/4] KVM: arm64: Get rid of old vcpu_reg()

2015-12-04 Thread Pavel Fedin
Using oldstyle vcpu_reg() accessor is proven to be inappropriate and unsafe on ARM64. This patch converts the rest of use cases to new accessors and completely removes vcpu_reg() on ARM64. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/psci.c

[PATCH v3 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-04 Thread Pavel Fedin
tore it directly in struct sys_reg_params instead of a pointer - Use lower_32_bits()/upper_32_bits() where appropriate - Fixed wrong usage of 'Rt' instead of 'Rt2' in kvm_handle_cp_64(), overlooked in v1 - Do not write value back when reading Pavel Fedin (4): KVM: arm64: Correctly handle zero regi

RE: [PATCH v2 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-04 Thread Pavel Fedin
Hello! > Thanks a lot for respining this quickly. I just had a few minor > comments, so this is almost ready to go. If you can fix that Damn, the rest of reviews got stuck somewhere and arrived later, so i've just sent v3 without wrap fix. Will correct it. Kind regards, Pavel Fedin

[PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-04 Thread Pavel Fedin
v2: - Changed type of transfer value to u64 and store it directly in struct sys_reg_params instead of a pointer - Use lower_32_bits()/upper_32_bits() where appropriate - Fixed wrong usage of 'Rt' instead of 'Rt2' in kvm_handle_cp_64(), overlooked in v1 - Do not write value back when reading Pav

[PATCH v4 2/4] KVM: arm64: Remove const from struct sys_reg_params

2015-12-04 Thread Pavel Fedin
Further rework is going to introduce a dedicated storage for transfer register value in struct sys_reg_params. Before doing this we have to remove 'const' modifiers from it in all accessor functions and their callers. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/kvm/sys_

[PATCH v4 1/4] KVM: arm64: Correctly handle zero register during MMIO

2015-12-04 Thread Pavel Fedin
are also added to ARM32 code. This patch fixes setting MMIO register to a random value (actually SP) instead of zero by something like: *((volatile int *)reg) = 0; compilers tend to generate "str wzr, [xx]" here Signed-off-by: Pavel Fedin <p.fe...@samsung.com> Reviewed-

[PATCH v4 4/4] KVM: arm64: Get rid of old vcpu_reg()

2015-12-04 Thread Pavel Fedin
Using oldstyle vcpu_reg() accessor is proven to be inappropriate and unsafe on ARM64. This patch converts the rest of use cases to new accessors and completely removes vcpu_reg() on ARM64. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> Reviewed-by: Marc Zyngier <marc.zyng...@arm.com&g

[PATCH v4 3/4] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-04 Thread Pavel Fedin
context structure, we introduce a dedicated storage for it in struct sys_reg_params. This refactor also gets rid of "massive hack" in kvm_handle_cp_64(). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> Reviewed-by: Marc Zyngier <marc.zyng...@arm.com> --- arch/arm64/kvm/sys_

[PATCH v2 4/4] KVM: arm64: Get rid of old vcpu_reg()

2015-12-04 Thread Pavel Fedin
Using oldstyle vcpu_reg() accessor is proven to be inappropriate and unsafe on ARM64. This patch converts the rest of use cases to new accessors and completely removes vcpu_reg() on ARM64. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/psci.c

[PATCH v2 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-04 Thread Pavel Fedin
lower_32_bits()/upper_32_bits() where appropriate - Fixed wrong usage of 'Rt' instead of 'Rt2' in kvm_handle_cp_64(), overlooked in v1 - Do not write value back when reading Pavel Fedin (4): KVM: arm64: Correctly handle zero register during MMIO KVM: arm64: Remove const from struct sys_reg_params

[PATCH v2 3/4] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-04 Thread Pavel Fedin
context structure, we introduce a dedicated storage for it in struct sys_reg_params. This refactor also gets rid of "massive hack" in kvm_handle_cp_64(). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/kvm/sys_regs.c| 88 ++--

[PATCH v2 1/4] KVM: arm64: Correctly handle zero register during MMIO

2015-12-04 Thread Pavel Fedin
are also added to ARM32 code. This patch fixes setting MMIO register to a random value (actually SP) instead of zero by something like: *((volatile int *)reg) = 0; compilers tend to generate "str wzr, [xx]" here Signed-off-by: Pavel Fedin <p.fe...@samsung.com> Reviewed-

[PATCH v2 2/4] KVM: arm64: Remove const from struct sys_reg_params

2015-12-04 Thread Pavel Fedin
Further rework is going to introduce a dedicated storage for transfer register value in struct sys_reg_params. Before doing this we have to remove all 'const' modifiers from it. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/kvm/sys_regs.c

RE: [PATCH v2 2/4] KVM: arm64: Remove const from struct sys_reg_params

2015-12-04 Thread Pavel Fedin
Hello! > I think you are being a bit overzealous here, and a few const can > legitimately be kept, see below. :) Yes, i've just commanded "search and replace" to the editor. Fixing... Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Pavel Fedin
it is cc'd to stable, so unless it is going to be nacked at review > stage, any subsequent fixes should also be cc'd. Sorry guys for messing things up a bit, but the affected commit actually is in stable branch (4.4-rc3), so i decided to Cc: stable, just in case, because the breakage is quite bi

RE: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Pavel Fedin
inter for exchange with userspace, see vgic_v3_cpu_regs_access() and callers. I wouldn't like to refactor the code again. What's your opinion on this? And of course i'll fix up the rest. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this li

RE: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Pavel Fedin
_params' declaration, and callers, and their callers... This 'const' is all around the code, and it would take a separate huge patch to un-const'ify all this. Does it worth that? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this lis

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Pavel Fedin
st in case. I was about to finish the testing and send the patch in maybe one or two hours. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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

[PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-03 Thread Pavel Fedin
discovered by performing an operation *((volatile int *)reg) = 0; which compiles as "str xzr, [xx]", and resulted in strange values being written. Pavel Fedin (3): KVM: arm64: Correctly handle zero register during MMIO KVM: arm64: Correctly handle zero register in system registe

[PATCH 1/3] KVM: arm64: Correctly handle zero register during MMIO

2015-12-03 Thread Pavel Fedin
are also added to ARM32 code. This patch fixes setting MMIO register to a random value (actually SP) instead of zero by something like: *((volatile int *)reg) = 0; compilers tend to generate "str wzr, [xx]" here Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch

[PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Pavel Fedin
System register accesses also use zero register for Rt == 31, and therefore using it will also result in getting SP value instead. This patch makes them also using new accessors, introduced by the previous patch. Additionally, got rid of "massive hack" in kvm_handle_cp_64(). Signed-off

[PATCH 3/3] KVM: arm64: Get rid of old vcpu_reg()

2015-12-03 Thread Pavel Fedin
Using oldstyle vcpu_reg() accessor is proven to be inapproptiate and unsafe on ARM64. This patch fixes the rest of use cases and completely removes vcpu_reg() on ARM64. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/psci.c | 20 ++-- arch

RE: [PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-03 Thread Pavel Fedin
n our vgic-v3-switch.S: msr_s ICH_HCR_EL2, xzr It's only because it is KVM code we have never discovered this problem yet. Somebody could write such a thing in some other place, with some other register, which would be executed by KVM, and... boo... Kind regards, Pavel

RE: [PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-12-03 Thread Pavel Fedin
] http://www.spinics.net/lists/kvm/msg121669.html, > http://www.spinics.net/lists/kvm/msg121662.html > [2] http://www.spinics.net/lists/kvm/msg119236.html Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-02 Thread Pavel Fedin
. I have found the problem, and it's just good luck that it works on some machines. Unreliably, BTW. The problem is that it verifies guest's physical addresses (IPA) against host memory map; and the fix is here: http://www.spinics.net/lists/kvm/msg124561.html Kind regards, Pavel Fedin Expert En

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Pavel Fedin
c timer), and it still works fine there. > And instead of reverting, could we fix this properly instead? Of course, i'm not against alternate approaches, feel free to. I've just suggested what i could, to fix things quickly. I'm indeed no expert in KVM memory management yet. After all, this is what m

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Pavel Fedin
only on some particular HW. I'll try to figure this out. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Pavel Fedin
nd testing, and i was involved too. Perhaps it's board's code fault, however. Cc'ed to others involved. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to

[PATCH 3/3] KVM: arm/arm64: Decouple virtual timer from vGIC

2015-12-01 Thread Pavel Fedin
Remove dependency on vgic_initialized() and use the newly introduced infrastructure to send interrupts via the userspace if vGIC is not being used. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/arm.c| 8 +--- virt/kvm/arm/arch_timer.

[PATCH 2/3] KVM: Documentation: Document KVM_EXIT_IRQ

2015-12-01 Thread Pavel Fedin
Add documentation for the new exit code. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- Documentation/virtual/kvm/api.txt | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 092ee9f..d8aae4c

[PATCH 1/3] KVM: Introduce KVM_EXIT_IRQ

2015-12-01 Thread Pavel Fedin
code. This can be extended in the future if necessary. The interface is designed to be as much arch-agnostic as possible. Therefore, it has IRQ number and level as parameters (encoded in struct kvm_irq_level). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/arm.c

[PATCH 0/3] Add support for handling IRQs in userspace

2015-12-01 Thread Pavel Fedin
. The API is designed to be as much architecture-agnostic is possible. Currently it actually supports only a single IRQ, but it can be easily extended to accomodate more. Pavel Fedin (3): KVM: Introduce KVM_EXIT_IRQ KVM: Documentation: Document KVM_EXIT_IRQ KVM: arm/arm64: Decouple virtual timer from

[PATCH v6] arm/arm64: KVM: Detect vGIC presence at runtime

2015-12-01 Thread Pavel Fedin
The guest is currently suggested to use some memory-mapped timer which can be emulated in userspace. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- v5 => v6: - KVM_CAP_IRQFD patch also dropped, causing many problems on PowerPC and S390 - Rebased on top of 4.3-rc3 v4 => v5: - T

[PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-01 Thread Pavel Fedin
on Samsung proprietary hardware. Cc: sta...@vger.kernel.org Fixes: e6fab5442345 ("ARM/arm64: KVM: test properly for a PTE's uncachedness") Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ar

RE: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-12-01 Thread Pavel Fedin
03:16.135724Z qemu-system-arm: Error binding guest notifier: 11 2015-12-01T11:03:16.135849Z qemu-system-arm: unable to start vhost net: 11: falling back on userspace virtio --- cut --- So, the resume is: we just drop this patch and only N1 remains. Kind regards, Pavel Fedin Expert Engineer Samsun

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-01 Thread Pavel Fedin
Hello! > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf > Of Pavel Fedin > Sent: Tuesday, December 01, 2015 1:03 PM > To: 'Marc Zyngier'; kvm...@lists.cs.columbia.edu; kvm@vger.kernel.org > Cc: 'Ard Biesheuv

BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-11-30 Thread Pavel Fedin
time to investigate this quickly, but i'll post some new information as soon as i get it Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.

RE: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-11-30 Thread Pavel Fedin
at perhaps we have some real need to distinguish between different irqchip types, but shouldn't the kernel also publish KVM_CAP_IRQCHIP, which stands just for "we support some irqchip virtualization"? May be we should just add this for PowerPC and S390, to make things less ambiguous?

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

2015-11-30 Thread Pavel Fedin
t 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 (2): arm/arm64: KVM: Detect vGIC presence at runtime KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

[PATCH v5 1/2] arm/arm64: KVM: Detect vGIC presence at runtime

2015-11-30 Thread Pavel Fedin
The guest is currently suggested to use some memory-mapped timer which can be emulated in userspace. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm/kvm/arm.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm

[PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-11-30 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 <p.fe...@samsung.com> --- virt/kvm/kvm_main.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

RE: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-11-30 Thread Pavel Fedin
ere's simply no use for them. But, well, perhaps there would be an exception in vhost, i don't remember testing it. So what shall we do? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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

RE: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-11-30 Thread Pavel Fedin
mber testing it. > > Wouldn't an irqfd emulation cover vhost? Of course it would. At least it should, but perhaps will need some minor tweaks. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "

RE: [PATCH v3 15/16] KVM: arm64: implement MSI injection in ITS emulation

2015-11-25 Thread Pavel Fedin
ts_inject_msi(struct kvm *kvm, struct kvm_msi *msi); > + > bool vits_queue_lpis(struct kvm_vcpu *vcpu); > void vits_unqueue_lpi(struct kvm_vcpu *vcpu, int irq); > > diff --git a/virt/kvm/arm/vgic-v3-emul.c b/virt/kvm/arm/vgic-v3-emul.c > index f482e34..90f3628 100644 > --- a/virt

[PATCH v6 2/7] KVM: arm/arm64: Move endianness conversion out of vgic_attr_regs_access()

2015-11-24 Thread Pavel Fedin
of endianness conversion and masking. Masking is not used here (the mask is set to ~0), so we just move out the remaining endianness conversion. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- virt/kvm/arm/vgic-v2-emul.c | 20 1 file changed, 8 insertions(+), 12 deletions(-)

[PATCH v6 7/7] KVM: arm64: Implement vGICv3 CPU interface access

2015-11-24 Thread Pavel Fedin
Access size is always 64 bits. Since CPU interface state actually affects only a single vCPU, no vGIC locking is done in order to avoid code duplication. Just made sure that the vCPU is not running. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/include/uapi/asm/kvm.h

[PATCH v6 6/7] KVM: arm64: Introduce find_reg_by_id()

2015-11-24 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 <p

[PATCH v6 4/7] KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace

2015-11-24 Thread Pavel Fedin
ould normally be 0), for read operations this would cause duplication of the same word in both halves. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- arch/arm64/include/uapi/asm/kvm.h | 1 + include/linux/irqchip/arm-gic-v3.h | 1 + virt/kvm/arm/vgic-v3-emul.c

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

2015-11-24 Thread Pavel Fedin
GICv3 save/restore API documentation Pavel Fedin (6): KVM: arm/arm64: Move endianness conversion out of vgic_attr_regs_access() KVM: arm/arm64: Refactor vGIC attributes handling code KVM: arm64: Implement vGICv3 distributor and redistributor access from userspace KVM: arm64: Refact

[PATCH v6 1/7] KVM: arm/arm64: Add VGICv3 save/restore API documentation

2015-11-24 Thread Pavel Fedin
eter.mayd...@linaro.org> Acked-by: Marc Zyngier <marc.zyng...@arm.com> Signed-off-by: Christoffer Dall <christoffer.d...@linaro.org> Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- Documentation/virtual/kvm/devices/arm-vgic-v3.txt | 116 ++ Documentation/vi

[PATCH v6 5/7] KVM: arm64: Refactor system register handlers

2015-11-24 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 <p.fe...@samsung.com> ---

[PATCH v6 3/7] KVM: arm/arm64: Refactor vGIC attributes handling code

2015-11-24 Thread Pavel Fedin
differently. Also, vcpu pointer has backpointer to kvm, so 'dev' was replaced with 'vcpu'. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- virt/kvm/arm/vgic-v2-emul.c | 120 +++- virt/kvm/arm/vgic.c | 57 + virt/kvm/arm/

[PATCH v2 1/3] vfio: Introduce map and unmap operations

2015-11-24 Thread Pavel Fedin
These new functions allow direct mapping and unmapping of addresses on the given IOMMU. They will be used for mapping MSI hardware. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- drivers/vfio/vfio_iommu_type1.c | 29 + include/linux/vfio.h

[PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-11-24 Thread Pavel Fedin
=> v2: - Adde dependency on CONFIG_GENERIC_MSI_IRQ_DOMAIN in some parts of the code, should fix build without this option Pavel Fedin (3): vfio: Introduce map and unmap operations gicv3, its: Introduce VFIO map and unmap operations vfio: Introduce generic MSI mapping operations driv

[PATCH v2 2/3] gicv3, its: Introduce VFIO map and unmap operations

2015-11-24 Thread Pavel Fedin
These new functions use the supplied IOMMU in order to map and unmap MSI translation register(s). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- drivers/irqchip/irq-gic-v3-its.c | 31 +++ include/linux/irqchip/arm-gic-v3.h | 2 ++ include/linux

[PATCH v2 3/3] vfio: Introduce generic MSI mapping operations

2015-11-24 Thread Pavel Fedin
at least one device referring to it using MSI. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- drivers/vfio/pci/vfio_pci_intrs.c | 11 drivers/vfio/vfio.c | 116 ++ include/linux/vfio.h | 13 + 3 files change

[PATCH 2/3] gicv3, its: Introduce VFIO map and unmap operations

2015-11-23 Thread Pavel Fedin
These new functions use the supplied IOMMU in order to map and unmap MSI translation register(s). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- drivers/irqchip/irq-gic-v3-its.c | 31 +++ include/linux/irqchip/arm-gic-v3.h | 2 ++ include/linux

[PATCH 1/3] vfio: Introduce map and unmap operations

2015-11-23 Thread Pavel Fedin
These new functions allow direct mapping and unmapping of addresses on the given IOMMU. They will be used for mapping MSI hardware. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- drivers/vfio/vfio_iommu_type1.c | 29 + include/linux/vfio.h

[PATCH 0/3] Introduce MSI hardware mapping for VFIO

2015-11-23 Thread Pavel Fedin
On some architectures (e.g. ARM64) if the device is behind an IOMMU, and is being mapped by VFIO, it is necessary to also add mappings for MSI translation register for interrupts to work. This series implements the necessary API to do this, and makes use of this API for GICv3 ITS on ARM64. Pavel

RE: [PATCH v2] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-10 Thread Pavel Fedin
Hello! Tested-by: Pavel Fedin <p.fe...@samsung.com> Personally i have a small concern about this way of testing. I know many ports of the kernel to proprietary systems, and they tend to have drivers which just deal with hardcoded physical memory regions on their own, withou

RE: [PATCH] ARM/arm64: KVM: test properly for a PTE's uncachedness

2015-11-08 Thread Pavel Fedin
Hello! I have tested this patch, it also fixes the crash on Exynos5410, and is indeed a better approach. Tested-by: Pavel Fedin <p.fe...@samsung.com> CC'ed general KVM mailing list too. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia >

RE: [PATCH] KVM: arm: Fix crash in free_hyp_pgds() if timer initialization fails

2015-11-06 Thread Pavel Fedin
e_pte(old_pte); > + > + put_page(virt_to_page(pte)); > } while (pte++, addr += PAGE_SIZE, addr != end); > > if (kvm_pte_table_empty(kvm, start_pte)) > -- I see you inverted pte_none() check, and now kbuild bot complains about "mixed declarations and code". Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- 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

RE: [PATCH] KVM: arm: Fix crash in free_hyp_pgds() if timer initialization fails

2015-11-06 Thread Pavel Fedin
unmapping logic to carry over a flag, telling whether we are removing normal or HYP mappings. But wouldn't this be much more complicated? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm&quo

RE: [PATCH] KVM: arm: Fix crash in free_hyp_pgds() if timer initialization fails

2015-11-06 Thread Pavel Fedin
ill test it on monday. Indeed, this is better than my approach, and this is what i actually wanted to do but didn't study the thing deeply enough to implement. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line &

RE: [PATCH v4 0/3] KVM: arm/arm64: Clean up some obsolete code

2015-11-04 Thread Pavel Fedin
CP15-timer-less boards like Exynos: http://www.spinics.net/lists/kvm/msg122746.html. Just to make sure that you don't miss it. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -- To unsubscribe from this list: send the line "unsubscribe kvm" in the b

[PATCH v5 2/4] KVM: arm/arm64: Replace lr_used with elrsr

2015-11-03 Thread Pavel Fedin
n elrsr '1' means 'free'). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- include/kvm/arm_vgic.h | 3 --- virt/kvm/arm/vgic-v2.c | 1 + virt/kvm/arm/vgic-v3.c | 1 + virt/kvm/arm/vgic.c| 37 + 4 files changed, 15 insertions(+), 27 deletion

[PATCH v5 1/4] KVM: arm/arm64: Remove vgic_irq_lr_map

2015-11-03 Thread Pavel Fedin
it in order to get prepared for LPI support introduction. After this number of IRQs will grow up to at least 16384, while numbers from 1024 to 8192 are never going to be used. This would be a huge memory waste. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- include/kvm/arm_vgic.

[PATCH v5 0/4] KVM: arm/arm64: Clean up some obsolete code

2015-11-03 Thread Pavel Fedin
e care about vgic_retire_lr(), which has deserved own patch. Pavel Fedin (4): KVM: arm/arm64: Remove vgic_irq_lr_map KVM: arm/arm64: Replace lr_used with elrsr KVM: arm/arm64: Clean up vgic_retire_lr() and surroundings KVM: arm/arm64: Merge vgic_set_lr() and vgic_sync_lr_elrsr() include/kvm/arm_

[PATCH v5 4/4] KVM: arm/arm64: Merge vgic_set_lr() and vgic_sync_lr_elrsr()

2015-11-03 Thread Pavel Fedin
Now we see that vgic_set_lr() and vgic_sync_lr_elrsr() are always used together. Merge them into one function, saving from second vgic_ops dereferencing every time. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- include/kvm/arm_vgic.h | 1 - virt/kvm/arm/vgic-v2.c | 5 - virt/k

[PATCH v5 3/4] KVM: arm/arm64: Clean up vgic_retire_lr() and surroundings

2015-11-03 Thread Pavel Fedin
ear_queued() inside of it. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- virt/kvm/arm/vgic.c | 37 ++--- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 265a410..96e45f3 100644 --- a/vir

RE: [PATCH v4 0/3] KVM: arm/arm64: Clean up some obsolete code

2015-11-03 Thread Pavel Fedin
stop at any point, and actually you should be able to easily throw away 0003 and apply just 1, 2, 4. The minimum needed thing for LPIs introduction is 0001. You can also stick to v4 if the problem does not get triggered by its first patch, if you prefer reduced commit log. Kind regards, Pa

RE: [PATCH v4 0/3] KVM: arm/arm64: Clean up some obsolete code

2015-11-02 Thread Pavel Fedin
hat version then, which will provide the necessary changes to plug in LPIs, yet with minimal changes (it will only remove vgic_irq_lr_map). I guess i should have done it before. Or, i could even respin v5, with current 0001 split up. This should make it easier to bisect the problem. Kind regards,

RE: [PATCH v5 0/7] KVM: arm64: Implement API for vGICv3 live migration

2015-10-28 Thread Pavel Fedin
--- cut --- -EBUSY: One or more VCPUs are running --- cut --- While my version says "VCPU is running". Since this is CPU interface, it does not affect other CPUs, so for simplicity i check only current vCPU in my code. That's all. Just i'm maybe too careful about fundamentals... Kind rega

RE: [PATCH v3 2/3] KVM: arm/arm64: Merge vgic_set_lr() and vgic_sync_lr_elrsr()

2015-10-27 Thread Pavel Fedin
h it in. > which breaks bisectability and makes it impossible to understand the logic by > looking > at this commit in isolation. Will this be understood better if i make this particular refactor a separate commit, with better explanations? Kind regards, Pavel Fedin Expert Engineer Samsung E

[PATCH v4 1/3] KVM: arm/arm64: Optimize away redundant LR tracking

2015-10-27 Thread Pavel Fedin
elrsr/aisr in sync with software model"), because together with lr_used we also update elrsr. This allows to easily replace lr_used with elrsr, inverting all conditions (because in elrsr '1' means 'free'). Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- include/kvm/arm_vgic.h | 6

[PATCH v4 2/3] KVM: arm/arm64: Clean up vgic_retire_lr() and surroundings

2015-10-27 Thread Pavel Fedin
ear_queued() inside of it. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- virt/kvm/arm/vgic.c | 37 ++--- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 265a410..96e45f3 100644 --- a/virt/kvm/arm/v

[PATCH v4 3/3] KVM: arm/arm64: Merge vgic_set_lr() and vgic_sync_lr_elrsr()

2015-10-27 Thread Pavel Fedin
Now we see that vgic_set_lr() and vgic_sync_lr_elrsr() are always used together. Merge them into one function, saving from second vgic_ops dereferencing every time. Signed-off-by: Pavel Fedin <p.fe...@samsung.com> --- include/kvm/arm_vgic.h | 1 - virt/kvm/arm/vgic-v2.c | 5 - virt/k

  1   2   3   4   >