[kvm-unit-test RFC] x86: Memory instructions test case

2015-11-04 Thread Eduardo Habkost
Quickly hacked test case for memory instructions (clflush, mfence, sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD exceptions. This was useful to test TCG handling of those instructions. The "fake clwb" part will probably break once a new instruction use those opcodes.

Re: [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-04 Thread Eduardo Habkost
On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote: > The value of the migrated vcpu's TSC rate is determined as below. > 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this > user-specified value will be used. > 2. If neither a user-specified TSC rate nor a

Re: [patch] vfio: make an array larger

2015-11-04 Thread walter harms
Am 04.11.2015 14:26, schrieb Dan Carpenter: > Smatch complains about a possible out of bounds error: > > drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init() > error: buffer overflow 'pci_cap_length' 20 <= 20 > > Fix this by making the array larger. > > Signed-off-by: Dan

Re: [PATCH] Fixed KVM problems with old DOS programs. Compatibility can be forced by module parameter.

2015-11-04 Thread Paolo Bonzini
On 04/11/2015 22:33, Gerhard Wiesinger wrote: >>> >> What is the problem you are seeing? KVM can emulate task switches; the >> intercept is set here because of a processor erratum that can mess them >> up even though, in theory, AMD supports task switching from guest mode. > > See old thread:

[PATCH 1/2] target-i386: tcg: Accept clwb instruction

2015-11-04 Thread Eduardo Habkost
Accept the clwb instruction (66 0F AE /6) if its corresponding feature flag is enabled on CPUID[7]. Signed-off-by: Eduardo Habkost --- target-i386/translate.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/target-i386/translate.c

[PATCH 2/2] target-i386: tcg: Check right CPUID bits for clflushopt/pcommit

2015-11-04 Thread Eduardo Habkost
Detect the clflushopt and pcommit instructions and check their corresponding feature flags, instead of checking CPUID_SSE and CPUID_CLFLUSH. Signed-off-by: Eduardo Habkost --- target-i386/translate.c | 28 1 file changed, 20 insertions(+), 8

[PATCH 0/2] target-i386: tcg: Handle clflushopt/clwb/pcommit instructions

2015-11-04 Thread Eduardo Habkost
This series makes TCG accept the clwb instruction, and make it check the right CPUID bits when handling clflushopt and pcommit. Tested using the kvm-unit-test patch I sent earlier today: Subject: [kvm-unit-test RFC] x86: Memory instructions test case Message-Id:

Re: [PATCH] Fixed KVM problems with old DOS programs. Compatibility can be forced by module parameter.

2015-11-04 Thread Gerhard Wiesinger
On 04.11.2015 22:27, Paolo Bonzini wrote: On 04/11/2015 20:33, Gerhard Wiesinger wrote: Signed-off-by: Gerhard Wiesinger --- arch/x86/kvm/svm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 2f9ed1f..e0b00fc

Re: [PATCH] Fixed KVM problems with old DOS programs. Compatibility can be forced by module parameter.

2015-11-04 Thread Paolo Bonzini
On 04/11/2015 20:33, Gerhard Wiesinger wrote: > Signed-off-by: Gerhard Wiesinger > --- > arch/x86/kvm/svm.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 2f9ed1f..e0b00fc 100644 > --- a/arch/x86/kvm/svm.c >

Re: [v2] KVM: VMX: Fix commit which broke PML

2015-11-04 Thread Kai Huang
Hi Paolo, Thanks for applying! I am really sorry that I forgot to delete the line that clears SECONDARY_EXEC_ENABLE_PML bit in vmx_disable_pml, which is renamed to vmx_destroy_pml_buffer now. It won't impact functionality but to make the function consistent, would you also do below? Sorry for

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-04 Thread Mario Smarduch
On 11/4/2015 10:51 AM, Ard Biesheuvel wrote: > On 4 November 2015 at 19:49, Christopher Covington > wrote: >> On 11/04/2015 08:31 AM, Christoffer Dall wrote: >>> On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote: On Tue, Nov 3, 2015 at 1:17 PM, Mario

Re: [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-04 Thread Haozhong Zhang
On 11/04/15 19:42, Eduardo Habkost wrote: > On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote: > > The value of the migrated vcpu's TSC rate is determined as below. > > 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this > > user-specified value will be used. >

Re: [PATCH 2/2] kvmtool: assume dead vcpus are paused too

2015-11-04 Thread Sasha Levin
On 11/04/2015 06:51 AM, Will Deacon wrote: > + mutex_lock(_lock); > + > + /* The kvm->cpus array contains a null pointer in the last location */ > + for (i = 0; ; i++) { > + if (kvm->cpus[i]) > + pthread_kill(kvm->cpus[i]->thread, SIGKVMEXIT); > +

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-04 Thread Peter Hurley
On 11/04/2015 06:28 PM, Mario Smarduch wrote: > I spent time debugging 'earlycon' for pl011, ironically using DEBUG_LL, from > the > looks of it no mmio uart should work for armv7. It appears earlycon_map() > requires a fixed mapping similar to arm64. commit a5f4c561b3b1 ("ARM: 8415/1: early

Re: [Qemu-devel] [kvm-unit-test RFC] x86: Memory instructions test case

2015-11-04 Thread Xiao Guangrong
On 11/05/2015 05:21 AM, Eduardo Habkost wrote: Quickly hacked test case for memory instructions (clflush, mfence, sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD exceptions. This was useful to test TCG handling of those instructions. The "fake clwb" part will probably

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

2015-11-04 Thread Pavel Fedin
Hello! > Actually, I seem to have been just incredibly unlucky with my test > cycles, because I eventually reproduced the bug without your patches. Or lucky, without "un" :) > I'm going to take this version of the series because that's what I > reviewed and tested. It's OK, as i wrote, v5

Re: [Qemu-devel] [PATCH] target-i386: enable cflushopt/clwb/pcommit instructions

2015-11-04 Thread Richard Henderson
On 11/04/2015 08:35 PM, Eduardo Habkost wrote: On Fri, Oct 30, 2015 at 01:54:33PM -0700, Richard Henderson wrote: On 10/29/2015 12:31 AM, Xiao Guangrong wrote: These instructions are used by NVDIMM drivers and the specification locates at:

Re: [Qemu-devel] [PATCH] target-i386: enable cflushopt/clwb/pcommit instructions

2015-11-04 Thread Eduardo Habkost
On Fri, Oct 30, 2015 at 01:54:33PM -0700, Richard Henderson wrote: > On 10/29/2015 12:31 AM, Xiao Guangrong wrote: > > These instructions are used by NVDIMM drivers and the specification > > locates at: > > https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf > > > > There

[PATCH] Fixed KVM problems with old DOS programs. Compatibility can be forced by module parameter.

2015-11-04 Thread Gerhard Wiesinger
Signed-off-by: Gerhard Wiesinger --- arch/x86/kvm/svm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 2f9ed1f..e0b00fc 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -198,6 +198,10 @@ static bool

Re: [PATCH 2/2] kvmtool: assume dead vcpus are paused too

2015-11-04 Thread Will Deacon
Hi Sasha, [adding the kvm list; not sure why it was dropped] On Wed, Oct 28, 2015 at 01:34:25PM +, Will Deacon wrote: > On Wed, Oct 28, 2015 at 09:00:07AM -0400, Sasha Levin wrote: > > On 10/28/2015 08:27 AM, Will Deacon wrote: > > > On Tue, Oct 27, 2015 at 10:08:44PM -0400, Sasha Levin

Re: [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-04 Thread Eduardo Habkost
On Wed, Nov 04, 2015 at 11:12:41AM +0800, Xiao Guangrong wrote: > On 11/04/2015 07:00 AM, Eduardo Habkost wrote: > >On Mon, Nov 02, 2015 at 05:13:10PM +0800, Xiao Guangrong wrote: > >>Currently file_ram_alloc() is designed for hugetlbfs, however, the memory > >>of nvdimm can come from either raw

Re: [PATCH] kvm: irqchip: fix memory leak

2015-11-04 Thread Paolo Bonzini
On 03/11/2015 22:17, William Dauchy wrote: > Hi Paolo, > > I was wondering it this could be a valid candidate for -stable, don't you > think? > (commit ba60c41) Indeed, feel free to propose it! Paolo > Best regards, > > On Sep02 12:33, Sudip Mukherjee wrote: >> We were taking the exit path

[PATCH] vfio: Fix bug in vfio_device_get_from_name()

2015-11-04 Thread Joerg Roedel
From: Joerg Roedel The vfio_device_get_from_name() function might return a non-NULL pointer, when called with a device name that is not found in the list. This causes undefined behavior, in my case calling an invalid function pointer later on: kernel tried to execute

Re: [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-04 Thread Eduardo Habkost
On Wed, Nov 04, 2015 at 11:17:09AM +0800, Xiao Guangrong wrote: > > > On 11/04/2015 07:21 AM, Eduardo Habkost wrote: > >On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote: > >[...] > >>+size_t qemu_file_getlength(const char *file, Error **errp) > >>+{ > >>+int64_t size; > >[...]

[PULL 08/21] arm/arm64: KVM: Support edge-triggered forwarded interrupts

2015-11-04 Thread Christoffer Dall
We mark edge-triggered interrupts with the HW bit set as queued to prevent the VGIC code from injecting LRs with both the Active and Pending bits set at the same time while also setting the HW bit, because the hardware does not support this. However, this means that we must also clear the queued

[PULL 02/21] arm/arm64: KVM: arch_timer: Only schedule soft timer on vcpu_block

2015-11-04 Thread Christoffer Dall
We currently schedule a soft timer every time we exit the guest if the timer did not expire while running the guest. This is really not necessary, because the only work we do in the timer work function is to kick the vcpu. Kicking the vcpu does two things: (1) If the vpcu thread is on a

[PULL 00/21] KVM/ARM Changes for v4.4-rc1

2015-11-04 Thread Christoffer Dall
Hi Paolo, Here is the set of changes for v4.4. Some of the commits listed here were already merged as fixes for v4.3, but since they are not in kvm/next yet, they show up here. Let me know if you want me to handle this differently somehow. As usual, there's a lot of churn in the vgic and timer

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

2015-11-04 Thread Christoffer Dall
On Tue, Nov 03, 2015 at 12:44:54PM +0300, Pavel Fedin wrote: > Hello! > > > By this time i'll make a very minimal version of patch 0001, for you to > > test it. If we have > > problems with current 0001, which we > > cannot solve quickly, we could stick to that version then, which will > >

[PULL 04/21] arm/arm64: KVM: Implement GICD_ICFGR as RO for PPIs

2015-11-04 Thread Christoffer Dall
The GICD_ICFGR allows the bits for the SGIs and PPIs to be read only. We currently simulate this behavior by writing a hardcoded value to the register for the SGIs and PPIs on every write of these bits to the register (ignoring what the guest actually wrote), and by writing the same value as the

[PULL 03/21] arm/arm64: KVM: vgic: Factor out level irq processing on guest exit

2015-11-04 Thread Christoffer Dall
Currently vgic_process_maintenance() processes dealing with a completed level-triggered interrupt directly, but we are soon going to reuse this logic for level-triggered mapped interrupts with the HW bit set, so move this logic into a separate static function. Probably the most scary part of this

Re: [PATCH v7 27/35] nvdimm acpi: build ACPI nvdimm devices

2015-11-04 Thread Xiao Guangrong
On 11/04/2015 04:56 PM, Igor Mammedov wrote: On Tue, 3 Nov 2015 22:22:40 +0800 Xiao Guangrong wrote: On 11/03/2015 09:13 PM, Igor Mammedov wrote: On Mon, 2 Nov 2015 17:13:29 +0800 Xiao Guangrong wrote: NVDIMM devices is

Re: [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-04 Thread Xiao Guangrong
On 11/04/2015 08:40 PM, Eduardo Habkost wrote: On Wed, Nov 04, 2015 at 11:12:41AM +0800, Xiao Guangrong wrote: On 11/04/2015 07:00 AM, Eduardo Habkost wrote: On Mon, Nov 02, 2015 at 05:13:10PM +0800, Xiao Guangrong wrote: Currently file_ram_alloc() is designed for hugetlbfs, however, the

Re: [PATCH/RFC 0/4] dma ops and virtio

2015-11-04 Thread Cornelia Huck
On Tue, 3 Nov 2015 10:45:12 -0800 Andy Lutomirski wrote: > On Tue, Nov 3, 2015 at 9:59 AM, Cornelia Huck > wrote: > > It's just failing very early in the setup phase. As it works for me > > with a kvm setup, I'm suspecting some error in qemu's

Re: [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-04 Thread Xiao Guangrong
On 11/04/2015 10:44 PM, Eduardo Habkost wrote: On Wed, Nov 04, 2015 at 11:17:09AM +0800, Xiao Guangrong wrote: On 11/04/2015 07:21 AM, Eduardo Habkost wrote: On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote: [...] +size_t qemu_file_getlength(const char *file, Error **errp)

[PULL 17/21] arm64: kvm: restore EL1N SP for panic

2015-11-04 Thread Christoffer Dall
From: Mark Rutland If we panic in hyp mode, we inject a call to panic() into the EL1N host kernel. If a guest context is active, we first attempt to restore the minimal amount of state necessary to execute the host kernel with restore_sysregs. However, the SP is restored

[PULL 01/21] KVM: Add kvm_arch_vcpu_{un}blocking callbacks

2015-11-04 Thread Christoffer Dall
Some times it is useful for architecture implementations of KVM to know when the VCPU thread is about to block or when it comes back from blocking (arm/arm64 needs to know this to properly implement timers, for example). Therefore provide a generic architecture callback function in line with what

[PULL 14/21] KVM: arm/arm64: Fix vGIC documentation

2015-11-04 Thread Christoffer Dall
From: Pavel Fedin Correct some old mistakes in the API documentation: 1. VCPU is identified by index (using kvm_get_vcpu() function), but "cpu id" can be mistaken for affinity ID. 2. Some error codes are wrong. [ Slightly tweaked some grammer and did some s/CPU

[PULL 12/21] KVM: arm/arm64: check power_off in critical section before VCPU run

2015-11-04 Thread Christoffer Dall
From: Eric Auger In case a vcpu off PSCI call is called just after we executed the vcpu_sleep check, we can enter the guest although power_off is set. Let's check the power_off state in the critical section, just before entering the guest. Signed-off-by: Eric Auger

[PULL 19/21] KVM: arm/arm64: Optimize away redundant LR tracking

2015-11-04 Thread Christoffer Dall
From: Pavel Fedin Currently we use vgic_irq_lr_map in order to track which LRs hold which IRQs, and lr_used bitmap in order to track which LRs are used or free. vgic_irq_lr_map is actually used only for piggy-back optimization, and can be easily replaced by iteration over

[PULL 18/21] KVM: arm: Do not indent the arguments of DECLARE_BITMAP

2015-11-04 Thread Christoffer Dall
From: Michal Marek Besides being a coding style issue, it confuses make tags: ctags: Warning: include/kvm/arm_vgic.h:307: null expansion of name pattern "\1" ctags: Warning: include/kvm/arm_vgic.h:308: null expansion of name pattern "\1" ctags: Warning:

[PULL 06/21] arm/arm64: KVM: Add forwarded physical interrupts documentation

2015-11-04 Thread Christoffer Dall
Forwarded physical interrupts on arm/arm64 is a tricky concept and the way we deal with them is not apparently easy to understand by reading various specs. Therefore, add a proper documentation file explaining the flow and rationale of the behavior of the vgic. Some of this text was contributed

[PULL 20/21] KVM: arm/arm64: Clean up vgic_retire_lr() and surroundings

2015-11-04 Thread Christoffer Dall
From: Pavel Fedin 1. Remove unnecessary 'irq' argument, because irq number can be retrieved from the LR. 2. Since cff9211eb1a1f58ce7f5a2d596b617928fd4be0e ("arm/arm64: KVM: Fix arch timer behavior for disabled interrupts ") LR_STATE_PENDING is queued back by

[PULL 21/21] KVM: arm/arm64: Merge vgic_set_lr() and vgic_sync_lr_elrsr()

2015-11-04 Thread Christoffer Dall
From: 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 Signed-off-by: Christoffer Dall

[PULL 07/21] arm/arm64: KVM: Rework the arch timer to use level-triggered semantics

2015-11-04 Thread Christoffer Dall
The arch timer currently uses edge-triggered semantics in the sense that the line is never sampled by the vgic and lowering the line from the timer to the vgic doesn't have any effect on the pending state of virtual interrupts in the vgic. This means that we do not support a guest with the

[PULL 11/21] KVM: arm/arm64: check power_off in kvm_arch_vcpu_runnable

2015-11-04 Thread Christoffer Dall
From: Eric Auger kvm_arch_vcpu_runnable now also checks whether the power_off flag is set. Signed-off-by: Eric Auger Reviewed-by: Christoffer Dall Signed-off-by: Christoffer Dall ---

[PULL 10/21] KVM: arm/arm64: rename pause into power_off

2015-11-04 Thread Christoffer Dall
From: Eric Auger The kvm_vcpu_arch pause field is renamed into power_off to prepare for the introduction of a new pause field. Also vcpu_pause is renamed into vcpu_sleep since we will sleep until both power_off and pause are false. Signed-off-by: Eric Auger

[PULL 05/21] arm/arm64: KVM: Use appropriate define in VGIC reset code

2015-11-04 Thread Christoffer Dall
We currently initialize the SGIs to be enabled in the VGIC code, but we use the VGIC_NR_PPIS define for this purpose, instead of the the more natural VGIC_NR_SGIS. Change this slightly confusing use of the defines. Note: This should have no functional change, as both names are defined to the

[PULL 13/21] KVM: arm/arm64: implement kvm_arm_[halt,resume]_guest

2015-11-04 Thread Christoffer Dall
From: Eric Auger We introduce kvm_arm_halt_guest and resume functions. They will be used for IRQ forward state change. Halt is synchronous and prevents the guest from being re-entered. We use the same mechanism put in place for PSCI former pause, now renamed power_off. A

[PULL 16/21] arm/arm64: KVM: Add tracepoints for vgic and timer

2015-11-04 Thread Christoffer Dall
The VGIC and timer code for KVM arm/arm64 doesn't have any tracepoints or tracepoint infrastructure defined. Rewriting some of the timer code handling showed me how much we need this, so let's add these simple trace points once and for all and we can easily expand with additional trace points in

[PULL 09/21] arm/arm64: KVM : Enable vhost device selection under KVM config menu

2015-11-04 Thread Christoffer Dall
From: Wei Huang vhost drivers provide guest VMs with better I/O performance and lower CPU utilization. This patch allows users to select vhost devices under KVM configuration menu on ARM. This makes vhost support on arm/arm64 on a par with other architectures (e.g. x86, ppc).

[PULL 15/21] arm/arm64: KVM: Improve kvm_exit tracepoint

2015-11-04 Thread Christoffer Dall
The ARM architecture only saves the exit class to the HSR (ESR_EL2 for arm64) on synchronous exceptions, not on asynchronous exceptions like an IRQ. However, we only report the exception class on kvm_exit, which is confusing because an IRQ looks like it exited at some PC with the same reason as

Re: [v2] KVM: VMX: Fix commit which broke PML

2015-11-04 Thread Paolo Bonzini
On 04/11/2015 06:46, Kai Huang wrote: > I found PML was broken since below commit: > > commit feda805fe7c4ed9cf78158e73b1218752e3b4314 > Author: Xiao Guangrong > Date: Wed Sep 9 14:05:55 2015 +0800 > > KVM: VMX: unify

[patch] vfio: make an array larger

2015-11-04 Thread Dan Carpenter
Smatch complains about a possible out of bounds error: drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init() error: buffer overflow 'pci_cap_length' 20 <= 20 Fix this by making the array larger. Signed-off-by: Dan Carpenter diff --git

Re: [PATCH] KVM: x86: obey KVM_X86_QUIRK_CD_NW_CLEARED in kvm_set_cr0()

2015-11-04 Thread Paolo Bonzini
On 03/11/2015 19:34, Laszlo Ersek wrote: > Commit b18d5431acc7 ("KVM: x86: fix CR0.CD virtualization") was > technically correct, but it broke OVMF guests by slowing down various > parts of the firmware. > > Commit fb279950ba02 ("KVM: vmx: obey KVM_QUIRK_CD_NW_CLEARED") quirked the > first

[PATCH] KVM: x86: merge handle_mmio_page_fault and handle_mmio_page_fault_common

2015-11-04 Thread Paolo Bonzini
They are exactly the same, except that handle_mmio_page_fault has an unused argument and a call to WARN_ON. Remove the unused argument from the callers, and move the warning to (the former) handle_mmio_page_fault_common. --- arch/x86/kvm/mmu.c | 20 +---

Re: [PATCH] kvm: irqchip: fix memory leak

2015-11-04 Thread Paolo Bonzini
On 03/11/2015 22:17, William Dauchy wrote: > Hi Paolo, > > I was wondering it this could be a valid candidate for -stable, don't you > think? > (commit ba60c41) Certainly, feel free to propose it to sta...@vger.kernel.org! Paolo > Best regards, > > On Sep02 12:33, Sudip Mukherjee wrote: >>

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-04 Thread Christoffer Dall
On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote: > On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch wrote: > > > > > > On 11/3/2015 9:55 AM, Will Deacon wrote: > >> On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario Smarduch wrote: > >>> On 11/3/2015 8:33 AM,

kvm: irqchip: fix memory leak in -stable

2015-11-04 Thread William Dauchy
Hello stable release team, The commit ba60c41 kvm: irqchip: fix memory leak is fixing commit e73f61e kvm: irqchip: Break up high order allocations of kvm_irq_routing_table I believe commit ba60c41 kvm: irqchip: fix memory leak is a good candidate for -stable. I also got an agreement from

Re: [PULL 00/21] KVM/ARM Changes for v4.4-rc1

2015-11-04 Thread Paolo Bonzini
On 04/11/2015 15:49, Christoffer Dall wrote: > Hi Paolo, > > Here is the set of changes for v4.4. Some of the commits listed here were > already merged as fixes for v4.3, but since they are not in kvm/next yet, they > show up here. Let me know if you want me to handle this differently

Re: [PATCH] vfio: Fix bug in vfio_device_get_from_name()

2015-11-04 Thread Alex Williamson
On Wed, 2015-11-04 at 13:53 +0100, Joerg Roedel wrote: > From: Joerg Roedel > > The vfio_device_get_from_name() function might return a > non-NULL pointer, when called with a device name that is not > found in the list. This causes undefined behavior, in my > case calling an

Re: [patch] vfio: make an array larger

2015-11-04 Thread Alex Williamson
On Wed, 2015-11-04 at 16:26 +0300, Dan Carpenter wrote: > Smatch complains about a possible out of bounds error: > > drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init() > error: buffer overflow 'pci_cap_length' 20 <= 20 > > Fix this by making the array larger. > > Signed-off-by:

Re: [patch] vfio: make an array larger

2015-11-04 Thread Joe Perches
On Wed, 2015-11-04 at 16:26 +0300, Dan Carpenter wrote: > Smatch complains about a possible out of bounds error: > > drivers/vfio/pci/vfio_pci_config.c:1241 vfio_cap_init() > error: buffer overflow 'pci_cap_length' 20 <= 20 > > Fix this by making the array larger. > > Signed-off-by:

Re: [PATCH/RFC 0/4] dma ops and virtio

2015-11-04 Thread Cornelia Huck
On Wed, 4 Nov 2015 15:29:23 +0100 Cornelia Huck wrote: > I'm currently suspecting some endianness issues, probably with the ecw > accesses, which is why I'd be interested in your trace information (as > I currently don't have a LE test setup at hand.) I think I've got

Re: [PATCH v7 27/35] nvdimm acpi: build ACPI nvdimm devices

2015-11-04 Thread Igor Mammedov
On Tue, 3 Nov 2015 22:22:40 +0800 Xiao Guangrong wrote: > > > On 11/03/2015 09:13 PM, Igor Mammedov wrote: > > On Mon, 2 Nov 2015 17:13:29 +0800 > > Xiao Guangrong wrote: > > > >> NVDIMM devices is defined in ACPI 6.0 9.20

[PATCH 1/1] KVM: PPC: Increase memslots to 320

2015-11-04 Thread Thomas Huth
Only using 32 memslots for KVM on powerpc is way too low, you can nowadays hit this limit quite fast by adding a couple of PCI devices and/or pluggable memory DIMMs to the guest. x86 already increased the limit to 512 in total, to satisfy 256 pluggable DIMM slots, 3 private slots and 253 slots for

[PATCH 1/1] KVM: PPC: Increase memslots to 320

2015-11-04 Thread Thomas Huth
Only using 32 memslots for KVM on powerpc is way too low, you can nowadays hit this limit quite fast by adding a couple of PCI devices and/or pluggable memory DIMMs to the guest. x86 already increased the limit to 512 in total, to satisfy 256 pluggable DIMM slots, 3 private slots and 253 slots for

[PATCH 0/1] KVM: PPC: Increase memslots

2015-11-04 Thread Thomas Huth
Now that the patch from Nikunj to support the KVM_CAP_NR_MEMSLOTS capability on powerpc has been merged to kvm/next, we can/should increase the amount of memslots on ppc, too. Since nobody else sent a patch yet (as far as I can see), I'd like to suggest to increase the slot number to 320 now. Why

[PATCH 0/1] KVM: PPC: Increase memslots

2015-11-04 Thread Thomas Huth
Now that the patch from Nikunj to support the KVM_CAP_NR_MEMSLOTS capability on powerpc has been merged to kvm/next, we can/should increase the amount of memslots on ppc, too. Since nobody else sent a patch yet (as far as I can see), I'd like to suggest to increase the slot number to 320 now. Why

Re: [patch] vfio: make an array larger

2015-11-04 Thread Alex Williamson
On Wed, 2015-11-04 at 21:20 +0300, Dan Carpenter wrote: > Sorry, I should have said that I am on linux-next at the start. > > > > -static u8 pci_cap_length[] = { > > > +static u8 pci_cap_length[PCI_CAP_ID_MAX + 1] = { > > > [PCI_CAP_ID_BASIC] = PCI_STD_HEADER_SIZEOF, /* pci config header

Re: [patch] vfio: make an array larger

2015-11-04 Thread Dan Carpenter
On Wed, Nov 04, 2015 at 08:40:19AM -0800, Joe Perches wrote: > Doesn't the same thing happen with pci_ext_cap_length? pci_ext_cap_length is fine as-is but you're right that we probably should make the size explicit as well. I will fix and resend. > Both array declarations might be better as

Re: [PATCH/RFC 0/4] dma ops and virtio

2015-11-04 Thread Andy Lutomirski
On Wed, Nov 4, 2015 at 9:52 AM, Cornelia Huck wrote: > On Wed, 4 Nov 2015 15:29:23 +0100 > Cornelia Huck wrote: > >> I'm currently suspecting some endianness issues, probably with the ecw >> accesses, which is why I'd be interested in your

Re: [patch] vfio: make an array larger

2015-11-04 Thread Dan Carpenter
Sorry, I should have said that I am on linux-next at the start. > > -static u8 pci_cap_length[] = { > > +static u8 pci_cap_length[PCI_CAP_ID_MAX + 1] = { > > [PCI_CAP_ID_BASIC] = PCI_STD_HEADER_SIZEOF, /* pci config header */ > > [PCI_CAP_ID_PM] = PCI_PM_SIZEOF, > >

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-04 Thread Christopher Covington
On 11/04/2015 08:31 AM, Christoffer Dall wrote: > On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote: >> On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch >> wrote: >>> On 11/3/2015 9:55 AM, Will Deacon wrote: On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario

[PATCH v2] vfio: Include No-IOMMU mode

2015-11-04 Thread Alex Williamson
There is really no way to safely give a user full access to a DMA capable device without an IOMMU to protect the host system. There is also no way to provide DMA translation, for use cases such as device assignment to virtual machines. However, there are still those users that want userspace

Re: [PATCH] KVM/arm: kernel low level debug support for ARM32 virtual platforms

2015-11-04 Thread Ard Biesheuvel
On 4 November 2015 at 19:49, Christopher Covington wrote: > On 11/04/2015 08:31 AM, Christoffer Dall wrote: >> On Tue, Nov 03, 2015 at 01:39:44PM -0600, Rob Herring wrote: >>> On Tue, Nov 3, 2015 at 1:17 PM, Mario Smarduch >>> wrote: On

Re: [PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-11-04 Thread Riku Voipio
On 30 October 2015 at 19:20, Andre Przywara wrote: > When a Makefile variable is set on the make command line, all > Makefile-internal assignments to that very variable are _ignored_. > Since we add quite some essential values to CFLAGS internally, > specifying some CFLAGS

Re: [PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-11-04 Thread Riku Voipio
On 4 November 2015 at 12:13, Andre Przywara wrote: > Hi Riku, > > On 04/11/15 10:02, Riku Voipio wrote: >> On 30 October 2015 at 19:20, Andre Przywara wrote: >>> When a Makefile variable is set on the make command line, all >>> Makefile-internal

Re: [PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-11-04 Thread Andre Przywara
Hi Riku, On 04/11/15 10:02, Riku Voipio wrote: > On 30 October 2015 at 19:20, Andre Przywara wrote: >> When a Makefile variable is set on the make command line, all >> Makefile-internal assignments to that very variable are _ignored_. >> Since we add quite some essential

Re: [PATCH 1/2] Makefile: allow overriding CFLAGS on the command line

2015-11-04 Thread Will Deacon
On Wed, Nov 04, 2015 at 12:02:23PM +0200, Riku Voipio wrote: > On 30 October 2015 at 19:20, Andre Przywara wrote: > > When a Makefile variable is set on the make command line, all > > Makefile-internal assignments to that very variable are _ignored_. > > Since we add quite