VirtualBox

source: vbox/trunk/include/VBox/platforms/vbox-armv8.h

Last change on this file was 105600, checked in by vboxsync, 6 weeks ago

VMM/ARM: Move the VBox ARMv8 platform descriptor from the end of the address space right after the UEFI region, bugref:10746

The original solution was to avoid as many hardcoded addresses as possible by placing the VBox region descriptor right at the end
of the guest physical address space. This turned out to be a bad idea because on M3 the host maximum physical address width and
guest maxmium physical address width differ so mapping the platform descriptor fails. Also saved states would not be portable if
a saved state is mvoed between systems with different physical address widths.
The solution is to move the platform descriptor right after the UEFI region and move the MMIO region, which grew from top to bottom
to start right after the base RAM region and grow upwards.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
Line 
1/** @file
2 * VirtualBox - ARMv8 virtual platform definitions shared by the device and firmware.
3 */
4
5/*
6 * Copyright (C) 2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_platforms_vbox_armv8_h
37#define VBOX_INCLUDED_platforms_vbox_armv8_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <iprt/assert.h>
43#include <iprt/types.h>
44#include <iprt/cdefs.h>
45
46
47/**
48 * The VBox region descriptor.
49 */
50typedef struct VBOXPLATFORMARMV8
51{
52 /** A magic value identifying the descriptor. */
53 uint32_t u32Magic;
54 /** Decriptor version. */
55 uint32_t u32Version;
56 /** Size of this descriptor. */
57 uint32_t cbDesc;
58 /** Some flags (MBZ for now). */
59 uint32_t fFlags;
60 /** Base RAM region start address. */
61 uint64_t u64PhysAddrRamBase;
62 /** Size of the base RAM region in bytes. */
63 uint64_t cbRamBase;
64 /** Offset to the beginning of the FDT from the start of this descriptor, 0 if not available. */
65 int64_t i64OffFdt;
66 /** Size of the FDT in bytes, 0 if not available. */
67 uint64_t cbFdt;
68 /** Offset to the RDSP/XSDP table for ACPI from the start of this descriptor, 0 if not available. */
69 int64_t i64OffAcpiXsdp;
70 /** Size of the RDSP/XSDP table, 0 if not available. */
71 uint64_t cbAcpiXsdp;
72 /** Offset to the start of the UEFI ROM region from the start of this descriptor, 0 if not available (doesn't make much sense though). */
73 int64_t i64OffUefiRom;
74 /** Size if the UEFI ROM region in bytes, 0 if not available. */
75 uint64_t cbUefiRom;
76 /** Offset to the start of the MMIO region from the start of this descriptor, 0 if not available (doesn't make much sense though). */
77 int64_t i64OffMmio;
78 /** Size of the MMIO region in bytes, 0 if not available. */
79 uint64_t cbMmio;
80 /** Offset to the start of the MMIO32 region from the start of this descriptor, 0 if not available. */
81 int64_t i64OffMmio32;
82 /** Size of the MMIO32 region in bytes, 0 if not available. */
83 uint64_t cbMmio32;
84 /** Padding to 64KiB. */
85 uint8_t abPadding[_64K - 4 * sizeof(uint32_t) - 12 * sizeof(uint64_t)];
86} VBOXPLATFORMARMV8;
87AssertCompileSize(VBOXPLATFORMARMV8, _64K);
88typedef VBOXPLATFORMARMV8 *PVBOXPLATFORMARMV8;
89typedef const VBOXPLATFORMARMV8 *PCVBOXPLATFORMARMV8;
90
91/** Magic identifying the VirtualBox descriptor. */
92#define VBOXPLATFORMARMV8_MAGIC RT_MAKE_U32_FROM_U8('V', '8', 'O', 'X')
93/** Current version of the descriptor. */
94#define VBOXPLATFORMARMV8_VERSION 0x1
95
96/** Physical address of the VBox platform descriptor (128MiB). */
97#define VBOXPLATFORMARMV8_PHYS_ADDR UINT64_C(0x08000000)
98
99#endif /* !VBOX_INCLUDED_platforms_vbox_armv8_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette