Re: [PATCH 2/2] ppc: kvm: use anon_inode_getfd() with O_CLOEXEC flag

2013-08-26 Thread Paolo Bonzini
Il 26/08/2013 10:23, Yann Droneaud ha scritto: Sounds a lot like InfiniBand subsystem behavor: IB file descriptors are of no use accross exec() since memory mappings tied to those fds won't be available in the new process: https://lkml.org/lkml/2013/7/8/380

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-09-26 Thread Paolo Bonzini
Il 26/09/2013 08:31, Michael Ellerman ha scritto: Some powernv systems include a hwrng. Guests can access it via the H_RANDOM hcall. We add a real mode implementation of H_RANDOM when a hwrng is found. Userspace can detect the presence of the hwrng by quering the KVM_CAP_PPC_HWRNG

Re: [PATCH] powerpc/kvm/cma: Fix panic introduces by signed shift operation

2014-09-03 Thread Paolo Bonzini
Il 02/09/2014 18:13, Laurent Dufour ha scritto: fc95ca7284bc54953165cba76c3228bd2cdb9591 introduces a memset in kvmppc_alloc_hpt since the general CMA doesn't clear the memory it allocates. However, the size argument passed to memset is computed from a signed value and its signed bit is

Re: [PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

2014-09-29 Thread Paolo Bonzini
Il 29/09/2014 10:28, Alexander Graf ha scritto: On 29.09.14 10:02, Aneesh Kumar K.V wrote: We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like

Re: [PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

2014-09-29 Thread Paolo Bonzini
Il 29/09/2014 13:57, Alexander Graf ha scritto: On 29.09.14 13:48, Paolo Bonzini wrote: Il 29/09/2014 10:28, Alexander Graf ha scritto: On 29.09.14 10:02, Aneesh Kumar K.V wrote: We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode

Re: lockdep warning with 2d65a9f48fcdf7866aab6457bc707ca233e0c791

2014-10-28 Thread Paolo Bonzini
On 10/15/2014 07:28 PM, Aneesh Kumar K.V wrote: = [ INFO: possible recursive locking detected ] 3.17.0+ #31 Not tainted - qemu-system-ppc/9112 is trying to acquire lock:

Re: [PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-27 Thread Paolo Bonzini
Il 21/05/2013 05:06, Alexey Kardashevskiy ha scritto: This adds real mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as virtio devices or emulated PCI. Do you mean vio? virtio (without getting into whether that's good or bad) will bypass the

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-27 Thread Paolo Bonzini
Il 25/05/2013 04:45, David Gibson ha scritto: + case KVM_CREATE_SPAPR_TCE_IOMMU: { + struct kvm_create_spapr_tce_iommu create_tce_iommu; + struct kvm *kvm = filp-private_data; + + r = -EFAULT; + if (copy_from_user(create_tce_iommu, argp, +

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-27 Thread Paolo Bonzini
Il 27/05/2013 16:26, Alexey Kardashevskiy ha scritto: On 05/27/2013 08:23 PM, Paolo Bonzini wrote: Il 25/05/2013 04:45, David Gibson ha scritto: + case KVM_CREATE_SPAPR_TCE_IOMMU: { + struct kvm_create_spapr_tce_iommu create_tce_iommu; + struct kvm *kvm = filp-private_data

Re: [PATCH 4/4] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-06-17 Thread Paolo Bonzini
Il 05/06/2013 08:11, Alexey Kardashevskiy ha scritto: +/* + * The KVM guest can be backed with 16MB pages (qemu switch + * -mem-path /var/lib/hugetlbfs/global/pagesize-16MB/). Nitpick: we try to avoid references to QEMU, so perhaps s/qemu switch/for example, with QEMU you can use the

Re: [PATCH v2 29/45] kvm/vmx: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paolo Bonzini
Il 25/06/2013 22:30, Srivatsa S. Bhat ha scritto: - cpu = get_cpu(); + cpu = get_online_cpus_atomic(); vmx_vcpu_load(vmx-vcpu, cpu); vmx-vcpu.cpu = cpu; err = vmx_vcpu_setup(vmx); vmx_vcpu_put(vmx-vcpu); - put_cpu(); + put_online_cpus_atomic(); The

Re: [PATCH v2 28/45] KVM: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paolo Bonzini
invoking from atomic context. Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: k...@vger.kernel.org Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- virt/kvm/kvm_main.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff

Re: [PATCH v2 29/45] kvm/vmx: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paolo Bonzini
Il 26/06/2013 10:06, Srivatsa S. Bhat ha scritto: On 06/26/2013 01:16 PM, Paolo Bonzini wrote: Il 25/06/2013 22:30, Srivatsa S. Bhat ha scritto: - cpu = get_cpu(); + cpu = get_online_cpus_atomic(); vmx_vcpu_load(vmx-vcpu, cpu); vmx-vcpu.cpu = cpu; err = vmx_vcpu_setup(vmx

Re: [PATCH v2 29/45] kvm/vmx: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-26 Thread Paolo Bonzini
Il 26/06/2013 10:41, Srivatsa S. Bhat ha scritto: On 06/26/2013 01:53 PM, Paolo Bonzini wrote: Il 26/06/2013 10:06, Srivatsa S. Bhat ha scritto: On 06/26/2013 01:16 PM, Paolo Bonzini wrote: Il 25/06/2013 22:30, Srivatsa S. Bhat ha scritto: - cpu = get_cpu(); + cpu = get_online_cpus_atomic

Re: [PATCH 1/2] Revert KVM: PPC: Book3S HV: Add new state for transactional memory

2014-03-10 Thread Paolo Bonzini
Il 10/03/2014 11:50, Paul Mackerras ha scritto: We can either do this revert, or apply a patch removing the extra hunk, but one or the other should go in for 3.14 since it's quite broken as it is (that is, HV-mode KVM on powerpc is broken). Paolo, do you have a preference about revert vs. fix?

Re: [RFC PATCH 3/3] PPC, KVM, CMA: use general CMA reserved area management framework

2014-06-03 Thread Paolo Bonzini
Nazarewicz min...@mina86.com Acked-by: Paolo Bonzini pbonz...@redhat.com Aneesh, can you test this series? Paolo ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH 09/11] kvm: simplify processor compat check

2013-09-27 Thread Paolo Bonzini
Il 27/09/2013 15:13, Aneesh Kumar K.V ha scritto: Alexander Graf ag...@suse.de writes: On 27.09.2013, at 12:03, Aneesh Kumar K.V wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Missing patch description. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com I

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Paolo Bonzini
Il 01/10/2013 10:34, Michael Ellerman ha scritto: If you really want to have the hypercall, implementing it in QEMU means that you can support it on all systems, in fact even when running without KVM. Sure, I can add a fallback to /dev/hwrng for full emulation. The QEMU command line

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-01 Thread Paolo Bonzini
Il 01/10/2013 11:38, Benjamin Herrenschmidt ha scritto: So for the sake of that dogma you are going to make us do something that is about 100 times slower ? (and possibly involves more lines of code) If it's 100 times slower there is something else that's wrong. It's most likely not 100 times

Re: [RFC PATCH 00/11 Allow PR and HV KVM to coexist in one kernel

2013-10-01 Thread Paolo Bonzini
Il 01/10/2013 13:36, Alexander Graf ha scritto: Yes, so we should verify in the machine models that we're runnable with the currently selected type at least, to give the user a sensible error message. Something like the below I like that one a lot. Andreas, Paolo, what do you think? Yes,

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Paolo Bonzini
Il 01/10/2013 23:44, Benjamin Herrenschmidt ha scritto: On Tue, 2013-10-01 at 13:19 +0200, Paolo Bonzini wrote: Il 01/10/2013 11:38, Benjamin Herrenschmidt ha scritto: So for the sake of that dogma you are going to make us do something that is about 100 times slower ? (and possibly involves

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Paolo Bonzini
Il 02/10/2013 07:09, Paul Mackerras ha scritto: On Tue, Oct 01, 2013 at 01:19:06PM +0200, Paolo Bonzini wrote: Anyhow, I would like to know more about this hwrng and hypercall. Does the hwrng return random numbers (like rdrand) or real entropy (like rdseed that Intel will add in Broadwell

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Paolo Bonzini
Il 02/10/2013 16:08, Alexander Graf ha scritto: The hwrng is accessible by host userspace via /dev/mem. A guest should live on the same permission level as a user space application. If you run QEMU as UID 1000 without access to /dev/mem, why should the guest suddenly be able to directly

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Paolo Bonzini
Il 02/10/2013 16:36, Alexander Graf ha scritto: With Michael's earlier patch in this series, the hwrng is accessible by host userspace via /dev/hwrng, no? Yes, but there's not token from user space that gets passed into the kernel to check whether access is ok or not. So while QEMU may

Re: [PATCH 0/2] powerpc/kvm: Enable running guests on RT Linux

2015-02-20 Thread Paolo Bonzini
On 20/02/2015 14:45, Alexander Graf wrote: On 18.02.15 10:32, Bogdan Purcareata wrote: This patchset enables running KVM SMP guests with external interrupts on an underlying RT-enabled Linux. Previous to this patch, a guest with in-kernel MPIC emulation could easily panic the kernel

Re: [PATCH 0/2] powerpc/kvm: Enable running guests on RT Linux

2015-02-20 Thread Paolo Bonzini
On 20/02/2015 15:54, Sebastian Andrzej Siewior wrote: Usually you see scheduling while atomic on -RT and convert them to raw locks if it is appropriate. Bogdan wrote in 2/2 that he needs to limit the number of CPUs in oder not cause a DoS and large latencies in the host. I haven't seen an

Re: [PATCH 0/2] powerpc/kvm: Enable running guests on RT Linux

2015-02-27 Thread Paolo Bonzini
On 27/02/2015 02:05, Scott Wood wrote: Obviously leaving it in a buggy state is not what we want -- but I lean towards a short term fix of putting depends on !PREEMPT_RT on the in-kernel MPIC emulation (which is itself just an optimization -- you can still use KVM without it). This way

Re: [PATCH 0/2] powerpc/kvm: Enable running guests on RT Linux

2015-02-20 Thread Paolo Bonzini
On 20/02/2015 16:06, Sebastian Andrzej Siewior wrote: On 02/20/2015 03:57 PM, Paolo Bonzini wrote: Yes, but large latencies just mean the code has to be rewritten (x86 doesn't anymore do event injection in an atomic regions for example). Until it is, using raw_spin_lock is correct

Re: [PATCH 0/2] powerpc/kvm: Enable running guests on RT Linux

2015-02-26 Thread Paolo Bonzini
On 24/02/2015 00:27, Scott Wood wrote: This isn't a host PIC driver. It's guest PIC emulation, some of which is indeed not suitable for a rawlock (in particular, openpic_update_irq which loops on the number of vcpus, with a loop body that calls IRQ_check() which loops over all pending

Re: [PATCH v3 02/12] KVM: define common __KVM_GUESTDBG_USE_SW/HW_BP values

2015-05-08 Thread Paolo Bonzini
On 08/05/2015 11:23, Christoffer Dall wrote: On Wed, May 06, 2015 at 05:23:17PM +0100, Alex Bennée wrote: Currently x86, powerpc and soon arm64 use the same two architecture specific bits for guest debug support for software and hardware breakpoints. This makes the shared values explicit

Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Paolo Bonzini
On 07/08/2015 15:47, Nicholas Krause wrote: - kvm_set_irq_routing(opp-kvm, routing, 0, 0); + ret = kvm_set_irq_routing(opp-kvm, routing, 0, 0); + if (ret) { + kfree(routing); + return ret; + } kfree(routing); return 0; You could

Re: [PATCH] kvm:powerpc:Fix error handling in the function mpic_set_default_irq_routing

2015-08-07 Thread Paolo Bonzini
On 06/08/2015 19:13, Nicholas Krause wrote: diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c index 6249cdc..5a18859 100644 --- a/arch/powerpc/kvm/mpic.c +++ b/arch/powerpc/kvm/mpic.c @@ -1641,13 +1641,16 @@ static void mpic_destroy(struct kvm_device *dev) static int

Re: [PATCH] mm: rename and document alloc_pages_exact_node

2015-07-22 Thread Paolo Bonzini
On 21/07/2015 15:55, Vlastimil Babka wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2d73807..a8723a8 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3158,7 +3158,7 @@ static struct vmcs *alloc_vmcs_cpu(int cpu) struct page *pages; struct vmcs

Re: [PATCH] KVM: powerpc: kvmppc_visible_gpa can be boolean

2015-11-18 Thread Paolo Bonzini
On 16/11/2015 04:10, Yaowei Bai wrote: > In another patch kvm_is_visible_gfn is maken return bool due to this > function only returns zero or one as its return value, let's also make > kvmppc_visible_gpa return bool to keep consistent. > > No functional change. > > Signed-off-by: Yaowei Bai

Re: [PATCH 3/4] kvm/stats: Add provisioning for 64-bit vcpu statistics

2016-06-20 Thread Paolo Bonzini
On 20/06/2016 02:08, Paul Mackerras wrote: > Paolo, > > Can I have an ack for Suraj's patch below? If it's OK with you, > I'll take his series through my tree. Yes, please do. Paolo > Thanks, > Paul. > > On Wed, Jun 15, 2016 at 07:21:07PM +1000, Suraj Jitindar Singh wrote: >> vcpus have

Re: [PATCH kernel] KVM: PPC: Create a virtual-mode only TCE table handlers

2016-03-18 Thread Paolo Bonzini
On 18/03/2016 10:16, Paul Mackerras wrote: > On Fri, Mar 18, 2016 at 01:50:42PM +1100, Alexey Kardashevskiy wrote: >> Upcoming in-kernel VFIO acceleration needs different handling in real >> and virtual modes which makes it hard to support both modes in >> the same handler. >> >> This creates a

Re: [PATCH 0/7] KVM/X86/PPC: Clear up kvm mmu memory barriers and update related comments

2016-03-14 Thread Paolo Bonzini
On 13/03/2016 04:10, Lan Tianyu wrote: > This series is to clear up kvm mmu memory barriers. > 1) Remove redundant barrier (PATCH 1) > 2) Replace origin barrier functions with preferrable ones (PATCH 2, 3, 5) > 3) Fix unpaired barriers (PATCH 4) > 4) Update or add barrier related comments (PATCH

Re: [PATCH] kvm-pr: manage illegal instructions

2016-05-10 Thread Paolo Bonzini
On 09/05/2016 10:14, Thomas Huth wrote: >> > Tested-by: Thomas Huth > Ping! > > Alex, Paul, could you please pick up this patch? This patch is required > to get the kvm-unit-tests working properly with kvm-pr, so I'd be glad > if we could get this included finally... I have

[PATCH v2] powerpc: move hmi.c to arch/powerpc/kvm/

2016-08-11 Thread Paolo Bonzini
Cc: k...@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- v1->v2: use CONFIG_KVM_BOOK3S_HV_POSSIBLE, not CONFIG_KVM_BOOK3S_64_HANDLER. The former implies the latter, but the reverse is not true. arch/powerpc/include/asm/hmi.h

Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics

2016-07-14 Thread Paolo Bonzini
On 13/07/2016 20:00, Christian Borntraeger wrote: >>> >> I thought u64 still existed on 32-bit architectures. unsigned long >>> >> would be fine but with the caveat that certain stats would overflow on >>> >> 32-bit architectures. >> > >> > Yes, but not all 32-bit architectures can do atomic

Re: [PATCH v2 1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-07-20 Thread Paolo Bonzini
On 20/07/2016 07:46, Michael Ellerman wrote: > Thanks. > > Acked-by: Michael Ellerman > > Or do you want me to merge this before Paul gets back? No, this should be merged through the KVM tree. Please Cc the KVM maintainers before offering to apply a patch that formally

Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics

2016-07-11 Thread Paolo Bonzini
On 11/07/2016 19:30, David Matlack wrote: > On Mon, Jul 11, 2016 at 10:05 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: >> >> >> On 11/07/2016 18:51, David Matlack wrote: >>>>> vcpus have statistics associated with them which can be viewed within

Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics

2016-07-18 Thread Paolo Bonzini
On 18/07/2016 09:17, Christian Borntraeger wrote: > On 07/15/2016 09:52 AM, Suraj Jitindar Singh wrote: >> >> >> On 14/07/16 19:42, Paolo Bonzini wrote: >>> >>> On 13/07/2016 20:00, Christian Borntraeger wrote: >>>>>>>> I t

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-06 Thread Paolo Bonzini
On 06/07/2016 08:52, Peter Zijlstra wrote: > On Tue, Jun 28, 2016 at 10:43:07AM -0400, Pan Xinhui wrote: >> change fomr v1: >> a simplier definition of default vcpu_is_preempted >> skip mahcine type check on ppc, and add config. remove dedicated macro. >> add one patch to drop

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-06 Thread Paolo Bonzini
On 06/07/2016 14:08, Wanpeng Li wrote: > 2016-07-06 18:44 GMT+08:00 Paolo Bonzini <pbonz...@redhat.com>: >> >> >> On 06/07/2016 08:52, Peter Zijlstra wrote: >>> On Tue, Jun 28, 2016 at 10:43:07AM -0400, Pan Xinhui wrote: >>>> change fom

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-06 Thread Paolo Bonzini
On 06/07/2016 10:19, Peter Zijlstra wrote: >>> Paolo, could you help out with an (x86) KVM interface for this? >> > >> > Xen support of this interface should be rather easy. Could you please >> > Cc: xen-devel-requ...@lists.xenproject.org in the next version? > So meta question; aren't all you

Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics

2016-07-11 Thread Paolo Bonzini
On 11/07/2016 18:51, David Matlack wrote: >> > vcpus have statistics associated with them which can be viewed within the >> > debugfs. Currently it is assumed within the vcpu_stat_get() and >> > vcpu_stat_get_per_vm() functions that all of these statistics are >> > represented as 32-bit numbers.

Re: [PATCH V2 3/5] kvm/ppc/book3s_hv: Implement halt polling in the kvm_hv kernel module

2016-07-11 Thread Paolo Bonzini
On 11/07/2016 18:57, David Matlack wrote: > On Mon, Jul 11, 2016 at 12:08 AM, Suraj Jitindar Singh > wrote: > > This patch introduces new halt polling functionality into the kvm_hv kernel > > module. When a vcore is idle it will poll for some period of time before > >

Re: [PATCH v2 1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-08-01 Thread Paolo Bonzini
On 20/07/2016 08:30, Paolo Bonzini wrote: > In particular this patch would indeed have a conflict, because you have > > +#define KVM_CAP_PPC_HTM 129 > > but cap numbers 129 and 130 are already taken. So whoever applies it > should bump the number to 131. Applied now

Re: [PATCH 1/4] kvm/ppc/book3s_hv: Change vcore element runnable_threads from linked-list to array

2016-06-29 Thread Paolo Bonzini
On 29/06/2016 06:44, Suraj Jitindar Singh wrote: > Thanks for catching that, yeah I see. > > I don't think we can trivially move the struct kvmppc_vcore definition into > kvm_book3s.h as other code in kvm_host.h (i.e. struct kvm_vcpu_arch) requires > the definition. I was thinking that I could

Re: [PATCH 01/11] KVM: PPC: Book3S HV: Move assignments for the variable "err" in kvm_htab_write()

2017-01-23 Thread Paolo Bonzini
On 20/01/2017 19:19, SF Markus Elfring wrote: > From: Markus Elfring > Date: Thu, 19 Jan 2017 22:45:56 +0100 > > * A local variable was set to an error code in five cases > before a concrete error situation was detected. > Thus move the corresponding

Re: [PATCH 03/11] KVM: PPC: Book3S HV: Move error code assignments in two functions

2017-01-23 Thread Paolo Bonzini
On 20/01/2017 19:21, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 20 Jan 2017 10:30:26 +0100 > > A local variable was set to an error code in a few cases before a concrete > error situation was detected. Thus move the corresponding assignments

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-14 Thread Paolo Bonzini
On 14/02/2017 09:45, Michael Ellerman wrote: >> If possible, please pull only up to "powerpc/64: Allow for relocation-on >> interrupts from guest to host" and cherry-pick the top two patches >> ("powerpc/64: CONFIG_RELOCATABLE support for hmi interrupts" and >> "powerpc/powernv: Remove separate

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-15 Thread Paolo Bonzini
On 15/02/2017 12:16, Michael Ellerman wrote: >> However, the reason was that this is simply not how topic branches >> should work: topic branches should be the base for other work, they >> shouldn't contain _all_ the work. > > I think that's an overly specific definition of what a topic branch

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-10 Thread Paolo Bonzini
On 10/02/2017 04:59, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kvm tree got a conflict in: > > arch/powerpc/include/asm/head-64.h > > between commit: > > 852e5da99d15 ("powerpc/64s: Tidy up after exception handler rework") > > from the powerpc tree and

[PATCH] powerpc: move hmi.c to arch/powerpc/kvm/

2016-08-03 Thread Paolo Bonzini
paca_struct only if KVM is supported by the kernel. Cc: Paul Mackerras <pau...@samba.org> Cc: Michael Ellerman <m...@ellerman.id.au> Cc: Mahesh Salgaonkar <mah...@linux.vnet.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org Cc: kvm-...@vger.kernel.org Cc: k...@vger.kernel.org Signed-off-by: Pa

Re: [PATCH v2 3/3] powerpc/mm: Speed up computation of base and actual page size for a HPTE

2016-09-08 Thread Paolo Bonzini
On 08/09/2016 12:08, Paul Mackerras wrote: >> > >> > arch/powerpc/include/asm/book3s/64/mmu-hash.h | 37 >> > arch/powerpc/include/asm/kvm_book3s_64.h | 87 >> > +++ >> > arch/powerpc/include/asm/mmu.h| 1 + >> >

Re: [PATCH v2 3/3] powerpc/mm: Speed up computation of base and actual page size for a HPTE

2016-09-12 Thread Paolo Bonzini
On 12/09/2016 05:03, Michael Ellerman wrote: >> > Can you place it in a pull request for both Michael and myself? > Paul and I talked about this offline, he's going to create a topic > branch with this in it. > > I'll hold off merging it until closer to the merge window, and I'll > merge it

Re: [PATCH v3 0/4] implement vcpu preempted check

2016-09-30 Thread Paolo Bonzini
> > > > Please consider s390 and (x86/arm) KVM. Once we have a few, more can > > > > follow later, but I think its important to not only have PPC support for > > > > this. > > > > > > Actually the s390 preemted check via sigp sense running is available for > > > all hypervisors (z/VM, LPAR and

Re: [PATCH v3 0/4] implement vcpu preempted check

2016-09-30 Thread Paolo Bonzini
On 30/09/2016 10:52, Pan Xinhui wrote: >> x86 has no hypervisor support, and I'd like to understand the desired >> semantics first, so I don't think it should block this series. In > > Once a guest do a hypercall or something similar, IOW, there is a > kvm_guest_exit. we think this is a lock

Re: [PATCH v2] powerpc: move hmi.c to arch/powerpc/kvm/

2016-08-18 Thread Paolo Bonzini
On 11/08/2016 15:07, Paolo Bonzini wrote: > hmi.c functions are unused unless sibling_subcore_state is nonzero, and > that in turn happens only if KVM is in use. So move the code to > arch/powerpc/kvm/, putting it under CONFIG_KVM_BOOK3S_HV_POSSIBLE > rather than CONFIG_P

Re: [PATCH] vfio: Fix build break when SPAPR_TCE_IOMMU=n

2016-11-07 Thread Paolo Bonzini
On 07/11/2016 17:25, Alex Williamson wrote: > On Mon, 07 Nov 2016 19:34:42 +1100 > Michael Ellerman <m...@ellerman.id.au> wrote: > >> Paolo Bonzini <pbonz...@redhat.com> writes: >>> On 04/11/2016 06:48, Michael Ellerman wrote: >>>> diff --g

Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check

2016-10-24 Thread Paolo Bonzini
On 19/10/2016 19:24, Radim Krčmář wrote: >> > + if (vcpu->arch.st.msr_val & KVM_MSR_ENABLED) >> > + if (kvm_read_guest_cached(vcpu->kvm, >arch.st.stime, >> > + >arch.st.steal, >> > + sizeof(struct kvm_steal_time)) == 0)

Re: [PATCH v5 9/9] Documentation: virtual: kvm: Support vcpu preempted check

2016-10-24 Thread Paolo Bonzini
On 21/10/2016 20:39, rkrc...@redhat.com wrote: > 2016-10-21 11:27+, David Laight: >> From: Pan Xinhui >>> Sent: 20 October 2016 22:28 >>> Commit ("x86, kvm: support vcpu preempted check") add one field "__u8 >>> preempted" into struct kvm_steal_time. This field tells if one vcpu is >>>

Re: [PATCH v4 5/5] x86, kvm: support vcpu preempted check

2016-10-24 Thread Paolo Bonzini
On 24/10/2016 17:14, Radim Krčmář wrote: > 2016-10-24 16:39+0200, Paolo Bonzini: >> On 19/10/2016 19:24, Radim Krčmář wrote: >>>>> + if (vcpu->arch.st.msr_val & KVM_MSR_ENABLED) >>>>> + if (k

Re: [PATCH v6 00/11] implement vcpu preempted check

2016-10-28 Thread Paolo Bonzini
On 28/10/2016 10:11, Pan Xinhui wrote: > change from v5: > spilt x86/kvm patch into guest/host part. > introduce kvm_write_guest_offset_cached. > fix some typos. > rebase patch onto 4.9.2 Acked-by: Paolo Bonzini <pbonz...@redhat.com> Thanks, Pa

Re: [PATCH] vfio: Fix build break when SPAPR_TCE_IOMMU=n

2016-11-04 Thread Paolo Bonzini
On 04/11/2016 06:48, Michael Ellerman wrote: > Currently the kconfig logic for VFIO_IOMMU_SPAPR_TCE and VFIO_SPAPR_EEH > is broken when SPAPR_TCE_IOMMU=n. Leading to: > > warning: (VFIO) selects VFIO_IOMMU_SPAPR_TCE which has unmet direct > dependencies (VFIO && SPAPR_TCE_IOMMU) >

Re: [PATCH] ibmvscsi: add write memory barrier to CRQ processing

2016-12-08 Thread Paolo Bonzini
On 08/12/2016 00:31, Tyrel Datwyler wrote: > The first byte of each CRQ entry is used to indicate whether an entry is > a valid response or free for the VIOS to use. After processing a > response the driver sets the valid byte to zero to indicate the entry is > now free to be reused. Add a

Re: powerpc KVM build break in linux-next (was Re: [PATCH tip/core/rcu 40/40] srcu: Parallelize callback handling)

2017-04-21 Thread Paolo Bonzini
;m...@ellerman.id.au> > Thank you, Michael! > > Paolo, does this look good to you? My upstream maintainer will be much > more likely to take this with your ack. ;-) Sure, Acked-by: Paolo Bonzini <pbonz...@redhat.com> since I don't expect conflicts between whoever applies this patch and the KVM tree. Paolo

Re: powerpc KVM build break in linux-next (was Re: [PATCH tip/core/rcu 40/40] srcu: Parallelize callback handling)

2017-04-20 Thread Paolo Bonzini
On 20/04/2017 05:40, Michael Ellerman wrote: > "Paul E. McKenney" writes: > >> diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h >> index f2b3bd6c6bc2..0400e211aa44 100644 >> --- a/include/linux/srcutree.h >> +++ b/include/linux/srcutree.h >> @@

Re: [PATCH] fix memory leak on kvm_vm_ioctl_get_htab_fd

2017-08-22 Thread Paolo Bonzini
t; + kfree(ctx); > kvm_put_kvm(kvm); > return ret; > } > Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>

Re: [PATCH] perf: libdw support for powerpc

2017-05-19 Thread Paolo Bonzini
On 18/05/2017 20:48, Paolo Bonzini wrote: > > > On 18/05/2017 20:19, Naveen N. Rao wrote: >> Paolo Bonzini wrote: >>> The ARM and x86 architectures already use libdw, and it is useful to >>> have as much common code for the unwinder as possible. Po

Re: [PATCH] perf: libdw support for powerpc

2017-05-18 Thread Paolo Bonzini
On 18/05/2017 20:19, Naveen N. Rao wrote: > Paolo Bonzini wrote: >> The ARM and x86 architectures already use libdw, and it is useful to >> have as much common code for the unwinder as possible. Porting PPC >> to libdw only needs an architecture-specific hook to move the r

[PATCH v2] perf: libdw support for powerpc

2017-06-01 Thread Paolo Bonzini
n.n@linux.vnet.ibm.com> Cc: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- v1->v2: fix for 4.11->4.12 changes tools/perf/Makefile.config | 2 +- tools/perf

Re: [PATCH v2] perf: libdw support for powerpc [ping]

2017-06-09 Thread Paolo Bonzini
On 01/06/2017 12:24, Paolo Bonzini wrote: > Porting PPC to libdw only needs an architecture-specific hook to move > the register state from perf to libdw. > > The ARM and x86 architectures already use libdw, and it is useful to > have as much common code for the unwinder as

Re: [PATCH] KVM: PPC: Book3S HV: Check for updated HDSISR on P9 HDSI exception

2017-09-22 Thread Paolo Bonzini
On 22/09/2017 12:30, David Gibson wrote: > On Fri, Sep 22, 2017 at 10:46:36AM +0200, Paolo Bonzini wrote: >> On 15/09/2017 07:26, Michael Neuling wrote: >>> On POWER9 DD2.1 and below, sometimes on a Hypervisor Data Storage >>> Interrupt (HDSI) the HDSISR is not be upda

Re: [PATCH] KVM: PPC: Book3S HV: Check for updated HDSISR on P9 HDSI exception

2017-09-22 Thread Paolo Bonzini
On 15/09/2017 07:26, Michael Neuling wrote: > On POWER9 DD2.1 and below, sometimes on a Hypervisor Data Storage > Interrupt (HDSI) the HDSISR is not be updated at all. > > To work around this we put a canary value into the HDSISR before > returning to a guest and then check for this canary when

Re: [PATCH] Revert "KVM: Don't accept obviously wrong gsi values via KVM_IRQFD"

2017-09-18 Thread Paolo Bonzini
On 18/09/2017 08:44, Michael Ellerman wrote: > "Jan H. Schönherr" writes: > >> This reverts commit 36ae3c0a36b7456432fedce38ae2f7bd3e01a563. >> >> The commit broke compilation on !CONFIG_HAVE_KVM_IRQ_ROUTING. Also, >> there may be cases with CONFIG_HAVE_KVM_IRQ_ROUTING, where

Re: [PATCH] KVM: PPC: fix oops when checking KVM_CAP_PPC_HTM

2017-10-13 Thread Paolo Bonzini
On 13/10/2017 01:16, Greg Kurz wrote: > Ping ? When is Paul back from vacation? :) Paolo > On Thu, 14 Sep 2017 23:56:25 +0200 > Greg Kurz wrote: > >> The following program causes a kernel oops: >> >> #include >> #include >> #include >> #include >> #include >> >> main() >>

Re: BSOD with [PATCH 00/13] mmu_notifier kill invalidate_page callback

2017-11-30 Thread Paolo Bonzini
On 30/11/2017 10:33, Fabian Grünbichler wrote: > > It was reverted in 785373b4c38719f4af6775845df6be1dfaea120f after which > the symptoms disappeared until this series was merged, which contains > > 369ea8242c0fb5239b4ddf0dc568f694bd244de4 mm/rmap: update to new mmu_notifier > semantic v2 > >

Re: [PATCH] kvm: Change return type to vm_fault_t

2018-05-10 Thread Paolo Bonzini
On 18/04/2018 21:19, Souptick Joarder wrote: > Use new return type vm_fault_t for fault handler. For > now, this is just documenting that the function returns > a VM_FAULT value rather than an errno. Once all instances > are converted, vm_fault_t will become a distinct type. > > commit

Re: [PATCH] kvm: no need to check return value of debugfs_create functions

2018-05-29 Thread Paolo Bonzini
t, as this code will never get > hit. > > Cc: Paul Mackerras > Cc: Benjamin Herrenschmidt > Cc: Michael Ellerman > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Arvind Yadav > Cc: Eric Auger > Cc: And

Re: [PATCH] KVM: surround kvm_arch_vcpu_async_ioctl() with #ifdef

2018-02-27 Thread Paolo Bonzini
On 28/02/2018 03:31, wei.guo.si...@gmail.com wrote: > From: Simon Guo > > Although CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL is usually on, logically > kvm_arch_vcpu_async_ioctl() definition should be wrapped with > CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL #ifdef. No, the symbol is

Re: [PATCH] KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN

2018-03-02 Thread Paolo Bonzini
est_enter_irqoff() > instead. > > Fixes: 8b24e69fc47e > ("KVM: PPC: Book3S HV: Close race with testing for signals on guest entry") > Signed-off-by: Laurent Vivier <lviv...@redhat.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> > --- > arch/powerpc/kvm

Re: [PATCH V4 00/15] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-10-15 Thread Paolo Bonzini
On 13/10/2018 16:53, lantianyu1...@gmail.com wrote: > From: Lan Tianyu > > For nested memory virtualization, Hyper-v doesn't set write-protect > L1 hypervisor EPT page directory and page table node to track changes > while it relies on guest to tell it changes via HvFlushGuestAddressLlist >

Re: [PATCH V4 2/15] KVM/MMU: Add tlb flush with range helper function

2018-10-15 Thread Paolo Bonzini
On 14/10/2018 10:16, Thomas Gleixner wrote: >>> +static inline bool kvm_available_flush_tlb_with_range(void) >>> +{ >>> + return kvm_x86_ops->tlb_remote_flush_with_range; >>> +} >> Seems that kvm_available_flush_tlb_with_range() is not used in this patch… > What's wrong with that? > > It

Re: [Resend PATCH V5 0/10] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-12-21 Thread Paolo Bonzini
On 06/12/18 14:21, lantianyu1...@gmail.com wrote: > From: Lan Tianyu > > For nested memory virtualization, Hyper-v doesn't set write-protect > L1 hypervisor EPT page directory and page table node to track changes > while it relies on guest to tell it changes via HvFlushGuestAddressLlist >

Re: [Resend PATCH V5 2/10] x86/hyper-v: Add HvFlushGuestAddressList hypercall support

2018-12-21 Thread Paolo Bonzini
On 06/12/18 14:21, lantianyu1...@gmail.com wrote: > static inline int hyperv_flush_guest_mapping(u64 as) { return -1; } > +static inline int hyperv_flush_guest_mapping_range(u64 as, > + hyperv_fill_flush_list_func fill_func, void *data); > +{ > + return -1; This part for

Re: [PATCH 9/11] KVM/MMU: Flush tlb in the kvm_mmu_write_protect_pt_masked()

2019-01-07 Thread Paolo Bonzini
On 04/01/19 09:54, lantianyu1...@gmail.com wrote: > rmap_head = __gfn_to_rmap(slot->base_gfn + gfn_offset + > __ffs(mask), > PT_PAGE_TABLE_LEVEL, slot); > - __rmap_write_protect(kvm, rmap_head, false); > + flush |=

Re: [PATCH 4/11] KVM/MMU: Introduce tlb flush with range list

2019-01-07 Thread Paolo Bonzini
On 04/01/19 09:53, lantianyu1...@gmail.com wrote: > struct kvm_mmu_page { > struct list_head link; > + > + /* > + * Tlb flush with range list uses struct kvm_mmu_page as list entry > + * and all list operations should be under protection of mmu_lock. > + */ > + struct

Re: [PATCH 3/11] KVM: Add spte's point in the struct kvm_mmu_page

2019-01-07 Thread Paolo Bonzini
On 04/01/19 09:53, lantianyu1...@gmail.com wrote: > @@ -332,6 +332,7 @@ struct kvm_mmu_page { > int root_count; /* Currently serving as active root */ > unsigned int unsync_children; > struct kvm_rmap_head parent_ptes; /* rmap pointers to parent sptes */ > + u64

Re: [PATCH 6/11] KVM/MMU: Flush tlb with range list in sync_page()

2019-01-07 Thread Paolo Bonzini
On 04/01/19 17:30, Sean Christopherson wrote: >> + >> +if (kvm_available_flush_tlb_with_range() >> +&& (tmp_spte_ret & SET_SPTE_NEED_REMOTE_TLB_FLUSH)) { >> +struct kvm_mmu_page *leaf_sp = page_header(sp->spt[i] >> +

Re: [PATCH 7/11] KVM: Remove redundant check in the kvm_get_dirty_log_protect()

2019-01-07 Thread Paolo Bonzini
On 04/01/19 16:50, Sean Christopherson wrote: > Tangentially related, does mmu_lock actually need to be held while we > walk dirty_bitmap in kvm_{clear,get}_dirty_log_protect()? The bitmap > itself is protected by slots_lock (a lockdep assertion would be nice > too), e.g. can we grab the lock iff

Re: [PATCH v2 11/16] KVM: introduce a 'mmap' method for KVM devices

2019-02-26 Thread Paolo Bonzini
On 25/02/19 11:57, Cédric Le Goater wrote: > Hello Paolo, > > On 2/25/19 4:33 AM, David Gibson wrote: >> On Fri, Feb 22, 2019 at 12:28:35PM +0100, Cédric Le Goater wrote: >>> Some KVM devices will want to handle special mappings related to the >>> underlying HW. For instance, the XIVE interrupt

Re: [PATCH V3 00/10] X86/KVM/Hyper-V: Add HV ept tlb range list flush support in KVM

2019-02-22 Thread Paolo Bonzini
On 22/02/19 16:06, lantianyu1...@gmail.com wrote: > From: Lan Tianyu > > This patchset is to introduce hv ept tlb range list flush function > support in the KVM MMU component. Flushing ept tlbs of several address > range can be done via single hypercall and new list flush function is > used in

Re: [PATCH v2 15/16] KVM: introduce a KVM_DESTROY_DEVICE ioctl

2019-03-15 Thread Paolo Bonzini
On 13/03/19 09:02, Cédric Le Goater wrote: > The 'destroy' method is currently used to destroy all devices when the > VM is destroyed after the vCPUs have been freed. > > This new KVM ioctl exposes the same KVM device method. It acts as a > software reset of the VM to 'destroy' selected devices

Re: [PATCH V2 3/10] KVM/MMU: Add last_level in the struct mmu_spte_page

2019-02-14 Thread Paolo Bonzini
On 02/02/19 02:38, lantianyu1...@gmail.com wrote: > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index ce770b446238..70cafd3f95ab 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -2918,6 +2918,9 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, > > if

Re: [PATCH V2 3/10] KVM/MMU: Add last_level in the struct mmu_spte_page

2019-02-14 Thread Paolo Bonzini
On 02/02/19 02:38, lantianyu1...@gmail.com wrote: > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index ce770b446238..70cafd3f95ab 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -2918,6 +2918,9 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, > > if

Re: [PATCH V2 00/10] X86/KVM/Hyper-V: Add HV ept tlb range list flush support in KVM

2019-02-14 Thread Paolo Bonzini
On 02/02/19 02:38, lantianyu1...@gmail.com wrote: > From: Lan Tianyu > > This patchset is to introduce hv ept tlb range list flush function > support in the KVM MMU component. Flushing ept tlbs of several address > range can be done via single hypercall and new list flush function is > used in

Re: [PATCH V2 3/10] KVM/MMU: Add last_level in the struct mmu_spte_page

2019-02-15 Thread Paolo Bonzini
On 15/02/19 16:05, Tianyu Lan wrote: > Yes, you are right. Thanks to point out and will fix. The last_level > flag is to avoid adding middle page node(e.g, PGD, PMD) > into flush list. The address range will be duplicated if adding both > leaf, node and middle node into flush list. Hmm, that's

  1   2   3   >