From mboxrd@z Thu Jan 1 00:00:00 1970 From: Art Napor Subject: Re: HVM firmware passthrough - helper library Date: Tue, 26 Mar 2013 21:50:55 -0700 (PDT) Message-ID: <1364359855.76582.YahooMailNeo@web161404.mail.bf1.yahoo.com> References: <831D55AF5A11D64C9B4B43F59EEBF720A31FBE1BC0@FTLPMAILBOX02.citrite.net> <1363806237.80975.YahooMailNeo@web161405.mail.bf1.yahoo.com> <514A172D.8050605@citrix.com> <1363894935.85161.YahooMailNeo@web161402.mail.bf1.yahoo.com> <514F6BAC.4010709@citrix.com> Reply-To: Art Napor Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8611900889962712892==" Return-path: In-Reply-To: <514F6BAC.4010709@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Philipson , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============8611900889962712892== Content-Type: multipart/alternative; boundary="1038709272-1923931022-1364359855=:76582" --1038709272-1923931022-1364359855=:76582 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Works great with the updated libxl commits - thanks.=A0 =0A=0A> ./biospt 6= =0A> Make SMBIOS file from FW.=0A> Fail(1), errno: 2=0A=0ALooks like this d= oes require the sysfs-dmi kmod to expose the dmi structure for the utility = to write out the smbios_fw.bin. =0A=0A=0A# ./biospt 6=0AMake SMBIOS file fr= om FW.=0AMake SMBIOS Xen vendor struct.=0AWrote SMBIOS structures file: smb= ios_fw.bin count: 8=0AMake ACPI SLIC file from FW.=0AFail(3), errno: 2=0A= =0A=0ADo the ACPI tables require the same exposure via sysfs? Not sure if t= his =0Achanges from 2.6 to 3.x kernels. The biospt utility can dump the ACP= I =0Atables using the MMAP option, but not via sysfs on a 3.4.32 system. = =0A=0A=0A=0AThanks,=0AArt=0A=0A=0A=0A=0A=0A________________________________= =0A From: Ross Philipson =0ATo: Art Napor ; "xen-devel@lists.xensource.com" =0ASent: Sunday, March 24, 2013 5:10 PM=0ASubject: Re: HVM firmware pa= ssthrough - helper library=0A =0AOn 03/21/2013 03:42 PM, Art Napor wrote:= =0A> Ross,=0A>=0A> I rebuilt Xen 4.2.1 with the V5 patch series and the upd= ated helper=0A> library. The biospt utility built cleanly and runs on Dom0 = with the=0A> aformentioned libraries in place. However, I'm not seeing the = SMBIOS=0A> strings passed through to the DomU (A Centos 5 VM). Options 1 an= d 3=0A> using the biostpt utility appear to dump the SMBIOS and ACPI tables= , but=0A> I'm not sure how to pass the tables in to the VM?=0A=0ALook at th= e related commits to libxl. After the firmware chunks are =0Agiven to libxc= to load into the new domain, the addresses are returned =0Ato libxl which = writes them to xenstore.=0A=0A>=0A> [root@localhost biospt]# ./biospt=0A> U= sage:=0A> $ biospt =0A> 1 - Write some SMBIOS tables using MMAP=0A> 2 - = Write some SMBIOS tables using SYSFS=0A> 3 - Write some ACPI tables using M= MAP=0A> 4 - Write some ACPI using SYSFS=0A> 5 - Read and trace DMI files=0A= > 6 - Write out some test files=0A>=0A> ./biospt 6=0A> Make SMBIOS file fro= m FW.=0A> Fail(1), errno: 2=0A=0AThis is a rather rough test app for using = the library. You should look =0Aclosely at the code in it and figure out wh= at it is doing. It does not =0Ahave very robust error handling etc.=0A=0ATh= anks=0ARoss=0A=0A>=0A>=0A> -=0A> Art=0A>=0A> ------------------------------= ------------------------------------------=0A> *From:* Ross Philipson =0A> *To:* xen-devel@lists.xensource.com=0A> *Cc:* Ar= t Napor =0A> *Sent:* Wednesday, March 20, 2013 4:08 PM= =0A> *Subject:* Re: HVM firmware passthrough - helper library=0A>=0A>=0A>= =A0 > Ross,=0A>=A0 >=0A>=A0 > Finally got back to this project to test out = the helper lib using the v3=0A>=A0 > hvm-firmware passthrough patches with = Xen 4.2.1. When building from=0A>=A0 > tools/firmware the build failed with= the following output:=0A>=A0 >=0A>=A0 > make=0A>=A0 > gcc -Wl,-soname -Wl,= libxenhvm.so.1.0 -shared -o libxenhvm.so.1.0.0=0A>=A0 > xenhvm.opic smbios_= module.opic acpi_module.opic xh_internal.opic=0A>=A0 >=0A> /home/ajn131/rpm= build/SOURCES/xen-4.2.1/tools/firmware/libhvm/../../../tools/xenstore/libxe= nstore.so=0A>=A0 >=0A>=A0 > xenhvm.opic: could not read symbols: File in wr= ong format=0A>=A0 > collect2: ld returned 1 exit status=0A>=A0 > make: *** = [libxenhvm.so.1.0.0] Error 1=0A>=A0 >=0A>=A0 > I was hoping to integrate th= e build into the RPM. Any thoughts? Should I=0A>=A0 > try it with the lates= t 4.3?=0A>=A0 >=0A>=A0 >=0A>=A0 > Thanks Again,=0A>=A0 >=0A>=A0 > -=0A>=A0 = > Art=0A>=0A> Art,=0A>=0A> Can you try the attached tarball. A colleague fo= und and fixed a couple=0A> of issues in my sample including the face that i= t was including in the=0A> wrong Rules.mk.=0A>=0A> Thanks=0A> Ross=0A>=0A>= =A0 > ---------------------------------------------------------------------= ---=0A>=A0 > *From:* Ross Philipson >=0A>=A0 > *To:* "xen-devel@lists.xensource.com= =0A> " >=0A>=A0 > *Cc:* "Art Napor (art= napor@yahoo.com )"=0A> >=0A>=A0 > *Sent:* Tuesday, January 8, 2013 5:04 PM= =0A>=A0 > *Subject:* HVM firmware passthrough - helper library=0A>=A0 >=0A>= =A0 > Attached is a tarball with a helper library for reading host ACPI and= =0A>=A0 > SMBIOS firmware and creating firmware files that can be used with= the=0A>=A0 > HVM firmware passthrough patches I submitted. I used it in my= testing of=0A>=A0 > the patches and planned to use it later when we moved = to a new Xen=0A>=A0 > version. This library was requested by a few people -= I hope you find it=0A>=A0 > useful.=0A>=A0 >=0A>=A0 > Ross Philipson=0A>= =A0 > Senior Software Engineer=0A>=A0 > Citrix Systems, Inc=0A>=A0 > 14 Cro= sby Drive=0A>=A0 > Bedford, MA 01730=0A>=A0 > 781-301-7949=0A>=A0 > ross.ph= ilipson@citrix.com =0A> >=0A>=A0 >=0A>=0A>=0A>= =0A>=0A> --1038709272-1923931022-1364359855=:76582 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Works great with the = updated libxl commits - thanks. 

