public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "James Bottomley" <James.Bottomley@HansenPartnership.com>
To: devel@edk2.groups.io, chris.willing@linux.com
Cc: ardb+tianocore@kernel.org, jiewen.yao@intel.com,
	Gerd Hoffmann <gerd@kraxel.org>
Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg PlatformBootManagerLib: Move TryRunningQemuKernel()
Date: Tue, 10 Aug 2021 16:24:34 -0700	[thread overview]
Message-ID: <8286f815812caccbffaa3696f5e884a62ec0a046.camel@HansenPartnership.com> (raw)
In-Reply-To: <7dc3b9d2-5ebb-c261-46b4-658dcbbfd0f4@linux.com>

On Wed, 2021-08-11 at 09:04 +1000, Christoph Willing wrote:
> On 11/8/21 12:26 am, James Bottomley wrote:
> [...]
> > In the working kernel dmesg Gerd requested, what does it mount as
> > root? sda?  In which case what does the kernel say about where it
> > got sda from?
> > 
> Yes it mounts /dev/sda2 as root.
> 
> The boot logs are are now attached at
> https://bugzilla.tianocore.org/show_bug.cgi?id=3504 as well a diff
> between good and bad boots (patched & unpatched code). There's
> nothing obvious (to me) as to why the unpatched code can't find the
> virtual disk.
> 
> My simple minded guess is that PlatformBdsConnectSequence() performs
> some preparatory work that enables the kernel to have access to the
> vm (therefore to the virtual disk) by the time TryRunningQemuKernel()
> is called. At the moment however, TryRunningQemuKernel() is called
> before PlatformBdsConnectSequence() so that preparatory work hasn't
> been done and the disk can't be found.

I suspect the problem is that it no longer creates default devices if
you don't specify them.  If I look at my working version of a command
line boot, it's this:

qemu-kvm \
    -drive if=pflash,format=raw,unit=0,file=/home/jejb/git/edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd,readonly \
    -debugcon file:debug.log -global isa-debugcon.iobase=0x402 \
    -kernel bzImage \
    -initrd initrd.img \
    -append "console=ttyS0 rd.driver.pre=virtio_scsi,9p,9pnet_virtio root=/dev/sda1" \
    -m 2048 \
    -serial stdio \
    -drive if=none,id=sd00,file=debian.img,format=qcow2 \
    -fsdev local,security_model=passthrough,id=modules,path=/tmp/lib/modules \
    -fsdev local,security_model=passthrough,id=home,path=/home/jejb \
    -device virtio-scsi-pci,id=scsi \
    -device virtio-9p-pci,fsdev=modules,id=sd01,mount_tag=modules \
    -device virtio-9p-pci,fsdev=home,id=sd02,mount_tag=home \
    -device scsi-hd,bus=scsi.0,drive=sd00 \
    -device e1000,netdev=net0 \
    -netdev user,id=net0,hostfwd=tcp::5555-:22 \
    -display vnc=:5 \


#    -chardev socket,id=chrtpm,path=`pwd`/tpmdev/swtpm-sock \
#    -tpmdev emulator,id=tpm0,chardev=chrtpm \
#    -device tpm-tis,tpmdev=tpm0 \

You can ignore all the TPM stuff and my 9p pass throughs for home
directory and /tmp modules directory (to make it easy to boot any
kernel I build).  The relevant lines for you are:

    -drive if=none,id=sd00,file=debian.img,format=qcow2 \
    -device virtio-scsi-pci,id=scsi \
    -device scsi-hd,bus=scsi.0,drive=sd00 \

Which is how I connect /dev/sda to the qcow2 debian image I use to
boot.  You have the drive line but no device lines giving the driver
... if you add device lines can you then get it to boot?

James



  reply	other threads:[~2021-08-10 23:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  2:02 [PATCH 0/1] OvmfPkg PlatformBootManagerLib: Move TryRunningQemuKernel() Christoph Willing
2021-07-28  2:02 ` [PATCH 1/1] " Christoph Willing
2021-08-09 13:08   ` [edk2-devel] " Ard Biesheuvel
     [not found] ` <1695D2E15A92C8E7.3876@groups.io>
2021-08-09 12:53   ` Christoph Willing
2021-08-09 14:52     ` James Bottomley
2021-08-10  0:10       ` Christoph Willing
2021-08-10  6:01         ` Gerd Hoffmann
2021-08-10 12:10           ` Christoph Willing
2021-08-10 14:26         ` James Bottomley
2021-08-10 23:04           ` Christoph Willing
2021-08-10 23:24             ` James Bottomley [this message]
2021-08-11  0:34               ` Christoph Willing
2021-08-11  6:12                 ` Gerd Hoffmann
2021-08-11  9:55                   ` Christoph Willing
2021-08-11 10:30                     ` Ard Biesheuvel
2021-08-12 12:41                       ` Christoph Willing
2021-08-12 13:36                         ` Gerd Hoffmann
2021-08-12 14:07                           ` Christoph Willing
2021-08-11  6:08           ` Gerd Hoffmann

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-list 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=8286f815812caccbffaa3696f5e884a62ec0a046.camel@HansenPartnership.com \
    --to=devel@edk2.groups.io \
    /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