search for: virtioballoon

Displaying 20 results from an estimated 38 matches for "virtioballoon".

Did you mean: virtio_balloon
2016 Mar 03
0
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...free_pages_bitmap, free_pages_count); > + } > diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index e9c30e9..a5b9d08 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -76,6 +76,12 @@ static bool balloon_stats_supported(const VirtIOBalloon *s) > return virtio_vdev_has_feature(vdev, VIRTIO_BALLOON_F_STATS_VQ); > } > > +static bool balloon_free_pages_supported(const VirtIOBalloon *s) > +{ > + VirtIODevice *vdev = VIRTIO_DEVICE(s); > + return virtio_vdev_has_feature(vdev, VIRTIO_BALLOON_F_GET_FREE_PAGE...
2016 Mar 03
2
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...free_pages_bitmap, free_pages_count); + } diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index e9c30e9..a5b9d08 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -76,6 +76,12 @@ static bool balloon_stats_supported(const VirtIOBalloon *s) return virtio_vdev_has_feature(vdev, VIRTIO_BALLOON_F_STATS_VQ); } +static bool balloon_free_pages_supported(const VirtIOBalloon *s) +{ + VirtIODevice *vdev = VIRTIO_DEVICE(s); + return virtio_vdev_has_feature(vdev, VIRTIO_BALLOON_F_GET_FREE_PAGES); +} + static bool balloon_stats...
2008 Jan 08
1
[PATCH] QEMU KVM balloon support
...lloon_init(PCIBus *bus); + #endif Index: kvm-userspace/qemu/hw/virtio-balloon.c =================================================================== --- /dev/null +++ kvm-userspace/qemu/hw/virtio-balloon.c @@ -0,0 +1,103 @@ +#include "virtio.h" +#include "pc.h" + +typedef struct VirtIOBalloon +{ + VirtIODevice vdev; +} VirtIOBalloon; + +struct virtio_balloon_hdr +{ + uint8_t cmd; + uint8_t status; +}; + +struct virtio_balloon_config +{ + uint32_t target_nrpages; +}; + +VirtIOBalloon *virtio_balloon; + +extern int64_t ram_size; +int64_t target_ramsize; + +#define VIRTIO_ID_BALLOON 3...
2008 Jan 08
1
[PATCH] QEMU KVM balloon support
...lloon_init(PCIBus *bus); + #endif Index: kvm-userspace/qemu/hw/virtio-balloon.c =================================================================== --- /dev/null +++ kvm-userspace/qemu/hw/virtio-balloon.c @@ -0,0 +1,103 @@ +#include "virtio.h" +#include "pc.h" + +typedef struct VirtIOBalloon +{ + VirtIODevice vdev; +} VirtIOBalloon; + +struct virtio_balloon_hdr +{ + uint8_t cmd; + uint8_t status; +}; + +struct virtio_balloon_config +{ + uint32_t target_nrpages; +}; + +VirtIOBalloon *virtio_balloon; + +extern int64_t ram_size; +int64_t target_ramsize; + +#define VIRTIO_ID_BALLOON 3...
2020 May 13
0
[RFC v3 for QEMU] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT
...#include "hw/virtio/virtio-access.h" > > #define BALLOON_PAGE_SIZE (1 << VIRTIO_BALLOON_PFN_SHIFT) > +#define CONT_PAGES_ORDER 9 > > typedef struct PartiallyBalloonedPage { > ram_addr_t base_gpa; > @@ -72,6 +73,8 @@ static void balloon_inflate_page(VirtIOBalloon *balloon, > RAMBlock *rb; > size_t rb_page_size; > int subpages; > + size_t inflate_size = BALLOON_PAGE_SIZE << balloon->current_pages_order; > + int pages_num; reverse christmas tree please. squash same types into a single line if possible. > &gt...
2020 Jul 16
0
[RFC for qemu v4 2/2] virtio_balloon: Add dcvq to deflate continuous pages
...2 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index d36a5c8..165adf7 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -138,7 +138,8 @@ static void balloon_inflate_page(VirtIOBalloon *balloon, > } > > static void balloon_deflate_page(VirtIOBalloon *balloon, > - MemoryRegion *mr, hwaddr mr_offset) > + MemoryRegion *mr, hwaddr mr_offset, > + size_t size) > { &...
2016 Mar 03
16
[RFC qemu 0/4] A PV solution for live migration optimization
The current QEMU live migration implementation mark the all the guest's RAM pages as dirtied in the ram bulk stage, all these pages will be processed and that takes quit a lot of CPU cycles. >From guest's point of view, it doesn't care about the content in free pages. We can make use of this fact and skip processing the free pages in the ram bulk stage, it can save a lot CPU cycles
2016 Mar 03
16
[RFC qemu 0/4] A PV solution for live migration optimization
The current QEMU live migration implementation mark the all the guest's RAM pages as dirtied in the ram bulk stage, all these pages will be processed and that takes quit a lot of CPU cycles. >From guest's point of view, it doesn't care about the content in free pages. We can make use of this fact and skip processing the free pages in the ram bulk stage, it can save a lot CPU cycles
2015 Apr 12
2
[PATCH 1/2] virtio_balloon: header update for virtio 1
...virtio/virtio-balloon.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index f863bfe..79eca67 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -56,6 +56,12 @@ typedef struct VirtIOBalloonStat { uint64_t val; } QEMU_PACKED VirtIOBalloonStat; +typedef struct virtio_balloon_stat_modern { + uint16_t tag; + uint8_t reserved[6]; + uint64_t val; +} VirtIOBalloonStatModern; + typedef struct VirtIOBalloon { VirtIODevice parent_obj; VirtQueue *ivq, *dvq, *...
2015 Apr 12
2
[PATCH 1/2] virtio_balloon: header update for virtio 1
...virtio/virtio-balloon.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index f863bfe..79eca67 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -56,6 +56,12 @@ typedef struct VirtIOBalloonStat { uint64_t val; } QEMU_PACKED VirtIOBalloonStat; +typedef struct virtio_balloon_stat_modern { + uint16_t tag; + uint8_t reserved[6]; + uint64_t val; +} VirtIOBalloonStatModern; + typedef struct VirtIOBalloon { VirtIODevice parent_obj; VirtQueue *ivq, *dvq, *...
2020 Mar 12
0
[RFC for QEMU] virtio-balloon: Add option thp-order to set VIRTIO_BALLOON_F_THP_ORDER
...tio_notify_config(vdev); > } > trace_virtio_balloon_to_target(target, dev->num_pages); > @@ -916,6 +933,8 @@ static Property virtio_balloon_properties[] = { > VIRTIO_BALLOON_F_DEFLATE_ON_OOM, false), > DEFINE_PROP_BIT("free-page-hint", VirtIOBalloon, host_features, > VIRTIO_BALLOON_F_FREE_PAGE_HINT, false), > + DEFINE_PROP_BIT("thp-order", VirtIOBalloon, host_features, > + VIRTIO_BALLOON_F_THP_ORDER, false), > /* QEMU 4.0 accidentally changed the config size even when free-p...
2014 Dec 11
0
[PATCH RFC v6 04/20] virtio: add feature checking helpers
...{ vring_avail_event(&vring->vr) = vring->last_avail_idx; } diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 7bfbb75..21e449a 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -69,7 +69,7 @@ static inline void reset_stats(VirtIOBalloon *dev) static bool balloon_stats_supported(const VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - return vdev->guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ); + return virtio_has_feature(vdev, VIRTIO_BALLOON_F_STATS_VQ); } static bool balloon_stats_enable...
2014 Dec 11
0
[PATCH RFC v6 04/20] virtio: add feature checking helpers
...{ vring_avail_event(&vring->vr) = vring->last_avail_idx; } diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 7bfbb75..21e449a 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -69,7 +69,7 @@ static inline void reset_stats(VirtIOBalloon *dev) static bool balloon_stats_supported(const VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - return vdev->guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ); + return virtio_has_feature(vdev, VIRTIO_BALLOON_F_STATS_VQ); } static bool balloon_stats_enable...
2015 Apr 13
3
[PATCH 2/2] virtio-balloon: virtio 1 support
...diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index d2d7c3e..568a008 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -239,7 +239,8 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) > { > VirtIOBalloon *s = VIRTIO_BALLOON(vdev); > VirtQueueElement *elem = &s->stats_vq_elem; > - VirtIOBalloonStat stat; > + VirtIOBalloonStat legacy_stat; > + VirtIOBalloonStatModern modern_stat; > size_t offset = 0; > qemu_timeval tv; > > @@ -253,14 +254,28 @@...
2015 Apr 13
3
[PATCH 2/2] virtio-balloon: virtio 1 support
...diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index d2d7c3e..568a008 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -239,7 +239,8 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) > { > VirtIOBalloon *s = VIRTIO_BALLOON(vdev); > VirtQueueElement *elem = &s->stats_vq_elem; > - VirtIOBalloonStat stat; > + VirtIOBalloonStat legacy_stat; > + VirtIOBalloonStatModern modern_stat; > size_t offset = 0; > qemu_timeval tv; > > @@ -253,14 +254,28 @@...
2015 Apr 12
0
[PATCH 2/2] virtio-balloon: virtio 1 support
...insertions(+), 8 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index d2d7c3e..568a008 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -239,7 +239,8 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) { VirtIOBalloon *s = VIRTIO_BALLOON(vdev); VirtQueueElement *elem = &s->stats_vq_elem; - VirtIOBalloonStat stat; + VirtIOBalloonStat legacy_stat; + VirtIOBalloonStatModern modern_stat; size_t offset = 0; qemu_timeval tv; @@ -253,14 +254,28 @@ static void virtio_balloon_receive_stat...
2016 Mar 03
0
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...| 10 ++- > 5 files changed, 134 insertions(+), 5 deletions(-) > +static int virtio_balloon_free_pages(void *opaque, > + unsigned long *free_pages_bitmap, > + unsigned long *free_pages_count) > +{ > + VirtIOBalloon *s = opaque; > + VirtIODevice *vdev = VIRTIO_DEVICE(s); > + VirtQueueElement *elem = s->free_pages_vq_elem; > + int len; > + > + if (!balloon_free_pages_supported(s)) { > + return -1; > + } > + > + if (s->req_status == NOT_STARTED) { > +...
2015 Apr 13
0
[PATCH 2/2] virtio-balloon: virtio 1 support
...-balloon.c b/hw/virtio/virtio-balloon.c > > index d2d7c3e..568a008 100644 > > --- a/hw/virtio/virtio-balloon.c > > +++ b/hw/virtio/virtio-balloon.c > > @@ -239,7 +239,8 @@ static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq) > > { > > VirtIOBalloon *s = VIRTIO_BALLOON(vdev); > > VirtQueueElement *elem = &s->stats_vq_elem; > > - VirtIOBalloonStat stat; > > + VirtIOBalloonStat legacy_stat; > > + VirtIOBalloonStatModern modern_stat; > > size_t offset = 0; > > qemu_timeval tv; &gt...
2014 Oct 07
1
[PATCH RFC 03/11] virtio: support more feature bits
...vring_avail_event(&vring->vr) = vring->vr.avail->idx; } diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index b5cf7ca..5af17e2 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -69,7 +69,7 @@ static inline void reset_stats(VirtIOBalloon *dev) static bool balloon_stats_supported(const VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - return vdev->guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ); + return vdev->guest_features[0] & (1 << VIRTIO_BALLOON_F_STATS_VQ); } static bool...
2014 Oct 07
1
[PATCH RFC 03/11] virtio: support more feature bits
...vring_avail_event(&vring->vr) = vring->vr.avail->idx; } diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index b5cf7ca..5af17e2 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -69,7 +69,7 @@ static inline void reset_stats(VirtIOBalloon *dev) static bool balloon_stats_supported(const VirtIOBalloon *s) { VirtIODevice *vdev = VIRTIO_DEVICE(s); - return vdev->guest_features & (1 << VIRTIO_BALLOON_F_STATS_VQ); + return vdev->guest_features[0] & (1 << VIRTIO_BALLOON_F_STATS_VQ); } static bool...