> ./biospt 6
> Make = SMBIOS file from FW.
> Fail(1), errno: 2

Looks like this does = require the sysfs-dmi kmod to expose the dmi structure for the utility to w= rite out the smbios_fw.bin.

# ./biospt 6
Make SMBIOS file from FW.
Make SMBIOS Xen vendor struct= .
Wrote SMBIOS structures file: smbios_fw.bin count: 8
Make ACPI SLIC= file from FW.
Fail(3), errno: 2

Do=0A the ACPI= tables require the same exposure via sysfs? Not sure if this =0Achanges fr= om 2.6 to 3.x kernels. The biospt utility can dump the ACPI =0Atables using= the MMAP option, but not via sysfs on a 3.4.32 system.


Thanks,
Art



From: Ross Phi= lipson <ross.philipson@citrix.com>
To: Art Napor <artnapor@yahoo.com>; "xen-devel@lis= ts.xensource.com" <xen-devel@lists.xensource.com>
Sent: Sunday, March 24, 2013 5:10 PM
= Subject: Re: HVM firmware= passthrough - helper library

=0AOn 03/21/2013 03:42= PM, Art Napor wrote:
> Ross,
>
> I rebuilt Xen 4.2.1 wit= h the V5 patch series and the updated helper
> library. The biospt ut= ility built cleanly and runs on Dom0 with the
> aformentioned librari= es in place. However, I'm not seeing the SMBIOS
> strings passed thro= ugh to the DomU (A Centos 5 VM). Options 1 and 3
> using the biostpt = utility appear to dump the SMBIOS and ACPI tables, but
> I'm not sure= how to pass the tables in to the VM?

