Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-20 Thread Filip Navara
On Jan 20, 2008 5:53 PM, Alexander Graf <[EMAIL PROTECTED]> wrote:

>
> On Jan 20, 2008, at 5:37 PM, Filip Navara wrote:
>
> The specific VMware backdoor call isn't implemented, but the framework is
> there and it wouldn't be hard to add support for it. The BIOS can fallback
> to some "reasonable" value if the backdoor isn't available.
>
>
> +memset(bios_uuid, 0, 16);
>
> This value? Why not put something more "reasonable" in there? Does a uuid
> have to meet specific criteria (checksums)? If not, why not simply put
> something like "QEMU" in here? If I remember correctly OSX needs a value in
> the uuid or it fails to boot, so it might be a good idea to give it
> something better than an empty string.
>

Yes, this value. All zeroes means that UUID is not present in the system.
The value has to follow the criteria of SMBIOS specification, section
3.3.2.1, namely it has to be formatted like this:

DWORD time_low;
WORD time_mid;
WORD time_high_and_version;
BYTE clock_seq_hi_and_reserved;
BYTE clock_seq_low;
BYTE node_number[6];

I doubt any driver really checks the value, except maybe for the all-0xFF or
all-0x00 case.

- Filip


Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-20 Thread Alexander Graf


On Jan 20, 2008, at 5:37 PM, Filip Navara wrote:

The specific VMware backdoor call isn't implemented, but the  
framework is there and it wouldn't be hard to add support for it.  
The BIOS can fallback to some "reasonable" value if the backdoor  
isn't available.




+memset(bios_uuid, 0, 16);

This value? Why not put something more "reasonable" in there? Does a  
uuid have to meet specific criteria (checksums)? If not, why not  
simply put something like "QEMU" in here? If I remember correctly OSX  
needs a value in the uuid or it fails to boot, so it might be a good  
idea to give it something better than an empty string.



Best regards,
Filip Navara

On Jan 20, 2008 5:20 PM, Alexander Graf <[EMAIL PROTECTED]> wrote:

On Jan 20, 2008, at 2:17 PM, Filip Navara wrote:

> Hello,
>
> attached is a patch that implements the SMBIOS within the Bochs BIOS
> code. Complete list of changes:
>
> - Added generation of SSDT ACPI table that contains definitions for
> available processors.
> - Added basic implementation of SMBIOS.
> - Added querying of BIOS UUID using VMware backdoor I/O port (enable
> only if BX_QEMU is defined).
> - Added RTC device to ACPI DSDT table.
>

This is great news. I was eagerly waiting for this. It looks like this
fixes most problems I had with running Mac OS X as a guest OS. I will
definitely try this tomorrow and tell you the results.

Is the VMWare I/O backdoor implemented already or is this patch meant
to be applied on top of another patch?

Regards,

Alex






Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-20 Thread Filip Navara
The specific VMware backdoor call isn't implemented, but the framework is
there and it wouldn't be hard to add support for it. The BIOS can fallback
to some "reasonable" value if the backdoor isn't available.

Best regards,
Filip Navara

On Jan 20, 2008 5:20 PM, Alexander Graf <[EMAIL PROTECTED]> wrote:

>
> On Jan 20, 2008, at 2:17 PM, Filip Navara wrote:
>
> > Hello,
> >
> > attached is a patch that implements the SMBIOS within the Bochs BIOS
> > code. Complete list of changes:
> >
> > - Added generation of SSDT ACPI table that contains definitions for
> > available processors.
> > - Added basic implementation of SMBIOS.
> > - Added querying of BIOS UUID using VMware backdoor I/O port (enable
> > only if BX_QEMU is defined).
> > - Added RTC device to ACPI DSDT table.
> >
>
> This is great news. I was eagerly waiting for this. It looks like this
> fixes most problems I had with running Mac OS X as a guest OS. I will
> definitely try this tomorrow and tell you the results.
>
> Is the VMWare I/O backdoor implemented already or is this patch meant
> to be applied on top of another patch?
>
> Regards,
>
> Alex
>
>


Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-20 Thread Alexander Graf


On Jan 20, 2008, at 2:17 PM, Filip Navara wrote:


Hello,

attached is a patch that implements the SMBIOS within the Bochs BIOS  
code. Complete list of changes:


- Added generation of SSDT ACPI table that contains definitions for  
available processors.

- Added basic implementation of SMBIOS.
- Added querying of BIOS UUID using VMware backdoor I/O port (enable  
only if BX_QEMU is defined).

- Added RTC device to ACPI DSDT table.



This is great news. I was eagerly waiting for this. It looks like this  
fixes most problems I had with running Mac OS X as a guest OS. I will  
definitely try this tomorrow and tell you the results.


