All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Bug 1831115 <1831115@bugs.launchpad.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Bug 1831115] Re: qemu 4.0.0 on aarch64: uefi firmware oversize
Date: Fri, 31 May 2019 17:28:50 +0100	[thread overview]
Message-ID: <87muj28u65.fsf@zen.linaroharston> (raw)
In-Reply-To: <155931574363.8426.10336516680800433530.malone@wampee.canonical.com>


Jerry <ubuntu@mail.jerryxiao.cc> writes:

> [jerry@jerry-n1 aarch64]$ du -b *
> 67108864        AAVMF_CODE.fd
> 67108864        AAVMF_VARS.fd
> 67108864        QEMU_EFI.fd
> 67108864        QEMU_VARS.fd
>
> 2097152 QEMU_EFI.fd.orig
> 786432  QEMU_VARS.fd.orig
>
>
> Both files have been padded to 64MB. (if padding means filling it with
> /dev/zero)

You can use:

   truncate -s 64m /path/to/blob

>
> QEMU_EFI.fd and QEMU_VARS.fd are built by myself according to
> https://wiki.linaro.org/LEG/UEFIforQEMU. With the self-built formware,
> I'm getting almost the same error: qemu-system-aarch64: Initialization
> of device cfi.pflash01 failed: device requires 67108864 bytes, block
> backend provides 786432 bytes

Are you sure your libvirt invocation is properly pointing at your new
re-sized blobs? WFM here on master:

  ./aarch64-softmmu/qemu-system-aarch64 -cpu max -machine type=virt,virtualization=on -display none -m 4096 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-buster-arm64 -device scsi-hd,drive=hd -bios /usr/share/AAVMF/AAVMF_CODE.fd

Where:

