All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Garhwal <vikram.garhwal@amd.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: "stefano.stabellini@amd.com" <stefano.stabellini@amd.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: Xen and Qemu virtio question
Date: Wed, 3 Jan 2024 12:44:03 -0800	[thread overview]
Message-ID: <ZZXHE3lQ3XPOj80o@amd.com> (raw)
In-Reply-To: <DU0PR04MB9417F7A337D7CAA59B38ED038860A@DU0PR04MB9417.eurprd04.prod.outlook.com>

Hi Peng,
Please see my comments below.
On Wed, Jan 03, 2024 at 05:38:07AM +0000, Peng Fan wrote:
> Hi Vikram, Oleksii
> 
> I follow the slide virtio for Xen on ARM[1], but I met some issues, and
> stuck for about two days.
> 
> I use upstream lastest qemu repo master branch, not qemu-xen.git
> repo.
This is right.
> 
> My start command as below[2], but seems I need first `xl create domu.cfg`,
> otherwise it will fail, because xen hypervisor
> dm_op->rcu_lock_remote_domain_by_id will return failure if domu
> not created.  My domu cfg is simple:
> kernel = "/run/media/boot-mmcblk1p1/Image"
> disk = [ '/etc/xen/disk_1.img,,xvda,specification=virtio' ]
> cmdline = "console=hvc0 root=/dev/xvda rw"
> name = "DomU"
> memory = 512
> serial = "pty"
> 
> I drop qdisk in the disk entry, because xen tool report qdisk and virtio
> not compatible.
> 
> And the arg xen_domid should be same as domu domain id? Is
> there any dynamic way to set xen_domid, start qemu when start
> domu?
Yes, it should be xen_domid. Below virtio-disk patches will take care of
invoking QEMU with right domid.
> 
> Does the domu dts still needed to include the virtio,mmio node?
> 
> however xl create domu.cfg relies virtio disk ready, which needs qemu
> start first. This confuses me. How do you address this
> or I do something wrong?
> 
> Then after xl create,  I quickly start qemu, but met:
> failed to create ioreq server, then I see there is mismatch.
> qemu use HVM_IOREQSRV_BUFIOREQ_ATOMIC to create ioreq server,
> but xen ioreq_server_create will return failure:
>      if ( !IS_ENABLED(CONFIG_X86) && bufioreq_handling )                                             
>                return -EINVAL;
> 
There is a downstream patch for this:
https://github.com/Xilinx/xen/commit/be35b46e907c7c78fd23888d837475eb28334638

> So I change HVM_IOREQSRV_BUFIOREQ_OFF in qemu, but met:
> qemu-system-aarch64: failed to map ioreq server resources: error 2
> handle=0xaaaad26c7f30
> qemu-system-aarch64: xen hardware virtual machine initialisation failed
> 
> Do you have out of box repo that works well? Including Qemu and Xen,
> I am trying virtio disk, but will move to test virtio gpu soon.
> 
> I am not sure there are some downstream patches in your side to
> address and make it work well.
> 
We have a few downstream patches for xen-tools.	
For Virtio disk backend:
https://github.com/Xilinx/xen/commit/947280803294bbb963f428423f679d074c60d632
For Virtio-net:
https://github.com/Xilinx/xen/commit/32fcc702718591270e5c8928b7687d853249c882
For changing the machine name to Xenpvh(to align with QEMU changes):
https://github.com/Xilinx/xen/commit/5f669949c9ffdb1947cb47038956b5fb8eeb072a

With above 4 patches it should work for you. Please re-compile Xen and Xen-tools
first and finally compile QEMU with this Xen.

> Thanks for your help.
> 
> Thanks,
> Peng.
> 
> [1]https://www.youtube.com/watch?v=boRQ8UHc760
> 
> [2]qemu-system-aarch64  -xen-domid 1 \
> -chardev socket,id=libxl-cmd,path=qmp-libxl-1,server=on,wait=off \
> -mon chardev=libxl-cmd,mode=control \
> -chardev socket,id=libxenstat-cmd,path=qmp-libxenstat-1,server=on,wait=off \
> -mon chardev=libxenstat-cmd,mode=control \
> -xen-attach -name guest0 -vnc none -display none -nographic \
> -machine xenpvh -m 513 &


  reply	other threads:[~2024-01-03 20:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03  5:38 Xen and Qemu virtio question Peng Fan
2024-01-03 20:44 ` Vikram Garhwal [this message]
2024-01-05 10:25   ` Peng Fan

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=ZZXHE3lQ3XPOj80o@amd.com \
    --to=vikram.garhwal@amd.com \
    --cc=oleksii_moisieiev@epam.com \
    --cc=peng.fan@nxp.com \
    --cc=stefano.stabellini@amd.com \
    --cc=viresh.kumar@linaro.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.