Wei Liu
2013-Nov-26 19:25 UTC
[PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo
EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It must match the definition on Xen side. XenInfo is extended to include necessary bits as well. Currently only E820 map is in use. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wei Liu <wei.liu2@citrix.com> --- OvmfPkg/Include/Guid/XenInfo.h | 7 +++++++ OvmfPkg/PlatformPei/Xen.h | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 OvmfPkg/PlatformPei/Xen.h diff --git a/OvmfPkg/Include/Guid/XenInfo.h b/OvmfPkg/Include/Guid/XenInfo.h index d512b0b..6146080 100644 --- a/OvmfPkg/Include/Guid/XenInfo.h +++ b/OvmfPkg/Include/Guid/XenInfo.h @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef __XEN_INFO_H__ #define __XEN_INFO_H__ +#include <Uefi/UefiBaseType.h> + #define EFI_XEN_INFO_GUID \ { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } @@ -35,6 +37,11 @@ typedef struct { /// Hypervisor minor version. /// UINT16 VersionMinor; + /// + /// E820 map + /// + EFI_PHYSICAL_ADDRESS E820; + UINT32 E820EntriesCount; } EFI_XEN_INFO; extern EFI_GUID gEfiXenInfoGuid; diff --git a/OvmfPkg/PlatformPei/Xen.h b/OvmfPkg/PlatformPei/Xen.h new file mode 100644 index 0000000..1885ede --- /dev/null +++ b/OvmfPkg/PlatformPei/Xen.h @@ -0,0 +1,44 @@ +/** @file + Ovmf info structure passed by Xen + +Copyright (c) 2013, Wei Liu <wei.liu2@citrix.com> +This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __XEN_H__ +#define __XEN_H__ + +#include <Uefi/UefiBaseType.h> + +// Physical address of OVMF info +#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000 + +// This structure must match the definition on Xen side +#pragma pack(1) +typedef struct { + CHAR8 Signature[14]; // XenHVMOVMF\0 + UINT8 Length; // Length of this structure + UINT8 Checksum; // Set such that the sum over bytes 0..length == 0 + // + // Physical address of an array of TablesCount elements. + // + // Each element contains the physical address of a BIOS table. + // + EFI_PHYSICAL_ADDRESS Tables; + UINT32 TablesCount; + // + // Physical address of the E820 table, contains E820EntriesCount entries. + // + EFI_PHYSICAL_ADDRESS E820; + UINT32 E820EntriesCount; +} EFI_XEN_OVMF_INFO; +#pragma pack() + +#endif /* __XEN_H__ */ -- 1.7.10.4
Jordan Justen
2013-Nov-28 01:09 UTC
Re: [PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo
On Tue, Nov 26, 2013 at 11:25 AM, Wei Liu <wei.liu2@citrix.com> wrote:> EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It > must match the definition on Xen side. > > XenInfo is extended to include necessary bits as well. Currently only E820 > map is in use. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wei Liu <wei.liu2@citrix.com> > --- > OvmfPkg/Include/Guid/XenInfo.h | 7 +++++++ > OvmfPkg/PlatformPei/Xen.h | 44 ++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 51 insertions(+) > create mode 100644 OvmfPkg/PlatformPei/Xen.h > > diff --git a/OvmfPkg/Include/Guid/XenInfo.h b/OvmfPkg/Include/Guid/XenInfo.h > index d512b0b..6146080 100644 > --- a/OvmfPkg/Include/Guid/XenInfo.h > +++ b/OvmfPkg/Include/Guid/XenInfo.h > @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > #ifndef __XEN_INFO_H__ > #define __XEN_INFO_H__ > > +#include <Uefi/UefiBaseType.h> > +I don''t think we want this #include in Guid/XenInfo.h. Can you make sure that the locations that #include Guid/XenInfo.h include PiPei.h, PiDxe.h, or Uefi.h before Guid/XenInfo.h?> #define EFI_XEN_INFO_GUID \ > { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } > > @@ -35,6 +37,11 @@ typedef struct { > /// Hypervisor minor version. > /// > UINT16 VersionMinor; > + /// > + /// E820 map > + /// > + EFI_PHYSICAL_ADDRESS E820; > + UINT32 E820EntriesCount;Can you add this chunk into the next patch which initializes E820/E820EntriesCount? With those 2 changes, patches 3 & 4 are Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>> } EFI_XEN_INFO; > > extern EFI_GUID gEfiXenInfoGuid; > diff --git a/OvmfPkg/PlatformPei/Xen.h b/OvmfPkg/PlatformPei/Xen.h > new file mode 100644 > index 0000000..1885ede > --- /dev/null > +++ b/OvmfPkg/PlatformPei/Xen.h > @@ -0,0 +1,44 @@ > +/** @file > + Ovmf info structure passed by Xen > + > +Copyright (c) 2013, Wei Liu <wei.liu2@citrix.com> > +This program and the accompanying materials are licensed and made available under > +the terms and conditions of the BSD License that accompanies this distribution. > +The full text of the license may be found at > +opensource.org/licenses/bsd-license.php. > + > +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > + > +**/ > + > +#ifndef __XEN_H__ > +#define __XEN_H__ > + > +#include <Uefi/UefiBaseType.h> > + > +// Physical address of OVMF info > +#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000 > + > +// This structure must match the definition on Xen side > +#pragma pack(1) > +typedef struct { > + CHAR8 Signature[14]; // XenHVMOVMF\0 > + UINT8 Length; // Length of this structure > + UINT8 Checksum; // Set such that the sum over bytes 0..length == 0 > + // > + // Physical address of an array of TablesCount elements. > + // > + // Each element contains the physical address of a BIOS table. > + // > + EFI_PHYSICAL_ADDRESS Tables; > + UINT32 TablesCount; > + // > + // Physical address of the E820 table, contains E820EntriesCount entries. > + // > + EFI_PHYSICAL_ADDRESS E820; > + UINT32 E820EntriesCount; > +} EFI_XEN_OVMF_INFO; > +#pragma pack() > + > +#endif /* __XEN_H__ */ > -- > 1.7.10.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > lists.xen.org/xen-devel
Jordan Justen
2013-Nov-28 01:36 UTC
Re: [PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo
On Wed, Nov 27, 2013 at 5:09 PM, Jordan Justen <jljusten@gmail.com> wrote:> On Tue, Nov 26, 2013 at 11:25 AM, Wei Liu <wei.liu2@citrix.com> wrote: >> EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It >> must match the definition on Xen side. >> >> XenInfo is extended to include necessary bits as well. Currently only E820 >> map is in use. >> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Wei Liu <wei.liu2@citrix.com> >> --- >> OvmfPkg/Include/Guid/XenInfo.h | 7 +++++++ >> OvmfPkg/PlatformPei/Xen.h | 44 ++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 51 insertions(+) >> create mode 100644 OvmfPkg/PlatformPei/Xen.h >> >> diff --git a/OvmfPkg/Include/Guid/XenInfo.h b/OvmfPkg/Include/Guid/XenInfo.h >> index d512b0b..6146080 100644 >> --- a/OvmfPkg/Include/Guid/XenInfo.h >> +++ b/OvmfPkg/Include/Guid/XenInfo.h >> @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. >> #ifndef __XEN_INFO_H__ >> #define __XEN_INFO_H__ >> >> +#include <Uefi/UefiBaseType.h> >> + > > I don''t think we want this #include in Guid/XenInfo.h. > > Can you make sure that the locations that #include Guid/XenInfo.h > include PiPei.h, PiDxe.h, or Uefi.h before Guid/XenInfo.h? > >> #define EFI_XEN_INFO_GUID \ >> { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } >> >> @@ -35,6 +37,11 @@ typedef struct { >> /// Hypervisor minor version. >> /// >> UINT16 VersionMinor; >> + /// >> + /// E820 map >> + /// >> + EFI_PHYSICAL_ADDRESS E820; >> + UINT32 E820EntriesCount; > > Can you add this chunk into the next patch which initializes > E820/E820EntriesCount?Actually ... this doesn''t need to be added into EFI_XEN_INFO, since PlatformPei is the only thing looking at the tables, right? So, maybe you just need a new function: EFI_STATUS XenGetE820Entries ( EFI_E820_ENTRY64 **Entries, UINTN *Count ); -Jordan> With those 2 changes, patches 3 & 4 are > Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> > >> } EFI_XEN_INFO; >> >> extern EFI_GUID gEfiXenInfoGuid; >> diff --git a/OvmfPkg/PlatformPei/Xen.h b/OvmfPkg/PlatformPei/Xen.h >> new file mode 100644 >> index 0000000..1885ede >> --- /dev/null >> +++ b/OvmfPkg/PlatformPei/Xen.h >> @@ -0,0 +1,44 @@ >> +/** @file >> + Ovmf info structure passed by Xen >> + >> +Copyright (c) 2013, Wei Liu <wei.liu2@citrix.com> >> +This program and the accompanying materials are licensed and made available under >> +the terms and conditions of the BSD License that accompanies this distribution. >> +The full text of the license may be found at >> +opensource.org/licenses/bsd-license.php. >> + >> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, >> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. >> + >> +**/ >> + >> +#ifndef __XEN_H__ >> +#define __XEN_H__ >> + >> +#include <Uefi/UefiBaseType.h> >> + >> +// Physical address of OVMF info >> +#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000 >> + >> +// This structure must match the definition on Xen side >> +#pragma pack(1) >> +typedef struct { >> + CHAR8 Signature[14]; // XenHVMOVMF\0 >> + UINT8 Length; // Length of this structure >> + UINT8 Checksum; // Set such that the sum over bytes 0..length == 0 >> + // >> + // Physical address of an array of TablesCount elements. >> + // >> + // Each element contains the physical address of a BIOS table. >> + // >> + EFI_PHYSICAL_ADDRESS Tables; >> + UINT32 TablesCount; >> + // >> + // Physical address of the E820 table, contains E820EntriesCount entries. >> + // >> + EFI_PHYSICAL_ADDRESS E820; >> + UINT32 E820EntriesCount; >> +} EFI_XEN_OVMF_INFO; >> +#pragma pack() >> + >> +#endif /* __XEN_H__ */ >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> lists.xen.org/xen-devel
Wei Liu
2013-Nov-28 02:19 UTC
Re: [PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo
On Wed, Nov 27, 2013 at 05:36:01PM -0800, Jordan Justen wrote:> On Wed, Nov 27, 2013 at 5:09 PM, Jordan Justen <jljusten@gmail.com> wrote: > > On Tue, Nov 26, 2013 at 11:25 AM, Wei Liu <wei.liu2@citrix.com> wrote: > >> EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It > >> must match the definition on Xen side. > >> > >> XenInfo is extended to include necessary bits as well. Currently only E820 > >> map is in use. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.0 > >> Signed-off-by: Wei Liu <wei.liu2@citrix.com> > >> --- > >> OvmfPkg/Include/Guid/XenInfo.h | 7 +++++++ > >> OvmfPkg/PlatformPei/Xen.h | 44 ++++++++++++++++++++++++++++++++++++++++ > >> 2 files changed, 51 insertions(+) > >> create mode 100644 OvmfPkg/PlatformPei/Xen.h > >> > >> diff --git a/OvmfPkg/Include/Guid/XenInfo.h b/OvmfPkg/Include/Guid/XenInfo.h > >> index d512b0b..6146080 100644 > >> --- a/OvmfPkg/Include/Guid/XenInfo.h > >> +++ b/OvmfPkg/Include/Guid/XenInfo.h > >> @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > >> #ifndef __XEN_INFO_H__ > >> #define __XEN_INFO_H__ > >> > >> +#include <Uefi/UefiBaseType.h> > >> + > > > > I don''t think we want this #include in Guid/XenInfo.h. > > > > Can you make sure that the locations that #include Guid/XenInfo.h > > include PiPei.h, PiDxe.h, or Uefi.h before Guid/XenInfo.h? > > > >> #define EFI_XEN_INFO_GUID \ > >> { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } > >> > >> @@ -35,6 +37,11 @@ typedef struct { > >> /// Hypervisor minor version. > >> /// > >> UINT16 VersionMinor; > >> + /// > >> + /// E820 map > >> + /// > >> + EFI_PHYSICAL_ADDRESS E820; > >> + UINT32 E820EntriesCount; > > > > Can you add this chunk into the next patch which initializes > > E820/E820EntriesCount? > > Actually ... this doesn''t need to be added into EFI_XEN_INFO, since > PlatformPei is the only thing looking at the tables, right? >At this stage, yes, we don''t need HOB for this.> So, maybe you just need a new function: > EFI_STATUS > XenGetE820Entries ( > EFI_E820_ENTRY64 **Entries, > UINTN *Count > ); >Looks like a good approach. Wei.> -Jordan >
Maybe Matching Threads
- [PATCH RFC v2 0/7] Make OVMF fully working with Xen
- Re: [edk2] [PATCH RFC 0/7] OvmfPkg: make OVMF fully working with Xen
- Re: [edk2] [PATCH RFC v2 7/7] OvmfPkg: introduce XenMemMapInitialization
- [PATCH v3 2/8] OvmfPkg: introduce E820.h
- [PATCH] tools: ovmf debug build only if tools debug is enabled