From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4878E606A31A for ; Wed, 2 Dec 2026 13:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=dJNizsKq Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYkLF-00032Y-4k; Wed, 02 Dec 2026 08:25:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYkLD-00031l-Bi; Wed, 02 Dec 2026 08:25:47 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYkLA-0005ET-Mb; Wed, 02 Dec 2026 08:25:47 -0500 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2AM6c7233401; Wed, 2 Dec 2026 13:25:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=yFSaAJ QKvP3e3NCK3VRtT9kM6xTT2HY/8WlNATo7agE=; b=dJNizsKq7xyuGni5TZc0he tE0DefWF4nupSb2TUm+coRTWhTbCN5faPQTp+IEM9QN0pOQOEoUx02ws4/YL2bLZ CBdZsZeT6ed733SzQO/IEz8aZbHImj8yPkgmcHKwHpVtmIEzKaLq/iER5mFTtHMz H3KUwsd3X8OGijHxhR9iAeWHNWYD4at6qtPZOPAnx1sW+ayUuDtpWg5YX32By8kS yFszNCc642QjjTpAJBPMio+KDOaPNEjBLM7wkeAzZZId1sG10Qn22+OmKcXhkHeJ xf0AXhuvs8ejQ/qY3C+rWLsg3T3ptJ7kLnqjBVakWHO8NDTjFkyeJA8xG1gGS8ZQ == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pku9qyv-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 13:25:27 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2BRceL2046264; Wed, 2 Dec 2026 13:25:27 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4jaajs9wvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 13:25:27 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B2DPLge27460256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Dec 2026 13:25:21 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7966520043; Wed, 2 Dec 2026 13:25:21 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FEC720040; Wed, 2 Dec 2026 13:25:17 +0000 (GMT) Received: from [9.124.212.61] (unknown [9.124.212.61]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 2 Dec 2026 13:25:17 +0000 (GMT) Message-ID: <68e0cd3b-95e7-4b04-b941-bbfb213aca8e@linux.ibm.com> Date: Wed, 2 Dec 2026 18:55:16 +0530 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 1/8] ppc/spapr: add PReP boot partition detection To: uverma@linux.ibm.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, aik@amd.com, avnish@linux.ibm.com Cc: pbonzini@redhat.com, th.huth@posteo.eu, sbhat@linux.ibm.com, harshpb@linux.ibm.com, amachhiw@linux.ibm.com, rathc@linux.ibm.com, balaton@eik.bme.hu, philmd@linaro.org, npiggin@gmail.com, marcandre.lureau@redhat.com, fam@euphon.net, alex.bennee@linaro.org, richard.henderson@linaro.org References: <20261002052605.605858-1-uverma@linux.ibm.com> <20261002052605.605858-2-uverma@linux.ibm.com> Content-Language: en-US From: Narayana Murty N In-Reply-To: <20261002052605.605858-2-uverma@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=KZZHIgYD c=1 sm=1 tr=0 ts=6b101c48 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=nFPWtzND9mYFgc9QIGkA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA1MiBTYWx0ZWRfX8avlkwp2sWVc C8pNFPOcuy+9msnSYBw5jre0W72Qsb++hrJaZb/ImNugpxbXIxpwXf3kkofg9SECi/qN9Nj3s/M DdjsHxZN6x9+j8VxD01C2svf2I7KZoe4i34iLFQxbHegOixPUehKxfEk+a40jgCEN6HBMVCvDEM OshPYoGIv2/3s3mIWB1i4JSZbKHMfUaPPlDF7tYlRrZQGr4hkjeMCdljYJK6jEg8uxq09Oi9Ql1 pqgVOq7p3nFoEfZzDHGBpE7EKayXiIiMIfqjJXmQ0lZXyygNy0Rl+RnbxZgo6xUIAQYDmGXAXae N+9dNcWEaxaw+OlvTviD+8v6nUq7uXY3twkYhjpoYvnB9AC+7d6ViI2nIlx5oAdrsL0l8dds0a3 nfvScsBGCum6YkSTq1HZR4UpZFp2guOdxv/MB5/L/yqr4//JH24QsLpPcoUW2HKkI+ztBqjF0Na puZNQjkCe7dKrzXOUug== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA1MiBTYWx0ZWRfXzRDcLIqiaaJT oR9EDbuz2kuVrBhht6FjXpMKAU+JCA2Tqjf4tlwctI8Za/m8MZ/6OkiJriTsAdEB3WaaYPKRN+m YhQxT6vq5oP5I4NWYmglYSOpuxX2a5c= X-Proofpoint-ORIG-GUID: AfC2-SyjSFZeq_Y8hpiLLAjmqCxtOn-O X-Proofpoint-GUID: IZgQnkBqR273VIKgEWoTfyoWLpZBN3N5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1011 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020052 Received-SPF: pass client-ip=148.163.158.5; envelope-from=nnmlinux@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Utkarsh, On 02/10/26 10:55 AM, uverma@linux.ibm.com wrote: > From: Utkarsh Verma > > Add spapr_vof_partition.c which implements basic MBR and GPT partition > table scanning to locate the PReP boot partition during VOF enabled boot. > > AI-used-for: code > Signed-off-by: Utkarsh Verma > --- > Chaneglog: > v2: > - Added CRC validations for GPT. > - Added bounds checking GPT header size. > - Added new GPT_MAX_PARTITION to cap max partitions at 128 > - Added bounds checking for the partition entry array against disk size > for GPT. > - Switched GPT entry to use a fixed-size buffer instead of g_malloc per > entry. > - Added validation for first_lba and last_lba in GPT before returning > size. > - Added validation for MBR PReP partition entries(start_lba/num_sectors) > --- > hw/ppc/meson.build | 5 +- > hw/ppc/spapr_vof_partition.c | 272 +++++++++++++++++++++++++++++++++++ > include/hw/ppc/spapr_vof.h | 14 ++ > 3 files changed, 290 insertions(+), 1 deletion(-) > create mode 100644 hw/ppc/spapr_vof_partition.c > create mode 100644 include/hw/ppc/spapr_vof.h > > diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build > index 37aa535db2..68a5d2622f 100644 > --- a/hw/ppc/meson.build > +++ b/hw/ppc/meson.build > @@ -93,6 +93,9 @@ ppc_ss.add(when: 'CONFIG_AMIGAONE', if_true: files('amigaone.c')) > ppc_ss.add(when: 'CONFIG_PEGASOS', if_true: files('pegasos.c')) > > ppc_ss.add(when: 'CONFIG_VOF', if_true: files('vof.c')) > -ppc_ss.add(when: ['CONFIG_VOF', 'CONFIG_PSERIES'], if_true: files('spapr_vof.c')) > +ppc_ss.add(when: ['CONFIG_VOF', 'CONFIG_PSERIES'], if_true: files( > + 'spapr_vof.c', > + 'spapr_vof_partition.c', > +)) > > hw_arch += {'ppc': ppc_ss} > diff --git a/hw/ppc/spapr_vof_partition.c b/hw/ppc/spapr_vof_partition.c > new file mode 100644 > index 0000000000..b495a53d9d > --- /dev/null > +++ b/hw/ppc/spapr_vof_partition.c > @@ -0,0 +1,272 @@ > +/* > + * QEMU PowerPC sPAPR VOF Partition Table Support. > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + * > + * This implements partition table detection for VOF boot, > + * supporting MBR and GPT partition tables with focus on PReP boot partition. > + */ > + > +#include "qemu/osdep.h" > +#include "qemu/bswap.h" > +#include "qemu/error-report.h" > +#include "system/block-backend-io.h" > +#include "hw/ppc/spapr_vof.h" > +#include > + > +#define SECTOR_SIZE 512 > +#define MBR_PARTITION_ENTRY_SIZE 16 > +#define MBR_PARTITION_TABLE_OFFSET 446 > +#define MBR_NUM_PARTITIONS 4 > + > +#define PARTITION_TYPE_PREP 0x41 /* PReP Boot partition */ > +#define PARTITION_TYPE_GPT 0xEE > + > +#define GPT_MAX_PARTITION 128 > +#define GPT_SIGNATURE "EFI PART" > +#define GPT_SIGNATURE_SIZE 8 > + > +/* PReP Boot: 9E1A2D38-C612-4316-AA26-8B49521E5A8B */ > +static const uint8_t GUID_PREP_BOOT[16] = { > + 0x38, 0x2D, 0x1A, 0x9E, 0x12, 0xC6, 0x16, 0x43, > + 0xAA, 0x26, 0x8B, 0x49, 0x52, 0x1E, 0x5A, 0x8B > +}; > + > +typedef struct MBRPartitionEntry { > + uint8_t boot_flag; > + uint8_t start_chs[3]; > + uint8_t type; > + uint8_t end_chs[3]; > + uint32_t start_lba; > + uint32_t num_sectors; > +} QEMU_PACKED MBRPartitionEntry; > + > +typedef struct GPTHeader { > + char signature[8]; > + uint32_t revision; > + uint32_t header_size; > + uint32_t header_crc32; > + uint32_t reserved; > + uint64_t current_lba; > + uint64_t backup_lba; > + uint64_t first_usable_lba; > + uint64_t last_usable_lba; > + uint8_t disk_guid[16]; > + uint64_t partition_entries_lba; > + uint32_t num_partition_entries; > + uint32_t partition_entry_size; > + uint32_t partition_array_crc32; > +} QEMU_PACKED GPTHeader; > + > +typedef struct GPTPartitionEntry { > + uint8_t type_guid[16]; > + uint8_t partition_guid[16]; > + uint64_t first_lba; > + uint64_t last_lba; > + uint64_t attributes; > + uint16_t name[36]; > +} QEMU_PACKED GPTPartitionEntry; > + > +static bool find_prep_partition_gpt(BlockBackend *blk, > + uint64_t *offset, uint64_t *size) > +{ > + uint8_t lba1[SECTOR_SIZE]; > + GPTHeader *header; > + uint32_t header_size; > + GPTHeader header_copy; > + uint32_t crc_stored; > + uint32_t crc_computed; > + uint64_t entries_lba; > + uint32_t num_entries; > + uint32_t entry_size; > + int64_t disk_size; > + uint64_t disk_last_lba; > + uint32_t array_bytes; > + g_autofree uint8_t *array_buf = NULL; > + uint8_t buf[sizeof(GPTPartitionEntry)]; > + GPTPartitionEntry *current_entry; > + uint32_t i; > + int ret; > + > + ret = blk_pread(blk, SECTOR_SIZE, SECTOR_SIZE, lba1, 0); > + if (ret < 0) { > + warn_report("GPT: failed to read LBA1 (ret=%d)", ret); > + return false; > + } > + > + header = (GPTHeader *)lba1; > + > + /* EFI PART signature validation */ > + if (memcmp(header->signature, GPT_SIGNATURE, GPT_SIGNATURE_SIZE) != 0) { > + return false; > + } > + > + /* GPT header size validation */ > + header_size = le32_to_cpu(header->header_size); > + if (header_size < sizeof(GPTHeader) || header_size > SECTOR_SIZE) { > + warn_report("GPT: invalid header size %u (expected %zu..%u)", > + header_size, sizeof(GPTHeader), SECTOR_SIZE); > + return false; > + } > + > + /* CRC32 validation of GPT header */ > + header_copy = *header; > + header_copy.header_crc32 = 0; > + crc_stored = le32_to_cpu(header->header_crc32); > + crc_computed = crc32(0, (uint8_t *)&header_copy, header_size); header_size can be larger than sizeof(GPTHeader), but header_copy is only sizeof(GPTHeader) bytes. Wouldn't this result in an out-of-bounds stack read during CRC calculation? Could we use the existing sector buffer for CRC validation after clearing the header_crc32 field? > + if (crc_computed != crc_stored) { > + warn_report("GPT: header CRC32 mismatch (computed=0x%08x " > + "stored=0x%08x)", crc_computed, crc_stored); > + return false; > + } > + > + entries_lba = le64_to_cpu(header->partition_entries_lba); > + num_entries = le32_to_cpu(header->num_partition_entries); > + entry_size = le32_to_cpu(header->partition_entry_size); > + > + /* > + * Usually the PReP is the first partition and most systems commonly have > + * 128 max partitions, so cap the scan at 128 > + */ > + if (num_entries > GPT_MAX_PARTITION) { > + warn_report("GPT: num_partition_entries %u exceeds %u, " > + "scanning only the first %u partitions", num_entries, > + GPT_MAX_PARTITION, GPT_MAX_PARTITION); > + num_entries = GPT_MAX_PARTITION; > + } The partition array CRC covers the entire partition entry array specified in the GPT header. By truncating num_entries here, wouldn't we reject an otherwise valid GPT containing more than GPT_MAX_PARTITION entries due to a CRC mismatch? Should we keep the original entry count for CRC validation and apply this limit only when scanning for the PReP partition? > + > + if (num_entries == 0) { > + warn_report("GPT: partition table has no entries"); > + return false; > + } > + > + if (entry_size < sizeof(GPTPartitionEntry)) { > + warn_report("GPT: partition entry size %u is too small", entry_size); > + return false; > + } Should we also validate the upper bound and permitted alignment of entry_size? Both operands are uint32_t values derived from the disk image. The preceding disk bounds check does not guarantee that their product fits in uint32_t. Could we use checked arithmetic and impose a reasonable allocation limit here? Alternatively, calculating the CRC incrementally would avoid allocating the entire partition entry array. > + > + disk_size = blk_getlength(blk); > + if (disk_size <= 0) { > + warn_report("GPT: failed to get disk size"); > + return false; > + } > + disk_last_lba = (uint64_t)disk_size / SECTOR_SIZE - 1; > + > + if (entries_lba >= UINT64_MAX / SECTOR_SIZE || > + entries_lba >= (uint64_t)disk_size / SECTOR_SIZE || > + num_entries > ((uint64_t)disk_size - entries_lba * SECTOR_SIZE) > + / entry_size) { > + warn_report("GPT: partition entry array extends beyond disk"); > + return false; > + } > + > + /* CRC32 validation of GPT partition array */ > + array_bytes = num_entries * entry_size; > + array_buf = g_malloc(array_bytes); > + crc_stored = le32_to_cpu(header->partition_array_crc32); > + > + ret = blk_pread(blk, entries_lba * SECTOR_SIZE, array_bytes, array_buf, 0); > + if (ret < 0) { > + warn_report("GPT: failed to read partition entry array for CRC " > + "(ret=%d)", ret); > + return false; > + } > + crc_computed = crc32(0, array_buf, array_bytes); > + if (crc_computed != crc_stored) { > + warn_report("GPT: partition array CRC32 mismatch (computed=0x%08x " > + "stored=0x%08x)", crc_computed, crc_stored); > + return false; > + } > + > + for (i = 0; i < num_entries; i++) { > + uint64_t current_entry_offset = entries_lba * SECTOR_SIZE + > + (uint64_t)i * entry_size; > + ret = blk_pread(blk, current_entry_offset, sizeof(buf), buf, 0); > + if (ret < 0) { > + warn_report("GPT: failed to read partition entry %u (ret=%d)", > + i, ret); > + return false; > + } > + > + current_entry = (GPTPartitionEntry *)buf; > + if (memcmp(current_entry->type_guid, GUID_PREP_BOOT, > + sizeof(GUID_PREP_BOOT)) == 0) { > + uint64_t first_lba = le64_to_cpu(current_entry->first_lba); > + uint64_t last_lba = le64_to_cpu(current_entry->last_lba); > + > + if (last_lba < first_lba) { > + warn_report("GPT: PReP entry has " > + "last_lba (%"PRIu64") < first_lba (%"PRIu64"), " > + "skipping", last_lba, first_lba); > + continue; > + } > + if (first_lba > disk_last_lba || last_lba > disk_last_lba) { > + warn_report("GPT: PReP entry LBA range [%"PRIu64", %"PRIu64"] " > + "exceeds disk (%"PRIu64"), skipping", > + first_lba, last_lba, disk_last_lba); > + continue; > + } > + > + *offset = first_lba * SECTOR_SIZE; > + *size = (last_lba - first_lba + 1) * SECTOR_SIZE; > + return true; Should we also validate the partition against first_usable_lba and last_usable_lba from the GPT header, rather than only checking against the disk boundaries? Thanks, Narayana Murty. > + } > + } > + return false; > +} > + > +static bool find_prep_partition_mbr(BlockBackend *blk, > + uint64_t *offset, uint64_t *size) > +{ > + uint8_t mbr[SECTOR_SIZE]; > + MBRPartitionEntry *entry; > + int ret; > + int i; > + > + ret = blk_pread(blk, 0, SECTOR_SIZE, mbr, 0); > + if (ret < 0) { > + warn_report("MBR: failed to read MBR sector (ret=%d)", ret); > + return false; > + } > + > + /* MBR boot signature: byte 510 = 0x55, byte 511 = 0xAA */ > + if (mbr[510] != 0x55 || mbr[511] != 0xAA) { > + warn_report("MBR: invalid boot signature (0x%02x 0x%02x), " > + "expected 0x55 0xAA", mbr[510], mbr[511]); > + return false; > + } > + > + for (i = 0; i < MBR_NUM_PARTITIONS; i++) { > + entry = (MBRPartitionEntry *)&mbr[MBR_PARTITION_TABLE_OFFSET + > + i * MBR_PARTITION_ENTRY_SIZE]; > + > + if (entry->type == PARTITION_TYPE_GPT) { > + return find_prep_partition_gpt(blk, offset, size); > + } > + > + if (entry->type == PARTITION_TYPE_PREP) { > + uint32_t start_lba = le32_to_cpu(entry->start_lba); > + uint32_t num_sectors = le32_to_cpu(entry->num_sectors); > + > + if (start_lba == 0 || num_sectors == 0) { > + warn_report("MBR: PReP partition entry %d has invalid " > + "start_lba=%u or num_sectors=%u, skipping", > + i, start_lba, num_sectors); > + continue; > + } > + *offset = (uint64_t)start_lba * SECTOR_SIZE; > + *size = (uint64_t)num_sectors * SECTOR_SIZE; > + return true; > + } > + } > + return false; > +} > + > +bool spapr_vof_find_prep_partition(BlockBackend *blk, > + uint64_t *offset, uint64_t *size) > +{ > + if (!blk) { > + return false; > + } > + return find_prep_partition_mbr(blk, offset, size); > +} > diff --git a/include/hw/ppc/spapr_vof.h b/include/hw/ppc/spapr_vof.h > new file mode 100644 > index 0000000000..08787d2aeb > --- /dev/null > +++ b/include/hw/ppc/spapr_vof.h > @@ -0,0 +1,14 @@ > +/* > + * QEMU PowerPC sPAPR VOF Support > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > +#ifndef HW_SPAPR_VOF_H > +#define HW_SPAPR_VOF_H > + > +typedef struct BlockBackend BlockBackend; > + > +bool spapr_vof_find_prep_partition(BlockBackend *blk, > + uint64_t *offset, uint64_t *size); > + > +#endif /* HW_SPAPR_VOF_H */