[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [edk2] [PATCH RFC v2 4/7] OvmfPkg: extract OVMF info passed by Xen hvmloader



On Sun, Nov 24, 2013 at 06:01:03PM -0800, Jordan Justen wrote:
[...]
> >    mXenInfo.HyperPages = AllocatePages (TransferPages);
> > @@ -72,6 +78,31 @@ XenConnect (
> >    /* TBD: Locate hvm_info and reserve it away. */
> >    mXenInfo.HvmInfo = NULL;
> >
> > +  if (!AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) {
> 
> Would AsciiStrnCmp be a good idea here? Like I mentioned in the other
> patch, we normally use an integer based signature.
> 

I think it is sufficient. We would like to keep the use that structure
to pass information. That structure is Xen => OVMF only  and consumed
internally by OVMF.

> > +    EFI_E820_ENTRY *E820Map;
> > +    UINTN Loop, EntryCount, Base;
> > +
> > +    /* E820 map */
> > +    EntryCount = Info->E820Nr;
> > +    Base = Info->E820;
> > +
> > +    E820Map = AllocateZeroPool (sizeof(EFI_E820_ENTRY) * EntryCount);
> > +
> > +    if (!E820Map) {
> > +      FreePages (mXenInfo.HyperPages, TransferPages);
> > +      return EFI_OUT_OF_RESOURCES;
> > +    }
> > +
> > +    for (Loop = 0; Loop < EntryCount; Loop++) {
> > +      EFI_E820_ENTRY *src = (EFI_E820_ENTRY *)Base + Loop;
> > +      EFI_E820_ENTRY *dst = (EFI_E820_ENTRY *)E820Map + Loop;
> > +      CopyMem (dst, src, sizeof(EFI_E820_ENTRY));
> > +    }
> 
> How about AllocateCopyPool and just copy the entire array in one shot?
> 

Sure, that seems much simpler. Thanks.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.