qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hongbo Zhang <hongbo.zhang@linaro.org>
To: peter.maydell@linaro.org, alex.bennee@linaro.org,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org,
	radoslaw.biernacki@linaro.org,
	Hongbo Zhang <hongbo.zhang@linaro.org>
Subject: [Qemu-devel] [PATCH v4] Add arm SBSA reference machine
Date: Fri, 19 Oct 2018 16:55:11 +0800	[thread overview]
Message-ID: <1539939312-19713-1-git-send-email-hongbo.zhang@linaro.org> (raw)

For the Aarch64, there is one machine 'virt', it is primarily meant to
run on KVM and execute virtualization workloads, but we need an
environment as faithful as possible to physical hardware,  to support
firmware and OS development for pysical Aarch64 machines.

See the patch commit comments for the features description.

V4 changes:
 - rebased to v3.0.0
 - removed timer, uart, rtc, *hci device tree nodes
   (others were removerd in v3)
 - other minore codes clean up, mainly unsed header files, comments etc.

V3 changes:
 - rename the platform 'sbsa-ref'
 - move all the codes to a separate file sbsa-ref.c
 - remove paravirtualized fw_cfg device
 - do not supply ACPI tables, since firmware will do it
 - supply only necessary DT nodes
 - and other minor code clean up


Well, there are still pending issues, you can find my whole tree here:
http://git.linaro.org/people/hongbo.zhang/qemu-enterprise.git/log/?h=sbsa-v3.0.0

 workaround: add fw_cfg, smbios and acpi
 workaround: add device tree nodes back
 hw/arm: Add arm SBSA reference machine
 Revert "target/arm: Implement new do_transaction_failed hook"
 Revert "device_tree: Increase FDT_MAX_SIZE to 1 MiB"

there are two commit reverts I have to do to boot system currently, these block not only my new 'sbsa-ref', but also the 'virt'.
(other two workarounds can be ignored, they are just for temp using before firmware porting is fully finished)

I am not saying the comments themselves have problem, maybe firmware need to be adapted accordingly too. But before they are fixed, I just simply revert them to not block my run.
(And, I've mentioned in v3 list that there are still problem of booting SMP too, but I won't mention it here this time, otherwise this patch/cover letter becomes too complicated -- at least we can boot one core, I can fix/discuss it later separately.)

Steps to reproduce issues:
1. Compile ARMTF
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=qemu all DEBUG=1

2. Compile edk2
make -C BaseTools
. edksetup.sh
export GCC49_AARCH64_PREFIX=aarch64-linux-gnu-
build -a AARCH64 -t GCC49 -p ArmVirtPkg/ArmVirtQemuKernel.dsc

3. Run QEMU
3a. copy or link ARMTF and edk2 images to the directory where you want to launch QEMU
bl1.bin -> /home/hongbo/work/arm-trusted-firmware/build/qemu/debug/bl1.bin*
bl2.bin -> /home/hongbo/work/arm-trusted-firmware/build/qemu/debug/bl2.bin*
bl31.bin -> /home/hongbo/work/arm-trusted-firmware/build/qemu/debug/bl31.bin*
bl33.bin -> /home/hongbo/work/edk2/Build/ArmVirtQemuKernel-AARCH64/DEBUG_GCC49/FV/QEMU_EFI.fd

3b. command to launch QEMU
command1 to load a whole system
qemu-system-aarch64 -machine virt,secure=on,virtualization=on -cpu cortex-a57 -m 1024 -bios bl1.bin -semihosting -serial stdio -device virtio-scsi-device,id=scsi -drive file=../qemu-imgs/deb9_arm64_netinst_uefi.raw,id=rootimg,if=none -device scsi-hd,drive=rootimg -netdev user,id=unet -device virtio-net-device,netdev=unet -net user

or command2 simply load a kernel
qemu-system-aarch64 -machine virt,secure=on,virtualization=on -cpu cortex-a57 -m 1024 -bios bl1.bin -semihosting -serial stdio -kernel Image -initrd xxx -append "root=/dev/xxx console=ttyAMA0"

