hw/ppc/pnv_psi.c | 17 ++++++++--------- target/ppc/mmu-book3s-v3.c | 33 ++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 14 deletions(-)
OpenBSD/powernv programs PTCR for LPID 0 with a partition
table size exponent one smaller than QEMU's existing ISA v3.0
interpretation. Try QEMU's existing PATS interpretation first,
then fall back to the OpenBSD LPID 0 form; nonzero LPIDs keep
the old behaviour.
The PSI model now exposes POWER9 IRQ level and pending status
registers, and keeps both updated while delivering through the
existing XIVE LSI source. This lets guests that select the
POWER9 PSI LSI IRQ method continue to receive LPC interrupts.
The blast radius is probably minimal: the partition table
fallback is limited to bare metal LPID 0 after the original
lookup fails, while the PSI change only touches POWER9 PSI
state and reuses the existing delivery path.
Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
---
hw/ppc/pnv_psi.c | 17 ++++++++---------
target/ppc/mmu-book3s-v3.c | 33 ++++++++++++++++++++++++++++-----
2 files changed, 36 insertions(+), 14 deletions(-)
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index e8701c6100..941540df2d 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -688,6 +688,8 @@ static uint64_t pnv_psi_p9_mmio_read(void *opaque, hwaddr addr, unsigned size)
case PSIHB9_ESB_CI_BASE:
case PSIHB9_ESB_NOTIF_ADDR:
case PSIHB9_IVT_OFFSET:
+ case PSIHB9_IRQ_LEVEL:
+ case PSIHB9_IRQ_STAT:
val = psi->regs[reg];
break;
default:
@@ -817,18 +819,15 @@ static const MemoryRegionOps pnv_psi_p9_xscom_ops = {
static void pnv_psi_power9_set_irq(void *opaque, int irq, int state)
{
PnvPsi *psi = opaque;
- uint64_t irq_method = psi->regs[PSIHB_REG(PSIHB9_INTERRUPT_CONTROL)];
+ uint64_t irq_bit = PPC_BIT(irq);
- if (irq_method & PSIHB9_IRQ_METHOD) {
- qemu_log_mask(LOG_GUEST_ERROR, "PSI: LSI IRQ method no supported\n");
- return;
- }
-
- /* Update LSI levels */
+ /* Update LSI levels and pending status */
if (state) {
- psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] |= PPC_BIT(irq);
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] |= irq_bit;
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_STAT)] |= irq_bit;
} else {
- psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] &= ~PPC_BIT(irq);
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] &= ~irq_bit;
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_STAT)] &= ~irq_bit;
}
qemu_set_irq(psi->qirqs[irq], state);
diff --git a/target/ppc/mmu-book3s-v3.c b/target/ppc/mmu-book3s-v3.c
index 3865556310..4babe4c536 100644
--- a/target/ppc/mmu-book3s-v3.c
+++ b/target/ppc/mmu-book3s-v3.c
@@ -23,19 +23,21 @@
#include "mmu-hash64.h"
#include "mmu-book3s-v3.h"
-bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry)
+static bool ppc64_v3_get_pate_from_size(PowerPCCPU *cpu, target_ulong lpid,
+ ppc_v3_pate_t *entry,
+ uint64_t table_size)
{
uint64_t patb = cpu->env.spr[SPR_PTCR] & PTCR_PATB;
- uint64_t pats = cpu->env.spr[SPR_PTCR] & PTCR_PATS;
+ uint64_t entries;
/* Check if partition table is properly aligned */
- if (patb & MAKE_64BIT_MASK(0, pats + 12)) {
+ if (patb & (table_size - 1)) {
return false;
}
/* Calculate number of entries */
- pats = 1ull << (pats + 12 - 4);
- if (pats <= lpid) {
+ entries = table_size / sizeof(*entry);
+ if (entries <= lpid) {
return false;
}
@@ -45,3 +47,24 @@ bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry)
entry->dw1 = ldq_phys(CPU(cpu)->as, patb + 8);
return true;
}
+
+bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry)
+{
+ uint64_t pats = cpu->env.spr[SPR_PTCR] & PTCR_PATS;
+
+ /*
+ * Keep the existing ISA v3.0 PATS interpretation first. OpenBSD/powernv
+ * uses the PATSIZE value it writes to PTCR as one exponent smaller, and it
+ * only needs that interpretation for the bare metal LPID 0 table.
+ */
+ if (ppc64_v3_get_pate_from_size(cpu, lpid, entry, 1ull << (pats + 12))) {
+ return true;
+ }
+
+ if (lpid == 0) {
+ return ppc64_v3_get_pate_from_size(cpu, lpid, entry,
+ 1ull << (pats + 11));
+ }
+
+ return false;
+}
--
2.54.0
On Tue, 09 Jun 2026 04:19:45 +0200,
"Kirill A. Korinsky" <kirill@korins.ky> wrote:
>
> OpenBSD/powernv programs PTCR for LPID 0 with a partition
> table size exponent one smaller than QEMU's existing ISA v3.0
> interpretation. Try QEMU's existing PATS interpretation first,
> then fall back to the OpenBSD LPID 0 form; nonzero LPIDs keep
> the old behaviour.
>
> The PSI model now exposes POWER9 IRQ level and pending status
> registers, and keeps both updated while delivering through the
> existing XIVE LSI source. This lets guests that select the
> POWER9 PSI LSI IRQ method continue to receive LPC interrupts.
>
> The blast radius is probably minimal: the partition table
> fallback is limited to bare metal LPID 0 after the original
> lookup fails, while the PSI change only touches POWER9 PSI
> state and reuses the existing delivery path.
>
> Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
It was tested as:
qemu-system-ppc64 \
-M powernv9 \
-cpu power9 \
-m 2G \
-nographic \
-kernel pnor.BOOTKERNEL \
-device ich9-ahci,id=sata0,bus=pcie.0,addr=0x0 \
-drive file=miniroot79.img,format=raw,if=none,id=bootdisk,snapshot=on \
-device ide-hd,bus=sata0.0,unit=0,drive=bootdisk,bootindex=1
Where:
1. miniroot79.img from https://cdn.openbsd.org/pub/OpenBSD/snapshots/powerpc64/
2. pnor.BOOTKERNEL was extracted from talos-ii-v2.10.pnor which I get from
https://wiki.raptorcs.com/wiki/File:Talos-ii-pnor-v2.10-bundle.tar by
extract-pnor-bootkernel.pl which I attached.
--
wbr, Kirill
#!/usr/bin/env perl
use strict;
use warnings;
use Fcntl qw(SEEK_SET);
use File::Basename qw(dirname);
use File::Path qw(make_path);
use constant FFS_MAGIC => "PART";
use constant FFS_VERSION => 1;
use constant FFS_MAGIC_SIZE => 4;
use constant FFS_NAME_SIZE => 16;
use constant FFS_UINT32_SIZE => 4;
use constant FFS_RESERVED_SIZE => 16;
use constant COPY_CHUNK => 1024 * 1024;
use constant FFS_HEADER_SIZE =>
FFS_MAGIC_SIZE + 6 * FFS_UINT32_SIZE + FFS_RESERVED_SIZE +
FFS_UINT32_SIZE;
use constant FFS_ENTRY_PREFIX_SIZE => FFS_NAME_SIZE + 7 * FFS_UINT32_SIZE;
# OpenPOWER PNOR images use a big-endian FFS partition table.
my @FFS_HEADER_FIELDS = (
[ magic => "a" . FFS_MAGIC_SIZE ],
[ version => "N" ],
[ table_blocks => "N" ],
[ entry_size => "N" ],
[ entry_count => "N" ],
[ block_size => "N" ],
[ block_count => "N" ],
[ reserved => "x" . FFS_RESERVED_SIZE ],
[ checksum => "N" ],
);
my @FFS_ENTRY_PREFIX_FIELDS = (
[ name => "Z" . FFS_NAME_SIZE ],
[ base => "N" ],
[ blocks => "N" ],
[ pid => "N" ],
[ id => "N" ],
[ type => "N" ],
[ flags => "N" ],
[ actual => "N" ],
);
my $FFS_HEADER_FORMAT = join " ", map { $_->[1] } @FFS_HEADER_FIELDS;
my $FFS_ENTRY_PREFIX_FORMAT = join " ", map { $_->[1] } @FFS_ENTRY_PREFIX_FIELDS;
sub usage {
die "usage: $0 talos-ii-vXXX.pnor pnor.BOOTKERNEL\n";
}
sub fail {
die "$0: @_\n";
}
sub read_exact {
my ($fh, $size, $what) = @_;
my $buf = "";
while (length($buf) < $size) {
my $n = read $fh, $buf, $size - length($buf), length($buf);
fail("$what: $!") unless defined $n;
fail("$what: unexpected EOF") if $n == 0;
}
return $buf;
}
sub copy_exact {
my ($in, $out, $size) = @_;
while ($size > 0) {
my $want = $size < COPY_CHUNK ? $size : COPY_CHUNK;
my $buf = read_exact($in, $want, "BOOTKERNEL data");
print {$out} $buf or fail("write: $!");
$size -= length($buf);
}
}
@ARGV == 2 or usage();
my ($pnor, $output) = @ARGV;
open my $fh, "<:raw", $pnor or fail("$pnor: $!");
my $file_size = -s $fh;
defined $file_size or fail("$pnor: cannot stat: $!");
my $header = read_exact($fh, FFS_HEADER_SIZE, "PNOR FFS header");
my ($magic, $version, $table_blocks, $entry_size, $entry_count, $block_size,
$block_count, undef) = unpack $FFS_HEADER_FORMAT, $header;
fail("PNOR FFS magic not found") if $magic ne FFS_MAGIC;
fail("unsupported PNOR FFS version $version") if $version != FFS_VERSION;
fail("PNOR FFS entry size is too small")
if $entry_size < FFS_ENTRY_PREFIX_SIZE;
my $table_size = $table_blocks * $block_size;
my $entries_end = FFS_HEADER_SIZE + $entry_count * $entry_size;
my $image_size = $block_count * $block_size;
fail("PNOR FFS table extends past the file") if $table_size > $file_size;
fail("PNOR FFS entries extend past the table") if $entries_end > $table_size;
fail("PNOR FFS image size extends past the file") if $image_size > $file_size;
my ($bootkernel_offset, $bootkernel_size);
for my $i (0 .. $entry_count - 1) {
my $entry_offset = FFS_HEADER_SIZE + $i * $entry_size;
seek $fh, $entry_offset, SEEK_SET or fail("seek entry $i: $!");
my $entry = read_exact($fh, $entry_size, "PNOR FFS entry $i");
my ($name, $base, $blocks, undef, undef, undef, undef, $actual) =
unpack $FFS_ENTRY_PREFIX_FORMAT, $entry;
next if $name eq "";
my $offset = $base * $block_size;
my $size = $blocks * $block_size;
fail("PNOR FFS entry $name extends past the image")
if $offset + $size > $image_size;
fail("PNOR FFS entry $name actual size is too large")
if $actual > $size;
if ($name eq "BOOTKERNEL") {
($bootkernel_offset, $bootkernel_size) = ($offset, $size);
last;
}
}
defined $bootkernel_offset or fail("BOOTKERNEL partition not found");
my $dir = dirname($output);
make_path($dir) if $dir ne "." && !-d $dir;
my $tmp = "$output.tmp";
open my $out, ">:raw", $tmp or fail("$tmp: $!");
seek $fh, $bootkernel_offset, SEEK_SET or fail("seek BOOTKERNEL: $!");
copy_exact($fh, $out, $bootkernel_size);
close $out or fail("$tmp: $!");
rename $tmp, $output or do {
my $err = $!;
unlink $tmp;
fail("rename $tmp to $output: $err");
};
printf "wrote %s from %s\n", $output, $pnor;
printf "BOOTKERNEL offset=0x%x size=0x%x\n",
$bootkernel_offset, $bootkernel_size;
Hi Kirill, On 9/6/26 04:30, Kirill A. Korinsky wrote: > On Tue, 09 Jun 2026 04:19:45 +0200, > "Kirill A. Korinsky" <kirill@korins.ky> wrote: >> >> OpenBSD/powernv programs PTCR for LPID 0 with a partition >> table size exponent one smaller than QEMU's existing ISA v3.0 >> interpretation. Try QEMU's existing PATS interpretation first, >> then fall back to the OpenBSD LPID 0 form; nonzero LPIDs keep >> the old behaviour. >> >> The PSI model now exposes POWER9 IRQ level and pending status >> registers, and keeps both updated while delivering through the >> existing XIVE LSI source. This lets guests that select the >> POWER9 PSI LSI IRQ method continue to receive LPC interrupts. >> >> The blast radius is probably minimal: the partition table >> fallback is limited to bare metal LPID 0 after the original >> lookup fails, while the PSI change only touches POWER9 PSI >> state and reuses the existing delivery path. >> >> Signed-off-by: Kirill A. Korinsky <kirill@korins.ky> > > > It was tested as: > > qemu-system-ppc64 \ > -M powernv9 \ > -cpu power9 \ > -m 2G \ > -nographic \ > -kernel pnor.BOOTKERNEL \ > -device ich9-ahci,id=sata0,bus=pcie.0,addr=0x0 \ > -drive file=miniroot79.img,format=raw,if=none,id=bootdisk,snapshot=on \ > -device ide-hd,bus=sata0.0,unit=0,drive=bootdisk,bootindex=1 Cool. Could you add as a functional test in tests/functional/ppc64/? See examples around this directory. > > Where: > > 1. miniroot79.img from https://cdn.openbsd.org/pub/OpenBSD/snapshots/powerpc64/ > > 2. pnor.BOOTKERNEL was extracted from talos-ii-v2.10.pnor which I get from > https://wiki.raptorcs.com/wiki/File:Talos-ii-pnor-v2.10-bundle.tar by > extract-pnor-bootkernel.pl which I attached. >
On Tue, 09 Jun 2026 13:26:09 +0200,
Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> wrote:
>
> Hi Kirill,
>
> On 9/6/26 04:30, Kirill A. Korinsky wrote:
> > On Tue, 09 Jun 2026 04:19:45 +0200,
> > "Kirill A. Korinsky" <kirill@korins.ky> wrote:
> >>
> >> OpenBSD/powernv programs PTCR for LPID 0 with a partition
> >> table size exponent one smaller than QEMU's existing ISA v3.0
> >> interpretation. Try QEMU's existing PATS interpretation first,
> >> then fall back to the OpenBSD LPID 0 form; nonzero LPIDs keep
> >> the old behaviour.
> >>
> >> The PSI model now exposes POWER9 IRQ level and pending status
> >> registers, and keeps both updated while delivering through the
> >> existing XIVE LSI source. This lets guests that select the
> >> POWER9 PSI LSI IRQ method continue to receive LPC interrupts.
> >>
> >> The blast radius is probably minimal: the partition table
> >> fallback is limited to bare metal LPID 0 after the original
> >> lookup fails, while the PSI change only touches POWER9 PSI
> >> state and reuses the existing delivery path.
> >>
> >> Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
> >
> >
> > It was tested as:
> >
> > qemu-system-ppc64 \
> > -M powernv9 \
> > -cpu power9 \
> > -m 2G \
> > -nographic \
> > -kernel pnor.BOOTKERNEL \
> > -device ich9-ahci,id=sata0,bus=pcie.0,addr=0x0 \
> > -drive file=miniroot79.img,format=raw,if=none,id=bootdisk,snapshot=on \
> > -device ide-hd,bus=sata0.0,unit=0,drive=bootdisk,bootindex=1
>
> Cool. Could you add as a functional test in tests/functional/ppc64/? See
> examples around this directory.
>
Sure, here I added functional test and I confirm that all old one passed.
I host artifacts for test at my host because I have no idea where to host
them, but feel free to move to the right place.
Miniroot from 7.9 release which is available at:
https://cdn.openbsd.org/pub/OpenBSD/7.9/powerpc64/miniroot79.img
but in few years can be gone.
pnor.BOOTKERNEL from talos-ii-v2.10.pnor which was extracted by my script.
--
wbr, Kirill
From f3641d1db5e6a2ec78e89f333b5957064db9bdc6 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Tue, 9 Jun 2026 18:29:44 +0200
Subject: [PATCH] powernv: boot OpenBSD on POWER9
OpenBSD/powernv programs PTCR for LPID 0 with a partition
table size exponent one smaller than QEMU's existing ISA v3.0
interpretation. Try QEMU's existing PATS interpretation first,
then fall back to the OpenBSD LPID 0 form; nonzero LPIDs keep
the old behaviour.
The PSI model now exposes POWER9 IRQ level and pending status
registers, and keeps both updated while delivering through the
existing XIVE LSI source. This lets guests that select the
POWER9 PSI LSI IRQ method continue to receive LPC interrupts.
The blast radius is probably minimal: the partition table
fallback is limited to bare metal LPID 0 after the original
lookup fails, while the PSI change only touches POWER9 PSI
state and reuses the existing delivery path.
Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
---
hw/ppc/pnv_psi.c | 17 ++++-----
target/ppc/mmu-book3s-v3.c | 33 +++++++++++++---
tests/functional/ppc64/meson.build | 2 +
tests/functional/ppc64/test_openbsd.py | 52 ++++++++++++++++++++++++++
4 files changed, 90 insertions(+), 14 deletions(-)
create mode 100755 tests/functional/ppc64/test_openbsd.py
diff --git hw/ppc/pnv_psi.c hw/ppc/pnv_psi.c
index e8701c6100..941540df2d 100644
--- hw/ppc/pnv_psi.c
+++ hw/ppc/pnv_psi.c
@@ -688,6 +688,8 @@ static uint64_t pnv_psi_p9_mmio_read(void *opaque, hwaddr addr, unsigned size)
case PSIHB9_ESB_CI_BASE:
case PSIHB9_ESB_NOTIF_ADDR:
case PSIHB9_IVT_OFFSET:
+ case PSIHB9_IRQ_LEVEL:
+ case PSIHB9_IRQ_STAT:
val = psi->regs[reg];
break;
default:
@@ -817,18 +819,15 @@ static const MemoryRegionOps pnv_psi_p9_xscom_ops = {
static void pnv_psi_power9_set_irq(void *opaque, int irq, int state)
{
PnvPsi *psi = opaque;
- uint64_t irq_method = psi->regs[PSIHB_REG(PSIHB9_INTERRUPT_CONTROL)];
+ uint64_t irq_bit = PPC_BIT(irq);
- if (irq_method & PSIHB9_IRQ_METHOD) {
- qemu_log_mask(LOG_GUEST_ERROR, "PSI: LSI IRQ method no supported\n");
- return;
- }
-
- /* Update LSI levels */
+ /* Update LSI levels and pending status */
if (state) {
- psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] |= PPC_BIT(irq);
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] |= irq_bit;
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_STAT)] |= irq_bit;
} else {
- psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] &= ~PPC_BIT(irq);
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_LEVEL)] &= ~irq_bit;
+ psi->regs[PSIHB_REG(PSIHB9_IRQ_STAT)] &= ~irq_bit;
}
qemu_set_irq(psi->qirqs[irq], state);
diff --git target/ppc/mmu-book3s-v3.c target/ppc/mmu-book3s-v3.c
index 3865556310..4babe4c536 100644
--- target/ppc/mmu-book3s-v3.c
+++ target/ppc/mmu-book3s-v3.c
@@ -23,19 +23,21 @@
#include "mmu-hash64.h"
#include "mmu-book3s-v3.h"
-bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry)
+static bool ppc64_v3_get_pate_from_size(PowerPCCPU *cpu, target_ulong lpid,
+ ppc_v3_pate_t *entry,
+ uint64_t table_size)
{
uint64_t patb = cpu->env.spr[SPR_PTCR] & PTCR_PATB;
- uint64_t pats = cpu->env.spr[SPR_PTCR] & PTCR_PATS;
+ uint64_t entries;
/* Check if partition table is properly aligned */
- if (patb & MAKE_64BIT_MASK(0, pats + 12)) {
+ if (patb & (table_size - 1)) {
return false;
}
/* Calculate number of entries */
- pats = 1ull << (pats + 12 - 4);
- if (pats <= lpid) {
+ entries = table_size / sizeof(*entry);
+ if (entries <= lpid) {
return false;
}
@@ -45,3 +47,24 @@ bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry)
entry->dw1 = ldq_phys(CPU(cpu)->as, patb + 8);
return true;
}
+
+bool ppc64_v3_get_pate(PowerPCCPU *cpu, target_ulong lpid, ppc_v3_pate_t *entry)
+{
+ uint64_t pats = cpu->env.spr[SPR_PTCR] & PTCR_PATS;
+
+ /*
+ * Keep the existing ISA v3.0 PATS interpretation first. OpenBSD/powernv
+ * uses the PATSIZE value it writes to PTCR as one exponent smaller, and it
+ * only needs that interpretation for the bare metal LPID 0 table.
+ */
+ if (ppc64_v3_get_pate_from_size(cpu, lpid, entry, 1ull << (pats + 12))) {
+ return true;
+ }
+
+ if (lpid == 0) {
+ return ppc64_v3_get_pate_from_size(cpu, lpid, entry,
+ 1ull << (pats + 11));
+ }
+
+ return false;
+}
diff --git tests/functional/ppc64/meson.build tests/functional/ppc64/meson.build
index f0f8ab8f61..cb3c745624 100644
--- tests/functional/ppc64/meson.build
+++ tests/functional/ppc64/meson.build
@@ -4,6 +4,7 @@ test_ppc64_timeouts = {
'fadump' : 480,
'hv' : 1000,
'mac99' : 120,
+ 'openbsd' : 240,
'powernv' : 480,
'pseries' : 480,
'replay' : 210,
@@ -20,6 +21,7 @@ tests_ppc64_system_thorough = [
'fadump',
'hv',
'mac99',
+ 'openbsd',
'powernv',
'pseries',
'replay',
diff --git tests/functional/ppc64/test_openbsd.py tests/functional/ppc64/test_openbsd.py
new file mode 100755
index 0000000000..bdbef6bf82
--- /dev/null
+++ tests/functional/ppc64/test_openbsd.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+#
+# Test that OpenBSD boots on a ppc powernv machine and reaches the installer.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern
+
+
+class OpenBSDPowerNV(QemuSystemTest):
+
+ ASSET_MINIROOT = Asset(
+ 'https://kirill.korins.ky/pub/qemu-powerpc64-openbsd/miniroot79.img',
+ '7829e42b75d81cafd732038b9d63228b79c1f5828d8375872a4bb655e1d6b13c')
+
+ ASSET_BOOTKERNEL = Asset(
+ 'https://kirill.korins.ky/pub/qemu-powerpc64-openbsd/pnor.BOOTKERNEL',
+ '397ce43ce61910e1a2c4f13d301f957e61513a9ec5371bc3e87d3095411fae7b')
+
+ def test_powernv9_openbsd_installer(self):
+ self.set_machine('powernv9')
+ self.require_accelerator('tcg')
+
+ miniroot_path = self.ASSET_MINIROOT.fetch()
+ bootkernel_path = self.ASSET_BOOTKERNEL.fetch()
+
+ self.vm.set_console()
+ self.vm.add_args('-cpu', 'power9',
+ '-accel', 'tcg,thread=single',
+ '-smp', '1,cores=1,threads=1',
+ '-m', '2g',
+ '-kernel', bootkernel_path,
+ '-device',
+ 'ich9-ahci,id=sata0,bus=pcie.0,addr=0x0',
+ '-drive',
+ f'file={miniroot_path},format=raw,if=none,'
+ 'id=bootdisk,snapshot=on',
+ '-device',
+ 'ide-hd,bus=sata0.0,unit=0,drive=bootdisk,'
+ 'bootindex=1')
+ self.vm.launch()
+
+ wait_for_console_pattern(self, 'OpenBSD 7.9 (RAMDISK)', 'panic:')
+ wait_for_console_pattern(
+ self,
+ '(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?',
+ 'panic:')
+
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
--
2.54.0
© 2016 - 2026 Red Hat, Inc.