Help debugging a regression in KVM Module

2015-08-14 Thread Peter Lieven
Hi, some time a go I stumbled across a regression in the KVM Module that has been introduced somewhere between 3.17 and 3.19. I have a rather old openSUSE guest with an XFS filesystem which realiably crashes after some live migrations. I originally believed that the issue might be related to

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

2015-08-14 Thread Marc Zyngier
On 05/08/15 11:53, Pavel Fedin wrote: Before commit 662d9715840aef44dcb573b0f9fab9e8319c868a is was possible to compile the kernel without vGIC and vTimer support. Commit message says about possibility to detect vGIC support in runtine, but this has never been implemented. This patch

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

2015-08-14 Thread Pavel Fedin
Hello! This is completely Linux-specific, unfortunately. Yes. But better than nothing. And it relies on userpace to expose a modified DT, so you need to be able to report back to userspace that you can't deal with the virtual timer. Easy. If KVM_CAP_IRQCHIP == 0, then we apparently

Re: [PATCH 2/2] KVM: x86: fix edge EOI and IOAPIC reconfig race

2015-08-14 Thread Radim Krčmář
2015-08-13 16:53+0200, Paolo Bonzini: On 13/08/2015 15:46, Radim Krčmář wrote: 1) IOAPIC inject a vector from i8254 2) guest reconfigures that vector's VCPU and therefore eoi_exit_bitmap on original VCPU gets cleared 3) guest's handler for the vector does EOI 4) KVM's EOI handler

Re: [PATCH v2 1/5] KVM: add kvm_has_request wrapper

2015-08-14 Thread Radim Krčmář
2015-08-13 12:03+0200, Christian Borntraeger: Am 13.08.2015 um 11:29 schrieb Paolo Bonzini: On 13/08/2015 11:11, Radim Krčmář wrote: for the new interface. maybe we can rename kvm_check_request in a separate patch somewhen. I wonder why haven't we copied the naming convention from bit

[PATCH v2 01/18] acpi: allow aml_operation_region() working on 64 bit offset

2015-08-14 Thread Xiao Guangrong
Currently, the offset in OperationRegion is limited to 32 bit, extend it to 64 bit so that we can switch SSDT to 64 bit in later patch Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/acpi/aml-build.c | 2 +- include/hw/acpi/aml-build.h | 2 +- 2 files changed, 2

[PATCH v2 09/18] nvdimm: build ACPI NFIT table

2015-08-14 Thread Xiao Guangrong
NFIT is defined in ACPI 6.0: 5.2.25 NVDIMM Firmware Interface Table (NFIT) Currently, we only support PMEM mode. Each device has 3 tables: - SPA table, define the PMEM region info - MEM DEV table, it has the @handle which is used to associate specified ACPI NVDIMM device we will introduce in

[PATCH v2 05/18] acpi: add aml_create_field

2015-08-14 Thread Xiao Guangrong
Implement CreateField term which are used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/acpi/aml-build.c | 14 ++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 15 insertions(+) diff --git a/hw/acpi/aml-build.c

[PATCH v2 03/18] acpi: add aml_derefof

2015-08-14 Thread Xiao Guangrong
Implement DeRefOf term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c

[PATCH v2 07/18] nvdimm: reserve address range for NVDIMM

2015-08-14 Thread Xiao Guangrong
NVDIMM reserves all the free range above 4G to do: - Persistent Memory (PMEM) mapping - implement NVDIMM ACPI device _DSM method Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/i386/pc.c | 12 ++-- hw/mem/nvdimm/pc-nvdimm.c | 13 +

[PATCH v2 06/18] pc: implement NVDIMM device abstract

2015-08-14 Thread Xiao Guangrong
Introduce pc-nvdimm device and it has two parameters: - @file, which is the backed memory file for NVDIMM device - @configdata, specify if we need to reserve 128k at the end of @file for nvdimm device's config data. Default is false If @configdata is false, Qemu will build a static and

[PATCH v2 08/18] nvdimm: init backend memory mapping and config data area

2015-08-14 Thread Xiao Guangrong
The parameter @file is used as backed memory for NVDIMM which is divided into two parts if @dataconfig is true: - first parts is (0, size - 128K], which is used as PMEM (Persistent Memory) - 128K at the end of the file, which is used as Config Data Area, it's used to store Label namespace data

[PATCH v2 17/18] nvdimm: support NFIT_CMD_SET_CONFIG_DATA

2015-08-14 Thread Xiao Guangrong
Function 6 is used to set Namespace Label Data Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/mem/nvdimm/acpi.c | 40 1 file changed, 40 insertions(+) diff --git a/hw/mem/nvdimm/acpi.c b/hw/mem/nvdimm/acpi.c index 517d710..283228d

