[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Porting xen on rpi4


  • To: Vipul Suneja <vsuneja63@xxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 25 Aug 2022 09:27:56 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ps/y4odxhD3VMf6tdbhYqnEv3+K9+UvqJJejb3aM18M=; b=IkajBnt/mIj6oTOQvZnD4aMIpq8p+o/FtequSl41tPN6yej+0dkPKlBkJXGfyFc/lNre3jv2hUlU3hOnAxIwb4nmKjl09JO1GxJBKwlwAh6wr5+1ypYkQ/30uamo0Mnb7wPeQ4ySh+TnafPA+oCSUQNqojJHNqLdibo3kzIUctd3DWWrI8iOAxFO/2/uZGYMuvIiMh8uFH1orSdxGiO1C6rq7ZY5zT441jptkXx99PT9XIupEyLu44JfSVC44I/et+w88+y3nxrujVXMJRrwAJvPzgcgHi/P7vSZrr6D1C8CBH50DmtDgIs0rB1VxOOILQWecgoMNU/dbH9OpfpSCA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ps/y4odxhD3VMf6tdbhYqnEv3+K9+UvqJJejb3aM18M=; b=HWk19TXqueb0RHmYXQsN3DcdakgN+omBmp0tD7/BPsA8I2NT60Ncap1x/PFVeJf/oGuJWZfOZwHFB8yHJ/LYOPVYks7YUzWy5TL8j8bRu5Oyd9Zsyr27nG8k1T0FaG2w6HFt7VvesJTmoxDpic7LPw5n13Dsf/Dz6oAl7P1kBsnfdTyMBeBEkoSh1xZ+SEGcnqkZHE91VWEeY0NjZOZyj32egfAuBlbNB5r88ExY6+/ymobUFwHeCKWcqyFMV0dMdIuoldihl8OuaeMPYycIEHRD7c0lqm64rDbNC6xulcFEVITaZYQRTzBLXRjwxGoATlJS6YUMdNiX42rT814Lfg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=OdfM/OZoPGl/JDW9YYdWSvMW3uOHJ0Pl2XDZ3dVxgeXeXuPouy3rQCdI65XStWF/8duoQdJ7wBtngKqzrCWyjFxMd9Jnu7xSg9UrxC5gduVCRUAVx+hI4h5SwhCTHvS4h0tGXxR8Kp18AdtGEd5+Bz/+eZZ/cUzK2yunO0/KyVkjqs34GeN0MuUdU5jvDEFlqeHE7mN3OzjUT1CsO6VopQQ4sa+vwHuQX/lABdyIDwKfrrGY0BKwpktLPK0anQZC+ecY5gTpooTsw5pGp/Q8HsiRPp75hW6K0ZqYtFFNR1K2zL7/Sfo+S8LjpicLf2s+hK33VSDhO9ETtZiyYvmZ8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTEGGkhCis4cwRjD7aS5vtUqsFWHFekdH35Mjbgw1f/qdUEZgK5UvSLJVcyDzDRGpDHr3rkI/X/ZyThJbw3VijnhXVvFOC8UdWXWFXO+XKVJONDCrdn0UbJNxKHC0glucI8H6vcPCSuIFSXpSJKOrnqP9Ki1ORZOWC+tGeJOz7gQeBC1UslPYG/aWl3Drd2LNxVk41mlxV/rVmFTOT+/9mmVmBYd0A4uvbr6KvvGGyG67fLfjFxLjw3b76MistbSHkP/8OaH5fa96X9Tx7vZr3hlM1tjM75XT5PEJgyXFSAnpbUiHDVb9qD0SvzjUM4iTDeDpzxCvgMVLJAudcHIWw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>
  • Delivery-date: Thu, 25 Aug 2022 09:28:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYt8SgkyOonJ7Wl0ezDHN7orB+v62+Hg2AgAAnmwCAAEWWAIAAroCAgAAG0YCAABDyAIAACN+A
  • Thread-topic: Porting xen on rpi4

Hi Vipul,

> On 25 Aug 2022, at 09:56, Vipul Suneja <vsuneja63@xxxxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> Thanks!
> 
> No, I couldn't see /dev/loop0. Can you please guide me to create it?

First thing to try is “modprobe loop"

It that does not work (ie module not found) you should check in your linux 
config if BLK_DEV_LOOP is enabled.

> 
> I didn't change dom0 configurations, it's default generated by yocto.
>  
> I will append this "IMAGE_FSTYPES:append = " wic.gz”" in local.conf & will 
> update you.
> 

Cheers
Bertrand

> Regards,
> Vipul Kumar
> 
> On Thu, Aug 25, 2022 at 1:25 PM Bertrand Marquis <Bertrand.Marquis@xxxxxxx> 
> wrote:
> Hi Vipul,
> 
> > On 25 Aug 2022, at 08:31, Vipul Suneja <vsuneja63@xxxxxxxxx> wrote:
> > 
> > Hi Stefano,
> > 
> > Thanks!
> > 
> > As suggested, I changed the guest1.cfg file. Below are the contents of 
> > config file
> > 
> > kernel = "/home/root/Image"
> > cmdline = "console=hvc0 earlyprintk=xen sync_console root=/dev/xvda"
> > memory = "1024"
> > name = "guest1"
> > vcpus = 1
> > serial="pty"
> > disk = [ 
> > 'file:/home/root/xen-guest-image-minimal-raspberrypi4-64.ext3,xvda,w' ]
> > vif=[ 'mac=00:11:22:66:88:22,bridge=xenbr0,type=netfront', ]
> > 
> > Its failing with below logs:
> > 
> > root@raspberrypi4-64:~# xl create -c guest1.cfg 
> > Parsing config from guest1.cfg
> > Invalid parameter `type'.
> > libxl: error: libxl_exec.c:117:libxl_report_child_exitstatus: 
> > /etc/xen/scripts/block add [742] exited with error status 1
> > libxl: error: libxl_device.c:1265:device_hotplug_child_death_cb: script: 
> > losetup /dev/loop0 /home/root/xen-guest-image-minimal-raspberrypi4-64.ext3 
> > failed
> > libxl: error: libxl_create.c:1643:domcreate_launch_dm: Domain 1:unable to 
> > add disk devices
> > libxl: error: libxl_exec.c:117:libxl_report_child_exitstatus: 
> > /etc/xen/scripts/block remove [793] exited with error status 1
> > libxl: error: libxl_device.c:1265:device_hotplug_child_death_cb: script: 
> > /etc/xen/scripts/block failed; error detected.
> > libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain 
> > 1:Non-existant domain
> > libxl: error: libxl_domain.c:1137:domain_destroy_callback: Domain 1:Unable 
> > to destroy guest
> > libxl: error: libxl_domain.c:1064:domain_destroy_cb: Domain 1:Destruction 
> > of domain failed
> 
> I think you have a loop issue.
> 
> Could you check if /dev/loop0 exists ?
> 
> Did you change something on the dom0 linux configuration generated by Yocto ?
> 
> We are using Yocto on RPI4 here without any issue like that, only difference 
> with
> your setup is that we generate a wic image to have a real disk image instead 
> of
> using the ext3/ext4 one.
> 
> Should be possible to do the same on your side by adding the following in 
> local.conf:
> IMAGE_FSTYPES:append = " wic.gz”
> 
> > 
> > Even after removing 'type=netfront' from vif it's failing. 
> 
> This option is only for hvm on x86, so you can remove it from your 
> configuration.
> 
> > One more doubt here, could this mac address be a dummy or actual here?
> 
> This is a dummy one you set for the guest network interface and this is the 
> Mac
>  address other devices on your network will see so it must be fully valid (and
>  not conflicting with other devices on your network).
> 
> Cheers
> Bertrand
> 
> > 
> > Regards,
> > Vipul Kumar
> > 
> > On Thu, Aug 25, 2022 at 2:36 AM Stefano Stabellini <sstabellini@xxxxxxxxxx> 
> > wrote:
> > On Wed, 24 Aug 2022, Vipul Suneja wrote:
> > > Hi Bertrand,
> > > Thanks for your response!
> > > 
> > > I builded the guest image on yocto kirkstone source which has FSTYPE 
> > > ext3. Guest image generated is
> > > xen-guest-image-minimal-raspberrypi4-64.ext3.
> > > Below is the content of guest.cfg file
> > > 
> > >    kernel = "/home/root/Image" 
> > >    cmdline = "console=hvc0 earlyprintk=xen sync_console root=/dev/xvda" 
> > >    memory = "256" 
> > >    name = "guest1" 
> > >    vcpus = 1 
> > >    serial="pty" 
> > >    disk = [ 'phy:/dev/loop0,xvda,w' ] 
> > >    vif=[ 'mac=00:11:22:66:88:22,bridge=xenbr0,type=netfront', ]
> > > 
> > > I am trying to mount xen-guest-image-minimal-raspberrypi4-64.ext3 to a 
> > > virtual device & then will run the guest VM by command "xl create -c
> > > guest.cfg". But facing issue while trying to mount. 
> > 
> > You don't actually need to mount
> > xen-guest-image-minimal-raspberrypi4-64.ext3 anywhere to use it to run
> > your guest VM with "xl create". 
> > 
> > It is enough to do this instead, as Bertrand suggested:
> > 
> > disk=["file:/path/to/file/xen-guest-image-minimal-raspberrypi4-64.ext3,xvda,w"]
> > 
> > No need to call losetup or mount. Just xl create -c.
> > 
> > More answers below.
> > 
> > 
> > > Regards,
> > > Vipul Kumar
> > > 
> > > On Wed, Aug 24, 2022 at 8:06 PM Bertrand Marquis 
> > > <Bertrand.Marquis@xxxxxxx> wrote:
> > >       Hi Vipul,
> > > 
> > >       > On 24 Aug 2022, at 15:16, Vipul Suneja <vsuneja63@xxxxxxxxx> 
> > > wrote:
> > >       >
> > >       > Hi,
> > >       >
> > >       > I am porting xen hypervisor on rpi4 with yocto kirkstone sources. 
> > > Followed the basic steps to build xen-image-minimal &
> > >       xen-guest-image-minimal. I could flash sd card with xen minimal 
> > > image & could see dom0 up. I copied "Image",
> > >       "xen-guest-image-minimal" .ext3 file & guest.cfg to "/home/root". 
> > > After that created a bridge with below step:
> > >       >
> > >       > killall -SIGUSR2 udhcpc
> > >       > brctl addbr xenbr0
> > >       > brctl addif xenbr0 eth0
> > >       > killall udhcpc
> > >       > udhcpc -R -b -p /var/run/udhcpc.xenbr0.pid -i xenbr0
> > >       >
> > >       > Could see the xenbr0 interface up.
> > >       > After that while mounting the guest file system it shows no such 
> > > file or directory but the file is already there.
> > >       >
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~# ls -l
> > >       > [23:40:15] <Guest9046> -rw-r--r--    1 root     root      
> > > 24652288 Mar  9 12:36 Image
> > >       > [23:40:15] <Guest9046> -rw-r--r--    1 root     root           
> > > 247 Mar  9 12:37 guest1.cfg
> > >       > [23:40:15] <Guest9046> -rw-r--r--    1 root     root     
> > > 868220928 Mar  9 12:39 xen-guest-image-minimal-raspberrypi4-64.ext3
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~# chmod 0777 
> > > xen-guest-image-minimal-raspberrypi4-64.ext3
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~# ls -l
> > >       > [23:40:15] <Guest9046> -rw-r--r--    1 root     root      
> > > 24652288 Mar  9 12:36 Image
> > >       > [23:40:15] <Guest9046> -rw-r--r--    1 root     root           
> > > 247 Mar  9 12:37 guest1.cfg
> > >       > [23:40:15] <Guest9046> -rwxrwxrwx    1 root     root     
> > > 868220928 Mar  9 12:39 xen-guest-image-minimal-raspberrypi4-64.ext3
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~# losetup /dev/loop0 
> > > xen-guest-image-minimal-raspberrypi4-64.ext3
> > >       > [23:40:15] <Guest9046> losetup: 
> > > xen-guest-image-minimal-raspberrypi4-64.ext3: No such file or directory
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~# losetup /dev/loop0 
> > > /home/root/xen-guest-image-minimal-raspberrypi4-64.ext3
> > >       > [23:40:15] <Guest9046> losetup: 
> > > /home/root/xen-guest-image-minimal-raspberrypi4-64.ext3: No such file or 
> > > directory
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~#
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~#
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~#
> > >       > [23:40:15] <Guest9046> root@raspberrypi4-64:~# losetup /dev/loop0 
> > > /home/root/xen-guest-image-minimal-raspberrypi4-64.ext3
> > >       > [23:40:15] <Guest9046> losetup: 
> > > /home/root/xen-guest-image-minimal-raspberrypi4-64.ext3: No such file or 
> > > directory
> > 
> > It looks like either
> > /home/root/xen-guest-image-minimal-raspberrypi4-64.ext3 doesn't exist or
> > /dev/loop0 doesn't exist
> > 
> > 
> > >       Why do you want to mount the file system ?
> > > 
> > >       Anyway this is not related to Xen, I guess you could start without 
> > > xen and still not manage to mount the file like that (linux
> > >       configuration issue ?)
> > > 
> > >       What is the content of you guest.cfg
> > >       How do you want to pass the guest root file system ?
> > > 
> > >       Yocto should actually generate an img file and you could use it by 
> > > having something like this in your guest.cfg:
> > >       disk=["file:/home/root/guest1.img,xvda,w”]
> > > 
> > >       Cheers
> > >       Bertrand
> > > 
> > >       >
> > >       > Any input on this issue will be really helpful, expecting your 
> > > response.
> > >       >
> > >       > Thanks & Regards,
> > >       > Vipul Kumar
> > > 
> > > 
> > >
> 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.