Displaying 20 results from an estimated 24 matches for "virtio_balloon_stat_modern".
2015 Apr 14
2
[PATCH] virtio_balloon: drop virtio_balloon_stat_modern
...In other words, add explicit reserved fields to align field and
+ * structure boundaries at field size, avoiding compiler padding
+ * without the packed attribute.
+ */
struct virtio_balloon_stat {
- __u16 tag;
- __u64 val;
+ __virtio16 tag;
+ __virtio64 val;
} __attribute__((packed));
-struct virtio_balloon_stat_modern {
- __le16 tag;
- __u8 reserved[6];
- __le64 val;
-};
-
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 0583720..9db546e 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,10 +77,7 @@ s...
2015 Apr 14
2
[PATCH] virtio_balloon: drop virtio_balloon_stat_modern
...In other words, add explicit reserved fields to align field and
+ * structure boundaries at field size, avoiding compiler padding
+ * without the packed attribute.
+ */
struct virtio_balloon_stat {
- __u16 tag;
- __u64 val;
+ __virtio16 tag;
+ __virtio64 val;
} __attribute__((packed));
-struct virtio_balloon_stat_modern {
- __le16 tag;
- __u8 reserved[6];
- __le64 val;
-};
-
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 0583720..9db546e 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,10 +77,7 @@ s...
2015 Apr 14
0
[PATCH] virtio_balloon: drop virtio_balloon_stat_modern
On Tue, 14 Apr 2015 12:01:13 +0200
"Michael S. Tsirkin" <mst at redhat.com> wrote:
> Looks like we are better off sticking with the misaligned stat struct,
> to reduce the amount of virtio 1 specific code in balloon. So let's do
> it.
>
> Add a detailed comment to reduce the chance people copy this bad example.
>
> This also fixes a bug on BE
2015 Apr 14
0
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...this historically: we require all parts
(spec,qemu,linux) to be available, but don't create specific order
between them. In particular, I'd strongly prefer not waiting until 4.2,
that would interfere with putting virtio 1 out to use in the field.
Since both Rusty and Cornelia are against virtio_balloon_stat_modern,
I accept this as the majority decision. And switching
over to __virtio tags found a bug, so I'm convinced now.
--->
virtio_balloon: drop virtio_balloon_stat_modern
Looks like we are better off sticking with the misaligned stat struct,
to reduce the amount of virtio 1 specific code in bal...
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
On Tue, 14 Apr 2015 10:42:56 +0930
Rusty Russell <rusty at rustcorp.com.au> wrote:
> "Michael S. Tsirkin" <mst at redhat.com> writes:
> > On Wed, Apr 01, 2015 at 02:57:35PM +0200, Michael S. Tsirkin wrote:
> >> Virtio 1.0 doesn't include a modern balloon device. At some point we'll likely
> >> define an incompatible interface with a
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
On Tue, 14 Apr 2015 10:42:56 +0930
Rusty Russell <rusty at rustcorp.com.au> wrote:
> "Michael S. Tsirkin" <mst at redhat.com> writes:
> > On Wed, Apr 01, 2015 at 02:57:35PM +0200, Michael S. Tsirkin wrote:
> >> Virtio 1.0 doesn't include a modern balloon device. At some point we'll likely
> >> define an incompatible interface with a
2015 Mar 31
2
[PATCH v2 1/6] virtio_balloon: transitional interface
..._balloon_config {
#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
#define VIRTIO_BALLOON_S_NR 6
+/* Legacy stat structure. We keep it around to avoid breaking old userspace. */
struct virtio_balloon_stat {
__u16 tag;
__u64 val;
} __attribute__((packed));
+struct virtio_balloon_stat_modern {
+ __u8 reserved[6];
+ __virtio16 tag;
+ __virtio64 val;
+};
+
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6a356e3..574267f 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,7 +77...
2015 Mar 31
2
[PATCH v2 1/6] virtio_balloon: transitional interface
..._balloon_config {
#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
#define VIRTIO_BALLOON_S_NR 6
+/* Legacy stat structure. We keep it around to avoid breaking old userspace. */
struct virtio_balloon_stat {
__u16 tag;
__u64 val;
} __attribute__((packed));
+struct virtio_balloon_stat_modern {
+ __u8 reserved[6];
+ __virtio16 tag;
+ __virtio64 val;
+};
+
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6a356e3..574267f 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,7 +77...
2015 Mar 30
0
[PATCH 1/6] virtio_balloon: transitional interface
...diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 4b0488f..5d83902 100644
--- a/include/uapi/linux/virtio_balloon.h
+++ b/include/uapi/linux/virtio_balloon.h
@@ -56,4 +56,10 @@ struct virtio_balloon_stat {
__u64 val;
} __attribute__((packed));
+struct virtio_balloon_stat_modern {
+ __u8 reserved[6];
+ __u16 tag;
+ __u64 val;
+};
+
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6a356e3..68e937f 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,7 +77,7 @@ stru...
2015 Mar 30
0
[PATCH 1/6] virtio_balloon: transitional interface
...diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 4b0488f..5d83902 100644
--- a/include/uapi/linux/virtio_balloon.h
+++ b/include/uapi/linux/virtio_balloon.h
@@ -56,4 +56,10 @@ struct virtio_balloon_stat {
__u64 val;
} __attribute__((packed));
+struct virtio_balloon_stat_modern {
+ __u8 reserved[6];
+ __u16 tag;
+ __u64 val;
+};
+
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6a356e3..68e937f 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,7 +77,7 @@ stru...
2015 Mar 30
10
[PATCH 0/6] virtio_balloon: virtio 1 support
Virtio 1.0 doesn't include a modern balloon device.
At some point we'll likely define an incompatible interface with a different
ID. But for now, it's not a big change to support a transitional balloon
device: this has the advantage of supporting existing drivers, transparently.
The only issue is with the stats buffer, which has misaligned fields.
Seems easy to fix by prepending a 6
2015 Mar 30
10
[PATCH 0/6] virtio_balloon: virtio 1 support
Virtio 1.0 doesn't include a modern balloon device.
At some point we'll likely define an incompatible interface with a different
ID. But for now, it's not a big change to support a transitional balloon
device: this has the advantage of supporting existing drivers, transparently.
The only issue is with the stats buffer, which has misaligned fields.
Seems easy to fix by prepending a 6
2015 Apr 14
0
[PATCH v3 0/6] virtio_balloon: virtio 1 support
...In other words, add explicit reserved fields to align field and
+ * structure boundaries at field size, avoiding compiler padding
+ * without the packed attribute.
+ */
struct virtio_balloon_stat {
- __u16 tag;
- __u64 val;
+ __virtio16 tag;
+ __virtio64 val;
} __attribute__((packed));
-struct virtio_balloon_stat_modern {
- __le16 tag;
- __u8 reserved[6];
- __le64 val;
-};
-
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 0583720..9db546e 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,10 +77,7 @@ s...
2015 Apr 01
2
[PATCH v3 1/6] virtio_balloon: transitional interface
...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 */
@@ -56,4 +57,10 @@ struct virtio_balloon_stat {
__u64 val;
} __attribute__((packed));
+struct virtio_balloon_stat_modern {
+ __le16 tag;
+ __u8 reserved[6];
+ __le64 val;
+};
+
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6a356e3..0583720 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,7 +77,10 @@ s...
2015 Apr 01
2
[PATCH v3 1/6] virtio_balloon: transitional interface
...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 */
@@ -56,4 +57,10 @@ struct virtio_balloon_stat {
__u64 val;
} __attribute__((packed));
+struct virtio_balloon_stat_modern {
+ __le16 tag;
+ __u8 reserved[6];
+ __le64 val;
+};
+
#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 6a356e3..0583720 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -77,7 +77,10 @@ s...
2016 Mar 03
0
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...typedef enum virtio_req_status {
> + NOT_STARTED,
> + STARTED,
> + DONE,
> +} VIRTIO_REQ_STATUS;
> +
> +typedef struct MemLayout {
> + uint64_t low_mem;
> +} MemLayout;
> +
> typedef struct virtio_balloon_stat VirtIOBalloonStat;
>
> typedef struct virtio_balloon_stat_modern {
> @@ -33,16 +43,21 @@ typedef struct virtio_balloon_stat_modern {
>
> typedef struct VirtIOBalloon {
> VirtIODevice parent_obj;
> - VirtQueue *ivq, *dvq, *svq;
> + VirtQueue *ivq, *dvq, *svq, *fvq;
> uint32_t num_pages;
> uint32_t actual;
>...
2016 Mar 03
2
[RFC qemu 2/4] virtio-balloon: Add a new feature to balloon device
...OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON)
+typedef enum virtio_req_status {
+ NOT_STARTED,
+ STARTED,
+ DONE,
+} VIRTIO_REQ_STATUS;
+
+typedef struct MemLayout {
+ uint64_t low_mem;
+} MemLayout;
+
typedef struct virtio_balloon_stat VirtIOBalloonStat;
typedef struct virtio_balloon_stat_modern {
@@ -33,16 +43,21 @@ typedef struct virtio_balloon_stat_modern {
typedef struct VirtIOBalloon {
VirtIODevice parent_obj;
- VirtQueue *ivq, *dvq, *svq;
+ VirtQueue *ivq, *dvq, *svq, *fvq;
uint32_t num_pages;
uint32_t actual;
uint64_t stats[VIRTIO_BALLOON_S_NR];
Vir...
2015 Apr 01
0
[PATCH v2 1/6] virtio_balloon: transitional interface
...a356e3..574267f 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -77,7 +77,7 @@ struct virtio_balloon {
>
> /* Memory statistics */
> int need_stats_update;
> - struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR];
> + struct virtio_balloon_stat_modern stats[VIRTIO_BALLOON_S_NR];
>
> /* To register callback in oom notifier call chain */
> struct notifier_block nb;
> @@ -269,7 +269,11 @@ static void stats_handle_request(struct virtio_balloon *vb)
> vq = vb->stats_vq;
> if (!virtqueue_get_buf(vq, &len))
> re...
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
On Tue, 14 Apr 2015 11:21:11 +0200
"Michael S. Tsirkin" <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
2015 Apr 14
2
[PATCH v3 0/6] virtio_balloon: virtio 1 support
On Tue, 14 Apr 2015 11:21:11 +0200
"Michael S. Tsirkin" <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