qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: libvir-list@redhat.com, Michal Privoznik <mprivozn@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 0/1] vmx: Fix <genid/> mapping
Date: Wed, 29 Sep 2021 11:10:35 +0100	[thread overview]
Message-ID: <YVQ7my3BHi1On/JK@redhat.com> (raw)
In-Reply-To: <20210929095719.GH3361@redhat.com>

On Wed, Sep 29, 2021 at 10:57:19AM +0100, Richard W.M. Jones wrote:
> Looking at the qemu code the problem IMHO is:
> 
> https://gitlab.com/qemu-project/qemu/-/blob/6b54a31bf7b403672a798b6443b1930ae6c74dea/docs/specs/vmgenid.txt#L189
> https://gitlab.com/qemu-project/qemu/-/blob/6b54a31bf7b403672a798b6443b1930ae6c74dea/hw/acpi/vmgenid.c#L37
> 
> This byte swapping makes no sense to me.  How do we know that the
> guest is little endian?  What will this code do for BE guests?  I
> think qemu would be better off treating the "GUID" as a list of bytes
> and writing that exactly into the guest memory.

This is an artifact of the HyperV only caring about x86 and thus leaving
endianness unspecified in the spec for GenID. QEMU docs say


Endian-ness Considerations:
---------------------------

Although not specified in Microsoft's document, it is assumed that the
device is expected to use little-endian format.

All GUID passed in via command line or monitor are treated as big-endian.
GUID values displayed via monitor are shown in big-endian format.


So by extension if libvirt is passing the value from its XML straight
to QEMU, then libvirt has effectively defined that the XML is storing
it big-endian too.

This could be where the confusion with VMX config is coming into play,
though the byte re-ordering in v2v seems more complex than just an
endianess-fiddle ?

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2021-09-29 10:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1632900578.git.mprivozn@redhat.com>
2021-09-29  9:20 ` [PATCH 0/1] vmx: Fix <genid/> mapping Richard W.M. Jones
2021-09-29  9:33   ` Daniel P. Berrangé
2021-09-29  9:46     ` Richard W.M. Jones
2021-09-29 10:07       ` Daniel P. Berrangé
2021-09-29 10:24         ` Richard W.M. Jones
2021-09-29 10:24       ` Richard W.M. Jones
2021-09-29  9:57     ` Richard W.M. Jones
2021-09-29 10:10       ` Daniel P. Berrangé [this message]
2021-09-29 10:34         ` Richard W.M. Jones
2021-09-30  7:33           ` Richard W.M. Jones
2021-09-30  8:35             ` Laszlo Ersek
2021-09-30  8:47             ` Daniel P. Berrangé
2021-09-30  9:16               ` Richard W.M. Jones
2021-10-04  9:59                 ` Richard W.M. Jones
2021-10-04 14:50                   ` Laszlo Ersek
2021-10-04 14:59                     ` Richard W.M. Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVQ7my3BHi1On/JK@redhat.com \
    --to=berrange@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).