Re: [PATCH] ARM/ARM64: KVM: remove 'config KVM_ARM_MAX_VCPUS'

2015-09-17 Thread Ming Lei
On Wed, Sep 2, 2015 at 7:42 PM, Ming Lei wrote: > On Wed, Sep 2, 2015 at 6:25 PM, Christoffer Dall > wrote: >> On Wed, Sep 02, 2015 at 02:31:21PM +0800, Ming Lei wrote: >>> This patch removes config option of KVM_ARM_MAX_VCPUS, >>> and like

Re: [PATCH] ARM/ARM64: KVM: remove 'config KVM_ARM_MAX_VCPUS'

2015-09-17 Thread Marc Zyngier
On 17/09/15 07:08, Ming Lei wrote: > On Wed, Sep 2, 2015 at 7:42 PM, Ming Lei wrote: >> On Wed, Sep 2, 2015 at 6:25 PM, Christoffer Dall >> wrote: >>> On Wed, Sep 02, 2015 at 02:31:21PM +0800, Ming Lei wrote: This patch removes config

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Ingo Molnar
* Andy Lutomirski wrote: > Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently > turns all rdmsr and wrmsr operations into the safe variants without > any checks that the operations actually succeed. > > This is IMO awful: it papers over bugs. In particular,

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-17 Thread Shannon Zhao
Hi Wei, On 2015/9/17 13:56, Wei Huang wrote: > > > On 09/16/2015 08:32 PM, Shannon Zhao wrote: >> Hi Wei, >> >> On 2015/9/17 5:07, Wei Huang wrote: >>> I am testing this series. >> Thanks for your time and help. >> >>> The first question is: do you plan to add ACPI >>> support in QEMU? > > I

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

2015-09-17 Thread Xiao Guangrong
On 09/16/2015 12:07 AM, Paolo Bonzini wrote: On 26/08/2015 12:40, Xiao Guangrong wrote: + +size = get_file_size(fd); +buf = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); I guess the user will want to choose between MAP_SHARED and MAP_PRIVATE. This can be added in

