Re: [PATCH 1/2] Add a rudimentary manpage

2015-12-22 Thread Will Deacon
Hi Andre, of Phoronix fame, On Tue, Dec 22, 2015 at 02:00:46PM +, Andre Przywara wrote: > The kvmtool documentation is somewhat lacking, also it is not easily > accessible when living in the source tree only. > Add a good ol' manpage to document at least the basic commands and > their

Re: [PATCH v6 02/21] KVM: ARM64: Define PMU data structure for each vcpu

2015-12-08 Thread Will Deacon
On Tue, Dec 08, 2015 at 01:37:14PM +, Marc Zyngier wrote: > On 08/12/15 12:47, Shannon Zhao wrote: > > From: Shannon Zhao > > > > Here we plan to support virtual PMU for guest by full software > > emulation, so define some basic structs and functions preparing for >

[PATCH] kvmtool: virtio-net: fix VIRTIO_NET_F_MRG_RXBUF usage in rx thread

2015-11-26 Thread Will Deacon
otal size, we *then* publish the buffers to the guest. Cc: Marc Zyngier <marc.zyng...@arm.com> Cc: Sasha Levin <sasha.le...@oracle.com> Signed-off-by: Will Deacon <will.dea...@arm.com> --- Without this patch, I can't boot to a prompt using NFS over virtio-net. include/kvm/virtio.h |

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-18 Thread Will Deacon
On Wed, Nov 18, 2015 at 10:29:30AM +, Andre Przywara wrote: > On 02/11/15 14:58, Will Deacon wrote: > > On Fri, Oct 30, 2015 at 06:26:53PM +, Andre Przywara wrote: > >> this series cleans up kvmtool's kernel loading functionality a bit. > >> It has been broken

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-18 Thread Will Deacon
On Wed, Nov 18, 2015 at 10:29:30AM +, Andre Przywara wrote: > On 02/11/15 14:58, Will Deacon wrote: > > On Fri, Oct 30, 2015 at 06:26:53PM +, Andre Przywara wrote: > >> this series cleans up kvmtool's kernel loading functionality a bit. > >> It has been broken

Re: [PATCH 2/2] arm64: KVM: Add workaround for Cortex-A57 erratum 834220

2015-11-17 Thread Will Deacon
> +alternative_if_not ARM64_WORKAROUND_834220 > and x2, x1, #ESR_ELx_FSC_TYPE > cmp x2, #FSC_PERM > b.ne1f // Not a permission fault > +alternative_else > + nop // Use the permission fault path to > + nop /

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