Is the VMWare I/O backdoor implemented already or is this patch meant  
to be applied on top of another patch?


Regards,

Alex





Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-20 Thread Filip Navara
http://sourceforge.net/tracker/index.php?func=detail&aid=1864692&group_id=12580&atid=312580

- Filip

On Jan 20, 2008 3:25 PM, Paul Brook <[EMAIL PROTECTED]> wrote:

> On Sunday 20 January 2008, Filip Navara wrote:
> > Hello,
> >
> > attached is a patch that implements the SMBIOS within the Bochs BIOS
> code.
> > Complete list of changes:
>
> This should be submitted to the Bochs list.
>
> Paul
>
>
>


Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-20 Thread Paul Brook
On Sunday 20 January 2008, Filip Navara wrote:
> Hello,
>
> attached is a patch that implements the SMBIOS within the Bochs BIOS code.
> Complete list of changes:

This should be submitted to the Bochs list.

Paul




Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2008-01-03 Thread Ryan Harper
* Filip Navara <[EMAIL PROTECTED]> [2007-12-11 15:29]:
> Hi Ryan & others,
> 
> now I have been holding a SMBIOS patch on my hard disk for way to long it
> seems. I used a different approach from yours, so I decided to publish it
> for review or further ideas. What I did was to modify the bochs bios to
> produce the SMBIOS tables and I get the UUID using VMware backdoor port from
> the virtual machine.
> 
> Attached are just the changed files, creating a patch will take a while
> because it's against VERY OLD version of the sources.

Filip,

Thanks for posting this.  I agree with Fabrice that doing the SMBIOS
tables in rombios is a better approach.  The rombio32.c file you
included didn't look that old to me; it has a CVS release tag of:
'rombios32.c,v 1.11 2007/08/03 13:56:13'  

AFAICT, it looks like a straight-forward SMBIOS implementation.  The
only thing worth adding to yours is the BIOS release date string in the
type 0 table.  Setting this date to something newer than typical
CONFIG_ACPI_BLACKLIST_YEAR value (2000 in Gutsy's kernels) lets the
kernel enable ACPI features (like power-off).

Any idea on when you might have a patch that I can test?

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
[EMAIL PROTECTED]




Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2007-12-12 Thread Fabrice Bellard
Filip Navara wrote:
> Hi Ryan & others,
> 
> now I have been holding a SMBIOS patch on my hard disk for way to long it
> seems. I used a different approach from yours, so I decided to publish it
> for review or further ideas. What I did was to modify the bochs bios to
> produce the SMBIOS tables and I get the UUID using VMware backdoor port from
> the virtual machine.
> 
> Attached are just the changed files, creating a patch will take a while
> because it's against VERY OLD version of the sources.
> 
> Oh, it also contains ACPI patch for the processor descriptors which was
> needed for some Windows versions and Darwin. Similar patch was used in KVM
> before, but this one dynamically detects the number of CPUs.

I strongly prefer your solution (Bochs BIOS) compared to modifying QEMU:
I already spent a lot of time moving the ACPI tables and other stuff to
the Bochs BIOS just for that !

Regards,

Fabrice.




[Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2007-12-11 Thread Ryan Harper
3 files changed, 38 insertions(+), 2 deletions(-)
Makefile.target |5 -
configure   |   26 ++
smbios.c|9 -


# HG changeset patch
# User Ryan Harper <[EMAIL PROTECTED]>
# Date 1197402122 21600
# Node ID 115f40a4994be1d5b44ef193b3ccbe8e26410eef
# Parent  e81bef5fa072360d12b87b3237b7d3f72c9b9784
Optionally link against libuuid if present.

This patch makes libuuid optional.  If not detected, SMBIOS tables will use
canned UUID.

Signed-off-by: Ryan Harper <[EMAIL PROTECTED]>

diff -r e81bef5fa072 -r 115f40a4994b Makefile.target
--- a/Makefile.target   Tue Dec 11 13:42:01 2007 -0600
+++ b/Makefile.target   Tue Dec 11 13:42:02 2007 -0600
@@ -402,6 +402,9 @@ VL_OBJS+=block-raw.o
 
 ifdef CONFIG_ALSA
 LIBS += -lasound
+endif
+ifdef CONFIG_UUID
+LIBS += -luuid
 endif
 ifdef CONFIG_DSOUND
 LIBS += -lole32 -ldxguid
@@ -535,7 +538,7 @@ ifndef CONFIG_DARWIN
 ifndef CONFIG_DARWIN
 ifndef CONFIG_WIN32
 ifndef CONFIG_SOLARIS
-VL_LIBS+=-lutil -luuid
+VL_LIBS+=-lutil
 endif
 endif
 endif
diff -r e81bef5fa072 -r 115f40a4994b configure
--- a/configure Tue Dec 11 13:42:01 2007 -0600
+++ b/configure Tue Dec 11 13:42:02 2007 -0600
@@ -89,6 +89,7 @@ dsound="no"
 dsound="no"
 coreaudio="no"
 alsa="no"
+uuid="yes"
 fmod="no"
 fmod_lib=""
 fmod_inc=""
@@ -260,6 +261,8 @@ for opt do
   ;;
   --enable-alsa) alsa="yes"
   ;;
+  --enable-uuid) uuid="yes"
+  ;;
   --enable-dsound) dsound="yes"
   ;;
   --enable-fmod) fmod="yes"