[PATCH v2 15/18] nvdimm: support NFIT_CMD_GET_CONFIG_SIZE function

2015-08-14 Thread Xiao Guangrong
Function 4 is used to get Namespace lable size Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/mem/nvdimm/acpi.c | 70 1 file changed, 70 insertions(+) diff --git a/hw/mem/nvdimm/acpi.c b/hw/mem/nvdimm/acpi.c index

[PATCH v2 16/18] nvdimm: support NFIT_CMD_GET_CONFIG_DATA

2015-08-14 Thread Xiao Guangrong
Function 5 is used to get Namespace Label Data Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/mem/nvdimm/acpi.c | 32 1 file changed, 32 insertions(+) diff --git a/hw/mem/nvdimm/acpi.c b/hw/mem/nvdimm/acpi.c index 0a5f2c2..517d710 100644 ---

[PATCH v2 18/18] nvdimm: add maintain info

2015-08-14 Thread Xiao Guangrong
Add NVDIMM maintainer Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 978b717..86786e6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -793,6 +793,12 @@ M: Jiri Pirko

[PATCH v2 13/18] nvdimm: build namespace config data

2015-08-14 Thread Xiao Guangrong
If @configdata is false, Qemu will build a static and readonly namespace in memory and use it serveing for DSM GET_CONFIG_SIZE/GET_CONFIG_DATA requests Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/mem/Makefile.objs | 3 +- hw/mem/nvdimm/acpi.c | 10 ++

[PATCH v2 11/18] nvdimm: build ACPI nvdimm devices

2015-08-14 Thread Xiao Guangrong
NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices This is a root device under \_SB and specified NVDIMM device are under the root device. Each NVDIMM device has _ADR which return its handle used to associate MEMDEV table in NFIT We reserve handle 0 for root device. In this patch, we save

[PATCH v2 12/18] nvdimm: save arg3 for NVDIMM device _DSM method

2015-08-14 Thread Xiao Guangrong
Check if the function (Arg2) has additional input info (arg3) and save the info if needed We only do the save on NVDIMM device since we are not going to support any function on root device Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/mem/nvdimm/acpi.c | 73

[PATCH v2 14/18] nvdimm: support NFIT_CMD_IMPLEMENTED function

2015-08-14 Thread Xiao Guangrong
__DSM is defined in ACPI 6.0: 9.14.1 _DSM (Device Specific Method) Function 0 is a query function. We do not support any function on root device and only 3 functions are support for NVDIMM device, NFIT_CMD_GET_CONFIG_SIZE, NFIT_CMD_GET_CONFIG_DATA and NFIT_CMD_SET_CONFIG_DATA, that means we

[PATCH v2 10/18] nvdimm: init the address region used by DSM method

2015-08-14 Thread Xiao Guangrong
This memory range is used to transfer data between ACPI in guest and Qemu, it occupies two pages: - one is RAM-based used to save the input info of _DSM method and Qemu reuse it store output info - another one is MMIO-based, ACPI write data to this page to transfer the control to Qemu

[PATCH v2 02/18] i386/acpi-build: allow SSDT to operate on 64 bit

2015-08-14 Thread Xiao Guangrong
Only 512M is left for MMIO below 4G and that are used by PCI, BIOS etc. Other components also reserve regions from their internal usage, e.g, [0xFED0, 0xFED0 + 0x400) is reserved for HPET Switch SSDT to 64 bit to use the huge free room above 4G. In the later patches, we will dynamical

[PATCH v2 00/18] implement vNVDIMM

2015-08-14 Thread Xiao Guangrong
Changlog: - Use litten endian for DSM method, thanks for Stefan's suggestion - introduce a new parameter, @configdata, if it's false, Qemu will build a static and readonly namespace in memory and use it serveing for DSM GET_CONFIG_SIZE/GET_CONFIG_DATA requests. In this case, no reserved

[PATCH v2 04/18] acpi: add aml_sizeof

2015-08-14 Thread Xiao Guangrong
Implement SizeOf term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- hw/acpi/aml-build.c | 8 include/hw/acpi/aml-build.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/acpi/aml-build.c

Re: Help debugging a regression in KVM Module

2015-08-14 Thread Peter Lieven
Am 14.08.2015 um 15:01 schrieb Paolo Bonzini: - Original Message - From: Peter Lieven p...@kamp.de To: qemu-de...@nongnu.org, kvm@vger.kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Sent: Friday, August 14, 2015 1:11:34 PM Subject: Help debugging a regression in KVM Module Hi,

