From: Laszlo Ersek <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, Li Qiang <liq3ea@gmail.com>
Cc: "Thomas Huth" <thuth@redhat.com>, "Li Qiang" <liq3ea@163.com>,
lvivier@redhat.com, "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Qemu Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 3/4] tests: fw_cfg: add reboot_timeout test case
Date: Fri, 26 Apr 2019 18:53:33 +0200 [thread overview]
Message-ID: <e5087d25-fc45-84e9-db61-5a4c38f69c74@redhat.com> (raw)
In-Reply-To: <20190425081519.n4leez6sz2wlvpla@sirius.home.kraxel.org>
On 04/25/19 10:15, Gerd Hoffmann wrote:
> On Wed, Apr 24, 2019 at 09:16:56AM +0800, Li Qiang wrote:
>> Thomas Huth <thuth@redhat.com> 于2019年4月24日周三 上午12:29写道:
>>
>>> Is this endianess-safe? Or do you need to byteswap reboot_timeout if the
>>> host and guest endianess does not match?
>>
>> Good question!
>>
>> IIUC, the qemu fw_cfg store the 'file' entry data just in byte stream.
>
> No. Integers are defined to be little endian. See fw_cfg_add_i64() for
> example, there is an explicit cpu_to_le64() call for that.
Endianness may be defined on a case-by-case basis (i.e. if you introduce
a new named fw_cfg file, you can make its contents whatever you like);
however, the integer-adding/modifying helper functions do express a
preference for endianness. Search "include/hw/nvram/fw_cfg.h" for "endian".
Thanks
Laszlo
WARNING: multiple messages have this Message-ID (diff)
From: Laszlo Ersek <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, Li Qiang <liq3ea@gmail.com>
Cc: lvivier@redhat.com, "Thomas Huth" <thuth@redhat.com>,
"Li Qiang" <liq3ea@163.com>,
"Qemu Developers" <qemu-devel@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/4] tests: fw_cfg: add reboot_timeout test case
Date: Fri, 26 Apr 2019 18:53:33 +0200 [thread overview]
Message-ID: <e5087d25-fc45-84e9-db61-5a4c38f69c74@redhat.com> (raw)
Message-ID: <20190426165333.oQHZloC9CQUn1FbM1WaJ593wFgO5mxTKzfmgjuJMpdc@z> (raw)
In-Reply-To: <20190425081519.n4leez6sz2wlvpla@sirius.home.kraxel.org>
On 04/25/19 10:15, Gerd Hoffmann wrote:
> On Wed, Apr 24, 2019 at 09:16:56AM +0800, Li Qiang wrote:
>> Thomas Huth <thuth@redhat.com> 于2019年4月24日周三 上午12:29写道:
>>
>>> Is this endianess-safe? Or do you need to byteswap reboot_timeout if the
>>> host and guest endianess does not match?
>>
>> Good question!
>>
>> IIUC, the qemu fw_cfg store the 'file' entry data just in byte stream.
>
> No. Integers are defined to be little endian. See fw_cfg_add_i64() for
> example, there is an explicit cpu_to_le64() call for that.
Endianness may be defined on a case-by-case basis (i.e. if you introduce
a new named fw_cfg file, you can make its contents whatever you like);
however, the integer-adding/modifying helper functions do express a
preference for endianness. Search "include/hw/nvram/fw_cfg.h" for "endian".
Thanks
Laszlo
next prev parent reply other threads:[~2019-04-26 16:53 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-20 10:00 [Qemu-devel] [PATCH 0/4] fw_cfg_test refactor and add two test cases Li Qiang
2019-04-20 10:00 ` Li Qiang
2019-04-20 10:00 ` [Qemu-devel] [PATCH 1/4] tests: refactor fw_cfg_test Li Qiang
2019-04-20 10:00 ` Li Qiang
2019-04-23 16:25 ` Thomas Huth
2019-04-23 16:25 ` Thomas Huth
2019-04-20 10:00 ` [Qemu-devel] [PATCH 2/4] tests: fw_cfg: add a function to get the fw_cfg file Li Qiang
2019-04-20 10:00 ` Li Qiang
2019-04-23 16:26 ` Thomas Huth
2019-04-23 16:26 ` Thomas Huth
2019-04-20 10:00 ` [Qemu-devel] [PATCH 3/4] tests: fw_cfg: add reboot_timeout test case Li Qiang
2019-04-20 10:00 ` Li Qiang
2019-04-23 16:29 ` Thomas Huth
2019-04-23 16:29 ` Thomas Huth
2019-04-24 1:16 ` Li Qiang
2019-04-24 1:16 ` Li Qiang
2019-04-24 7:30 ` Thomas Huth
2019-04-24 7:30 ` Thomas Huth
2019-04-24 7:41 ` Li Qiang
2019-04-24 7:41 ` Li Qiang
2019-04-24 14:08 ` Li Qiang
2019-04-24 14:08 ` Li Qiang
2019-04-25 8:15 ` Gerd Hoffmann
2019-04-25 8:15 ` Gerd Hoffmann
2019-04-25 8:29 ` Li Qiang
2019-04-25 8:29 ` Li Qiang
2019-04-25 10:23 ` Philippe Mathieu-Daudé
2019-04-25 10:23 ` Philippe Mathieu-Daudé
2019-04-26 16:57 ` Laszlo Ersek
2019-04-26 16:57 ` Laszlo Ersek
2019-04-26 16:53 ` Laszlo Ersek [this message]
2019-04-26 16:53 ` Laszlo Ersek
2019-04-20 10:00 ` [Qemu-devel] [PATCH 4/4] tests: fw_cfg: add splash time " Li Qiang
2019-04-20 10:00 ` Li Qiang
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=e5087d25-fc45-84e9-db61-5a4c38f69c74@redhat.com \
--to=lersek@redhat.com \
--cc=kraxel@redhat.com \
--cc=liq3ea@163.com \
--cc=liq3ea@gmail.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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).