From: Wei Wang <wei.w.wang@intel.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
linux-mm@kvack.org, mst@redhat.com, mhocko@kernel.org,
akpm@linux-foundation.org, dgilbert@redhat.com
Cc: torvalds@linux-foundation.org, pbonzini@redhat.com,
liliang.opensource@gmail.com, yang.zhang.wz@gmail.com,
quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com,
peterx@redhat.com, quintela@redhat.com,
Halil Pasic <pasic@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>
Subject: [virtio-dev] Re: [PATCH v37 0/3] Virtio-balloon: support free page reporting
Date: Fri, 28 Dec 2018 14:41:41 +0800 [thread overview]
Message-ID: <5C25C5A5.4080706@intel.com> (raw)
In-Reply-To: <e79b5c3d-aa89-6b99-00b1-c92c85fe214c@de.ibm.com>
On 12/27/2018 08:17 PM, Christian Borntraeger wrote:
>
> On 27.12.2018 12:59, Christian Borntraeger wrote:
>> On 27.12.2018 12:31, Christian Borntraeger wrote:
>>> This patch triggers random crashes in the guest kernel on s390 early during boot.
>>> No migration and no setting of the balloon is involved.
>>>
>> Adding Conny and Halil,
>>
>> As the QEMU provides no PAGE_HINT feature yet, this quick hack makes the
>> guest boot fine again:
>>
>>
>> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
>> index 728ecd1eea305..aa2e1864c5736 100644
>> --- a/drivers/virtio/virtio_balloon.c
>> +++ b/drivers/virtio/virtio_balloon.c
>> @@ -492,7 +492,7 @@ static int init_vqs(struct virtio_balloon *vb)
>> callbacks[VIRTIO_BALLOON_VQ_FREE_PAGE] = NULL;
>> }
>>
>> - err = vb->vdev->config->find_vqs(vb->vdev, VIRTIO_BALLOON_VQ_MAX,
>> + err = vb->vdev->config->find_vqs(vb->vdev, 3, //VIRTIO_BALLOON_VQ_MAX,
>> vqs, callbacks, names, NULL, NULL);
>> if (err)
>> return err;
>>
>>
>> To me it looks like that virtio_ccw_find_vqs will abort if any of the virtqueues
>> that it is been asked for does not exist (including the earlier ones).
>>
> This "hack" makes the random crashes go away, but the balloon interface itself
> does not work. (setting the value to anything will hang the guest).
> As patch 1 also modifies the main path, there seem to be additional issues, maybe
> endianess
>
> Looking at things like
>
> + vb->cmd_id_received = VIRTIO_BALLOON_CMD_ID_STOP;
> + vb->cmd_id_active = cpu_to_virtio32(vb->vdev,
> + VIRTIO_BALLOON_CMD_ID_STOP);
> + vb->cmd_id_stop = cpu_to_virtio32(vb->vdev,
> + VIRTIO_BALLOON_CMD_ID_STOP);
>
>
> Why is cmd_id_received not using cpu_to_virtio32?
>
That conversion is only needed when we need to send the value to the device.
cmd_id_received doesn't need to be sent to the device.
Best,
Wei
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
WARNING: multiple messages have this Message-ID (diff)
From: Wei Wang <wei.w.wang@intel.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
linux-mm@kvack.org, mst@redhat.com, mhocko@kernel.org,
akpm@linux-foundation.org, dgilbert@redhat.com
Cc: torvalds@linux-foundation.org, pbonzini@redhat.com,
liliang.opensource@gmail.com, yang.zhang.wz@gmail.com,
quan.xu0@gmail.com, nilal@redhat.com, riel@redhat.com,
peterx@redhat.com, quintela@redhat.com,
Halil Pasic <pasic@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>
Subject: Re: [PATCH v37 0/3] Virtio-balloon: support free page reporting
Date: Fri, 28 Dec 2018 14:41:41 +0800 [thread overview]
Message-ID: <5C25C5A5.4080706@intel.com> (raw)
In-Reply-To: <e79b5c3d-aa89-6b99-00b1-c92c85fe214c@de.ibm.com>
On 12/27/2018 08:17 PM, Christian Borntraeger wrote:
>
> On 27.12.2018 12:59, Christian Borntraeger wrote:
>> On 27.12.2018 12:31, Christian Borntraeger wrote:
>>> This patch triggers random crashes in the guest kernel on s390 early during boot.
>>> No migration and no setting of the balloon is involved.
>>>
>> Adding Conny and Halil,
>>
>> As the QEMU provides no PAGE_HINT feature yet, this quick hack makes the
>> guest boot fine again:
>>
>>
>> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
>> index 728ecd1eea305..aa2e1864c5736 100644
>> --- a/drivers/virtio/virtio_balloon.c
>> +++ b/drivers/virtio/virtio_balloon.c
>> @@ -492,7 +492,7 @@ static int init_vqs(struct virtio_balloon *vb)
>> callbacks[VIRTIO_BALLOON_VQ_FREE_PAGE] = NULL;
>> }
>>
>> - err = vb->vdev->config->find_vqs(vb->vdev, VIRTIO_BALLOON_VQ_MAX,
>> + err = vb->vdev->config->find_vqs(vb->vdev, 3, //VIRTIO_BALLOON_VQ_MAX,
>> vqs, callbacks, names, NULL, NULL);
>> if (err)
>> return err;
>>
>>
>> To me it looks like that virtio_ccw_find_vqs will abort if any of the virtqueues
>> that it is been asked for does not exist (including the earlier ones).
>>
> This "hack" makes the random crashes go away, but the balloon interface itself
> does not work. (setting the value to anything will hang the guest).
> As patch 1 also modifies the main path, there seem to be additional issues, maybe
> endianess
>
> Looking at things like
>
> + vb->cmd_id_received = VIRTIO_BALLOON_CMD_ID_STOP;
> + vb->cmd_id_active = cpu_to_virtio32(vb->vdev,
> + VIRTIO_BALLOON_CMD_ID_STOP);
> + vb->cmd_id_stop = cpu_to_virtio32(vb->vdev,
> + VIRTIO_BALLOON_CMD_ID_STOP);
>
>
> Why is cmd_id_received not using cpu_to_virtio32?
>
That conversion is only needed when we need to send the value to the device.
cmd_id_received doesn't need to be sent to the device.
Best,
Wei
next prev parent reply other threads:[~2018-12-28 6:36 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-27 1:32 [virtio-dev] [PATCH v37 0/3] Virtio-balloon: support free page reporting Wei Wang
2018-08-27 1:32 ` Wei Wang
2018-08-27 1:32 ` [PATCH v37 1/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT Wei Wang
2018-08-27 1:32 ` [virtio-dev] " Wei Wang
2018-08-27 1:32 ` Wei Wang
2018-12-27 12:03 ` Christian Borntraeger
2018-12-27 12:03 ` [virtio-dev] " Christian Borntraeger
2018-12-27 12:03 ` Christian Borntraeger
2018-12-28 3:12 ` [virtio-dev] " Wei Wang
2018-12-28 3:12 ` Wei Wang
2018-12-28 8:03 ` [virtio-dev] " Christian Borntraeger
2018-12-28 8:03 ` Christian Borntraeger
2018-12-28 8:03 ` Christian Borntraeger
2018-12-28 3:12 ` Wei Wang
2018-08-27 1:32 ` [virtio-dev] [PATCH v37 2/3] mm/page_poison: expose page_poisoning_enabled to kernel modules Wei Wang
2018-08-27 1:32 ` Wei Wang
2018-08-27 1:32 ` Wei Wang
2018-08-27 1:32 ` [virtio-dev] [PATCH v37 3/3] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON Wei Wang
2018-08-27 1:32 ` Wei Wang
2018-08-27 1:32 ` Wei Wang
2018-10-25 0:58 ` [PATCH v37 0/3] Virtio-balloon: support free page reporting Michael S. Tsirkin
2018-10-25 0:58 ` [virtio-dev] " Michael S. Tsirkin
2018-10-25 0:58 ` Michael S. Tsirkin
2018-10-25 10:18 ` Wei Wang
2018-10-25 10:18 ` [virtio-dev] " Wei Wang
2018-10-25 10:18 ` Wei Wang
2018-12-27 11:31 ` [virtio-dev] " Christian Borntraeger
2018-12-27 11:31 ` Christian Borntraeger
2018-12-27 11:59 ` Christian Borntraeger
2018-12-27 11:59 ` [virtio-dev] " Christian Borntraeger
2018-12-27 11:59 ` Christian Borntraeger
2018-12-27 12:17 ` [virtio-dev] " Christian Borntraeger
2018-12-27 12:17 ` Christian Borntraeger
2018-12-28 6:41 ` Wei Wang
2018-12-28 6:41 ` Wei Wang [this message]
2018-12-28 6:41 ` Wei Wang
2018-12-27 12:17 ` Christian Borntraeger
2018-12-27 11:31 ` Christian Borntraeger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5C25C5A5.4080706@intel.com \
--to=wei.w.wang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=liliang.opensource@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=mst@redhat.com \
--cc=nilal@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=quan.xu0@gmail.com \
--cc=quintela@redhat.com \
--cc=riel@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=yang.zhang.wz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.