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

Re: OvmfXen and PVH


  • To: Stefan Kadow <xen@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 5 Jan 2022 17:19:19 +0000
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-users@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 05 Jan 2022 17:19:58 +0000
  • Ironport-data: A9a23:KCL51qOgmRY5vvzvrR2VkMFynXyQoLVcMsEvi/4bfWQNrUok02MPz TNJUDjVb6zbYzfzfthxbtmxoE4P7cfTzoA3HAto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdpJYz/uUGuCJQUNUjMlkfZKhTr6UUsxNbVU8En150Eo+w7RRbrNA2rBVPSvc4 bsenOWHULOV82Yc3rU8sv/rRLtH5ZweiRtA1rAMTakjUGz2zhH5OKk3N6CpR0YUd6EPdgKMq 0Qv+5nilo/R109F5tpICd8XeGVSKlLZFVDmZna7x8FOK/WNz8A/+v9TCRYSVatYoxqvmc1c0 JJQibepGFkjbofRp9QgSxYNRkmSPYUekFPGCX22sMjVxEzaaXr8hf5pCSnaP6VBpLwxWzsXs 6VFdnZdNXhvhMrvqF6/YuBqmsQkKtitJI4Fs2ts5TrYEewnUdbIRKCiCdpwgm5r1pgXRKu2i 8wxbRFPMDCDcTl2PHAtKIsfxt+N2Xz8bGgNwL6SjfVuuDWCpOBr65D9PdyQZ8eHX959mkeDu nmA72n/GgsdNtGU1XyC6H3Erv/CmwvgW4tMS/u0+5ZXbEa7nzJJTkdMDB3i/Kf/2hXWt89jx 1I81QwosIUqs1GXZcCsARfoimO7jiMEVI8FewEl0z2lxq3R6gefI2ELSD9dddAr3PMLqSwWO kyhxI2wW2E22FGBYTfEr+rP82vuUcQABTJaDRLoWzfp9DUKTGsbqhvUBuhuH6eu5jEeMWGhm mvaxMTSalh6sCLq60l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ozovNM bbDZyKSgE8Ly9P57p5FNQLG4DDb6FWM0jHCGH7MmcL1NhhaulOQw0eiqEOgHyJ4JBYSOpslXGE E1GEWUEAFbHWzG/ngJvRluSZGmmDMBGj0kqHSl5I1vv+sw3VPfeYAsRmBngRTElRXIUI/0/2vy ZDAZhgFrp1Em11H4Q/BcJlvn
  • List-id: Xen user discussion <xen-users.lists.xenproject.org>

On Tue, Jan 04, 2022 at 03:37:12PM +0100, Stefan Kadow wrote:
> Hello,
> I read in an old post from 2019 that the specific OVMF target platform
> OvmfXen can boot in a PVH type domU. And in another old post I read that a
> new console type was built for use with this PVH domUs.
> I was hoping that I could use it to boot Linux PVH DomUs with EFIstub
> kernels or systemd-boot, but I can't get it to work.

Thanks for testing this! Unfortunately, there's still a little bit of
work on the project. OvmfXen doesn't know how to shutdown when run as
PVH yet, and this is checked at boot time so it doesn't even try to boot
the operating system.

> I use a simple pvh-domu.cfg:
> type = "pvh"
> kernel = "/usr/lib/xen/boot/ovmf.bin"
> disk = [...]
> vif = [...]
> ...
> 
> In the verbose output of xl toolstack (xl -vvv create -c pvh-domu.cfg) I can
> see that the domU is destroyed right after creation. The same domU
> configuration works as HVM domU and as PVH domU with pygrub bootloader.

I don't know why the guest would be destroyed, is there some information
before that? Maybe `xl` didn't recognized "ovmf.bin" as a PVH "kernel"?

In the issue I've mention above, I think OvmfXen would just run an
infinite loop, so the guess wouldn't be destroyed.

> Is there any way to get this to work with Xen 4.16.0?

By hacking OVMF and rebuilding it. Otherwise not really. Sorry.

For you or anyone looking at testing OVMF on PVH, the hack is going to
be:

diff --git a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c 
b/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c
--- a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c
+++ b/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c
@@ -35,9 +35,7 @@ DxeResetInit (
       mAcpiPmBaseAddress = ICH9_PMBASE_VALUE;
       break;
     default:
-      ASSERT (FALSE);
-      CpuDeadLoop ();
-      return EFI_UNSUPPORTED;
+      break;
   }

   return EFI_SUCCESS;


With that, the guest should boot, but shutdown isn't going to work so
one will have to destroy the guest after trying to shutdown.

There's also a build option to have OVMF logging somewhere when run as
PVH, "-D DEBUG_ON_HYPERVISOR_CONSOLE", which would log to the host
serial console. But that might only work with a debug build of xen and
one would probably need a serial port.

Cheers,

-- 
Anthony PERARD



 


Rackspace

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