2015-11-05 Thread Will Deacon
On Wed, Nov 04, 2015 at 06:51:12PM -0500, Sasha Levin wrote: > 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++) { &

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

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

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

2015-11-03 Thread Will Deacon
On Tue, Nov 03, 2015 at 09:44:52AM -0800, Mario Smarduch wrote: > On 11/3/2015 8:33 AM, Christopher Covington wrote: > > On 11/02/2015 06:51 PM, Mario Smarduch wrote: > >>this is a re-post from couple weeks ago, please take time to review > >> this > >> simple patch which simplifies DEBUG_LL

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-02 Thread Will Deacon
On Fri, Oct 30, 2015 at 06:26:53PM +, Andre Przywara wrote: > Hi, Hello Andre, > this series cleans up kvmtool's kernel loading functionality a bit. > It has been broken out of a previous series I sent [1] and contains > just the cleanup and bug fix parts, which should be less controversial

Re: [PATCH 0/7] kvmtool: Cleanup kernel loading

2015-11-02 Thread Will Deacon
On Fri, Oct 30, 2015 at 06:26:53PM +, Andre Przywara wrote: > Hi, Hello Andre, > this series cleans up kvmtool's kernel loading functionality a bit. > It has been broken out of a previous series I sent [1] and contains > just the cleanup and bug fix parts, which should be less controversial

Re: [RFC PATCH] vfio/type1: Do not support IOMMUs that allow bypass

2015-10-29 Thread Will Deacon
On Tue, Oct 27, 2015 at 10:00:11AM -0600, Alex Williamson wrote: > On Tue, 2015-10-27 at 15:40 +, Will Deacon wrote: > > On Fri, Oct 16, 2015 at 09:51:22AM -0600, Alex Williamson wrote: > > > Would it be possible to add iommu_domain_geometry support to arm-smmu.c?

Re: [RFC PATCH] vfio/type1: Do not support IOMMUs that allow bypass

2015-10-29 Thread Will Deacon
On Thu, Oct 29, 2015 at 06:42:10PM +, Robin Murphy wrote: > On 29/10/15 18:28, Will Deacon wrote: > >On Tue, Oct 27, 2015 at 10:00:11AM -0600, Alex Williamson wrote: > >>On Tue, 2015-10-27 at 15:40 +, Will Deacon wrote: > >>>On Fri, Oct 16, 2015 at 09:51:22A

Re: [PATCH] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-29 Thread Will Deacon
arity while iommu driver can use the sub-PAGE_HOST size > + * to map the buffer. > + */ > + if (bitmap & ~PAGE_MASK) { > + bitmap &= PAGE_MASK; > + bitmap |= PAGE_SIZE; > + } > + s/PAGE_HOST/PAGE_SIZE/g (in the cover-letter too) a

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Will Deacon
On Wed, Oct 28, 2015 at 01:12:45PM +, Eric Auger wrote: > Current vfio_pgsize_bitmap code hides the supported IOMMU page > sizes smaller than PAGE_SIZE. As a result, in case the IOMMU > does not support PAGE_SIZE page, the alignment check on map/unmap > is done with larger page sizes, if any.

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Will Deacon
On Wed, Oct 28, 2015 at 10:27:28AM -0600, Alex Williamson wrote: > On Wed, 2015-10-28 at 13:12 +, Eric Auger wrote: > > diff --git a/drivers/vfio/vfio_iommu_type1.c > > b/drivers/vfio/vfio_iommu_type1.c > > index 57d8c37..13fb974 100644 > > --- a/drivers/vfio/vfio_iommu_type1.c > > +++

Re: [RFC] vfio/type1: handle case where IOMMU does not support PAGE_SIZE size

2015-10-28 Thread Will Deacon
On Wed, Oct 28, 2015 at 06:48:41PM +0100, Eric Auger wrote: > On 10/28/2015 06:37 PM, Alex Williamson wrote: > > Ok, so with hopefully correcting my understand of what this does, isn't > > this effectively the same: > > > > diff --git a/drivers/vfio/vfio_iommu_type1.c > >

Re: Network hangs when communicating with host

2015-10-27 Thread Will Deacon
and I didn't get round to posting it. Will --->8 >From 7cbcdfef1b9f094db4bf75676f22339f3164e103 Mon Sep 17 00:00:00 2001 From: Will Deacon <will.dea...@arm.com> Date: Fri, 17 Apr 2015 17:31:36 +0100 Subject: [PATCH] kvmtool: virtio-net: fix VIRTIO_NET_F_MRG_RXBUF usage in rx thread

Re: [RFC PATCH] vfio/type1: Do not support IOMMUs that allow bypass

2015-10-27 Thread Will Deacon
On Fri, Oct 16, 2015 at 09:51:22AM -0600, Alex Williamson wrote: > On Fri, 2015-10-16 at 16:03 +0200, Eric Auger wrote: > > Hi Alex, > > On 10/15/2015 10:52 PM, Alex Williamson wrote: > > > We can only provide isolation if DMA is forced through the IOMMU > > > aperture. Don't allow type1 to be

Re: [PATCH 0/3] kvmtool: don't overwrite /virt/init

2015-10-27 Thread Will Deacon
Hi Oleg, On Thu, Oct 22, 2015 at 05:59:21PM +0200, Oleg Nesterov wrote: > On top of "[PATCH 0/3] kvmtool: tiny init fox x86_64" I sent. > > I simply can't understand why kvmtool always overwrites /virt/init. > This doesn't look right, especially because you can't pass "init=" > kernel argument

Re: [kvmtool] Add a link to the lwn.net article

2015-10-06 Thread Will Deacon
Hi Sven, On Sat, Oct 03, 2015 at 10:42:55PM +1000, Sven Dowideit wrote: > Signed-off-by: Sven Dowideit > --- > README | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/README b/README > index 6667f23..5501f05 100644 > --- a/README > +++ b/README > @@ -97,6

Re: [PATCH kvmtool] Skip a few messages by default: command line args; flat binary; earlyprintk.

2015-10-06 Thread Will Deacon
On Wed, Sep 30, 2015 at 05:11:15PM +0100, Andre Przywara wrote: > On 29/09/15 17:59, Dimitri John Ledkov wrote: > > The partial command line args & earlyprintk=serial are still enabled > > in the debug mode. Warning that a flat binary kernel image is attemped > > to be loaded is completely

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

2015-09-18 Thread Will Deacon
On Fri, Sep 18, 2015 at 11:51:37AM +0100, Riku Voipio wrote: > On 17 September 2015 at 18:53, Will Deacon <will.dea...@arm.com> wrote: > > 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

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: [PATCH v2 kvmtool] Make static libc and guest-init functionality optional.

2015-09-15 Thread Will Deacon
aintainance. Signed-off-by: Dimitri John Ledkov <dimitri.j.led...@intel.com> [will: moved all the guest_init handling into builtin_setup.c] Signed-off-by: Will Deacon <will.dea...@arm.com> --- Makefile| 12 +++- builtin-run.c | 29 +--

[PATCH] KVM: arm64: remove all traces of the ThumbEE registers

2015-09-15 Thread 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. Cc: Marc Zyngier <marc.zyng...@arm.com> Signed-off-by: Will Deacon <will.dea...@arm.com> --- arch/arm64/include/asm/kvm_arm.h

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

2015-09-14 Thread Will Deacon
.@arm.com> Signed-off-by: Will Deacon <will.dea...@arm.com> --- arch/arm64/kvm/hyp.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 3c4f641451bb..c4016d411f4a 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.

Re: [PATCH] KVM: arm64: add workaround for Cortex-A57 erratum #852523

2015-09-14 Thread Will Deacon
On Mon, Sep 14, 2015 at 04:46:28PM +0100, Marc Zyngier wrote: > On 14/09/15 16:06, Will Deacon wrote: > > 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

Re: [PATCH] kvmtool Makefile: relax arm test

2015-09-10 Thread Will Deacon
On Thu, Sep 10, 2015 at 06:45:59AM +0100, Riku Voipio wrote: > On 4 September 2015 at 14:06, Andre Przywara wrote: > > On 04/09/15 11:52, Riku Voipio wrote: > >> On 4 September 2015 at 13:10, Andre Przywara > >> wrote: > >>> On 03/09/15 12:20,

[GIT PULL] Late arm64 KVM fix for 4.2

2015-08-27 Thread Will Deacon
Hi Linus, I appreciate that it's extremely late in the cycle, but we've uncovered a nasty bug in the arm64 KVM code which allows a badly behaved 32-bit guest to bring down the host. The fix is simple (it's what I believe we call a brown paper bag bug) and I don't think it makes sense to sit on

Re: [PATCH kvmtool] kvm__emulate_io: Don't call br_read_unlock() twice on IO error

2015-08-07 Thread Will Deacon
On Thu, Aug 06, 2015 at 07:39:44PM +0100, Josh Triplett wrote: The IO error path in kvm__emulate_io would call br_read_unlock(), then goto error, which would call br_read_unlock() again. Refactor the control flow to have only one exit path and one call to br_read_unlock(). Thanks, Josh. I

Re: [PATCHv3 1/2] kvmtool: Introduce downscript option for virtio-net

2015-07-24 Thread Will Deacon
On Tue, Jul 21, 2015 at 10:44:31AM +0100, Andre Przywara wrote: thanks for the rework, that looks good to me, some minor nits below. Not sure if that requires a new version, maybe Will can fix that up when he applies it. Nah, please send a new version with these points addressed. Will -- To

Re: [PATCH 00/12] kvmtool: Improve portability

2015-07-17 Thread Will Deacon
On Fri, Jul 17, 2015 at 05:02:06PM +0100, Andre Przywara wrote: Hi, Hi Andre, this is a collection of patches to bring kvmtool closer to standards compliance (with standards not necessarily meaning GNU only). With all those patches applied, you can compile kvmtool with newer C standards,

Re: [PATCH 06/12] kvm__set_dir(): avoid variable arguments call

2015-07-17 Thread Will Deacon
On Fri, Jul 17, 2015 at 05:02:12PM +0100, Andre Przywara wrote: The clang compiler by default dislikes non-literal format strings in *printf functions, so it complains about kvm__set_dir() in kvm.c. Instead of suppressing this warning, lets change the code to avoid that unneeded var_args

Re: [PATCH 07/12] util/util.c: avoid clang error on vsnprintf

2015-07-17 Thread Will Deacon
On Fri, Jul 17, 2015 at 05:02:13PM +0100, Andre Przywara wrote: clang by default doesn't seem to like printf calls with non-literal format strings. Add the proper pragma to disable this warning in the report function to make kvmtool compile with clang. Despite its GCC name, clang also accepts

Re: [PATCH 10/13] arm64: Add support for running Linux in EL2 mode

2015-07-16 Thread Will Deacon
On Wed, Jul 08, 2015 at 05:19:13PM +0100, Marc Zyngier wrote: With the ARMv8.1 VHE, the architecture is able to (almost) transparently run the kernel at EL2, despite being written for EL1. This patch takes care of the almost part, mostly preventing the kernel from dropping from EL2 to EL1,

Re: [PATCH 11/13] arm64: Panic when VHE and non VHE CPUs coexist

2015-07-16 Thread Will Deacon
On Wed, Jul 08, 2015 at 05:19:14PM +0100, Marc Zyngier wrote: Having both VHE and non-VHE capable CPUs in the same system is likely to be a recipe for disaster. If the boot CPU has VHE, but a secondary is not, we won't be able to downgrade and run the kernel at EL1. Add CPU hotplug to the

Re: [PATCH 03/13] arm64: Add ARM64_HAS_VIRT_HOST_EXTN feature

2015-07-16 Thread Will Deacon
On Wed, Jul 08, 2015 at 05:19:06PM +0100, Marc Zyngier wrote: Add a new ARM64_HAS_VIRT_HOST_EXTN features to indicate that the CPU has the ARMv8,1 VHE capability. This will be used to trigger kernel patching in KVM. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Acked-by: Will Deacon

Re: [PATCH 01/13] arm/arm64: Add new is_kernel_in_hyp_mode predicate

2015-07-16 Thread Will Deacon
On Wed, Jul 08, 2015 at 05:19:04PM +0100, Marc Zyngier wrote: With ARMv8.1 VHE extension, it will be possible to run the kernel at EL2 (aka HYP mode). In order for the kernel to easily find out where it is running, add a new predicate that returns whether or not the kernel is in HYP mode.

Re: [PATCH 01/18] ARM64: Move PMU register related defines to asm/pmu.h

2015-07-08 Thread Will Deacon
On Mon, Jul 06, 2015 at 03:17:31AM +0100, shannon.z...@linaro.org wrote: From: Shannon Zhao shannon.z...@linaro.org To use the ARMv8 PMU related register defines from the KVM code, we move the relevant definitions to asm/pmu.h header file. Signed-off-by: Anup Patel anup.pa...@linaro.org

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-08 Thread Will Deacon
On Wed, Jul 08, 2015 at 11:50:22AM +0100, Zhichao Huang wrote: Are you happy with this?: You miss the reserved breakpoint, I think. I also still don't understand why this is preferable to trapping. Will -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-07 Thread Will Deacon
On Tue, Jul 07, 2015 at 11:06:57AM +0100, Zhichao Huang wrote: Chazy and me are talking about how to reduce the saving/restoring overhead for debug registers. We want to add a state in hw_breakpoint.c to indicate whether the host enable any hwbrpts or not (might export a fuction that kvm can

Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-06 Thread Will Deacon
On Fri, Jul 03, 2015 at 05:07:41PM +0100, Alex Bennée wrote: Will Deacon will.dea...@arm.com writes: On Thu, Jul 02, 2015 at 02:50:33PM +0100, Alex Bennée wrote: Are you happy with this?: [...] +/** + * kvm_arch_dev_ioctl_check_extension + * + * We currently assume

Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-03 Thread Will Deacon
Hi Alex, On Thu, Jul 02, 2015 at 02:50:33PM +0100, Alex Bennée wrote: Are you happy with this?: [...] +/** + * kvm_arch_dev_ioctl_check_extension + * + * We currently assume that the number of HW registers is uniform + * across all CPUs (see cpuinfo_sanity_check). + */ int

Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-02 Thread Will Deacon
Hi Alex, On Wed, Jul 01, 2015 at 07:29:01PM +0100, Alex Bennée wrote: This adds support for userspace to control the HW debug registers for guest debug. In the debug ioctl we copy an IMPDEF registers into a new register set called host_debug_state. We use the recently introduced vcpu

Re: [PATCH v2] kvmtool: Add parameter to specifiy number of threads in thread_pool

2015-06-30 Thread Will Deacon
Hi Andreas, On Mon, Jun 29, 2015 at 12:43:33PM +0100, Andreas Herrmann wrote: With current code the number of threads added to the thread_pool equals number of online CPUs. So on cn78xx we usually have 48 threads per guest just for the thread_pool. IMHO this is overkill for guests that just

Re: [PATCH v4 10/10] arm: use new irqchip parameter to create different vGIC types

2015-06-30 Thread Will Deacon
On Fri, Jun 26, 2015 at 02:16:18PM +0100, Andre Przywara wrote: Currently we unconditionally create a virtual GICv2 in the guest. Add a --irqchip= parameter to let the user specify a different GIC type for the guest, when omitting this parameter it still defaults to --irqchip=gicv2. For now

Re: [PATCH v4 07/10] limit number of VCPUs on demand

2015-06-30 Thread Will Deacon
On Fri, Jun 26, 2015 at 02:16:15PM +0100, Andre Przywara wrote: Currently the ARM GIC checks the number of VCPUs against a fixed limit, which is GICv2 specific. Don't pretend we know better than the kernel and let's get rid of that explicit check. Instead be more relaxed about KVM_CREATE_VCPU

Re: [PATCH] kvmtool: Add parameter to specifiy number of threads in thread_pool

2015-06-29 Thread Will Deacon
On Mon, Jun 29, 2015 at 08:45:44AM +0100, Andreas Herrmann wrote: With current code the number of threads added to the thread_pool equals number of online CPUs. Thus on an OcteonIII cn78xx system we usually have 48 threads per guest just for the thread_pool. IMHO this is overkill for guests

Re: [PATCH] kvmtool: don't use PCI config space IRQ line field

2015-06-29 Thread Will Deacon
Hi Andre, On Thu, Jun 18, 2015 at 06:19:53PM +0100, Andre Przywara wrote: I am tempted to remove shmem, since it's broken: a) there is no upstream driver, only some out-of-tree uio driver module in some Github repo Right, but that's the same for qemu and we've already made the jump of merging

Re: [PATCH v3 06/10] arm: simplify MMIO dispatching

2015-06-24 Thread Will Deacon
On Wed, Jun 24, 2015 at 02:30:05PM +0100, Andre Przywara wrote: do you want me to respin the whole series to address the remaining minor comments in the last four patches or do you want to take patch 01-06 already (which I think Marc has already agreed upon)? Then I would just send an updated

Re: [PATCH 1/2] powerpc: Define the hcall opcodes return values we need

2015-06-19 Thread Will Deacon
On Fri, Jun 19, 2015 at 08:21:00AM +0100, Michael Ellerman wrote: Now that we don't have the kernel header on hand, just define the minimum set of hcall opcodes and return values we need in order to build. Thanks Michael! I pushed both of these out. Will -- To unsubscribe from this list:

Re: [PATCH 1/2] powerpc: Define the hcall opcodes return values we need

2015-06-19 Thread Will Deacon
On Fri, Jun 19, 2015 at 08:21:00AM +0100, Michael Ellerman wrote: Now that we don't have the kernel header on hand, just define the minimum set of hcall opcodes and return values we need in order to build. Thanks Michael! I pushed both of these out. Will -- To unsubscribe from this list:

Re: [PATCH 1/3] powerpc: implement barrier primitives

2015-06-18 Thread Will Deacon
On Thu, Jun 18, 2015 at 10:11:58AM +0100, Michael Ellerman wrote: On Wed, 2015-06-17 at 11:15 +0100, Will Deacon wrote: On Wed, Jun 17, 2015 at 10:43:48AM +0100, Andre Przywara wrote: Instead of referring to the Linux header including the barrier macros, copy over the rather simple

Re: [PATCH 1/3] powerpc: implement barrier primitives

2015-06-18 Thread Will Deacon
On Thu, Jun 18, 2015 at 10:11:58AM +0100, Michael Ellerman wrote: On Wed, 2015-06-17 at 11:15 +0100, Will Deacon wrote: On Wed, Jun 17, 2015 at 10:43:48AM +0100, Andre Przywara wrote: Instead of referring to the Linux header including the barrier macros, copy over the rather simple

Re: [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 08:17:49AM +0100, Andreas Herrmann wrote: On Tue, Jun 16, 2015 at 06:17:14PM +0100, Will Deacon wrote: On Mon, Jun 15, 2015 at 12:49:45PM +0100, Andreas Herrmann wrote: W/o dedicated endianess it's impossible to find reliably a match e.g. in kernel/virt/kvm

Re: [PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 10:43:50AM +0100, Andre Przywara wrote: The powerpc code uses some PAPR hypercalls, of which we need the hypercall number. Copy the macro definition parts from the kernel's (private) hvcall.h file and remove the extra tricks formerly used to be able to include this

Re: [PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 10:43:50AM +0100, Andre Przywara wrote: The powerpc code uses some PAPR hypercalls, of which we need the hypercall number. Copy the macro definition parts from the kernel's (private) hvcall.h file and remove the extra tricks formerly used to be able to include this

Re: [PATCH 1/3] powerpc: implement barrier primitives

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 10:43:48AM +0100, Andre Przywara wrote: Instead of referring to the Linux header including the barrier macros, copy over the rather simple implementation for the PowerPC barrier instructions kvmtool uses. This fixes build for powerpc. Signed-off-by: Andre Przywara

Re: [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event

2015-06-16 Thread Will Deacon
On Mon, Jun 15, 2015 at 12:49:45PM +0100, Andreas Herrmann wrote: W/o dedicated endianess it's impossible to find reliably a match e.g. in kernel/virt/kvm/eventfd.c ioeventfd_in_range. Hmm, but shouldn't this be the endianness of the guest, rather than just forcing things to little-endian?

Re: [PATCH v2 01/11] KVM: arm: plug guest debug exploit

2015-06-16 Thread Will Deacon
On Sun, Jun 14, 2015 at 05:13:05PM +0100, zichao wrote: I and marc are talking about how to plug the guest debug exploit in an easier way. I remembered that you mentioned disabling monitor mode had proven to be extremely fragile in practice on 32-bit ARM SoCs, what if I save/restore the

Re: [PATCH 0/5] kvmtool: Misc fixes

2015-06-16 Thread Will Deacon
On Mon, Jun 15, 2015 at 12:49:41PM +0100, Andreas Herrmann wrote: Following some patches to fix misc issues found when testing the standalone kvmtool version. Please apply. All applied, apart from the ioeventfd patch which I'm not sure about. Will -- To unsubscribe from this list: send the

Re: [PATCH] kvmtool: don't use PCI config space IRQ line field

2015-06-16 Thread Will Deacon
On Mon, Jun 15, 2015 at 11:45:38AM +0100, Andre Przywara wrote: On 06/05/2015 05:41 PM, Will Deacon wrote: On Thu, Jun 04, 2015 at 04:20:45PM +0100, Andre Przywara wrote: In PCI config space there is an interrupt line field (offset 0x3f), which is used to initially communicate the IRQ line

Re: [PATCH] kvmtool: don't use PCI config space IRQ line field

2015-06-05 Thread Will Deacon
On Thu, Jun 04, 2015 at 04:20:45PM +0100, Andre Przywara wrote: In PCI config space there is an interrupt line field (offset 0x3f), which is used to initially communicate the IRQ line number from firmware to the OS. _Hardware_ should never use this information, as the OS is free to write any

Re: stand-alone kvmtool

2015-06-03 Thread Will Deacon
On Mon, Feb 23, 2015 at 05:23:58PM +, Pekka Enberg wrote: On 2/18/15 5:50 PM, Will Deacon wrote: Thanks for doing this. Since it looks unlikely that kvmtool will ever be merged back into the kernel tree, it makes sense to cut the dependency in my opinion. I am certainly OK

[ANNOUNCE] Stand-alone kvmtool repository

2015-06-03 Thread Will Deacon
Hi all, Thanks to a tonne of help (and friendly nagging!) from Andre, I'm pleased to announce a stand-alone repository for kvmtool: git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git This is a follow-up from a previous thread[1] where we concluded that this was the right way to

Re: [PATCH v2 09/11] KVM: arm: disable debug mode if we don't actually need it.

2015-06-01 Thread Will Deacon
On Sun, May 31, 2015 at 05:27:10AM +0100, Zhichao Huang wrote: Until now we enable debug mode all the time even if we don't actually need it. Inspired by the implementation in arm64, disable debug mode if we don't need it. And then we are able to reduce unnecessary registers

Re: [PATCH v5 10/12] KVM: arm64: guest debug, HW assisted debug support

2015-06-01 Thread Will Deacon
Hi Alex, On Fri, May 29, 2015 at 10:30:26AM +0100, Alex Bennée wrote: This adds support for userspace to control the HW debug registers for guest debug. In the debug ioctl we copy the IMPDEF defined number of registers into a new register set called host_debug_state. There is now a new vcpu

Re: stand-alone kvmtool

2015-02-25 Thread Will Deacon
On Mon, Feb 23, 2015 at 05:23:58PM +, Pekka Enberg wrote: Hi, Hi Pekka, Sorry for the delay, I've been away from email for a few days. On 2/18/15 5:50 PM, Will Deacon wrote: Thanks for doing this. Since it looks unlikely that kvmtool will ever be merged back into the kernel tree

Re: stand-alone kvmtool

2015-02-18 Thread Will Deacon
Hi Andre, Thanks for doing this. Since it looks unlikely that kvmtool will ever be merged back into the kernel tree, it makes sense to cut the dependency in my opinion. On Fri, Feb 13, 2015 at 10:39:33AM +, Andre Przywara wrote: as I found it increasingly inconvenient to use kvmtool[1] as

Re: [PATCH -v3 0/6] rcu,nohz,kvm: use RCU extended quiescent state when running KVM guest

2015-02-09 Thread Will Deacon
Hi Rik, On Mon, Feb 09, 2015 at 04:04:38PM +, r...@redhat.com wrote: Apologies to Catalin and Will for not fixing up ARM. I am not familiar with ARM assembly, and not sure how to pass a constant argument to a function from assembly code on ARM :) It's a bit of a faff getting enum values

Re: [PATCH] kvmtool: don't use PCI config space IRQ line field

2015-02-06 Thread Will Deacon
On Fri, Feb 06, 2015 at 07:02:25PM +, Peter Maydell wrote: On 6 February 2015 at 18:55, Will Deacon will.dea...@arm.com wrote: On Wed, Feb 04, 2015 at 03:39:50PM +, Andre Przywara wrote: In PCI config space there is an interrupt line field (offset 0x3f), which is used to initially

Re: [PATCH] kvmtool: don't use PCI config space IRQ line field

2015-02-06 Thread Will Deacon
On Wed, Feb 04, 2015 at 03:39:50PM +, Andre Przywara wrote: In PCI config space there is an interrupt line field (offset 0x3f), which is used to initially communicate the IRQ line number from firmware to the OS. _Hardware_ should never use this information, as the OS is free to write any

Re: [PATCH 03/11] kvmtool: AArch{32,64}: use KVM_CREATE_DEVICE co to instanciate the GIC

2015-01-26 Thread Will Deacon
On Fri, Jan 23, 2015 at 04:35:02PM +, Andre Przywara wrote: From: Marc Zyngier marc.zyng...@arm.com As of 3.14, KVM/arm supports the creation/configuration of the GIC through a more generic device API, which is now the preferred way to do so. Plumb the new API in, and allow the old

Re: [PATCH 11/11] kvmtool: add command line parameter to instantiate a vGICv3

2015-01-26 Thread Will Deacon
On Fri, Jan 23, 2015 at 04:35:10PM +, Andre Przywara wrote: Add the command line parameter --gicv3 to request GICv3 emulation in the kernel. Connect that to the already existing GICv3 code. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- tools/kvm/arm/aarch64/arm-cpu.c

Re: [PATCH] kvmtool: virtio-9p: Convert EMFILE error at the server to ENFILE for the guest

2015-01-16 Thread Will Deacon
, but: Acked-by: Will Deacon will.dea...@arm.com Will Signed-off-by: Suzuki K. Poulose suzuki.poul...@arm.com --- tools/kvm/virtio/9p.c |4 1 file changed, 4 insertions(+) diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index 9073a1e..b24c0f2 100644 --- a/tools/kvm/virtio

Re: [RFC PATCH] kvmtool: remove 8250 IRQ line reset on device_init

2015-01-12 Thread Will Deacon
of the issue that this patch fixed? This is four years old and from what I see QEMU does no longer the mentioned IRQ reset(?). Reworking kvmtool to avoid this issue sound rather painful. I'm fine with this from an ARM point-of-view. Acked-by: Will Deacon will.dea...@arm.com Have you tested this on x86

Re: [PATCH v2 2/5] kvmtool: replace GIC specific IRQ type #defines

2014-12-17 Thread Will Deacon
On Wed, Dec 17, 2014 at 11:14:44AM +, Andre Przywara wrote: We had GIC specific defines for the IRQ type identifiers in kvmtool. But In fact the specification of being a level or edge interrupt is quite generic, with the GIC binding using the generic Linux defines. So lets replace the GIC

Re: [PATCH v2 5/5] kvmtool: remove warning about bzImage on non-x86 architectures

2014-12-17 Thread Will Deacon
On Wed, Dec 17, 2014 at 11:14:47AM +, Andre Przywara wrote: Among the architectures supported by kvmtool, only x86 defines a bzImage format. So we shouldn't bother users of other architectures with a message about something that cannot work. Make the bzImage check dependent on compiling

Re: [PATCH 2/4] kvmtool: ARM: allow level interrupts in device tree

2014-12-11 Thread Will Deacon
On Thu, Dec 11, 2014 at 04:30:33PM +, Andre Przywara wrote: Currently we describe every interrupt for each device in the FDT as being edge triggered. Add a parameter to the irq property generation to allow devices to specify their interrupts as level triggered if needed. Signed-off-by:

Re: [PATCH v4 1/3] KVM: arm/arm64: unset CONFIG_HAVE_KVM_IRQCHIP

2014-11-24 Thread Will Deacon
eric.au...@linaro.org --- The arm64 change is fine by me. I assume this will go via the kvm tree eventually? Acked-by: Will Deacon will.dea...@arm.com Will arch/arm/kvm/Kconfig | 2 -- arch/arm64/kvm/Kconfig | 1 - 2 files changed, 3 deletions(-) diff --git a/arch/arm/kvm/Kconfig b/arch

Re: [PATCH v5 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

2014-10-03 Thread Will Deacon
On Wed, Oct 01, 2014 at 11:34:54AM +0100, Anup Patel wrote: The KVM_EXIT_SYSTEM_EVENT exit reason was added to define architecture independent system-wide events for a Guest. Currently, it is used by in-kernel PSCI-0.2 emulation of KVM ARM/ARM64 to inform user space about PSCI SYSTEM_OFF or

Re: [PATCH v5 0/4] kvmtool: ARM/ARM64: Misc updates

2014-10-03 Thread Will Deacon
On Wed, Oct 01, 2014 at 11:34:51AM +0100, Anup Patel wrote: This patchset updates KVMTOOL to use some of the features supported by Linux-3.16 KVM ARM/ARM64, such as: 1. Target CPU == Host using KVM_ARM_PREFERRED_TARGET vm ioctl 2. Target CPU type Potenza for using KVMTOOL on X-Gene 3. PSCI

Re: [PATCH] kvm-vfio: do not use module_init

2014-09-24 Thread Will Deacon
On Wed, Sep 24, 2014 at 12:29:09PM +0100, Paolo Bonzini wrote: /me got confused between the kernel and QEMU. In the kernel, you can only have one module_init function, and it will prevent unloading the module unless you also have the corresponding module_exit function. Happy for you to take

Re: [PATCH] kvm-vfio: do not use module_init

2014-09-24 Thread Will Deacon
On Wed, Sep 24, 2014 at 12:45:53PM +0100, Paolo Bonzini wrote: Il 24/09/2014 13:44, Will Deacon ha scritto: On Wed, Sep 24, 2014 at 12:29:09PM +0100, Paolo Bonzini wrote: /me got confused between the kernel and QEMU. In the kernel, you can only have one module_init function

Re: [PATCH v2] kvm-vfio: do not use module_init

2014-09-24 Thread Will Deacon
80ce1639727e (KVM: VFIO: register kvm_device_ops dynamically, 2014-09-02) broke unloading of the kvm module, by adding a module_init function and no module_exit. Repair it by making kvm_vfio_ops_init weak, and checking it in kvm_init. Cc: Will Deacon will.dea...@arm.com Cc: Gleb Natapov g

Re: [PATCH v3] kvm-vfio: do not use module_init

2014-09-24 Thread Will Deacon
80ce1639727e (KVM: VFIO: register kvm_device_ops dynamically, 2014-09-02) broke unloading of the kvm module, by adding a module_init function and no module_exit. Repair it by making kvm_vfio_ops_init weak, and checking it in kvm_init. Cc: Will Deacon will.dea...@arm.com Cc: Gleb Natapov g

Re: [PATCHv7 01/26] iommu/arm-smmu: change IOMMU_EXEC to IOMMU_NOEXEC

2014-09-23 Thread Will Deacon
Hi Antonios, On Tue, Sep 23, 2014 at 03:46:00PM +0100, Antonios Motakis wrote: Exposing the XN flag of the SMMU driver as IOMMU_NOEXEC instead of IOMMU_EXEC makes it enforceable, since for IOMMUs that don't support the XN flag pages will always be executable. Signed-off-by: Antonios Motakis

Re: [PATCH v3 0/4] Make kvm_device_ops registration dynamic

2014-09-11 Thread Will Deacon
Hi Paolo, On Tue, Sep 02, 2014 at 10:27:32AM +0100, Will Deacon wrote: Hi all, This is version 3 of the patches originally posted here: v1: http://www.spinics.net/lists/kvm-arm/msg10219.html v2: http://www.spinics.net/lists/kvm/msg105197.html Changes since v2 include

Re: [PATCH] kvm tools: arm: remove register accessor macros now that they are in uapi

2014-09-05 Thread Will Deacon
On Fri, Aug 29, 2014 at 02:00:24PM +0100, Will Deacon wrote: The kernel now exposes register accessor macros in the uapi/ headers for arm and arm64, so use those instead (and avoid the compile failure from the duplicate definitions). Signed-off-by: Will Deacon will.dea...@arm.com

[PATCH v3 0/4] Make kvm_device_ops registration dynamic

2014-09-02 Thread Will Deacon
, flic and xics are still not ported over, as I don't want to risk breaking those devices (it's not clear at which point they need to be registered). Thanks, Will ---8 Cornelia Huck (1): KVM: s390: register flic ops dynamically Will Deacon (3): KVM: device: add simple registration mechanism

[PATCH v3 3/4] KVM: s390: register flic ops dynamically

2014-09-02 Thread Will Deacon
From: Cornelia Huck cornelia.h...@de.ibm.com Using the new kvm_register_device_ops() interface makes us get rid of an #ifdef in common code. Cc: Gleb Natapov g...@kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com Signed-off-by: Will Deacon

[PATCH v3 1/4] KVM: device: add simple registration mechanism for kvm_device_ops

2014-09-02 Thread Will Deacon
...@linaro.org Signed-off-by: Will Deacon will.dea...@arm.com --- include/linux/kvm_host.h | 1 + include/uapi/linux/kvm.h | 22 +++- virt/kvm/kvm_main.c | 65 3 files changed, 55 insertions(+), 33 deletions(-) diff --git a/include/linux

[PATCH v3 2/4] KVM: ARM: vgic: register kvm_device_ops dynamically

2014-09-02 Thread Will Deacon
...@linaro.org Signed-off-by: Will Deacon will.dea...@arm.com --- include/linux/kvm_host.h | 1 - virt/kvm/arm/vgic.c | 157 --- virt/kvm/kvm_main.c | 4 -- 3 files changed, 79 insertions(+), 83 deletions(-) diff --git a/include/linux/kvm_host.h b

[PATCH v3 4/4] KVM: VFIO: register kvm_device_ops dynamically

2014-09-02 Thread Will Deacon
Williamson alex.william...@redhat.com Signed-off-by: Will Deacon will.dea...@arm.com --- include/linux/kvm_host.h | 1 - virt/kvm/kvm_main.c | 4 virt/kvm/vfio.c | 22 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/linux/kvm_host.h b

[PATCH] kvm tools: arm: remove register accessor macros now that they are in uapi

2014-08-29 Thread Will Deacon
The kernel now exposes register accessor macros in the uapi/ headers for arm and arm64, so use those instead (and avoid the compile failure from the duplicate definitions). Signed-off-by: Will Deacon will.dea...@arm.com --- Pekka -- please take this as a fix, since merging the 3.16 sources has

Re: [PATCH v2 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu

2014-08-29 Thread Will Deacon
On Fri, Aug 29, 2014 at 10:10:52AM +0100, Andre Przywara wrote: (resent, that was the wrong account before ...) Aha, and now your true identity has been revealed to all! Nice try Andre... or should I say, Rienhard? Will -- To unsubscribe from this list: send the line unsubscribe kvm in the body

Re: [PATCH 2/5] kvmtool: ARM64: Fix compile error for aarch64

2014-08-28 Thread Will Deacon
On Thu, Aug 28, 2014 at 10:56:29AM +0100, Pekka Enberg wrote: On 08/07/2014 12:12 PM, Will Deacon wrote: Ok. Pekka, could you merge in 3.16 to the kvmtool master branch please? You'll need my patch below to resolve some ARM build fallout. Done. Thanks, Pekka! We'll give it a spin

Re: [RFC 4/5] vfio: amba: VFIO support for AMBA devices

2014-08-26 Thread Will Deacon
Hi Antonios, On Fri, Aug 22, 2014 at 10:01:27AM +0100, Antonios Motakis wrote: Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. [...] +static struct amba_id pl330_ids[] = { + { 0, 0 }, +}; + +MODULE_DEVICE_TABLE(amba, pl330_ids);

  1   2   3   4   >