@@ -404,6 +407,7 @@ echo "  --enable-adlib   enable 
 echo "  --enable-adlib   enable Adlib emulation"
 echo "  --enable-coreaudio   enable Coreaudio audio driver"
 echo "  --enable-alsaenable ALSA audio driver"
+echo "  --enable-uuidenable UUID generation for machines"
 echo "  --enable-fmodenable FMOD audio driver"
 echo "  --enable-dsound  enable DirectSound audio driver"
 echo "  --disable-vnc-tlsdisable TLS encryption for VNC server"
@@ -662,6 +666,23 @@ EOF
   fi
 fi
 
+##
+# uuid library
+if test "$uuid" = "yes" ; then
+  cat > $TMPC << EOF
+#include 
+int main(void) { uuid_t u; return 0; }
+EOF
+  if $cc -o $TMPE $TMPC -luuid 2> /dev/null ; then
+:
+  else
+echo
+echo "Error: Could not find uuid"
+echo "Make sure to have the uuid libs and headers installed."
+echo
+exit 1
+  fi
+fi
 # Check if tools are available to build documentation.
 if [ -x "`which texi2html 2>/dev/null`" ] && \
[ -x "`which pod2man 2>/dev/null`" ]; then
@@ -716,6 +737,7 @@ echo "Adlib support $adlib"
 echo "Adlib support $adlib"
 echo "CoreAudio support $coreaudio"
 echo "ALSA support  $alsa"
+echo "UUID support  $uuid"
 echo "DSound support$dsound"
 if test "$fmod" = "yes"; then
 if test -z $fmod_lib || test -z $fmod_inc; then
@@ -901,6 +923,10 @@ if test "$alsa" = "yes" ; then
   echo "CONFIG_ALSA=yes" >> $config_mak
   echo "#define CONFIG_ALSA 1" >> $config_h
 fi
+if test "$uuid" = "yes" ; then
+  echo "CONFIG_UUID=yes" >> $config_mak
+  echo "#define CONFIG_UUID 1" >> $config_h
+fi
 if test "$dsound" = "yes" ; then
   echo "CONFIG_DSOUND=yes" >> $config_mak
   echo "#define CONFIG_DSOUND 1" >> $config_h
diff -r e81bef5fa072 -r 115f40a4994b smbios.c
--- a/smbios.c  Tue Dec 11 13:42:01 2007 -0600
+++ b/smbios.c  Tue Dec 11 13:42:02 2007 -0600
@@ -25,11 +25,14 @@
 #include 
 #include 
 #include 
-#include 
 #include "hw/hw.h"
 #include "sysemu.h"
 #include "smbios_types.h"
 #include "config-host.h"
