We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca72cc3 commit 168c358Copy full SHA for 168c358
drivers/virtio/virtio_balloon.c
@@ -578,10 +578,14 @@ static int init_vqs(struct virtio_balloon *vb)
578
static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
579
{
580
if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
581
- &vb->config_read_bitmap))
+ &vb->config_read_bitmap)) {
582
virtio_cread(vb->vdev, struct virtio_balloon_config,
583
free_page_hint_cmd_id,
584
&vb->cmd_id_received_cache);
585
+ /* Legacy balloon config space is LE, unlike all other devices. */
586
+ if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
587
+ vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache);
588
+ }
589
590
return vb->cmd_id_received_cache;
591
}
0 commit comments