From mboxrd@z Thu Jan 1 00:00:00 1970 From: Art Napor Subject: Re: HVM firmware passthrough - helper library Date: Mon, 1 Apr 2013 20:19:30 -0700 (PDT) Message-ID: <1364872770.40081.YahooMailNeo@web161406.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> <1364359855.76582.YahooMailNeo@web161404.mail.bf1.yahoo.com> <515A0480.5000407@citrix.com> Reply-To: Art Napor Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0616451132247760861==" Return-path: In-Reply-To: <515A0480.5000407@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 Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============0616451132247760861== Content-Type: multipart/alternative; boundary="122454116-432717622-1364872770=:40081" --122454116-432717622-1364872770=:40081 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Looks like they're where they're supposed to be, but no SLIC. =0A=0A=0Als /= sys/firmware/acpi/tables/=0AAPIC=A0 ASF!=A0 DSDT=A0 dynamic=A0 FACP=A0 FACS= =A0 HPET=A0 MCFG=A0 SSDT1=A0 SSDT2=A0 XMAR=0A=0A=0Ahexdump -C < /sys/firmwa= re/acpi/tables/XMAR=0A00000000=A0 58 4d 41 52 e8 00 00 00=A0 01 f9 49 4e 54= 45 4c 20=A0 |XMAR......INTEL |=0A00000010=A0 53 4e 42 20 00 00 00 00=A0 01= 00 00 00 49 4e 54 4c=A0 |SNB ........INTL|=0A00000020=A0 01 00 00 00 23 01= 00 00=A0 00 00 00 00 00 00 00 00=A0 |....#...........|=0A00000030=A0 00 00= 18 00 00 00 00 00=A0 00 00 d9 fe 00 00 00 00=A0 |................|=0A00000= 040=A0 01 08 00 00 00 00 02 00=A0 00 00 58 00 01 00 00 00=A0 |..........X..= ...|=0A00000050=A0 00 10 d9 fe 00 00 00 00=A0 03 08 00 00 02 f0 1f 00=A0 |.= ...............|=0A00000060=A0 04 08 00 00 00 f0 0f 00=A0 04 08 00 00 00 f0= 0f 01=A0 |................|=0A00000070=A0 04 08 00 00 00 f0 0f 02=A0 04 08= 00 00 00 f0 0f 03=A0 |................|=0A00000080=A0 04 08 00 00 00 f0 0f= 04=A0 04 08 00 00 00 f0 0f 05=A0 |................|=0A00000090=A0 04 08 00= 00 00 f0 0f 06=A0 04 08 00 00 00 f0 0f 07=A0 |................|=0A000000a0= =A0 01 00 28 00 00 00 00 00=A0 00 30 d4 da 00 00 00 00=A0 |..(......0......= |=0A000000b0=A0 ff 1f d5 da 00 00 00 00=A0 01 08 00 00 00 00 1d 00=A0 |....= ............|=0A000000c0=A0 01 08 00 00 00 00 1a 00=A0 01 00 20 00 00 00 00= 00=A0 |.......... .....|=0A000000d0=A0 00 00 80 db 00 00 00 00=A0 ff ff 9f= df 00 00 00 00=A0 |................|=0A000000e0=A0 01 08 00 00 00 00 02 00= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 |........|=0A000000e8=0A=0A=0A=0A________________________________=0A Fr= om: Ross Philipson =0ATo: Art Napor =0ACc: "xen-devel@lists.xensource.com" =0ASent: Monday, April 1, 2013 6:04 PM=0ASubject: Re: HVM firmware pas= sthrough - helper library=0A =0AOn 03/27/2013 12:50 AM, Art Napor wrote:=0A= > Works great with the updated libxl commits - thanks.=0A>=0A>=A0 > ./biosp= t 6=0A>=A0 > Make SMBIOS file from FW.=0A>=A0 > Fail(1), errno: 2=0A>=0A> L= ooks like this does require the sysfs-dmi kmod to expose the dmi=0A> struct= ure for the utility to write out the smbios_fw.bin.=0A>=0A> # ./biospt 6=0A= > Make SMBIOS file from FW.=0A> Make SMBIOS Xen vendor struct.=0A> Wrote SM= BIOS structures file: smbios_fw.bin count: 8=0A> Make ACPI SLIC file from F= W.=0A> Fail(3), errno: 2=0A>=0A> Do the ACPI tables require the same exposu= re via sysfs? Not sure if this=0A> changes from 2.6 to 3.x kernels. The bio= spt utility can dump the ACPI=0A> tables using the MMAP option, but not via= sysfs on a 3.4.32 system.=0A=0AThey are in the same place on my wheezy wit= h 3.2.x kernel. I would be =0Apretty surprised if they moved. Can you go in= to =0A/sys/firmware/acpi/tables and see what's there? Maybe try a hexdump = -C < =0ASLIC ...=0A=0A>=0A>=0A> Thanks,=0A> Art=0A>=0A>=0A> ---------------= ---------------------------------------------------------=0A> *From:* Ross = Philipson =0A> *To:* Art Napor ; "xen-devel@lists.xensource.com"=0A> =0A= > *Sent:* Sunday, March 24, 2013 5:10 PM=0A> *Subject:* Re: HVM firmware pa= ssthrough - helper library=0A>=0A> On 03/21/2013 03:42 PM, Art Napor wrote:= =0A>=A0 > Ross,=0A>=A0 >=0A>=A0 > I rebuilt Xen 4.2.1 with the V5 patch ser= ies and the updated helper=0A>=A0 > library. The biospt utility built clean= ly and runs on Dom0 with the=0A>=A0 > aformentioned libraries in place. How= ever, I'm not seeing the SMBIOS=0A>=A0 > strings passed through to the DomU= (A Centos 5 VM). Options 1 and 3=0A>=A0 > using the biostpt utility appear= to dump the SMBIOS and ACPI tables, but=0A>=A0 > I'm not sure how to pass = the tables in to the VM?=0A>=0A> Look at the related commits to libxl. Afte= r the firmware chunks are=0A> given to libxc to load into the new domain, t= he addresses are returned=0A> to libxl which writes them to xenstore.=0A>= =0A>=A0 >=0A>=A0 > [root@localhost biospt]# ./biospt=0A>=A0 > Usage:=0A>=A0= > $ biospt =0A>=A0 > 1 - Write some SMBIOS tables using MMAP=0A>=A0 > 2= - Write some SMBIOS tables using SYSFS=0A>=A0 > 3 - Write some ACPI tables= using MMAP=0A>=A0 > 4 - Write some ACPI using SYSFS=0A>=A0 > 5 - Read and = trace DMI files=0A>=A0 > 6 - Write out some test files=0A>=A0 >=0A>=A0 > ./= biospt 6=0A>=A0 > Make SMBIOS file from FW.=0A>=A0 > Fail(1), errno: 2=0A>= =0A> This is a rather rough test app for using the library. You should look= =0A> closely at the code in it and figure out what it is doing. It does not= =0A> have very robust error handling etc.=0A>=0A> Thanks=0A> Ross=0A>=0A>= =A0 >=0A>=A0 >=0A>=A0 > -=0A>=A0 > Art=0A>=A0 >=0A>=A0 > ------------------= ------------------------------------------------------=0A>=A0 > *From:* Ros= s Philipson >=0A>=A0 > *To:* xen-devel@lists.xensource.com=0A> =0A>=A0 > *Cc:* Art Napor >=0A>=A0 > *Sent:* Wednesday, March 20, 2013 4:08 PM=0A>=A0 >= *Subject:* Re: HVM firmware passthrough - helper library=0A>=A0 >=0A>=A0 >= =0A>=A0 > > Ross,=0A>=A0 > >=0A>=A0 > > Finally got back to this project to= test out the helper lib using=0A> the v3=0A>=A0 > > hvm-firmware passthrou= gh 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>=A0 >=0A> /home/ajn131/rpmbuild/SOURCES/xen-4.2.1/tools/firmwar= e/libhvm/../../../tools/xenstore/libxenstore.so=0A>=A0 > >=0A>=A0 > > xenhv= m.opic: could not read symbols: File in wrong format=0A>=A0 > > collect2: l= d returned 1 exit status=0A>=A0 > > make: *** [libxenhvm.so.1.0.0] Error 1= =0A>=A0 > >=0A>=A0 > > I was hoping to integrate the build into the RPM. An= y thoughts?=0A> Should I=0A>=A0 > > try it with the latest 4.3?=0A>=A0 > >= =0A>=A0 > >=0A>=A0 > > Thanks Again,=0A>=A0 > >=0A>=A0 > > -=0A>=A0 > > Art= =0A>=A0 >=0A>=A0 > Art,=0A>=A0 >=0A>=A0 > Can you try the attached tarball.= A colleague found and fixed a couple=0A>=A0 > of issues in my sample inclu= ding the face that it was including in the=0A>=A0 > wrong Rules.mk.=0A>=A0 = >=0A>=A0 > Thanks=0A>=A0 > Ross=0A>=A0 >=0A>=A0 > >=0A> -------------------= -----------------------------------------------------=0A>=A0 > > *From:* Ro= ss Philipson =0A>=A0 > >>=0A>=A0 > > *To:* "xen-devel@lists.xensource.com=0A> =0A>=A0 > = >" =0A>=A0 > >>=0A>=A0 > > *Cc:* = "Art Napor (artnapor@yahoo.com =0A> >)"=0A>=A0 > =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 t= he=0A>=A0 > > HVM firmware passthrough patches I submitted. I used it in my= =0A> 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=0A> find it=0A>=A0 > > useful.=0A>=A0 > >=0A>=A0 > > Ro= ss Philipson=0A>=A0 > > Senior Software Engineer=0A>=A0 > > Citrix Systems,= Inc=0A>=A0 > > 14 Crosby Drive=0A>=A0 > > Bedford, MA 01730=0A>=A0 > > 781= -301-7949=0A>=A0 > > ross.philipson@citrix.com =0A> >=0A>=A0 > =0A> >>=0A>=A0 > >=0A>=A0 >=0A>=A0 >=0A>=A0 >=0A>=A0 >=0A>=A0 >=0A>=0A>=0A= > --122454116-432717622-1364872770=:40081 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Looks like they'= re where they're supposed to be, but no SLIC.

