Hi experts,
I scribbled thru kvm code as part of my work. I would like to make it
useful for beginners , as part of that effort i created blog with
some stuff. Would appreciate feedback,so that i can continue
enhancing or dropping the effort all together. Once again , really
appreciate your
On Fri, Oct 03, 2014 at 07:07:57PM +0200, Andrea Arcangeli wrote:
> We run out of 32bits in vm_flags, noop change for 64bit archs.
>
> Signed-off-by: Andrea Arcangeli
> ---
> fs/proc/task_mmu.c | 4 ++--
> include/linux/huge_mm.h | 4 ++--
> include/linux/ksm.h | 4 ++--
> include/li
On Oct 6, 2014, at 11:50 PM, Radim Krčmář wrote:
> 2014-10-03 01:10+0300, Nadav Amit:
>> Once an instruction crosses a page boundary, the size read from the second
>> page
>> disregards the common case that part of the operand resides on the first
>> page.
>> As a result, fetch of long insturc
On Mon, Oct 06, 2014 at 09:30:24PM +0100, Christoffer Dall wrote:
> The following host configurations have been tested with KVM on APM
> Mustang:
[...]
> 3) 64KB + 39 bits VA space
That would be 42-bit VA space.
--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
th
Thanks for reviewing this patch and the rest of the gang.
On Oct 6, 2014, at 11:57 PM, Radim Krčmář wrote:
> 2014-10-03 01:10+0300, Nadav Amit:
>> Setting the TSC deadline MSR that are initiated by the host (using ioctl's)
>> may
>> cause superfluous interrupt. This occurs in the following cas
On Tue, Oct 07, 2014 at 10:24:58AM +0100, Catalin Marinas wrote:
> On Mon, Oct 06, 2014 at 09:30:24PM +0100, Christoffer Dall wrote:
> > The following host configurations have been tested with KVM on APM
> > Mustang:
> [...]
> > 3) 64KB + 39 bits VA space
>
> That would be 42-bit VA space.
>
Ye
On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote:
> MADV_USERFAULT is a new madvise flag that will set VM_USERFAULT in the
> vma flags. Whenever VM_USERFAULT is set in an anonymous vma, if
> userland touches a still unmapped virtual address, a sigbus signal is
> sent instead of allo
* Kirill A. Shutemov (kir...@shutemov.name) wrote:
> On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote:
> > MADV_USERFAULT is a new madvise flag that will set VM_USERFAULT in the
> > vma flags. Whenever VM_USERFAULT is set in an anonymous vma, if
> > userland touches a still unmapped
On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote:
> +/**
> + * kvm_prealloc_hwpgd - allocate inital table for VTTBR
> + * @kvm: The KVM struct pointer for the VM.
> + * @pgd: The kernel pseudo pgd
> + *
> + * When the kernel uses more levels of page tables than the guest
On Tue, Oct 07, 2014 at 11:46:04AM +0100, Dr. David Alan Gilbert wrote:
> * Kirill A. Shutemov (kir...@shutemov.name) wrote:
> > On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote:
> > > MADV_USERFAULT is a new madvise flag that will set VM_USERFAULT in the
> > > vma flags. Whenever V
* Kirill A. Shutemov (kir...@shutemov.name) wrote:
> On Tue, Oct 07, 2014 at 11:46:04AM +0100, Dr. David Alan Gilbert wrote:
> > * Kirill A. Shutemov (kir...@shutemov.name) wrote:
> > > On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote:
> > > > MADV_USERFAULT is a new madvise flag th
On Fri, Oct 03, 2014 at 07:08:00PM +0200, Andrea Arcangeli wrote:
> There's one constraint enforced to allow this simplification: the
> source pages passed to remap_anon_pages must be mapped only in one
> vma, but this is not a limitation when used to handle userland page
> faults with MADV_USERFAU
On Tue, Oct 07, 2014 at 12:01:02PM +0100, Dr. David Alan Gilbert wrote:
> * Kirill A. Shutemov (kir...@shutemov.name) wrote:
> > On Tue, Oct 07, 2014 at 11:46:04AM +0100, Dr. David Alan Gilbert wrote:
> > > * Kirill A. Shutemov (kir...@shutemov.name) wrote:
> > > > On Fri, Oct 03, 2014 at 07:07:58P
On (Mon) 06 Oct 2014 [18:10:40], Michael S. Tsirkin wrote:
> On restore, virtio pci does the following:
> + set features
> + init vqs etc - device can be used at this point!
> + set ACKNOWLEDGE,DRIVER and DRIVER_OK status bits
>
> This is in violation of the virtio spec, which
> requires the follo
On 07/10/14 04:47, Dmitry Petuhov wrote:
07.10.2014 7:42, Dmitry Petuhov пишет:
05.10.2014 19:44, Michael S. Tsirkin пишет:
OK but pls cleanup indentation, it's all scrambled. You'll also need
to add proper attribution (using >From: header), your signature etc.
Don't understand what's wrong wi
On Mon, Oct 6, 2014 at 12:41 PM, Andrea Arcangeli wrote:
>
> Of course if somebody has better ideas on how to resolve an anonymous
> userfault they're welcome.
So I'd *much* rather have a "write()" style interface (ie _copying_
bytes from user space into a newly allocated page that gets mapped)
t
On Tue, Oct 07, 2014 at 05:35:13PM +0530, Amit Shah wrote:
> On (Mon) 06 Oct 2014 [18:10:40], Michael S. Tsirkin wrote:
> > On restore, virtio pci does the following:
> > + set features
> > + init vqs etc - device can be used at this point!
> > + set ACKNOWLEDGE,DRIVER and DRIVER_OK status bits
> >
On Mon, Oct 06, 2014 at 06:10:40PM +0300, Michael S. Tsirkin wrote:
> On restore, virtio pci does the following:
> + set features
> + init vqs etc - device can be used at this point!
> + set ACKNOWLEDGE,DRIVER and DRIVER_OK status bits
>
> This is in violation of the virtio spec, which
> requires
Hi Kirill,
On Tue, Oct 07, 2014 at 01:36:45PM +0300, Kirill A. Shutemov wrote:
> On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote:
> > MADV_USERFAULT is a new madvise flag that will set VM_USERFAULT in the
> > vma flags. Whenever VM_USERFAULT is set in an anonymous vma, if
> > user
On 07/10/14 11:48, Catalin Marinas wrote:
> On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote:
>> +/**
>> + * kvm_prealloc_hwpgd - allocate inital table for VTTBR
>> + * @kvm: The KVM struct pointer for the VM.
>> + * @pgd: The kernel pseudo pgd
>> + *
>> + * When the ker
Hi Kirill,
On Tue, Oct 07, 2014 at 02:10:26PM +0300, Kirill A. Shutemov wrote:
> On Fri, Oct 03, 2014 at 07:08:00PM +0200, Andrea Arcangeli wrote:
> > There's one constraint enforced to allow this simplification: the
> > source pages passed to remap_anon_pages must be mapped only in one
> > vma, b
Hi Christoffer,
On 06/10/14 21:30, Christoffer Dall wrote:
> This patch adds the necessary support for all host kernel PGSIZE and
> VA_SPACE configuration options for both EL2 and the Stage-2 page tables.
>
> However, for 40bit and 42bit PARange systems, the architecture mandates
> that VTCR_EL2.
Hello,
On Tue, Oct 07, 2014 at 08:47:59AM -0400, Linus Torvalds wrote:
> On Mon, Oct 6, 2014 at 12:41 PM, Andrea Arcangeli wrote:
> >
> > Of course if somebody has better ideas on how to resolve an anonymous
> > userfault they're welcome.
>
> So I'd *much* rather have a "write()" style interface
On Tue, Oct 07, 2014 at 03:24:58PM +0200, Andrea Arcangeli wrote:
> Hi Kirill,
>
> On Tue, Oct 07, 2014 at 01:36:45PM +0300, Kirill A. Shutemov wrote:
> > On Fri, Oct 03, 2014 at 07:07:58PM +0200, Andrea Arcangeli wrote:
> > > MADV_USERFAULT is a new madvise flag that will set VM_USERFAULT in the
On Tue, Oct 07, 2014 at 04:19:13PM +0200, Andrea Arcangeli wrote:
> mremap like interface, or file+commands protocol interface. I tend to
> like mremap more, that's why I opted for a remap_anon_pages syscall
> kept orthogonal to the userfaultfd functionality (remap_anon_pages
> could be also used s
On Tue, Oct 7, 2014 at 8:52 AM, Andrea Arcangeli wrote:
> On Tue, Oct 07, 2014 at 04:19:13PM +0200, Andrea Arcangeli wrote:
>> mremap like interface, or file+commands protocol interface. I tend to
>> like mremap more, that's why I opted for a remap_anon_pages syscall
>> kept orthogonal to the user
On Tue, Oct 07, 2014 at 05:52:47PM +0200, Andrea Arcangeli wrote:
> I probably grossly overestimated the benefits of resolving the
> userfault with a zerocopy page move, sorry. [...]
For posterity, I think it's worth noting that most expensive aspect of a TLB
shootdown is the interprocessor interr
On (Tue) 07 Oct 2014 [15:53:55], Michael S. Tsirkin wrote:
> On Mon, Oct 06, 2014 at 06:10:40PM +0300, Michael S. Tsirkin wrote:
> > On restore, virtio pci does the following:
> > + set features
> > + init vqs etc - device can be used at this point!
> > + set ACKNOWLEDGE,DRIVER and DRIVER_OK status
On Tue, Oct 7, 2014 at 10:19 AM, Andrea Arcangeli wrote:
>
> I see what you mean. The only cons I see is that we couldn't use then
> recv(tmp_addr, PAGE_SIZE), remap_anon_pages(faultaddr, tmp_addr,
> PAGE_SIZE, ..) and retain the zerocopy behavior. Or how could we?
> There's no recvfile(userfault
Il 07/10/2014 19:07, Dr. David Alan Gilbert ha scritto:
>> >
>> > So I'd *much* rather have a "write()" style interface (ie _copying_
>> > bytes from user space into a newly allocated page that gets mapped)
>> > than a "remap page" style interface
> Something like that might work for the postcopy
* Paolo Bonzini (pbonz...@redhat.com) wrote:
> Il 07/10/2014 19:07, Dr. David Alan Gilbert ha scritto:
> >> >
> >> > So I'd *much* rather have a "write()" style interface (ie _copying_
> >> > bytes from user space into a newly allocated page that gets mapped)
> >> > than a "remap page" style inter
* Linus Torvalds (torva...@linux-foundation.org) wrote:
> On Mon, Oct 6, 2014 at 12:41 PM, Andrea Arcangeli wrote:
> >
> > Of course if somebody has better ideas on how to resolve an anonymous
> > userfault they're welcome.
>
> So I'd *much* rather have a "write()" style interface (ie _copying_
>
From: Rusty Russell
Change the u32 to a u64, and make sure to use 1ULL everywhere!
Cc: Brian Swetland
Cc: Christian Borntraeger
[Thomas Huth: fix up virtio-ccw get_features]
Signed-off-by: Rusty Russell
Signed-off-by: Cornelia Huck
Acked-by: Pawel Moll
Acked-by: Ohad Ben-Cohen
---
drivers
From: Thomas Huth
Add the new VIRTIO_F_VERSION_1 definition to the virtio_config.h
linux header.
Signed-off-by: Thomas Huth
Signed-off-by: Cornelia Huck
---
linux-headers/linux/virtio_config.h |3 +++
1 file changed, 3 insertions(+)
diff --git a/linux-headers/linux/virtio_config.h
b/lin
From: Rusty Russell
[Cornelia Huck: we don't need the vq->vring.num -> vq->ring_mask change]
Signed-off-by: Rusty Russell
Signed-off-by: Cornelia Huck
---
drivers/virtio/virtio_ring.c | 195 ++
1 file changed, 138 insertions(+), 57 deletions(-)
diff --
From: Rusty Russell
[Cornelia Huck: converted some missed fields]
Signed-off-by: Rusty Russell
Signed-off-by: Cornelia Huck
---
drivers/net/virtio_net.c | 31 +++
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/ne
From: Rusty Russell
It seemed like a good idea, but it's actually a pain when we get more
than 32 feature bits. Just change it to a u32 for now.
Cc: Brian Swetland
Cc: Christian Borntraeger
Signed-off-by: Rusty Russell
Signed-off-by: Cornelia Huck
Acked-by: Pawel Moll
Acked-by: Ohad Ben-Co
This patchset tries to go towards implementing both virtio-1 compliant and
transitional virtio drivers in Linux. Branch available at
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux virtio-1
This is based on some old patches by Rusty to handle extended feature bits
and endianness conve
The only user of this function was virtio-ccw, and it should use
virtio_set_features() like everybody else: We need to make sure
that bad features are masked out properly, which this function did
not do.
Reviewed-by: Thomas Huth
Signed-off-by: Cornelia Huck
---
hw/s390x/virtio-ccw.c |
For virtio-1 devices, we allow a more complex queue layout that doesn't
require descriptor table and rings on a physically-contigous memory area:
add virtio_queue_set_rings() to allow transports to set this up.
Signed-off-by: Cornelia Huck
---
hw/virtio/virtio.c | 16
From: Thomas Huth
We need a possibility to run code when a subchannel gets disabled.
This patch adds the necessary infrastructure.
Signed-off-by: Thomas Huth
Signed-off-by: Cornelia Huck
---
hw/s390x/css.c | 12
hw/s390x/css.h |1 +
2 files changed, 13 insertions(+)
diff -
Handle endianness conversion for virtio-1 virtqueues correctly.
Note that dataplane now needs to be built per-target.
Signed-off-by: Cornelia Huck
---
hw/block/dataplane/virtio-blk.c |3 +-
hw/scsi/virtio-scsi-dataplane.c |2 +-
hw/virtio/Makefile.objs |2 +-
hw/
Note that we care only about the fields still in use for virtio v1.0.
Reviewed-by: Thomas Huth
Reviewed-by: David Hildenbrand
Signed-off-by: Cornelia Huck
---
drivers/block/virtio_blk.c |4
1 file changed, 4 insertions(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio
Provide helper functions that convert from/to LE for virtio devices that
are not operating in legacy mode. We check for the VERSION_1 feature bit
to determine that.
Based on original patches by Rusty Russell and Thomas Huth.
Reviewed-by: David Hildenbrand
Signed-off-by: Cornelia Huck
---
drive
From: Rusty Russell
Reviewed-by: David Hildenbrand
Signed-off-by: Rusty Russell
Signed-off-by: Cornelia Huck
---
include/linux/virtio_config.h |9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index a0
Now that virtio-ccw has everything needed to support virtio 1.0 in
place, try to enable it if the host supports it.
Reviewed-by: David Hildenbrand
Signed-off-by: Cornelia Huck
---
drivers/s390/kvm/virtio_ccw.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/k
From: Thomas Huth
With the new SET-VIRTIO-REVISION command of the virtio 1.0 standard, we
can now negotiate the virtio-ccw revision after setting a channel online.
Note that we don't negotiate version 1 yet.
[Cornelia Huck: reworked revision loop a bit]
Reviewed-by: David Hildenbrand
Signed-of
The CCW_CMD_SET_VQ command has a different format for revision 1+
devices, allowing to specify a more complex virtqueue layout. For
now, we stay however with the old layout and simply use the new
command format for virtio-1 devices.
Signed-off-by: Cornelia Huck
---
drivers/s390/kvm/virtio_ccw.c
virtio-ccw should now have everything in place to operate virtio 1.0
devices, so let's enable revision 1.
Signed-off-by: Cornelia Huck
---
hw/s390x/virtio-ccw.h |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index 03d5955..08e
We need to check guest feature size, not host feature size to find
out whether we should call virtio_set_features(). This check is
possible now that vdev->guest_features is an array.
Reviewed-by: Thomas Huth
Signed-off-by: Cornelia Huck
---
hw/s390x/virtio-ccw.c |2 +-
1 file changed, 1 ins
From: Thomas Huth
Handle the virtio-ccw revision according to what the guest sets.
When revision 1 is selected, we have a virtio-1 standard device
with byteswapping for the virtio rings.
When a channel gets disabled, we have to revert to the legacy behavior
in case the next user of the device do
Support the new CCW_CMD_SET_VQ format for virtio-1 devices.
While we're at it, refactor the code a bit and enforce big endian
fields (which had always been required, even for legacy).
Reviewed-by: Thomas Huth
Signed-off-by: Cornelia Huck
---
hw/s390x/virtio-ccw.c | 114 +++
This patchset aims to get us some way to implement virtio-1 compliant
and transitional devices in qemu. Branch available at
git://github.com/cohuck/qemu virtio-1
I've mainly focused on:
- endianness handling
- extended feature bits
- virtio-ccw new/changed commands
Thanks go to Thomas for some p
With virtio-1, we support more than 32 feature bits. Let's make
vdev->guest_features depend on the number of supported feature bits,
allowing us to grow the feature bits automatically.
We also need to enhance the internal functions dealing with getting
and setting features with an additional index
I have a Windows 2012R2 guest hosted on top of the KVM, the guest has 2 VFs
(from different PFs) assigned to it. I can team them together via Windows NIC
Teaming, but when I test failover (pulling one cable) I lose connectivity until
I restart the guest. Do you know where I can get instructions
For virtio-1, we can theoretically have a more complex virtqueue
layout with avail and used buffers not on a contiguous memory area
with the descriptor table. For now, it's fine for a transport driver
to stay with the old layout: It needs, however, a way to access
the locations of the avail/used ri
Introduce a helper function to indicate whether a virtio device is
operating in legacy or virtio standard mode.
It may be used to make decisions about the endianess of virtio accesses
and other virtio-1 specific changes, enabling us to support transitional
devices.
Reviewed-by: Thomas Huth
Sign
On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote:
> On 07/10/14 11:48, Catalin Marinas wrote:
> > On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote:
> >> +/**
> >> + * kvm_prealloc_hwpgd - allocate inital table for VTTBR
> >> + * @kvm: The KVM struct pointer for the
CR4.TSD is guest-owned; don't trap writes to it in VMX guests. This
avoids a VM exit on context switches into or out of a PR_TSC_SIGSEGV
task.
I think that this fixes an unintentional side-effect of:
4c38609ac569 KVM: VMX: Make guest cr4 mask more conservative
Signed-off-by: Andy Lutomirski
On 10/07/2014 07:39 AM, Cornelia Huck wrote:
> This patchset aims to get us some way to implement virtio-1 compliant
> and transitional devices in qemu. Branch available at
>
> git://github.com/cohuck/qemu virtio-1
>
> I've mainly focused on:
> - endianness handling
> - extended feature bits
> -
On Fri, Oct 03, 2014 at 01:40:29PM -0400, Mohan Kumar wrote:
>Hello all,
>
>I am new to KVM and look at a particular case in KVM.
>I know that KVM uses CFS.
>
>The question I have is as follows:
>
>- I have two VMs with 2 VCPU each. And the actual
> CPUs are also 2 and both the VMs use the 2 CPUs.
On Fri, Oct 03, 2014 at 12:30:52AM +0300, Nadav Amit wrote:
>KVM does not deliver x2APIC broadcast messages with physical mode. Intel SDM
>(10.12.9 ICR Operation in x2APIC Mode) states: "A destination ID value of
>_H is used for broadcast of interrupts in both logical destination and
>phys
On 2014/8/21 21:06, Andre Przywara wrote:
> GICv3 is the ARM generic interrupt controller designed to overcome
> some limits of the prevalent GICv2. Most notably it lifts the 8-CPU
> limit. Though with recent patches from Marc there is support for
> hosts to use a GICv3, the CPU limitation still
On Mon, Oct 06, 2014 at 02:19:32PM -0300, Marcelo Tosatti wrote:
> On Sat, Oct 04, 2014 at 10:23:32AM +0300, Gleb Natapov wrote:
> > On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote:
> > > On Mon, Jul 21, 2014 at 04:14:24PM +0300, Gleb Natapov wrote:
> > > > On Wed, Jul 09, 2014 at 0
64 matches
Mail list logo