Displaying 17 results from an estimated 17 matches for "free_page_hint_cmd_id".
2020 Apr 15
2
[PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
From: Alexander Duyck <alexander.h.duyck at linux.intel.com>
It can be confusing to have multiple features within the same driver that
are using the same verbage. As such this patch is creating a union of
free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
the userspace code a bit in terms of readability while maintaining the
functionality of legacy code.
Signed-off-by: Alexander Duyck <alexander.h.duyck at linux.intel.com>
---
drivers/virtio/virtio_balloon.c | 2 +-
include/uapi/linux/virtio_balloon.h | 11 ++...
2020 Apr 15
2
[PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
From: Alexander Duyck <alexander.h.duyck at linux.intel.com>
It can be confusing to have multiple features within the same driver that
are using the same verbage. As such this patch is creating a union of
free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
the userspace code a bit in terms of readability while maintaining the
functionality of legacy code.
Signed-off-by: Alexander Duyck <alexander.h.duyck at linux.intel.com>
---
drivers/virtio/virtio_balloon.c | 2 +-
include/uapi/linux/virtio_balloon.h | 11 ++...
2020 Apr 15
1
[PATCH v2] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
From: Alexander Duyck <alexander.h.duyck at linux.intel.com>
It can be confusing to have multiple features within the same driver that
are using the same verbage. As such this patch is creating a union of
free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
the userspace code a bit in terms of readability while maintaining the
functionality of legacy code.
Signed-off-by: Alexander Duyck <alexander.h.duyck at linux.intel.com>
---
drivers/virtio/virtio_balloon.c | 2 +-
include/uapi/linux/virtio_balloon.h | 13 ++...
2020 Jul 27
3
[PATCH] virtio_balloon: fix up endian-ness for free cmd id
...oon *vb)
static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
{
if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
- &vb->config_read_bitmap))
+ &vb->config_read_bitmap)) {
virtio_cread(vb->vdev, struct virtio_balloon_config,
free_page_hint_cmd_id,
&vb->cmd_id_received_cache);
+ /* Legacy balloon config space is LE, unlike all other devices. */
+ if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
+ vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache);
+ }
return vb->cmd_id...
2020 Apr 15
0
[PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
....20 19:44, Alexander Duyck wrote:
> From: Alexander Duyck <alexander.h.duyck at linux.intel.com>
>
> It can be confusing to have multiple features within the same driver that
> are using the same verbage. As such this patch is creating a union of
> free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
> the userspace code a bit in terms of readability while maintaining the
> functionality of legacy code.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck at linux.intel.com>
> ---
> drivers/virtio/virtio_balloon.c | 2 +-
> include/ua...
2020 Aug 03
0
[PATCH v2 05/24] virtio_balloon: correct tags for config space fields
...;
+ __le32 num_pages;
/* Number of pages we've actually got in balloon. */
- __u32 actual;
+ __le32 actual;
/*
* Free page hint command id, readonly by guest.
* Was previously named free_page_report_cmd_id so we
* need to carry that name for legacy support.
*/
union {
- __u32 free_page_hint_cmd_id;
- __u32 free_page_report_cmd_id; /* deprecated */
+ __le32 free_page_hint_cmd_id;
+ __le32 free_page_report_cmd_id; /* deprecated */
};
/* Stores PAGE_POISON if page poisoning is in use */
- __u32 poison_val;
+ __le32 poison_val;
};
#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of mem...
2020 Aug 05
0
[PATCH v3 05/38] virtio_balloon: correct tags for config space fields
...;
+ __le32 num_pages;
/* Number of pages we've actually got in balloon. */
- __u32 actual;
+ __le32 actual;
/*
* Free page hint command id, readonly by guest.
* Was previously named free_page_report_cmd_id so we
* need to carry that name for legacy support.
*/
union {
- __u32 free_page_hint_cmd_id;
- __u32 free_page_report_cmd_id; /* deprecated */
+ __le32 free_page_hint_cmd_id;
+ __le32 free_page_report_cmd_id; /* deprecated */
};
/* Stores PAGE_POISON if page poisoning is in use */
- __u32 poison_val;
+ __le32 poison_val;
};
#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of mem...
2020 Aug 05
0
[PATCH v3 29/38] virtio_balloon: use LE config space accesses
..._func(struct work_struct *work)
@@ -579,12 +573,10 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
{
if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
&vb->config_read_bitmap)) {
- virtio_cread(vb->vdev, struct virtio_balloon_config,
- free_page_hint_cmd_id,
- &vb->cmd_id_received_cache);
/* Legacy balloon config space is LE, unlike all other devices. */
- if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
- vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache);
+ virtio_cread_le(vb->vd...
2020 Jul 14
2
[PATCH] virtio_balloon: clear modern features under legacy
...tio_balloon *vb)
> > {
> > if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
> > &vb->config_read_bitmap))
> > virtio_cread(vb->vdev, struct virtio_balloon_config,
> > free_page_hint_cmd_id,
> > &vb->cmd_id_received_cache);
> >
> > return vb->cmd_id_received_cache;
> > }
> >
> >
> > So guest assumes native, host assumes LE.
>
> This wasn't even the one I was talking about, but now that...
2020 Jul 14
2
[PATCH] virtio_balloon: clear modern features under legacy
...tio_balloon *vb)
> > {
> > if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
> > &vb->config_read_bitmap))
> > virtio_cread(vb->vdev, struct virtio_balloon_config,
> > free_page_hint_cmd_id,
> > &vb->cmd_id_received_cache);
> >
> > return vb->cmd_id_received_cache;
> > }
> >
> >
> > So guest assumes native, host assumes LE.
>
> This wasn't even the one I was talking about, but now that...
2020 Jul 12
2
[PATCH] virtio_balloon: clear modern features under legacy
...atic u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
{
if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
&vb->config_read_bitmap))
virtio_cread(vb->vdev, struct virtio_balloon_config,
free_page_hint_cmd_id,
&vb->cmd_id_received_cache);
return vb->cmd_id_received_cache;
}
So guest assumes native, host assumes LE.
> > ---
> > drivers/virtio/virtio_balloon.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > dif...
2020 Jul 12
2
[PATCH] virtio_balloon: clear modern features under legacy
...atic u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
{
if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
&vb->config_read_bitmap))
virtio_cread(vb->vdev, struct virtio_balloon_config,
free_page_hint_cmd_id,
&vb->cmd_id_received_cache);
return vb->cmd_id_received_cache;
}
So guest assumes native, host assumes LE.
> > ---
> > drivers/virtio/virtio_balloon.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > dif...
2020 Jul 14
0
[PATCH] virtio_balloon: clear modern features under legacy
...; > {
> > > if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
> > > &vb->config_read_bitmap))
> > > virtio_cread(vb->vdev, struct virtio_balloon_config,
> > > free_page_hint_cmd_id,
> > > &vb->cmd_id_received_cache);
> > >
> > > return vb->cmd_id_received_cache;
> > > }
> > >
> > >
> > > So guest assumes native, host assumes LE.
> >
> > This wasn't eve...
2020 Jul 13
0
[PATCH] virtio_balloon: clear modern features under legacy
...md_id_received(struct virtio_balloon *vb)
> {
> if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
> &vb->config_read_bitmap))
> virtio_cread(vb->vdev, struct virtio_balloon_config,
> free_page_hint_cmd_id,
> &vb->cmd_id_received_cache);
>
> return vb->cmd_id_received_cache;
> }
>
>
> So guest assumes native, host assumes LE.
This wasn't even the one I was talking about, but now that you point
it out this is definately bug. The...
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.
2020 Aug 03
51
[PATCH v2 00/24] virtio: config space endian-ness cleanup
Config space endian-ness is currently a mess: fields are
not tagged with the correct endian-ness so it's easy
to make mistakes like instanciating config space in
native endian-ness.
The following patches adding sparse tagging are currently in my tree.
Lightly tested.
As a follow-up, I plan to add new APIs that handle modern config space
in a more efficient way (bypassing the version check).