ls -l /usr/share/AAVMF/*
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF32_CODE.fd
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF32_VARS.fd
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF_CODE.fd
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF_VARS.fd

--
Alex Bennée


WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Bug 1831115] Re: qemu 4.0.0 on aarch64: uefi firmware oversize
Date: Fri, 31 May 2019 16:28:50 -0000	[thread overview]
Message-ID: <87muj28u65.fsf@zen.linaroharston> (raw)
Message-ID: <20190531162850.5c6AdnsYVtK428UonsSftzUQc9Q3qC26Lcn5eY-LyEk@z> (raw)
In-Reply-To: 155931574363.8426.10336516680800433530.malone@wampee.canonical.com

Jerry <ubuntu@mail.jerryxiao.cc> writes:

> [jerry@jerry-n1 aarch64]$ du -b *
> 67108864        AAVMF_CODE.fd
> 67108864        AAVMF_VARS.fd
> 67108864        QEMU_EFI.fd
> 67108864        QEMU_VARS.fd
>
> 2097152 QEMU_EFI.fd.orig
> 786432  QEMU_VARS.fd.orig
>
>
> Both files have been padded to 64MB. (if padding means filling it with
> /dev/zero)

You can use:

   truncate -s 64m /path/to/blob

>
> QEMU_EFI.fd and QEMU_VARS.fd are built by myself according to
> https://wiki.linaro.org/LEG/UEFIforQEMU. With the self-built formware,
> I'm getting almost the same error: qemu-system-aarch64: Initialization
> of device cfi.pflash01 failed: device requires 67108864 bytes, block
> backend provides 786432 bytes

Are you sure your libvirt invocation is properly pointing at your new
re-sized blobs? WFM here on master:

  ./aarch64-softmmu/qemu-system-aarch64 -cpu max -machine
type=virt,virtualization=on -display none -m 4096 -serial mon:stdio
-netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-
pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-
name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-
disk/debian-buster-arm64 -device scsi-hd,drive=hd -bios
/usr/share/AAVMF/AAVMF_CODE.fd

Where:

ls -l /usr/share/AAVMF/*
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF32_CODE.fd
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF32_VARS.fd
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF_CODE.fd
-rw-r--r-- 1 root root 67108864 Mar 16 00:37 /usr/share/AAVMF/AAVMF_VARS.fd

--
Alex Bennée

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1831115

Title:
  qemu 4.0.0 on aarch64: uefi firmware oversize

Status in QEMU:
  New

Bug description:
  I'd like to enable uefi in my virtual machine, however qemu is always showing the same error:   qemu-system-aarch64: Initialization of device cfi.pflash01 failed: device requires 67108864 bytes, block backend provides 786432 bytes  
  It's clearly impossible to fit a uefi firmware into 786432 bytes.  

  Environment: qemu-system-aarch64 with kvm on an amlogic s905d aarch64
  dev board, running archlinuxarm, qemu in the repository is compiled
  with https://download.qemu.org/qemu-4.0.0.tar.xz

  (My AAVMF_CODE.fd and AAVMF_VARS.fd are extracted from debian package
  qemu-efi-aarch64 0~20181115.85588389-3)

  Below is my libvirt log.

  2019-05-30 15:07:44.216+0000: starting up libvirt version: 5.3.0, qemu version: 4.0.0, kernel: 4.19.46-1-ARCH, hostname: jerry-n1.localdomain
  LC_ALL=C \
  PATH=/usr/local/sbin:/usr/local/bin:/usr/bin \
  HOME=/var/lib/libvirt/qemu/domain-2-debiantesting \
  XDG_DATA_HOME=/var/lib/libvirt/qemu/domain-2-debiantesting/.local/share \
  XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain-2-debiantesting/.cache \
  XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain-2-debiantesting/.config \
  QEMU_AUDIO_DRV=none \
  /usr/bin/qemu-system-aarch64 \
  -name guest=debiantesting,debug-threads=on \
  -S \
  -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-2-debiantesting/master-key.aes \
  -machine virt-4.0,accel=kvm,usb=off,dump-guest-core=off,gic-version=2 \
  -cpu host \
  -drive file=/opt/ovmf/aarch64/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
  -drive file=/var/lib/libvirt/qemu/nvram/debiantesting_VARS.fd,if=pflash,format=raw,unit=1 \
  -m 1024 \
  -overcommit mem-lock=off \
  -smp 4,sockets=4,cores=1,threads=1 \
  -uuid 508d100a-b4e5-4199-9ff9-ac6d40fe2896 \
  -display none \
  -no-user-config \
  -nodefaults \
  -chardev socket,id=charmonitor,fd=25,server,nowait \
  -mon chardev=charmonitor,id=monitor,mode=control \
  -rtc base=utc \
  -no-reboot \
  -boot strict=on \
  -device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 \
  -device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
  -device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
  -device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
  -device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \
  -device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \
  -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 \
  -device virtio-scsi-pci,id=scsi0,bus=pci.3,addr=0x0 \
  -device virtio-serial-pci,id=virtio-serial0,bus=pci.4,addr=0x0 \
  -drive file=/mnt/hddp1/jerry/libvirt/aarch64-images/debiantesting.qcow2,format=qcow2,if=none,id=drive-scsi0-0-0-0 \
  -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi0-0-0-0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2 \
  -drive file=/mnt/hddp1/jerry/libvirt/aarch64-iso/debian-testing-arm64-netinst.iso,format=raw,if=none,id=drive-scsi0-0-0-1,readonly=on \
  -device scsi-cd,bus=scsi0.0,channel=0,scsi-id=0,lun=1,device_id=drive-scsi0-0-0-1,drive=drive-scsi0-0-0-1,id=scsi0-0-0-1,bootindex=1 \
  -netdev tap,fd=27,id=hostnet0 \
  -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d5:28:6d,bus=pci.1,addr=0x0 \
  -chardev pty,id=charserial0 \
  -serial chardev:charserial0 \
  -chardev socket,id=charchannel0,fd=28,server,nowait \
  -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
  -object rng-random,id=objrng0,filename=/dev/urandom \
  -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.5,addr=0x0 \
  -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
  -msg timestamp=on
  2019-05-30 15:07:44.216+0000: Domain id=2 is tainted: host-cpu
  char device redirected to /dev/pts/2 (label charserial0)
  2019-05-30T15:07:46.701125Z qemu-system-aarch64: Initialization of device cfi.pflash01 failed: device requires 67108864 bytes, block backend provides 786432 bytes
  2019-05-30 15:07:46.779+0000: shutting down, reason=failed
  (END)

  # /etc/libvirt/qemu.conf  
  nvram = [
          "/opt/ovmf/aarch64/AAVMF_CODE.fd:/opt/ovmf/aarch64/AAVMF_VARS.fd"
  ]

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1831115/+subscriptions


  reply	other threads:[~2019-05-31 16:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 15:57 [Qemu-devel] [Bug 1831115] [NEW] qemu 4.0.0 on aarch64: uefi firmware oversize Jerry
2019-05-31 13:12 ` [Qemu-devel] [Bug 1831115] " Laszlo Ersek (Red Hat)
2019-05-31 15:15 ` Jerry
2019-05-31 16:28   ` Alex Bennée [this message]
2019-05-31 16:28     ` Alex Bennée
2019-05-31 15:40 ` Jerry
2019-05-31 16:50 ` Jerry

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=87muj28u65.fsf@zen.linaroharston \
    --to=alex.bennee@linaro.org \
    --cc=1831115@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.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.