Re: [Qemu-devel] Help debugging a regression in KVM Module

2015-08-14 Thread Alex Bennée
Peter Lieven p...@kamp.de writes: Hi, some time a go I stumbled across a regression in the KVM Module that has been introduced somewhere between 3.17 and 3.19. I have a rather old openSUSE guest with an XFS filesystem which realiably crashes after some live migrations. I originally

x2APIC and number of the vcpu

2015-08-14 Thread Ozgur O Kilic
Hello, I am making some research abut the x2APIC and number of max vcpus. According to Intel if we use APIC we can only have 2^8 vcpu and if we use x2APIC it allows 2^10 vcpu because it has 32 bit address space for APIC_ID. My question is: is it possible theoretically or any one tried it? and if

Re: [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling

2015-08-14 Thread Cyrill Gorcunov
On Fri, Aug 14, 2015 at 01:57:42PM -0700, Andy Lutomirski wrote: Don't bother testing yet. I'm waffling between trying something like this and adding SA_SAVE_SS. I have partially written patches for the latter. ok, ping me if anything -- To unsubscribe from this list: send the line

Re: [RFC/PATCH 1/3] x86/kvm: Rename VMX's segment access rights defines

2015-08-14 Thread Paolo Bonzini
On 13/08/2015 22:18, Andy Lutomirski wrote: VMX encodes access rights differently from LAR, and the latter is most likely what x86 people think of when they think of access rights. Rename them to avoid confusion. Good idea, I've gone ahead and applied it for 4.3. Cc: kvm@vger.kernel.org

Re: [PATCH 2/2] KVM: x86: fix edge EOI and IOAPIC reconfig race

2015-08-14 Thread Paolo Bonzini
On 14/08/2015 10:38, Radim Krčmář wrote: How do you reproduce the bug? I run rhel4 (2.6.9) kernel on 2 VCPUs and frequently alternate smp_affinity of timer. The bug is hit within seconds. Nice, I'll try to make a unit test for it on the plane. :) Paolo -- To unsubscribe from this list:

[GIT PULL] KVM patches for 4.2-rc7

2015-08-14 Thread Paolo Bonzini
Linus, The following changes since commit fc1a8126bf8095b10f5a79893f2d2b19227f88f2: KVM: MTRR: Use default type for non-MTRR-covered gfn before WARN_ON (2015-08-05 11:57:57 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus for you

Re: [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling

2015-08-14 Thread Cyrill Gorcunov
On Thu, Aug 13, 2015 at 01:18:50PM -0700, Andy Lutomirski wrote: This adds two new uc_flags flags. UC_SAVED_SS will be set for all 64-bit signals (including x32). It indicates that the saved SS field is valid and that the kernel understands UC_RESTORE_SS. The kernel will *not* set

[GIT PULL] Early batch of KVM changes for 4.3 merge window

2015-08-14 Thread Paolo Bonzini
Linus, the merge window will likely coincide with my two-week vacation across August and September. Rather than hoping for an -rc8, I'm sending now what I have. The PPC and ARM parts might come a few days after the official end of the merge window. The uncommon name for the tag (you said you

Re: x2APIC and number of the vcpu

2015-08-14 Thread Paolo Bonzini
On 15/08/2015 01:03, Ozgur O Kilic wrote: My question is: is it possible theoretically or any one tried it? and if it is I cheched my pc's hardware is support x2APIC whıch version of KVM should I use for that? KVM doesn't support more than 256 VCPUs, even with x2APIC enabled in the guest.

Re: [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling

2015-08-14 Thread Andy Lutomirski
On Fri, Aug 14, 2015 at 1:55 PM, Cyrill Gorcunov gorcu...@gmail.com wrote: On Thu, Aug 13, 2015 at 01:18:50PM -0700, Andy Lutomirski wrote: This adds two new uc_flags flags. UC_SAVED_SS will be set for all 64-bit signals (including x32). It indicates that the saved SS field is valid and that

Re: [PATCH v3 0/5] KVM: optimize userspace exits with a new ioctl

2015-08-14 Thread Paolo Bonzini
On 14/08/2015 12:08, Radim Krčmář wrote: v3: * acked by Christian [1/5] * use ioctl argument directly (unsigned long as flags) [4/5] * precisely #ifdef arch-specific ioctls [5/5] v2: * move request_exits debug counter patch right after introduction of KVM_REQ_EXIT [3/5] * use

Re: [PATCH v2 11/15] KVM: arm64: handle pending bit for LPIs in ITS emulation

2015-08-14 Thread Eric Auger
On 07/10/2015 04:21 PM, Andre Przywara wrote: As the actual LPI number in a guest can be quite high, but is mostly assigned using a very sparse allocation scheme, bitmaps and arrays for storing the virtual interrupt status are a waste of memory. We use our equivalent of the Interrupt

Re: [PATCH v2 12/15] KVM: arm64: sync LPI configuration and pending tables

2015-08-14 Thread Eric Auger
On 07/10/2015 04:21 PM, Andre Przywara wrote: The LPI configuration and pending tables of the GICv3 LPIs are held in tables in (guest) memory. To achieve reasonable performance, we cache this data in our own data structures, so we need to sync those two views from time to time. This behaviour

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

2015-08-14 Thread Pavel Fedin
Hello! Thank you for quick response. This is fairly unreadable. Please use a switch statement instead. Christoffer disliked it in v1, so i thought a bit and changed it. Ok, will change it back. And here, we're going to assume that the arch timer still usable. We definitely need a way to

Re: [PATCH v2 12/15] KVM: arm64: sync LPI configuration and pending tables

2015-08-14 Thread Eric Auger
On 08/14/2015 01:58 PM, Eric Auger wrote: On 07/10/2015 04:21 PM, Andre Przywara wrote: The LPI configuration and pending tables of the GICv3 LPIs are held in tables in (guest) memory. To achieve reasonable performance, we cache this data in our own data structures, so we need to sync those

Re: Help debugging a regression in KVM Module

2015-08-14 Thread Paolo Bonzini
- Original Message - From: Peter Lieven p...@kamp.de To: qemu-de...@nongnu.org, kvm@vger.kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Sent: Friday, August 14, 2015 1:11:34 PM Subject: Help debugging a regression in KVM Module Hi, some time a go I stumbled across a

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: kvm...@lists.cs.columbia.edu;

[PATCH v3 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit

2015-08-14 Thread Radim Krčmář
The guest can use KVM_USER_EXIT instead of a signal-based exiting to userspace. Availability depends on KVM_CAP_USER_EXIT. Only x86 is implemented so far. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- v3: * use ioctl argument directly (unsigned long as flags) [Paolo] v2: * use vcpu

[PATCH v3 2/5] KVM: add KVM_REQ_EXIT request for userspace exit

2015-08-14 Thread Radim Krčmář
When userspace wants KVM to exit to userspace, it sends a signal. This has a disadvantage of requiring a change to the signal mask because the signal needs to be blocked in userspace to stay pending when sending to self. Using a request flag allows us to shave 200-300 cycles from every userspace

[PATCH v3 0/5] KVM: optimize userspace exits with a new ioctl

2015-08-14 Thread Radim Krčmář
v3: * acked by Christian [1/5] * use ioctl argument directly (unsigned long as flags) [4/5] * precisely #ifdef arch-specific ioctls [5/5] v2: * move request_exits debug counter patch right after introduction of KVM_REQ_EXIT [3/5] * use vcpu ioctl instead of vm one [4/5] * shrink

[PATCH v3 1/5] KVM: add kvm_has_request wrapper

2015-08-14 Thread Radim Krčmář
We want to have requests abstracted from bit operations. Acked-by: Christian Borntraeger borntrae...@de.ibm.com Signed-off-by: Radim Krčmář rkrc...@redhat.com --- v3: acked by Christian arch/x86/kvm/vmx.c | 2 +- include/linux/kvm_host.h | 7 ++- 2 files changed, 7 insertions(+), 2

[PATCH v3 3/5] KVM: x86: add request_exits debug counter

2015-08-14 Thread Radim Krčmář
We are still interested in the amount of exits userspace requested and signal_exits doesn't cover that anymore. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- v2: move request_exits debug counter patch right after introduction of KVM_REQ_EXIT arch/x86/include/asm/kvm_host.h | 1 +

[Bug 102651] vcpuX unhandled rdmsr: 0x570

2015-08-14 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=102651 Huaitong Han oen...@gmail.com changed: What|Removed |Added CC||oen...@gmail.com ---

[PATCH v3 5/5] KVM: refactor asynchronous vcpu ioctl dispatch

2015-08-14 Thread Radim Krčmář
I find the switch easier to read and modify. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- v3: precisely #ifdef arch-specific ioctls [Christian] v2: new virt/kvm/kvm_main.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c

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

2015-08-14 Thread Marc Zyngier
On 14/08/15 13:26, Pavel Fedin wrote: Hello! Thank you for quick response. This is fairly unreadable. Please use a switch statement instead. Christoffer disliked it in v1, so i thought a bit and changed it. Ok, will change it back. And here, we're going to assume that the arch timer