search for: virtio_balloon_config

Displaying 20 results from an estimated 261 matches for "virtio_balloon_config".

2020 Aug 05
0
[PATCH v3 29/38] virtio_balloon: use LE config space accesses
...b/drivers/virtio/virtio_balloon.c index 8bc1704ffdf3..31cc97f2f515 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -398,12 +398,9 @@ static inline s64 towards_target(struct virtio_balloon *vb) s64 target; u32 num_pages; - virtio_cread(vb->vdev, struct virtio_balloon_config, num_pages, - &num_pages); - /* Legacy balloon config space is LE, unlike all other devices. */ - if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1)) - num_pages = le32_to_cpu((__force __le32)num_pages); + virtio_cread_le(vb->vdev, struct virtio_balloon_config, num_pages, +...
2015 Mar 31
2
[PATCH v2 1/6] virtio_balloon: transitional interface
...+++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index 4b0488f..71ef93b 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -38,9 +38,9 @@ struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ - __le32 num_pages; + __u32 num_pages; /* Number of pages we've actually got in balloon. */ - __le32 actual; + __u32 actual; }; #define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */ @@ -51,9 +51,16 @@ struct virtio_b...
2015 Mar 31
2
[PATCH v2 1/6] virtio_balloon: transitional interface
...+++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index 4b0488f..71ef93b 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -38,9 +38,9 @@ struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ - __le32 num_pages; + __u32 num_pages; /* Number of pages we've actually got in balloon. */ - __le32 actual; + __u32 actual; }; #define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */ @@ -51,9 +51,16 @@ struct virtio_b...
2020 Jul 12
2
[PATCH] virtio_balloon: clear modern features under legacy
...by: Michael S. Tsirkin <mst at redhat.com> > > So I am not sure about the patch description. In the case of page > poison and free page reporting I don't think we are defining anything > that doesn't already have a definition of how to use in legacy. > Specifically the virtio_balloon_config is already defined as having > all fields as little endian in legacy mode, and there is a definition > for all of the fields in a virtqueue and how they behave in legacy > mode. > > As far as I can see the only item that may be an issue is the command > ID being supplied via the...
2020 Jul 12
2
[PATCH] virtio_balloon: clear modern features under legacy
...by: Michael S. Tsirkin <mst at redhat.com> > > So I am not sure about the patch description. In the case of page > poison and free page reporting I don't think we are defining anything > that doesn't already have a definition of how to use in legacy. > Specifically the virtio_balloon_config is already defined as having > all fields as little endian in legacy mode, and there is a definition > for all of the fields in a virtqueue and how they behave in legacy > mode. > > As far as I can see the only item that may be an issue is the command > ID being supplied via the...
2015 Apr 15
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...>> > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h >> > index f81b220..164e0c2 100644 >> > --- a/include/uapi/linux/virtio_balloon.h >> > +++ b/include/uapi/linux/virtio_balloon.h >> > @@ -52,15 +52,31 @@ struct virtio_balloon_config { >> > #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ >> > #define VIRTIO_BALLOON_S_NR 6 >> > >> > +/* >> > + * Memory statistics structure. >> > + * Driver fills an array of these structures and passes to device. &g...
2015 Apr 15
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...>> > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h >> > index f81b220..164e0c2 100644 >> > --- a/include/uapi/linux/virtio_balloon.h >> > +++ b/include/uapi/linux/virtio_balloon.h >> > @@ -52,15 +52,31 @@ struct virtio_balloon_config { >> > #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ >> > #define VIRTIO_BALLOON_S_NR 6 >> > >> > +/* >> > + * Memory statistics structure. >> > + * Driver fills an array of these structures and passes to device. &g...
2017 Oct 13
2
[PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()
On Tue, Oct 10, 2017 at 07:47:37PM +0900, Tetsuo Handa wrote: > In leak_balloon(), mutex_lock(&vb->balloon_lock) is called in order to > serialize against fill_balloon(). But in fill_balloon(), > alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is > called with vb->balloon_lock mutex held. Since GFP_HIGHUSER[_MOVABLE] > implies __GFP_DIRECT_RECLAIM |
2017 Oct 13
2
[PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()
On Tue, Oct 10, 2017 at 07:47:37PM +0900, Tetsuo Handa wrote: > In leak_balloon(), mutex_lock(&vb->balloon_lock) is called in order to > serialize against fill_balloon(). But in fill_balloon(), > alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is > called with vb->balloon_lock mutex held. Since GFP_HIGHUSER[_MOVABLE] > implies __GFP_DIRECT_RECLAIM |
2015 Jan 15
2
[PATCH] virtio_balloon: coding style fixes
...include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index be40f70..4b0488f 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -36,8 +36,7 @@ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 -struct virtio_balloon_config -{ +struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ __le32 num_pages; /* Number of pages we've actually got in balloon. */ diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 3176ea4..0413157 100644 --- a/drivers/virtio/vi...
2015 Jan 15
2
[PATCH] virtio_balloon: coding style fixes
...include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index be40f70..4b0488f 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h @@ -36,8 +36,7 @@ /* Size of a PFN in the balloon interface. */ #define VIRTIO_BALLOON_PFN_SHIFT 12 -struct virtio_balloon_config -{ +struct virtio_balloon_config { /* Number of pages host wants Guest to give up. */ __le32 num_pages; /* Number of pages we've actually got in balloon. */ diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 3176ea4..0413157 100644 --- a/drivers/virtio/vi...
2017 Oct 13
0
[PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()
...the balloon" ? According to https://lists.linuxfoundation.org/pipermail/virtualization/2014-October/027807.html , it seems to me that the expected behavior after deflating while inflating was not defined when VIRTIO_BALLOON_F_DEFLATE_ON_OOM was proposed. When the host increased "struct virtio_balloon_config"->num_pages and kicked the guest, the guest's update_balloon_size_func() starts calling fill_balloon() until "struct virtio_balloon"->num_pages reaches "struct virtio_balloon_config"->num_pages, doesn't it? struct virtio_balloon_config { /* Number of...
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...sirkin" <mst at redhat.com> wrote: > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index f81b220..164e0c2 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -52,15 +52,31 @@ struct virtio_balloon_config { > #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ > #define VIRTIO_BALLOON_S_NR 6 > > +/* > + * Memory statistics structure. > + * Driver fills an array of these structures and passes to device. > + * > + * NOTE: fields are laid out in a way tha...
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...sirkin" <mst at redhat.com> wrote: > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index f81b220..164e0c2 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -52,15 +52,31 @@ struct virtio_balloon_config { > #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ > #define VIRTIO_BALLOON_S_NR 6 > > +/* > + * Memory statistics structure. > + * Driver fills an array of these structures and passes to device. > + * > + * NOTE: fields are laid out in a way tha...
2020 Jul 13
0
[PATCH] virtio_balloon: clear modern features under legacy
...lt;mst at redhat.com> > > > > So I am not sure about the patch description. In the case of page > > poison and free page reporting I don't think we are defining anything > > that doesn't already have a definition of how to use in legacy. > > Specifically the virtio_balloon_config is already defined as having > > all fields as little endian in legacy mode, and there is a definition > > for all of the fields in a virtqueue and how they behave in legacy > > mode. > > > > As far as I can see the only item that may be an issue is the command > &g...
2015 Apr 01
0
[PATCH v2 1/6] virtio_balloon: transitional interface
...irtqueue_kick(vq); > } > @@ -283,21 +287,30 @@ static void virtballoon_changed(struct virtio_device *vdev) > > static inline s64 towards_target(struct virtio_balloon *vb) > { > - __le32 v; > s64 target; > + u32 num_pages; > > - virtio_cread(vb->vdev, struct virtio_balloon_config, num_pages, &v); > + virtio_cread(vb->vdev, struct virtio_balloon_config, > + num_pages, &num_pages); > > - target = le32_to_cpu(v); > + /* Legacy balloon config space is LE, unlike all other devices. */ > + if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_...
2020 Jul 10
4
[PATCH] virtio_balloon: clear modern features under legacy
Page reporting features were never supported by legacy hypervisors. Supporting them poses a problem: should we use native endian-ness (like current code assumes)? Or little endian-ness like the virtio spec says? Rather than try to figure out, and since results of incorrect endian-ness are dire, let's just block this configuration. Cc: stable at vger.kernel.org Signed-off-by: Michael S.
2020 Jul 10
4
[PATCH] virtio_balloon: clear modern features under legacy
Page reporting features were never supported by legacy hypervisors. Supporting them poses a problem: should we use native endian-ness (like current code assumes)? Or little endian-ness like the virtio spec says? Rather than try to figure out, and since results of incorrect endian-ness are dire, let's just block this configuration. Cc: stable at vger.kernel.org Signed-off-by: Michael S.
2017 Oct 15
2
[PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()
....html , > it seems to me that the expected behavior after deflating while inflating > was not defined when VIRTIO_BALLOON_F_DEFLATE_ON_OOM was proposed. I think the assumption is that it fill back up eventually when guest does have some free memory. > When the host increased "struct virtio_balloon_config"->num_pages and > kicked the guest, the guest's update_balloon_size_func() starts calling > fill_balloon() until "struct virtio_balloon"->num_pages reaches > "struct virtio_balloon_config"->num_pages, doesn't it? > > struct virtio_balloon_...
2017 Oct 15
2
[PATCH] virtio: avoid possible OOM lockup at virtballoon_oom_notify()
....html , > it seems to me that the expected behavior after deflating while inflating > was not defined when VIRTIO_BALLOON_F_DEFLATE_ON_OOM was proposed. I think the assumption is that it fill back up eventually when guest does have some free memory. > When the host increased "struct virtio_balloon_config"->num_pages and > kicked the guest, the guest's update_balloon_size_func() starts calling > fill_balloon() until "struct virtio_balloon"->num_pages reaches > "struct virtio_balloon_config"->num_pages, doesn't it? > > struct virtio_balloon_...