From 85c1fdac29cb916a41f8142b70365a709ef9d343 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 28 Jan 2021 11:51:30 +0000 Subject: [PATCH] configs: Use MmioVirtIO for disk image in baremetal.py The baremetal platform is the platform we use for running user supplied binaries on baremetal hardware. (simply put, it runs provided binaries without adding a gem5 bootloader) Some layers of this software stack might not have a pci driver. This might be the case for firmware images like edkII which needs to use a block device to extract the bootloader and/or the kernel image. Those can use the memory mapped (in host domain) virtio block device which is already part of the VExpress_GEM5 platforms Change-Id: I9c6ba7e1b4566a3999fd9ba20a2bebe191dc3ef8 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39995 Reviewed-by: Andreas Sandberg Reviewed-by: Richard Cooper Maintainer: Andreas Sandberg Tested-by: kokoro --- configs/example/arm/baremetal.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/configs/example/arm/baremetal.py b/configs/example/arm/baremetal.py index 011883b40..29e9b48fd 100644 --- a/configs/example/arm/baremetal.py +++ b/configs/example/arm/baremetal.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017,2019-2020 ARM Limited +# Copyright (c) 2016-2017,2019-2021 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -113,24 +113,13 @@ def create(args): cmd_line = " ".join([ object_file ] + args.args) ) - # Add the PCI devices we need for this system. The base system - # doesn't have any PCI devices by default since they are assumed - # to be added by the configurastion scripts needin them. - pci_devices = [] if args.disk_image: # Create a VirtIO block device for the system's boot # disk. Attach the disk image using gem5's Copy-on-Write # functionality to avoid writing changes to the stored copy of # the disk image. - system.disk = PciVirtIO(vio=VirtIOBlock( - image=create_cow_image(args.disk_image))) - pci_devices.append(system.disk) - - # Attach the PCI devices to the system. The helper method in the - # system assigns a unique PCI bus ID to each of the devices and - # connects them to the IO bus. - for dev in pci_devices: - system.attach_pci(dev) + system.realview.vio[0].vio = VirtIOBlock( + image=create_cow_image(args.disk_image)) # Wire up the system's memory system system.connect() -- 2.30.2