+
+#ifdef CONFIG_UUID
+#include 
+#endif
 
 /* Write a two-character hex representation of 'byte' to digits[].
Pre-condition: sizeof(digits) >= 2 */
@@ -489,9 +492,13 @@ load_smbios_tables(uint8_t *entry, uint8
 int len;
 uint32_t major_version = 0;
 uint32_t minor_version = 9;
+#ifdef CONFIG_UUID
 uuid_t uuid;
 
 uuid_generate(uuid);
+#else
+uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
+#endif
 
 len = write_smbios_tables(entry, table, phys_table_start,
   smp_cpus, (ram_size >> 20),




[Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present

2007-12-07 Thread Ryan Harper
3 files changed, 38 insertions(+), 2 deletions(-)
Makefile.target |5 -
configure   |   26 ++
smbios.c|9 -


# HG changeset patch
# User Ryan Harper <[EMAIL PROTECTED]>
# Date 1197058922 21600
# Node ID 3470dd05f46cc9f14c3fc9561d06031a4bc0ce7a
# Parent  37bf559ffcf74bfe62ec038c5818e4cf29b817f5
Optionally link against libuuid if present.

This patch makes libuuid optional.  If not detected, SMBIOS tables will use
canned UUID.

Signed-off-by: Ryan Harper <[EMAIL PROTECTED]>

diff -r 37bf559ffcf7 -r 3470dd05f46c Makefile.target
--- a/Makefile.target   Fri Dec 07 14:22:02 2007 -0600
+++ b/Makefile.target   Fri Dec 07 14:22:02 2007 -0600
@@ -402,6 +402,9 @@ VL_OBJS+=block-raw.o
 
 ifdef CONFIG_ALSA
 LIBS += -lasound
+endif
+ifdef CONFIG_UUID
+LIBS += -luuid
 endif
 ifdef CONFIG_DSOUND
 LIBS += -lole32 -ldxguid
@@ -535,7 +538,7 @@ ifndef CONFIG_DARWIN
 ifndef CONFIG_DARWIN
 ifndef CONFIG_WIN32
 ifndef CONFIG_SOLARIS
-VL_LIBS+=-lutil -luuid
+VL_LIBS+=-lutil
 endif
 endif
 endif
diff -r 37bf559ffcf7 -r 3470dd05f46c configure
--- a/configure Fri Dec 07 14:22:02 2007 -0600
+++ b/configure Fri Dec 07 14:22:02 2007 -0600
@@ -89,6 +89,7 @@ dsound="no"
 dsound="no"
 coreaudio="no"
 alsa="no"
+uuid="yes"
 fmod="no"
 fmod_lib=""
 fmod_inc=""
@@ -260,6 +261,8 @@ for opt do
   ;;
   --enable-alsa) alsa="yes"
   ;;
+  --enable-uuid) uuid="yes"
+  ;;
   --enable-dsound) dsound="yes"
   ;;
   --enable-fmod) fmod="yes"
@@ -404,6 +407,7 @@ echo "  --enable-adlib   enable 
 echo "  --enable-adlib   enable Adlib emulation"
 echo "  --enable-coreaudio   enable Coreaudio audio driver"
 echo "  --enable-alsaenable ALSA audio driver"
+echo "  --enable-uuidenable UUID generation for machines"
 echo "  --enable-fmodenable FMOD audio driver"
 echo "  --enable-dsound  enable DirectSound audio driver"
 echo "  --disable-vnc-tlsdisable TLS encryption for VNC server"
@@ -662,6 +666,23 @@ EOF
   fi
 fi
 
+##
+# uuid library
+if test "$uuid" = "yes" ; then
+  cat > $TMPC << EOF
+#include 
+int main(void) { uuid_t u; return 0; }
+EOF
+  if $cc -o $TMPE $TMPC -luuid 2> /dev/null ; then
+:
+  else
+echo
+echo "Error: Could not find uuid"
+echo "Make sure to have the uuid libs and headers installed."
+echo
+exit 1
+  fi
+fi
 # Check if tools are available to build documentation.
 if [ -x "`which texi2html 2>/dev/null`" ] && \
[ -x "`which pod2man 2>/dev/null`" ]; then
@@ -716,6 +737,7 @@ echo "Adlib support $adlib"
 echo "Adlib support $adlib"
 echo "CoreAudio support $coreaudio"
 echo "ALSA support  $alsa"
+echo "UUID support  $uuid"
 echo "DSound support$dsound"
 if test "$fmod" = "yes"; then
 if test -z $fmod_lib || test -z $fmod_inc; then
@@ -901,6 +923,10 @@ if test "$alsa" = "yes" ; then
   echo "CONFIG_ALSA=yes" >> $config_mak
   echo "#define CONFIG_ALSA 1" >> $config_h
 fi
+if test "$uuid" = "yes" ; then
+  echo "CONFIG_UUID=yes" >> $config_mak
+  echo "#define CONFIG_UUID 1" >> $config_h
+fi
 if test "$dsound" = "yes" ; then
   echo "CONFIG_DSOUND=yes" >> $config_mak
   echo "#define CONFIG_DSOUND 1" >> $config_h
diff -r 37bf559ffcf7 -r 3470dd05f46c smbios.c
--- a/smbios.c  Fri Dec 07 14:22:02 2007 -0600
+++ b/smbios.c  Fri Dec 07 14:22:02 2007 -0600
@@ -25,11 +25,14 @@
 #include 
 #include 
 #include 
-#include 
 #include "hw/hw.h"
 #include "sysemu.h"
 #include "smbios_types.h"
 #include "config-host.h"
+
+#ifdef CONFIG_UUID
+#include 
+#endif
 
 CPUState *first_cpu;
 
@@ -491,9 +494,13 @@ load_smbios_tables(uint8_t *entry, uint8
 int len;
 uint32_t major_version = 0;
 uint32_t minor_version = 9;
+#ifdef CONFIG_UUID
 uuid_t uuid;
 
 uuid_generate(uuid);
+#else
+uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
+#endif
 
 len = write_smbios_tables(entry, table, phys_table_start,
   smp_cpus, (ram_size >> 20),