1 /** @file
2   Expose the address(es) of the ACPI RSD PTR table(s) in a MB-aligned structure
3   to the hypervisor.
4 
5   The hypervisor locates the MB-aligned structure based on the signature GUID
6   that is at offset 0 in the structure. Once the RSD PTR address(es) are
7   retrieved, the hypervisor may perform various ACPI checks.
8 
9   This feature is a development aid, for supporting ACPI table unit tests in
10   hypervisors. Do not enable in production builds.
11 
12   Copyright (C) 2019, Red Hat, Inc.
13 
14   This program and the accompanying materials are licensed and made available
15   under the terms and conditions of the BSD License that accompanies this
16   distribution. The full text of the license may be found at
17   <http://opensource.org/licenses/bsd-license.php>.
18 
19   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
20   WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 **/
22 
23 #ifndef __BIOS_TABLES_TEST_H__
24 #define __BIOS_TABLES_TEST_H__
25 
26 #include <Uefi/UefiBaseType.h>
27 
28 #define BIOS_TABLES_TEST_GUID                          \
29   {                                                    \
30     0x5478594e,                                        \
31     0xdfcb,                                            \
32     0x425f,                                            \
33     { 0x8e, 0x42, 0xc8, 0xaf, 0xf8, 0x8a, 0x88, 0x7a } \
34   }
35 
36 extern EFI_GUID gBiosTablesTestGuid;
37 
38 //
39 // The following structure must be allocated in Boot Services Data type memory,
40 // aligned at a 1MB boundary.
41 //
42 #pragma pack (1)
43 typedef struct {
44   //
45   // The signature GUID is written to the MB-aligned structure from
46   // gBiosTablesTestGuid, but with all bits inverted. That's the actual GUID
47   // value that the hypervisor should look for at each MB boundary, looping
48   // over all guest RAM pages with that alignment, until a match is found. The
49   // bit-flipping occurs in order not to store the actual GUID in any UEFI
50   // executable, which might confuse guest memory analysis. Note that EFI_GUID
51   // has little endian representation.
52   //
53   EFI_GUID             InverseSignatureGuid;
54   //
55   // The Rsdp10 and Rsdp20 fields may be read when the signature GUID matches.
56   // Rsdp10 is the guest-physical address of the ACPI 1.0 specification RSD PTR
57   // table, in 8-byte little endian representation. Rsdp20 is the same, for the
58   // ACPI 2.0 or later specification RSD PTR table. Each of these fields may be
59   // zero (independently of the other) if the UEFI System Table does not
60   // provide the corresponding UEFI Configuration Table.
61   //
62   EFI_PHYSICAL_ADDRESS Rsdp10;
63   EFI_PHYSICAL_ADDRESS Rsdp20;
64 } BIOS_TABLES_TEST;
65 #pragma pack ()
66 
67 #endif // __BIOS_TABLES_TEST_H__
68