Re: [Xen-devel] [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Andrew Cooper
On 17/09/15 00:33, Andy Lutomirski wrote: > Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently > turns all rdmsr and wrmsr operations into the safe variants without > any checks that the operations actually succeed. > > This is IMO awful: it papers over bugs. In particular, KVM

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Borislav Petkov
On Thu, Sep 17, 2015 at 09:19:20AM +0200, Ingo Molnar wrote: > Most big distro kernels on bare metal have CONFIG_PARAVIRT=y (I checked > Ubuntu and > Fedora), so we are potentially exposing a lot of users to problems. + SUSE. > Crashing the bootup on an unknown MSR is bad. Many MSR reads and

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 10:58, Peter Zijlstra wrote: > But the far greater problem I have with the whole virt thing is that > you cannot use rdmsr_safe() to probe if an MSR exists at all because, as > you told me, these virt thingies return 0 for all 'unknown' MSRs instead > of faulting. At least for

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 11:31, Borislav Petkov wrote: > >> > Crashing the bootup on an unknown MSR is bad. Many MSR reads and writes >> > are >> > non-critical and returning the 'safe' result is much better than crashing >> > or >> > hanging the bootup. > ... and prepending all MSR accesses with

Re: [PATCH 2/3] arm64: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Marc Zyngier
On 17/09/15 12:17, Christoffer Dall wrote: > On Wed, Sep 16, 2015 at 04:58:06PM +0100, Marc Zyngier wrote: >> When running a guest with the architected timer disabled (with QEMU and >> the kernel_irqchip=off option, for example), it is important to make >> sure the timer gets turned off.

Re: [PATCH] KVM: add halt_attempted_poll to VCPU stats

2015-09-17 Thread David Hildenbrand
> Am 15.09.2015 um 18:27 schrieb Paolo Bonzini: > > This new statistic can help diagnosing VCPUs that, for any reason, > > trigger bad behavior of halt_poll_ns autotuning. > > > > For example, say halt_poll_ns = 48, and wakeups are spaced exactly > > like 479us, 481us, 479us, 481us. Then KVM

Re: [PATCH 2/3] arm64: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Christoffer Dall
On Wed, Sep 16, 2015 at 04:58:06PM +0100, Marc Zyngier wrote: > When running a guest with the architected timer disabled (with QEMU and > the kernel_irqchip=off option, for example), it is important to make > sure the timer gets turned off. Otherwise, the guest may try to > enable it anyway,

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread H. Peter Anvin
However, the difference between one CONFIG and another is quite frankly crazy. We should explicitly use the safe versions where this is appropriate, and then yes, we should do this. Yet another reason the paravirt code is batshit crazy. On September 17, 2015 2:31:34 AM PDT, Borislav Petkov

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

2015-09-17 Thread Xiao Guangrong
On 09/16/2015 12:06 AM, Paolo Bonzini wrote: On 25/08/2015 18:03, Stefan Hajnoczi wrote: +static uint64_t get_file_size(int fd) +{ +struct stat stat_buf; +uint64_t size; + +if (fstat(fd, _buf) < 0) { +return 0; +} + +if (S_ISREG(stat_buf.st_mode)) { +

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

2015-09-17 Thread Xiao Guangrong
On 09/16/2015 12:10 AM, Paolo Bonzini wrote: On 01/09/2015 11:14, Stefan Hajnoczi wrote: When I was digging into live migration code, i noticed that the same MR name may cause the name "idstr", please refer to qemu_ram_set_idstr(). Since nvdimm devices do not have parent-bus, it will

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

2015-09-17 Thread Xiao Guangrong
On 09/17/2015 05:04 PM, Igor Mammedov wrote: On Thu, 17 Sep 2015 16:39:12 +0800 Xiao Guangrong wrote: On 09/16/2015 12:10 AM, Paolo Bonzini wrote: On 01/09/2015 11:14, Stefan Hajnoczi wrote: When I was digging into live migration code, i noticed that

Re: [PATCH v8 09/13] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 03:51, Wu, Feng wrote: > > >> -Original Message- >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] >> Sent: Wednesday, September 16, 2015 5:27 PM >> To: Wu, Feng; alex.william...@redhat.com; j...@8bytes.org; >> mtosa...@redhat.com >> Cc: eric.au...@linaro.org;

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-17 Thread Shannon Zhao
Hi Andrew, On 2015/9/17 17:30, Andrew Jones wrote: > On Thu, Sep 17, 2015 at 09:32:34AM +0800, Shannon Zhao wrote: >> > Hi Wei, >> > >> > On 2015/9/17 5:07, Wei Huang wrote: >>> > > I am testing this series. >> > Thanks for your time and help. >> > >>> > > The first question is: do you plan to

[PATCH v4] ppc/spapr: Implement H_RANDOM hypercall in QEMU

2015-09-17 Thread Thomas Huth
The PAPR interface defines a hypercall to pass high-quality hardware generated random numbers to guests. Recent kernels can already provide this hypercall to the guest if the right hardware random number generator is available. But in case the user wants to use another source like EGD, or QEMU is

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

2015-09-17 Thread Igor Mammedov
On Thu, 17 Sep 2015 16:39:12 +0800 Xiao Guangrong wrote: > > > On 09/16/2015 12:10 AM, Paolo Bonzini wrote: > > > > > > On 01/09/2015 11:14, Stefan Hajnoczi wrote: > > When I was digging into live migration code, i noticed that the same MR > name

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Peter Zijlstra
On Wed, Sep 16, 2015 at 04:33:11PM -0700, Andy Lutomirski wrote: > Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently > turns all rdmsr and wrmsr operations into the safe variants without > any checks that the operations actually succeed. > > This is IMO awful: it papers over

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-17 Thread Andrew Jones
On Thu, Sep 17, 2015 at 09:32:34AM +0800, Shannon Zhao wrote: > Hi Wei, > > On 2015/9/17 5:07, Wei Huang wrote: > > I am testing this series. > Thanks for your time and help. > > > The first question is: do you plan to add ACPI > > support in QEMU? > To the completeness, this should be added.

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

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 11:14, Xiao Guangrong wrote: > > > /* get the memory region from backend memory. */ > mr = host_memory_backend_get_memory(dimm->hostmem, errp); > > /* nvdimm_nr will map to guest address space. */ > memory_region_init_alias(>nvdimm_mr, OBJECT(dev), >

Re: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 05:17, Wu, Feng wrote: >>> > > + if (irq->dest_mode == APIC_DEST_PHYSICAL) { >>> > > + if (irq->dest_id == 0xFF) >>> > > + goto out; >>> > > + >>> > > + if (irq->dest_id >= ARRAY_SIZE(map->phys_map)) { >> > >> > Warning here

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Peter Zijlstra
On Thu, Sep 17, 2015 at 01:40:30PM +0200, Paolo Bonzini wrote: > > > On 17/09/2015 10:58, Peter Zijlstra wrote: > > But the far greater problem I have with the whole virt thing is that > > you cannot use rdmsr_safe() to probe if an MSR exists at all because, as > > you told me, these virt

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

2015-09-17 Thread Xiao Guangrong
On 09/17/2015 05:34 PM, Paolo Bonzini wrote: On 17/09/2015 11:14, Xiao Guangrong wrote: /* get the memory region from backend memory. */ mr = host_memory_backend_get_memory(dimm->hostmem, errp); /* nvdimm_nr will map to guest address space. */ memory_region_init_alias(>nvdimm_mr,

[PATCH 7/8] arm64: KVM: Remove all traces of the ThumbEE registers

2015-09-17 Thread Marc Zyngier
From: Will Deacon Although the ThumbEE registers and traps were present in earlier versions of the v8 architecture, it was retrospectively removed and so we can do the same. Whilst this breaks migrating a guest started on a previous version of the kernel, it is much better

[PATCH 6/8] arm: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Marc Zyngier
When running a guest with the architected timer disabled (with QEMU and the kernel_irqchip=off option, for example), it is important to make sure the timer gets turned off. Otherwise, the guest may try to enable it anyway, leading to a screaming HW interrupt. The fix is to unconditionally turn

[PATCH 8/8] arm/arm64: KVM: Remove 'config KVM_ARM_MAX_VCPUS'

2015-09-17 Thread Marc Zyngier
From: Ming Lei This patch removes config option of KVM_ARM_MAX_VCPUS, and like other ARCHs, just choose the maximum allowed value from hardware, and follows the reasons: 1) from distribution view, the option has to be defined as the max allowed value because it need to

[PATCH 3/8] arm: KVM: Fix incorrect device to IPA mapping

2015-09-17 Thread Marc Zyngier
From: Marek Majtyka A critical bug has been found in device memory stage1 translation for VMs with more then 4GB of address space. Once vm_pgoff size is smaller then pa (which is true for LPAE case, u32 and u64 respectively) some more significant bits of pa may be lost

[PATCH 4/8] arm/arm64: KVM: vgic: Check for !irqchip_in_kernel() when mapping resources

2015-09-17 Thread Marc Zyngier
From: Pavel Fedin Until b26e5fdac43c ("arm/arm64: KVM: introduce per-VM ops"), kvm_vgic_map_resources() used to include a check on irqchip_in_kernel(), and vgic_v2_map_resources() still has it. But now vm_ops are not initialized until we call kvm_vgic_create(). Therefore

[PATCH 5/8] arm64: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Marc Zyngier
When running a guest with the architected timer disabled (with QEMU and the kernel_irqchip=off option, for example), it is important to make sure the timer gets turned off. Otherwise, the guest may try to enable it anyway, leading to a screaming HW interrupt. The fix is to unconditionally turn

Re: [Xen-devel] [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Boris Ostrovsky
On 09/17/2015 05:10 AM, Andrew Cooper wrote: On 17/09/15 00:33, Andy Lutomirski wrote: Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently turns all rdmsr and wrmsr operations into the safe variants without any checks that the operations actually succeed. This is IMO awful: it

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Andy Lutomirski
On Thu, Sep 17, 2015 at 12:19 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently >> turns all rdmsr and wrmsr operations into the safe variants without >> any checks that the operations

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Peter Zijlstra
On Thu, Sep 17, 2015 at 08:17:18AM -0700, Andy Lutomirski wrote: > > Ah, that would be good news. Andy earlier argued I could not rely on > > rdmsr_safe() faulting on unknown MSRs. If practically we can there's > > some code I can simplify :-) > > I was taking about QEMU TCG, not KVM. Just for

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Andy Lutomirski
On Thu, Sep 17, 2015 at 8:17 AM, Peter Zijlstra wrote: > On Thu, Sep 17, 2015 at 08:17:18AM -0700, Andy Lutomirski wrote: > >> > Ah, that would be good news. Andy earlier argued I could not rely on >> > rdmsr_safe() faulting on unknown MSRs. If practically we can there's >>

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 17:27, Arjan van de Ven wrote: >> >>> ( We should double check that rdmsr()/wrmsr() results are never left >>>uninitialized, but are set to zero or so, for cases where the >>> return code is not >>>checked. ) >> >> It sure looks like native_read_msr_safe doesn't clear the

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 17:26, Andy Lutomirski wrote: > Maybe Paolo can fix QEMU to fail bad MSR accesses for real... I was afraid of someone proposing exactly that. :) I can do it since the list of MSRs can be lifted from KVM. Let's first see the direction these patches go... Paolo -- To unsubscribe

Re: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Radim Krčmář
2015-09-17 16:24+0200, Paolo Bonzini: > I think kvm_apic_match_logical_addr for MSI and IOAPIC interrupts is > buggy in x2apic mode. > > It does: > > if (apic_x2apic_mode(apic)) > return ((logical_id >> 16) == (mda >> 16)) >&& (logical_id & mda &

[PATCH] kvm: fix preemption warnings in kvm_vcpu_block

2015-09-17 Thread Dominik Dingel
Commit f78195129963 ("kvm: add halt_poll_ns module parameter") calls, with enabled preemption, single_task_running. When CONFIG_DEBUG_PREEMPT is enabled that will result in a debug_smp_processor_id() call. Cc: # 4.2.x Signed-off-by: Dominik Dingel

Re: [PATCH 5/8] arm64: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Marc Zyngier
On 17/09/15 16:02, Paolo Bonzini wrote: > > > On 17/09/2015 16:46, Marc Zyngier wrote: >> When running a guest with the architected timer disabled (with QEMU and >> the kernel_irqchip=off option, for example), it is important to make >> sure the timer gets turned off. Otherwise, the guest may

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Arjan van de Ven
( We should double check that rdmsr()/wrmsr() results are never left uninitialized, but are set to zero or so, for cases where the return code is not checked. ) It sure looks like native_read_msr_safe doesn't clear the output if the rdmsr fails. I'd suggest to return some poison not

Re: [PATCH 5/8] arm64: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 17:28, Marc Zyngier wrote: > > diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S > > index 702740d37465..93e322b4d242 100644 > > --- a/arch/arm/kvm/interrupts_head.S > > +++ b/arch/arm/kvm/interrupts_head.S > > @@ -514,6 +514,7 @@ ARM_BE8(rev r6, r6

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Arjan van de Ven
On 9/17/2015 8:29 AM, Paolo Bonzini wrote: On 17/09/2015 17:27, Arjan van de Ven wrote: ( We should double check that rdmsr()/wrmsr() results are never left uninitialized, but are set to zero or so, for cases where the return code is not checked. ) It sure looks like

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Borislav Petkov
On Thu, Sep 17, 2015 at 01:39:26PM +0200, Paolo Bonzini wrote: > That's not a big deal, that's what *_safe is for. The problem is that > there are definitely some cases where the *_safe version is not being used. I mean to do feature checks which assure you that those MSRs are there so you don't

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 17:31, Arjan van de Ven wrote: >> >> What about 0 + WARN? > > why 0? > > 0xdeadbeef or any other pattern (even 0x3636363636) makes more sense (of > course also WARN... but most folks don't read dmesg for WARNs) > > (it's the same thing we do for list or slab poison stuff)

Re: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 17:58, Radim Krčmář wrote: > For interrupts from MSI and IOxAPIC: > - Flat logical interrupts are delivered as if we had natural > (CPU0<->bit0, CPU1<->bit1, ...) flat logical xAPIC for first 8 VCPUs. > - Cluster logical doesn't work much, it's interpreted like flat logical. >

Re: [PATCH] kvmtool: don't rely on $HOME

2015-09-17 Thread Will Deacon
On Thu, Sep 17, 2015 at 03:03:15PM +0100, Alban Crequy wrote: > kvm__set_dir() called in main() and kvm__get_dir() rely on $HOME. But in > some environments (such as starting lkvm through systemd-run), $HOME is > undefined. This causes bind() to use a socket path containing "(null)" > and this

Re: [Xen-devel] [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Andrew Cooper
On 17/09/15 16:27, Borislav Petkov wrote: > On Thu, Sep 17, 2015 at 01:39:26PM +0200, Paolo Bonzini wrote: >> That's not a big deal, that's what *_safe is for. The problem is that >> there are definitely some cases where the *_safe version is not being used. > I mean to do feature checks which

Re: [Xen-devel] [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Borislav Petkov
On Thu, Sep 17, 2015 at 04:32:53PM +0100, Andrew Cooper wrote: > There are plenty of non-architectural MSRs in use which don't have > feature bits. That's exactly what the "possible" adjective was supposed to represent. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.

RE: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Wu, Feng
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Thursday, September 17, 2015 5:42 PM > To: Wu, Feng; alex.william...@redhat.com; j...@8bytes.org; > mtosa...@redhat.com > Cc: eric.au...@linaro.org; kvm@vger.kernel.org; > io...@lists.linux-foundation.org;

Re: [GIT PULL] Second set of KVM/ARM updates for 4.3-rc2

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 16:46, Marc Zyngier wrote: > Hi Paolo, > > We've had a "nice" collection of fixes trickling in this week, and > since both Christoffer and I are away next week, I've decided to send > everything your way a bit early. Sure, thanks. I'll send the pull request to Linus tomorrow.

[PATCH 2/8] arm64: KVM: Fix user access for debug registers

2015-09-17 Thread Marc Zyngier
When setting the debug register from userspace, make sure that copy_from_user() is called with its parameters in the expected order. It otherwise doesn't do what you think. Fixes: 84e690bfbed1 ("KVM: arm64: introduce vcpu->arch.debug_ptr") Reported-by: Peter Maydell Cc:

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Andy Lutomirski
On Sep 17, 2015 5:33 AM, "Peter Zijlstra" wrote: > > On Thu, Sep 17, 2015 at 01:40:30PM +0200, Paolo Bonzini wrote: > > > > > > On 17/09/2015 10:58, Peter Zijlstra wrote: > > > But the far greater problem I have with the whole virt thing is that > > > you cannot use

[PATCH] kvmtool: don't rely on $HOME

2015-09-17 Thread Alban Crequy
kvm__set_dir() called in main() and kvm__get_dir() rely on $HOME. But in some environments (such as starting lkvm through systemd-run), $HOME is undefined. This causes bind() to use a socket path containing "(null)" and this fails. The current code does not check errors returned by realpath().

Re: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Paolo Bonzini
>> On 17/09/2015 05:17, Wu, Feng wrote: >>> + if (irq->dest_mode == APIC_DEST_PHYSICAL) { >>> + if (irq->dest_id == 0xFF) >>> + goto out; >>> + >>> + if (irq->dest_id >= ARRAY_SIZE(map->phys_map)) { > > Warning

[PATCH 1/8] KVM: arm64: add workaround for Cortex-A57 erratum #852523

2015-09-17 Thread Marc Zyngier
From: Will Deacon When restoring the system register state for an AArch32 guest at EL2, writes to DACR32_EL2 may not be correctly synchronised by Cortex-A57, which can lead to the guest effectively running with junk in the DACR and running into unexpected domain faults.

[GIT PULL] Second set of KVM/ARM updates for 4.3-rc2

2015-09-17 Thread Marc Zyngier
Hi Paolo, We've had a "nice" collection of fixes trickling in this week, and since both Christoffer and I are away next week, I've decided to send everything your way a bit early. Fairly random stuff to be honnest, but a negative diffstat can't be that bad! :-) Thanks, M. The following

Re: [PATCH 5/8] arm64: KVM: Disable virtual timer even if the guest is not using it

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 16:46, Marc Zyngier wrote: > When running a guest with the architected timer disabled (with QEMU and > the kernel_irqchip=off option, for example), it is important to make > sure the timer gets turned off. Otherwise, the guest may try to > enable it anyway, leading to a screaming

Re: single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block)

2015-09-17 Thread Dominik Dingel
On Thu, 17 Sep 2015 18:45:00 +0200 Paolo Bonzini wrote: > > > On 17/09/2015 18:27, Dominik Dingel wrote: > > + preempt_disable(); > > + solo = single_task_running(); > > + preempt_enable(); > > + > >

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Ingo Molnar
* Andy Lutomirski wrote: > On Thu, Sep 17, 2015 at 12:19 AM, Ingo Molnar wrote: > > > > * Andy Lutomirski wrote: > > > >> Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently > >> turns all rdmsr and wrmsr operations into

single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block)

2015-09-17 Thread Paolo Bonzini
On 17/09/2015 18:27, Dominik Dingel wrote: > + preempt_disable(); > + solo = single_task_running(); > + preempt_enable(); > + > cur = ktime_get(); > - } while (single_task_running() && ktime_before(cur,

Re: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops

2015-09-17 Thread Andy Lutomirski
On Thu, Sep 17, 2015 at 10:30 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> On Thu, Sep 17, 2015 at 12:19 AM, Ingo Molnar wrote: >> > >> > * Andy Lutomirski wrote: >> > >> >> Setting CONFIG_PARAVIRT=y has an

Re: single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block)

2015-09-17 Thread Tim Chen
On Thu, 2015-09-17 at 19:07 +0200, Dominik Dingel wrote: > On Thu, 17 Sep 2015 18:45:00 +0200 > Paolo Bonzini wrote: > > > > > > > On 17/09/2015 18:27, Dominik Dingel wrote: > > > + preempt_disable(); > > > + solo = single_task_running(); >

Re: rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] Running fedora xen on top of KVM?

2015-09-17 Thread Andy Lutomirski
On Thu, Sep 17, 2015 at 1:10 PM, Konrad Rzeszutek Wilk wrote: > On Wed, Sep 16, 2015 at 06:39:03PM -0400, Cole Robinson wrote: >> On 09/16/2015 05:08 PM, Konrad Rzeszutek Wilk wrote: >> > On Wed, Sep 16, 2015 at 05:04:31PM -0400, Cole Robinson wrote: >> >> On 09/16/2015

rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] Running fedora xen on top of KVM?

2015-09-17 Thread Konrad Rzeszutek Wilk
On Wed, Sep 16, 2015 at 06:39:03PM -0400, Cole Robinson wrote: > On 09/16/2015 05:08 PM, Konrad Rzeszutek Wilk wrote: > > On Wed, Sep 16, 2015 at 05:04:31PM -0400, Cole Robinson wrote: > >> On 09/16/2015 04:07 PM, M A Young wrote: > >>> On Wed, 16 Sep 2015, Cole Robinson wrote: > >>> >

Re: [Xen-devel] rdmsr_safe in Linux PV (under Xen) gets an #GP:Re: [Fedora-xen] Running fedora xen on top of KVM?

2015-09-17 Thread Andrew Cooper
On 17/09/2015 21:23, Andy Lutomirski wrote: > On Thu, Sep 17, 2015 at 1:10 PM, Konrad Rzeszutek Wilk > wrote: >> On Wed, Sep 16, 2015 at 06:39:03PM -0400, Cole Robinson wrote: >>> On 09/16/2015 05:08 PM, Konrad Rzeszutek Wilk wrote: On Wed, Sep 16, 2015 at 05:04:31PM

[PATCH 0/2] x86/msr: MSR access failure changes

2015-09-17 Thread Andy Lutomirski
This applies on top of my earlier MSR series. Andy Lutomirski (2): x86/msr: Carry on after a non-"safe" MSR access fails without !panic_on_oops x86/msr: Set the return value to zero when native_rdmsr_safe fails arch/x86/include/asm/msr.h | 5 - arch/x86/kernel/traps.c| 51

[PATCH 2/2] x86/msr: Set the return value to zero when native_rdmsr_safe fails

2015-09-17 Thread Andy Lutomirski
This will cause unchecked native_rdmsr_safe failures to return deterministic results. We could poison the results with something other than zero, but that would increase code size. Signed-off-by: Andy Lutomirski --- arch/x86/include/asm/msr.h | 5 - 1 file changed, 4

[PATCH 1/2] x86/msr: Carry on after a non-"safe" MSR access fails without !panic_on_oops

2015-09-17 Thread Andy Lutomirski
This demotes an OOPS and likely panic due to a failed non-"safe" MSR access to a WARN_ON_ONCE and a return of poisoned values (in the RDMSR case). We still write a pr_info entry unconditionally for debugging. To be clear, this type of failure should *not* happen. This patch exists to minimize

[PATCH 2/2] KVM/arm: enable armv7 fp/simd lazy switch

2015-09-17 Thread Mario Smarduch
Adds code to enable fp/simd lazy switch. On each entry check if fp/simd registers have been switched to guest, if no set the trap flag. On trap switch fp/simd registers and set vfp_lazy to true and disable trapping. When the vcpu is about to be put, then context switch fp/simd registers save

[PATCH 0/2] KVM/arm: add fp/simd lazy switch support

2015-09-17 Thread Mario Smarduch
These patches enable armv7 fp/simd lazy switch. On guest entry fp/simd access trap is set, and on guest first access fp/simd registers are switched - host saved, guest restored. CPU continues with guest fp/simd content until vcpu_put where guest is saved and host is restored. Running floating

[PATCH 1/2] KVM/arm: add hooks for armv7 fp/simd lazy switch support

2015-09-17 Thread Mario Smarduch
Basic hooks are added to support fp/simd lazy switch. A vcpu flag to track fp/simd state, offset into the vcpu structure and switch prototype function. Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 3 +++

RE: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Wu, Feng
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Friday, September 18, 2015 12:00 AM > To: Radim Krčmář > Cc: Wu, Feng; alex.william...@redhat.com; j...@8bytes.org; > mtosa...@redhat.com; eric.au...@linaro.org; kvm@vger.kernel.org; >

RE: [PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-17 Thread Wu, Feng
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Thursday, September 17, 2015 10:25 PM > To: Wu, Feng; alex.william...@redhat.com; j...@8bytes.org; > mtosa...@redhat.com > Cc: eric.au...@linaro.org; kvm@vger.kernel.org; > io...@lists.linux-foundation.org;