ls /sys/firmware/acpi/tables/
APIC  ASF!  DSDT = ; dynamic  FACP  FACS  HPET  MCFG  SSDT1  SSD= T2  XMAR

hexdump -C < /sys/firmware/acpi/tables/X= MAR
00000000  58 4d 41 52 e8 00 00 00  01 f9 49 4e 54 45 4c 20=   |XMAR......INTEL |
00000010  53 4e 42 20 00 00 00 00  0= 1 00 00 00 49 4e 54 4c  |SNB ........INTL|
00000020  01 00 00 00 23 01 00 00  00 00 00 00 00 00 00 00  |....#...........|
0= 0000030  00 00 18 00 00 00 00 00  00 00 d9 fe 00 00 00 00  |= ................|
00000040  01 08 00 00 00 00 02 00  00 00 58 = 00 01 00 00 00  |..........X.....|
00000050  00 10 d9 fe 00 00= 00 00  03 08 00 00 02 f0 1f 00  |................|
00000060&n= bsp; 04 08 00 00 00 f0 0f 00  04 08 00 00 00 f0 0f 01  |.........= .......|
00000070  04 08 00 00 00 f0 0f 02  04 08 00 00 00 f0 = 0f 03  |................|
00000080  04 08 00 00 00 f0 0f 04&nb= sp; 04 08 00 00 00 f0 0f 05  |................|
00000090  04 0= 8 00 00 00 f0 0f 06  04 08 00 00 00 f0 0f 07  |................|<= br>000000a0  01 00 28 00 00 00 00 00  00 30 d4 da 00 00 00 00&nbs= p; |..(......0......|
000000b0  ff 1f d5 da 00 00 00 00  01 08= 00 00 00 00 1d 00  |................|
000000c0  01 08 00 00 00 00 1a 00  01 00 20 00 00 00 00 00  |.......... .....|000000d0  00 00 80 db 00 00 00 00  ff ff 9f df 00 00 00 00 = ; |................|
000000e0  01 08 00 00 00 00 02 00  &= nbsp;           &nbs= p;            |.....= ...|
000000e8

<= font face=3D"Arial" size=3D"2">
From: Ross Philipson <ross.philipson@citrix.com>= ;
To: Art Napor <ar= tnapor@yahoo.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com> Sent: Monday, April 1, 2013 6:04 P= M
Subject: Re: HVM fir= mware passthrough - helper library

=0AOn 03/27/2013 = 12:50 AM, Art Napor wrote:
> Works great with the updated libxl commi= ts - thanks.
>
>  > ./biospt 6
>  > Make = SMBIOS file from FW.
>  > Fail(1), errno: 2
>
> L= ooks like this does require the sysfs-dmi kmod to expose the dmi
> st= ructure for the utility to write 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= the ACPI tables require the same exposure via sysfs? Not sure if this
&= gt; changes from 2.6 to 3.x kernels. The biospt utility can dump the ACPI> tables using the MMAP option, but not via sysfs on a 3.4.32 system.<= br>
They are in the same place on my wheezy with 3.2.x kernel. I would b= e
pretty surprised if they moved. Can you go in to
/sys/firmware/acpi/tables and see what's there? Maybe try a hexdump -C= <
SLIC ...

>
>
> Thanks,
> Art
><= br>>
> -----------------------------------------------------------= -------------
> *From:* Ross Philipson <ross.philip= son@citrix.com>
> *To:* Art Napor <artnapor@yahoo.com&= gt;; "xen-devel@lists.xensource.com"
> <= ;xen-devel@lists.xensource.com>
> *Sent= :* Sunday, March 24, 2013 5:10 PM
> *Subject:* Re: HVM firmware passt= hrough - helper library
>
> On 03/21/2013 03:42 PM, Art Napor wrote:
>  > Ross,
>  >
>  > I re= built Xen 4.2.1 with the V5 patch series and the updated helper
>&nbs= p; > library. The biospt utility built cleanly and runs on Dom0 with the=
>  > aformentioned libraries in place. However, I'm not seei= ng the SMBIOS
>  > strings passed through to the DomU (A Cent= os 5 VM). Options 1 and 3
>  > using the biostpt utility appe= ar 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 co= mmits to libxl. After the firmware chunks are
> given to libxc to loa= d into the new domain, the addresses are returned
> to libxl which wr= ites them to xenstore.
>
>  >
>  > [root@= localhost biospt]# ./biospt
>  > Usage:
>  > $ = biospt <n>
>  > 1 - Write some SMBIOS tables using MMAP
>  > 2 - Write some SMBIOS tables using SYSFS
= >  > 3 - Write some ACPI tables using MMAP
>  > 4 = - Write some ACPI using SYSFS
>  > 5 - Read and trace DMI fil= es
>  > 6 - Write out some test files
>  >
&= gt;  > ./biospt 6
>  > Make SMBIOS file from FW.
&= gt;  > Fail(1), errno: 2
>
> This is a rather rough tes= t app for using the library. You should look
> closely at the code in= it and figure out what it is doing. It does not
> have very robust e= rror handling etc.
>
> Thanks
> Ross
>
> = ; >
>  >
>  > -
>  > Art
&g= t;  >
>  > ------------------------------------------= ------------------------------
>  > *From:* Ross Philipson &l= t;ross.philipson@citrix.com> <mailto:ross.philipson@citrix.com>>
&g= t;  > *To:* xen-devel@lists.xensource.com
> <mailto:
xen-devel@lists.xensource.com>
>  > *Cc:* Art Napor <
artnapor@yahoo.com <m= ailto:artnapor@yahoo.com>>
>  > *Sent:* Wednesday,= March 20, 2013 4:08 PM
>  > *Subject:* Re: HVM firmware pass= through - helper library
>  >
>  >
> = ; > > Ross,
>  > >
>  > > Finally got back to = this project to test out the helper lib using
> the v3
>  = > > hvm-firmware passthrough patches with Xen 4.2.1. When building fr= om
>  > > tools/firmware the build failed with the followi= ng output:
>  > >
>  > > make
>&nbs= p; > > gcc -Wl,-soname -Wl,libxenhvm.so.1.0 -shared -o libxenhvm.so.1= .0.0
>  > > xenhvm.opic smbios_module.opic acpi_module.opi= c xh_internal.opic
>  > >
>  >
> /home= /ajn131/rpmbuild/SOURCES/xen-4.2.1/tools/firmware/libhvm/../../../tools/xen= store/libxenstore.so
>  > >
>  > > xenhvm= .opic: could not read symbols: File in wrong format
>  > >= collect2: ld returned 1 exit status
>  > > make: *** [lib= xenhvm.so.1.0.0] Error 1
>  > >
>  > > I was hoping to integrate the build into the RPM. Any thoughts?
&g= t; Should I
>  > > try it with the latest 4.3?
>&nbs= p; > >
>  > >
>  > > Thanks Again,<= br>>  > >
>  > > -
>  > > A= rt
>  >
>  > Art,
>  >
>&nb= sp; > Can you try the attached tarball. A colleague found and fixed a co= uple
>  > of issues in my sample including the face that it w= as including in the
>  > wrong Rules.mk.
>  >>  > Thanks
>  > Ross
>  >
>=   > >
> --------------------------------------------------= ----------------------
>  > > *From:* Ross Philipson <<= a ymailto=3D"mailto:Ross.Philipson@citrix.com" href=3D"mailto:Ross.Philipso= n@citrix.com">Ross.Philipson@citrix.com
> <mailto:Ross.Philipson@citrix.com>
>  > <mailt= o:Ross.Philipson@citrix.com <mailto:Ro= ss.Philipson@citrix.com>>>
>  > > *To:* "xen-devel@lists.xensource.com
> <mailto:xen-devel@lists.xensource.com>
>  >= ; <mailto:xen-devel@lists.xensource.com
&g= t; <mailto:xen-devel@lists.xensource.co= m>>" <xen-devel@lists.xensource.com=
> <mailto:xen-devel@lists.xensource.com>
>  > <mailto:
xen-devel@lists.= xensource.com
> <mailto:xen-devel@lists= .xensource.com>>>
>  > > *Cc:* "Art Napor (a= rtnapor@yahoo.com <mailto:artnapor@yahoo.com>
> <ma= ilto:a= rtnapor@yahoo.com <mailto:artnapor@yahoo.com>>)"
>&= nbsp; > <artnapor@yahoo.com <mailto:artnapor@yahoo.com&g= t;
> <mailto:artnapor@yahoo.com <mailto:artnapor@yahoo.co= m>>>
>  > > *Sent:* Tuesday, January 8, 2013 = 5:04 PM
>  > > *Subject:* HVM firmware passthrough - helpe= r library
>  > >
>  > > Attached is a tar= ball with a helper library for reading host ACPI and
>  > >= ; SMBIOS firmware and creating firmware files that can be used with the
>  > &= gt; HVM firmware passthrough patches I submitted. I used it in my
> t= esting of
>  > > the patches and planned to use it later w= hen we moved to a new Xen
>  > > version. This library was= requested by a few people - I hope you
> find it
>  > = > useful.
>  > >
>  > > Ross Philipson=
>  > > Senior Software Engineer
>  > > C= itrix Systems, Inc
>  > > 14 Crosby Drive
>  &g= t; > Bedford, MA 01730
>  > > 781-301-7949
> = ; > > ross.philipson@citrix.com <mailto:ross.philipson@citrix.com>
> <mailto:ross.philipson@citrix.com <mailto:ross.p= hilipson@citrix.com>>
>  > <mailto:ross.philipson@citrix.com <mailto:ross.philipson@ci= trix.com>
> <mailto:ross.philipson@citrix.co= m <mailto:ross.philipson@citrix.com>>>>  > >
>  >
>  >
>  = >
>  >
>  >
>
>
>

<= br>
--122454116-432717622-1364872770=:40081-- --===============0616451132247760861== 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 --===============0616451132247760861==--