Look at the related commits to= libxl. After the firmware chunks are
given to libxc to load into the n= ew domain, the addresses are returned
to libxl which writes them to xen= store.

>
> [root@localhost biospt]# ./biospt
> Usage:=
> $ biospt <n>
> 1 - Write some SMBIOS tables using MMAP=
> 2 - Write some SMBIOS tables using SYSFS
> 3 - Write some AC= PI tables using MMAP
> 4 - Write some ACPI using SYSFS
> 5 - Read and trace DMI files
> 6 - Write out som= e test files
>
> ./biospt 6
> Make SMBIOS file from FW.> Fail(1), errno: 2

This is a rather rough test app for using t= he library. You should look
closely at the code in it and figure out wh= at it is doing. It does not
have very robust error handling etc.
Thanks
Ross

>
>
> -
> Art
>
> -= -----------------------------------------------------------------------
= > *From:* Ross Philipson <ross.philipson@citrix.com>
> *To:*
xen-devel@lists.xensource.com
> *Cc:* Art Napor <
artnapor@yahoo.com>
> *Sent:* Wednesday, March 20, 2013 4:08 PM
> *Subject:* Re: HVM firmware pass= through - helper library
>
>
>  > Ross,
>&n= bsp; >
>  > Finally got back to this project to test out t= he helper lib using the v3
>  > hvm-firmware passthrough patc= hes with Xen 4.2.1. When building from
>  > tools/firmware th= e build failed with the following output:
>  >
>  = > make
>  > gcc -Wl,-soname -Wl,libxenhvm.so.1.0 -shared -= o libxenhvm.so.1.0.0
>  > xenhvm.opic smbios_module.opic acpi= _module.opic xh_internal.opic
>  >
> /home/ajn131/rpmbu= ild/SOURCES/xen-4.2.1/tools/firmware/libhvm/../../../tools/xenstore/libxens= tore.so
>  >
>  > xenhvm.opic: could not read s= ymbols: File in wrong format
>  > collect2: ld returned 1 exi= t status
>  > make: *** [libxenhvm.so.1.0.0] Error 1
>  >
>  > I was hoping to integrate the buil= d into the RPM. Any thoughts? Should I
>  > try it with the l= atest 4.3?
>  >
>  >
>  > Thanks = Again,
>  >
>  > -
>  > Art
&g= t;
> Art,
>
> Can you try the attached tarball. A colleag= ue found and fixed a couple
> of issues in my sample including the fa= ce that it was including in the
> wrong Rules.mk.
>
> Tha= nks
> Ross
>
>  > -------------------------------= -----------------------------------------
>  > *From:* Ross P= hilipson <Ross.Philipson@citrix.com
> <mailt= o:Ross.Philipson@citrix.com>>
>  > *To:* "xen-devel@lists.xensource.com
> &l= t;mailto:xen-devel@lists.xensource.com>" <= xen-devel@lists.xensource.com
> <mailto= :xen-devel@lists.xensource.com>>
>&n= bsp; > *Cc:* "Art Napor (artnapor@yahoo.com <mailto:artnapor@= yahoo.com>)"
> <artnapor@yahoo.com <mailto:a= rtnapor@yahoo.com>>
>  > *Sent:* Tuesday, January 8= , 2013 5:04 PM
>  > *Subject:* HVM firmware passthrough - hel= per library
>  >
>  > Attached is a tarball wit= h a helper library for reading host ACPI and
>  > SMBIOS firm= ware and creating firmware files that can be used with the
>  &g= t; HVM firmware passthrough patches I submitted. I used it in my testing of=
>  > the patches and planned to use it later when we moved t= o a new Xen
>  > version. This library was requested by a few= people - I hope you find it
>  > useful.
>  ><= br>>  > Ross Philipson
>  > Senior Software Engine= er
>  > Citrix Systems, Inc
>  > 14 Crosby Driv= e
>  > Bedford, MA 01730
>  > 781-301-7949
>  > ross.philipson@citrix.com <mailto:ross.philipson@citrix.com>
> <= mailto:ross.philipson@citrix.com <mailto:ross.philipson@citrix.com>>
>  >
>
&g= t;
>
>
>



--1038709272-1923931022-1364359855=:76582-- --===============8611900889962712892== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8611900889962712892==--