4a. system halt with error message
ASSERT_EFI_ERROR (Status = Not Found)
ASSERT [ResetSystemRuntimeDxe] /home/hongbo/work/edk2/Build/ArmVirtQemuKernel-AARCH64/DEBUG_GCC49/AARCH64/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe/DEBUG/AutoGen.c(370): !EFI_ERROR (Status)

4b. Revert "device_tree: Increase FDT_MAX_SIZE to 1 MiB"
command1 can run further to halt at nother place, see 5a and 5b
command2 can load kernel successfully

5a. 2nd system halt with message
Synchronous Exception at 0x0000000078A152F0
PC 0x000078A152F0 (0x000078A00000+0x000152F0) [ 0] ArmVeNorFlashDxe.dll
PC 0x000078A152A0 (0x000078A00000+0x000152A0) [ 0] ArmVeNorFlashDxe.dll
PC 0x000078A11DF0 (0x000078A00000+0x00011DF0) [ 0] ArmVeNorFlashDxe.dll
[...snip...]
PC 0x0000600088C4
PC 0x000060008230
PC 0x580B24C2580B24A1

Recursive exception occurred while dumping the CPU state

5b Revert "target/arm: Implement new do_transaction_failed hook"
then no halt, command1 can boot OS successfully

Hongbo Zhang (1):
  hw/arm: Add arm SBSA reference machine

 hw/arm/Makefile.objs  |   2 +-
 hw/arm/sbsa-ref.c     | 937 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/hw/arm/virt.h |   2 +
 3 files changed, 940 insertions(+), 1 deletion(-)
 create mode 100644 hw/arm/sbsa-ref.c

-- 
2.7.4

             reply	other threads:[~2018-10-19  8:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19  8:55 Hongbo Zhang [this message]
2018-10-19  8:55 ` [Qemu-devel] [PATCH v4] hw/arm: Add arm SBSA reference machine Hongbo Zhang
2018-11-15 16:05   ` Peter Maydell
2018-11-16 10:46     ` Hongbo Zhang
2018-11-16 11:29       ` Peter Maydell
2018-11-19 10:49         ` Hongbo Zhang
2018-11-19 10:54           ` Hongbo Zhang
2018-12-06  9:19         ` Hongbo Zhang
2018-11-16 12:27       ` Gerd Hoffmann
2018-11-16 22:04         ` Ard Biesheuvel
2018-11-19 12:44           ` Leif Lindholm
2018-11-19 15:51             ` Ard Biesheuvel
2018-11-19 16:44               ` Leif Lindholm
2018-11-19 17:17                 ` Ard Biesheuvel
2018-11-20  8:16                   ` Gerd Hoffmann
2018-11-20  8:49                     ` Hongbo Zhang
2018-11-20  9:40                       ` Ard Biesheuvel
2018-11-21  8:35                         ` Hongbo Zhang
2018-12-29  9:52                           ` Hongbo Zhang
2018-11-23  7:14     ` Hongbo Zhang
2018-11-23  7:32       ` Hongbo Zhang
2018-12-05  9:50     ` Hongbo Zhang
2018-12-05 10:36       ` Leif Lindholm
2018-12-06  1:50         ` Hongbo Zhang
2019-01-29 11:28     ` Ard Biesheuvel
2019-01-30  8:34       ` Hongbo Zhang
2019-01-30  8:37         ` Ard Biesheuvel
2019-01-31 13:21           ` Radoslaw Biernacki
2018-11-05 16:31 ` [Qemu-devel] [PATCH v4] " Peter Maydell
2018-11-06 10:16   ` Hongbo Zhang
2018-11-15 16:20 ` Peter Maydell
2018-11-15 18:59   ` Ard Biesheuvel
2018-11-16  8:23   ` Hongbo Zhang
2018-11-16  9:58     ` Peter Maydell
2018-11-16 10:52       ` Hongbo Zhang

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=1539939312-19713-1-git-send-email-hongbo.zhang@linaro.org \
    --to=hongbo.zhang@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=leif.lindholm@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=radoslaw.biernacki@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).