public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* OEM version of Windows in kvm (SLIC &Co)
@ 2010-03-24 15:35 Michael Tokarev
  2010-03-25 11:58 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tokarev @ 2010-03-24 15:35 UTC (permalink / raw)
  To: KVM list

After a series of tries, I finally made my OEM copy
of Windows 7 to work in KVM using the original
registration key.

In short, one need SCIC table from the BIOS on the
original hardware, -- it should be in the BIOS in
the virtual machine too.  And second part is that
other tables in our virtual BIOS need to have the
same OEM identification as the SLIC table - namely
FACP (in case of kmv), and also XSDT and RSDT if
present.

The way to insert custom acpi table is using -acpitable
parameter.  But unfortunately kvm does not provide a way
to insert whole table this way, together with the header --
instead, it expects the header on the command line.  It
is possible to extract the header into printable form for
the command line, and cut it from the slic.bin, but I used
different way: I modified hw/acpi.c load whole thing from
the given file.

After doing that, and giving -acpitable file=slic.bin (with
file= parameter being my quick-n-dirty addition) to kvm,
I were able to see the correct SLIC table in /sys/firmware/
acpi/tables/SLIC in linux.  But windows refused to activate.

So the next step was to modify seabios OEM string which it
placed to other tables.  For that, in src/acpi.c I just added

  memcpy(h->oem_id, "_ASUS_Notebook", 14);

to build_header() routine (yes it is a notebook from Asus with
licensed version of windows7 professional).

And after that step windows happily told me that I'm now using
genuine copy of it and the activation is completed.

As far as I can see I have right to run my licensed copy this
way, on the same notebook it were purchased with.

So.. the real question is: while this quick-n-dirty proof of
concept works, it's not the way to go.  What can be done to
simplify the whole thing and to do it the Right Way?

At least having a way to accept complete acpi table (with header
and checksum and everything) is - IMHO - a good thing.

But I'm not sure about the OEM ID strings in other tables in seabios, --
it is quite ugly, both in implementation (how to tell bios to change
its identify?) and in the whole fact of it, since we're lying to the
(virtual) machine.  But from another point of view, it should be a
good debugging tool, since some software behaves differently given
one or another strings in the BIOS...

Comments, anyone?

Thanks!

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: OEM version of Windows in kvm (SLIC &Co)
  2010-03-24 15:35 OEM version of Windows in kvm (SLIC &Co) Michael Tokarev
@ 2010-03-25 11:58 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-03-25 11:58 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: KVM list

On 03/24/2010 05:35 PM, Michael Tokarev wrote:
> At least having a way to accept complete acpi table (with header
> and checksum and everything) is - IMHO - a good thing.
>    

Agreed.

> But I'm not sure about the OEM ID strings in other tables in seabios, --
> it is quite ugly, both in implementation (how to tell bios to change
> its identify?)

There is the firmware configuration interface, see hw/fw_cfg.[ch] (used 
to expose the acpi tables as well).

> and in the whole fact of it, since we're lying to the
> (virtual) machine.  But from another point of view, it should be a
> good debugging tool, since some software behaves differently given
> one or another strings in the BIOS...
>    

It's perfectly legitimate to lie to your guests.

For the OEM ID, we really need to change it to qemu for 0.13, so we'll 
need a firmware config interface for this even if we don't want to 
expose it to users.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-25 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 15:35 OEM version of Windows in kvm (SLIC &Co) Michael Tokarev
2010-03-25 11:58 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox