All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Li Qiang" <liq3ea@163.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Laszlo Ersek" <lersek@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	lvivier@redhat.com, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Qemu Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases
Date: Thu, 25 Apr 2019 22:29:18 +0800	[thread overview]
Message-ID: <CAKXe6SLXrthYFrQGVQNT4hK1-22wrteMNyygZgx_j=jtDfYC6g@mail.gmail.com> (raw)
In-Reply-To: <2b623811-1be2-159c-0fa6-c548aa9eea82@redhat.com>

Thomas Huth <thuth@redhat.com> 于2019年4月25日周四 下午5:57写道:

> On 24/04/2019 16.06, Li Qiang wrote:
> > In the disscuss of adding reboot timeout test case:
> > https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg03304.html
> >
> > Philippe suggested we should uses the only related option for one
> > specific test. However currently we uses one QTestState for all the
> > test cases. In order to achieve Philippe's idea, I split the test case
> > for its own QTestState. As this patchset has changed a lot, I don't bump
> > the version.
> >
> > Change since v1:
> > Add a patch to store the reboot_timeout as little endian
> > Fix the endian issue per Thomas's review
>
> The test still aborts on a big endian host:
>
> $ QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 tests/fw_cfg-test
> /x86_64/fw_cfg/signature: OK
> /x86_64/fw_cfg/id: OK
> /x86_64/fw_cfg/uuid: OK
> /x86_64/fw_cfg/ram_size: OK
> /x86_64/fw_cfg/nographic: OK
> /x86_64/fw_cfg/nb_cpus: OK
> /x86_64/fw_cfg/max_cpus: OK
> /x86_64/fw_cfg/numa: OK
> /x86_64/fw_cfg/boot_menu: OK
> /x86_64/fw_cfg/reboot_timeout: **
>
> ERROR:/home/thuth/devel/qemu/tests/fw_cfg-test.c:190:test_fw_cfg_reboot_timeout:
> assertion failed (reboot_timeout == 15): (251658240 == 15)
> Aborted
>
> 251658240 is 0x0F000000, i.e. a byte-swapped 0xf = 15 ... i.e. you still
> got an endianess issue somewhere in the code.
>


Hmmmm,

I have thought a long time, still can't point where is wrong.

Let's from the result:
0x0f000000 in the big endian laid as this:
low ---> high
0x0f 00 00 00

As I have swapped before the compare so it is read as this:
low ---> high
00 00 00 0x0f

However from the store side:
the 15 in big endian is:
low ---> high
00 00 00 0x0f

But Before I store it, I convert it to little endian, so following should
be stored:
low ---> high
0x0f 00 00 00

Do you apply the patch 3 and recompile the qemu binary?
If it is, I may need your help as I have no big endian host device.

You can debug and  inspect the memory layout and point out where is wrong.

Thanks,
Li Qiang







>
>  Thomas
>

WARNING: multiple messages have this Message-ID (diff)
From: Li Qiang <liq3ea@gmail.com>
To: Thomas Huth <thuth@redhat.com>
Cc: lvivier@redhat.com, "Laszlo Ersek" <lersek@redhat.com>,
	"Li Qiang" <liq3ea@163.com>,
	"Qemu Developers" <qemu-devel@nongnu.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases
Date: Thu, 25 Apr 2019 22:29:18 +0800	[thread overview]
Message-ID: <CAKXe6SLXrthYFrQGVQNT4hK1-22wrteMNyygZgx_j=jtDfYC6g@mail.gmail.com> (raw)
Message-ID: <20190425142918.zbY4dzwCXSaeqde3PpGDVuLuAyuo2jJ1sNxvDLajW1A@z> (raw)
In-Reply-To: <2b623811-1be2-159c-0fa6-c548aa9eea82@redhat.com>

Thomas Huth <thuth@redhat.com> 于2019年4月25日周四 下午5:57写道:

> On 24/04/2019 16.06, Li Qiang wrote:
> > In the disscuss of adding reboot timeout test case:
> > https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg03304.html
> >
> > Philippe suggested we should uses the only related option for one
> > specific test. However currently we uses one QTestState for all the
> > test cases. In order to achieve Philippe's idea, I split the test case
> > for its own QTestState. As this patchset has changed a lot, I don't bump
> > the version.
> >
> > Change since v1:
> > Add a patch to store the reboot_timeout as little endian
> > Fix the endian issue per Thomas's review
>
> The test still aborts on a big endian host:
>
> $ QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 tests/fw_cfg-test
> /x86_64/fw_cfg/signature: OK
> /x86_64/fw_cfg/id: OK
> /x86_64/fw_cfg/uuid: OK
> /x86_64/fw_cfg/ram_size: OK
> /x86_64/fw_cfg/nographic: OK
> /x86_64/fw_cfg/nb_cpus: OK
> /x86_64/fw_cfg/max_cpus: OK
> /x86_64/fw_cfg/numa: OK
> /x86_64/fw_cfg/boot_menu: OK
> /x86_64/fw_cfg/reboot_timeout: **
>
> ERROR:/home/thuth/devel/qemu/tests/fw_cfg-test.c:190:test_fw_cfg_reboot_timeout:
> assertion failed (reboot_timeout == 15): (251658240 == 15)
> Aborted
>
> 251658240 is 0x0F000000, i.e. a byte-swapped 0xf = 15 ... i.e. you still
> got an endianess issue somewhere in the code.
>


Hmmmm,

I have thought a long time, still can't point where is wrong.

Let's from the result:
0x0f000000 in the big endian laid as this:
low ---> high
0x0f 00 00 00

As I have swapped before the compare so it is read as this:
low ---> high
00 00 00 0x0f

However from the store side:
the 15 in big endian is:
low ---> high
00 00 00 0x0f

But Before I store it, I convert it to little endian, so following should
be stored:
low ---> high
0x0f 00 00 00

Do you apply the patch 3 and recompile the qemu binary?
If it is, I may need your help as I have no big endian host device.

You can debug and  inspect the memory layout and point out where is wrong.

Thanks,
Li Qiang







>
>  Thomas
>

  reply	other threads:[~2019-04-25 14:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 14:06 [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases Li Qiang
2019-04-24 14:06 ` Li Qiang
2019-04-24 14:06 ` [Qemu-devel] [PATCH v2 1/5] tests: refactor fw_cfg_test Li Qiang
2019-04-24 14:06   ` Li Qiang
2019-04-24 14:06 ` [Qemu-devel] [PATCH v2 2/5] tests: fw_cfg: add a function to get the fw_cfg file Li Qiang
2019-04-24 14:06   ` Li Qiang
2019-04-24 14:06 ` [Qemu-devel] [PATCH v2 3/5] fw_cfg: reboot: store reboot-timeout as little endian Li Qiang
2019-04-24 14:06   ` Li Qiang
2019-04-24 14:06 ` [Qemu-devel] [PATCH v2 4/5] tests: fw_cfg: add reboot_timeout test case Li Qiang
2019-04-24 14:06   ` Li Qiang
2019-04-24 14:06 ` [Qemu-devel] [PATCH v2 5/5] tests: fw_cfg: add splash time " Li Qiang
2019-04-24 14:06   ` Li Qiang
2019-04-25  9:57 ` [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases Thomas Huth
2019-04-25  9:57   ` Thomas Huth
2019-04-25 14:29   ` Li Qiang [this message]
2019-04-25 14:29     ` Li Qiang
2019-04-29  5:09     ` Li Qiang
2019-04-29  5:09       ` Li Qiang
2019-04-29 13:18       ` Thomas Huth
2019-04-29 13:18         ` Thomas Huth
2019-04-29 13:46         ` Li Qiang
2019-04-29 13:46           ` Li Qiang
2019-05-09  9:57 ` Li Qiang
2019-05-17  2:28   ` Li Qiang
2019-05-20 21:29     ` Philippe Mathieu-Daudé
2019-05-21  2:17       ` 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='CAKXe6SLXrthYFrQGVQNT4hK1-22wrteMNyygZgx_j=jtDfYC6g@mail.gmail.com' \
    --to=liq3ea@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=liq3ea@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.