Path: blob/master/include/xen/interface/hvm/start_info.h
26298 views
/* SPDX-License-Identifier: MIT */1/*2* Copyright (c) 2016, Citrix Systems, Inc.3*/45#ifndef __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__6#define __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__78/*9* Start of day structure passed to PVH guests and to HVM guests in %ebx.10*11* NOTE: nothing will be loaded at physical address 0, so a 0 value in any12* of the address fields should be treated as not present.13*14* 0 +----------------+15* | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE16* | | ("xEn3" with the 0x80 bit of the "E" set).17* 4 +----------------+18* | version | Version of this structure. Current version is 1. New19* | | versions are guaranteed to be backwards-compatible.20* 8 +----------------+21* | flags | SIF_xxx flags.22* 12 +----------------+23* | nr_modules | Number of modules passed to the kernel.24* 16 +----------------+25* | modlist_paddr | Physical address of an array of modules26* | | (layout of the structure below).27* 24 +----------------+28* | cmdline_paddr | Physical address of the command line,29* | | a zero-terminated ASCII string.30* 32 +----------------+31* | rsdp_paddr | Physical address of the RSDP ACPI data structure.32* 40 +----------------+33* | memmap_paddr | Physical address of the (optional) memory map. Only34* | | present in version 1 and newer of the structure.35* 48 +----------------+36* | memmap_entries | Number of entries in the memory map table. Zero37* | | if there is no memory map being provided. Only38* | | present in version 1 and newer of the structure.39* 52 +----------------+40* | reserved | Version 1 and newer only.41* 56 +----------------+42*43* The layout of each entry in the module structure is the following:44*45* 0 +----------------+46* | paddr | Physical address of the module.47* 8 +----------------+48* | size | Size of the module in bytes.49* 16 +----------------+50* | cmdline_paddr | Physical address of the command line,51* | | a zero-terminated ASCII string.52* 24 +----------------+53* | reserved |54* 32 +----------------+55*56* The layout of each entry in the memory map table is as follows:57*58* 0 +----------------+59* | addr | Base address60* 8 +----------------+61* | size | Size of mapping in bytes62* 16 +----------------+63* | type | Type of mapping as defined between the hypervisor64* | | and guest. See XEN_HVM_MEMMAP_TYPE_* values below.65* 20 +----------------|66* | reserved |67* 24 +----------------+68*69* The address and sizes are always a 64bit little endian unsigned integer.70*71* NB: Xen on x86 will always try to place all the data below the 4GiB72* boundary.73*74* Version numbers of the hvm_start_info structure have evolved like this:75*76* Version 0: Initial implementation.77*78* Version 1: Added the memmap_paddr/memmap_entries fields (plus 4 bytes of79* padding) to the end of the hvm_start_info struct. These new80* fields can be used to pass a memory map to the guest. The81* memory map is optional and so guests that understand version 182* of the structure must check that memmap_entries is non-zero83* before trying to read the memory map.84*/85#define XEN_HVM_START_MAGIC_VALUE 0x336ec5788687/*88* The values used in the type field of the memory map table entries are89* defined below and match the Address Range Types as defined in the "System90* Address Map Interfaces" section of the ACPI Specification. Please refer to91* section 15 in version 6.2 of the ACPI spec: http://uefi.org/specifications92*/93#define XEN_HVM_MEMMAP_TYPE_RAM 194#define XEN_HVM_MEMMAP_TYPE_RESERVED 295#define XEN_HVM_MEMMAP_TYPE_ACPI 396#define XEN_HVM_MEMMAP_TYPE_NVS 497#define XEN_HVM_MEMMAP_TYPE_UNUSABLE 598#define XEN_HVM_MEMMAP_TYPE_DISABLED 699#define XEN_HVM_MEMMAP_TYPE_PMEM 7100101/*102* C representation of the x86/HVM start info layout.103*104* The canonical definition of this layout is above, this is just a way to105* represent the layout described there using C types.106*/107struct hvm_start_info {108uint32_t magic; /* Contains the magic value 0x336ec578 */109/* ("xEn3" with the 0x80 bit of the "E" set).*/110uint32_t version; /* Version of this structure. */111uint32_t flags; /* SIF_xxx flags. */112uint32_t nr_modules; /* Number of modules passed to the kernel. */113uint64_t modlist_paddr; /* Physical address of an array of */114/* hvm_modlist_entry. */115uint64_t cmdline_paddr; /* Physical address of the command line. */116uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */117/* structure. */118/* All following fields only present in version 1 and newer */119uint64_t memmap_paddr; /* Physical address of an array of */120/* hvm_memmap_table_entry. */121uint32_t memmap_entries; /* Number of entries in the memmap table. */122/* Value will be zero if there is no memory */123/* map being provided. */124uint32_t reserved; /* Must be zero. */125};126127struct hvm_modlist_entry {128uint64_t paddr; /* Physical address of the module. */129uint64_t size; /* Size of the module in bytes. */130uint64_t cmdline_paddr; /* Physical address of the command line. */131uint64_t reserved;132};133134struct hvm_memmap_table_entry {135uint64_t addr; /* Base address of the memory region */136uint64_t size; /* Size of the memory region in bytes */137uint32_t type; /* Mapping type */138uint32_t reserved; /* Must be zero for Version 1. */139};140141#endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */142143144