qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ide-test: Fix endianness problems
@ 2013-05-15 13:00 Kevin Wolf
  2013-05-15 13:15 ` [Qemu-devel] [PATCH for-1.5?] " Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kevin Wolf @ 2013-05-15 13:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

The test case passes on big endian hosts now (tested on ppc64)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/ide-test.c | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/tests/ide-test.c b/tests/ide-test.c
index bdc1da7..365e995 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -252,7 +252,10 @@ static void test_bmdma_simple_rw(void)
     uintptr_t guest_buf = guest_alloc(guest_malloc, len);
 
     PrdtEntry prdt[] = {
-        { .addr = guest_buf, .size = len | PRDT_EOT },
+        {
+            .addr = cpu_to_le32(guest_buf),
+            .size = cpu_to_le32(len | PRDT_EOT),
+        },
     };
 
     buf = g_malloc(len);
@@ -304,7 +307,10 @@ static void test_bmdma_short_prdt(void)
     uint8_t status;
 
     PrdtEntry prdt[] = {
-        { .addr = 0, .size = 0x10 | PRDT_EOT },
+        {
+            .addr = 0,
+            .size = cpu_to_le32(0x10 | PRDT_EOT),
+        },
     };
 
     /* Normal request */
@@ -325,7 +331,10 @@ static void test_bmdma_long_prdt(void)
     uint8_t status;
 
     PrdtEntry prdt[] = {
-        { .addr = 0, .size = 0x1000 | PRDT_EOT },
+        {
+            .addr = 0,
+            .size = cpu_to_le32(0x1000 | PRDT_EOT),
+        },
     };
 
     /* Normal request */
@@ -355,6 +364,17 @@ static void test_bmdma_teardown(void)
     ide_test_quit();
 }
 
+static void string_cpu_to_be16(uint16_t *s, size_t bytes)
+{
+    g_assert((bytes & 1) == 0);
+    bytes /= 2;
+
+    while (bytes--) {
+        *s = cpu_to_be16(*s);
+        s++;
+    }
+}
+
 static void test_identify(void)
 {
     uint8_t data;
@@ -389,10 +409,12 @@ static void test_identify(void)
     assert_bit_clear(data, BSY | DF | ERR | DRQ);
 
     /* Check serial number/version in the buffer */
-    ret = memcmp(&buf[10], "ettsidks            ", 20);
+    string_cpu_to_be16(&buf[10], 20);
+    ret = memcmp(&buf[10], "testdisk            ", 20);
     g_assert(ret == 0);
 
-    ret = memcmp(&buf[23], "evsroi n", 8);
+    string_cpu_to_be16(&buf[23], 8);
+    ret = memcmp(&buf[23], "version ", 8);
     g_assert(ret == 0);
 
     /* Write cache enabled bit */
-- 
1.8.1.4

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

* Re: [Qemu-devel] [PATCH for-1.5?] ide-test: Fix endianness problems
  2013-05-15 13:00 [Qemu-devel] [PATCH] ide-test: Fix endianness problems Kevin Wolf
@ 2013-05-15 13:15 ` Paolo Bonzini
  2013-05-15 13:24   ` Kevin Wolf
  2013-05-16  9:04 ` [Qemu-devel] [PATCH] " Stefan Hajnoczi
  2013-05-16 12:50 ` Anthony Liguori
  2 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2013-05-15 13:15 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Anthony Liguori, qemu-devel, stefanha

Il 15/05/2013 15:00, Kevin Wolf ha scritto:
> The test case passes on big endian hosts now (tested on ppc64)
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

For 1.5?  Do we need an extra -rc?

Paolo

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

* Re: [Qemu-devel] [PATCH for-1.5?] ide-test: Fix endianness problems
  2013-05-15 13:15 ` [Qemu-devel] [PATCH for-1.5?] " Paolo Bonzini
@ 2013-05-15 13:24   ` Kevin Wolf
  2013-05-15 13:47     ` Paolo Bonzini
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Wolf @ 2013-05-15 13:24 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Anthony Liguori, qemu-devel, stefanha

Am 15.05.2013 um 15:15 hat Paolo Bonzini geschrieben:
> Il 15/05/2013 15:00, Kevin Wolf ha scritto:
> > The test case passes on big endian hosts now (tested on ppc64)
> > 
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> 
> For 1.5?  Do we need an extra -rc?

An extra -rc for a test case fix on big endian hosts is probably too
much... But if it can still be applied for the release, sure, why not.

Kevin

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

* Re: [Qemu-devel] [PATCH for-1.5?] ide-test: Fix endianness problems
  2013-05-15 13:24   ` Kevin Wolf
@ 2013-05-15 13:47     ` Paolo Bonzini
  2013-05-15 15:37       ` Anthony Liguori
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2013-05-15 13:47 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Anthony Liguori, qemu-devel, stefanha

Il 15/05/2013 15:24, Kevin Wolf ha scritto:
> Am 15.05.2013 um 15:15 hat Paolo Bonzini geschrieben:
>> Il 15/05/2013 15:00, Kevin Wolf ha scritto:
>>> The test case passes on big endian hosts now (tested on ppc64)
>>>
>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>>
>> For 1.5?  Do we need an extra -rc?
> 
> An extra -rc for a test case fix on big endian hosts is probably too
> much... But if it can still be applied for the release, sure, why not.

Well, we have Mac OS X not building, BSDs not supporting the GTK+
release, and SLIRP broken on Windows.  At least the first two have
patches on the list, the last is bisected but no patch yet.

Paolo

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

* Re: [Qemu-devel] [PATCH for-1.5?] ide-test: Fix endianness problems
  2013-05-15 13:47     ` Paolo Bonzini
@ 2013-05-15 15:37       ` Anthony Liguori
  2013-05-15 16:07         ` mdroth
  0 siblings, 1 reply; 9+ messages in thread
From: Anthony Liguori @ 2013-05-15 15:37 UTC (permalink / raw)
  To: Paolo Bonzini, Kevin Wolf; +Cc: qemu-devel, stefanha, Michael Roth

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 15/05/2013 15:24, Kevin Wolf ha scritto:
>> Am 15.05.2013 um 15:15 hat Paolo Bonzini geschrieben:
>>> Il 15/05/2013 15:00, Kevin Wolf ha scritto:
>>>> The test case passes on big endian hosts now (tested on ppc64)
>>>>
>>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>>>
>>> For 1.5?  Do we need an extra -rc?
>> 
>> An extra -rc for a test case fix on big endian hosts is probably too
>> much... But if it can still be applied for the release, sure, why not.
>
> Well, we have Mac OS X not building,

Peter's patch fixes it and will be in -rc2

> BSDs not supporting the GTK+

We don't have a formal support statement, but I don't think it's
controversial to say that BSD hosts are a secondary platform from a host
point of view.

A build issue in an optional feature on a secondary platform is not
something I'd consider a release blocker.

> release, and SLIRP broken on Windows.

This is a tough one since it's the default networking backend.  That
said, it likely has been broken for a while (months) and no one
noticed.  That makes me think that fixing in stable (particularly if we
scheduled a stable release for two weeks after 1.5.0) is reasonable.

Regards,

Anthony Liguori

>  At least the first two have
> patches on the list, the last is bisected but no patch yet.
>
> Paolo

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

* Re: [Qemu-devel] [PATCH for-1.5?] ide-test: Fix endianness problems
  2013-05-15 15:37       ` Anthony Liguori
@ 2013-05-15 16:07         ` mdroth
  0 siblings, 0 replies; 9+ messages in thread
From: mdroth @ 2013-05-15 16:07 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Kevin Wolf, Paolo Bonzini, qemu-devel, stefanha

On Wed, May 15, 2013 at 10:37:43AM -0500, Anthony Liguori wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
> > Il 15/05/2013 15:24, Kevin Wolf ha scritto:
> >> Am 15.05.2013 um 15:15 hat Paolo Bonzini geschrieben:
> >>> Il 15/05/2013 15:00, Kevin Wolf ha scritto:
> >>>> The test case passes on big endian hosts now (tested on ppc64)
> >>>>
> >>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> >>>
> >>> For 1.5?  Do we need an extra -rc?
> >> 
> >> An extra -rc for a test case fix on big endian hosts is probably too
> >> much... But if it can still be applied for the release, sure, why not.
> >
> > Well, we have Mac OS X not building,
> 
> Peter's patch fixes it and will be in -rc2
> 
> > BSDs not supporting the GTK+
> 
> We don't have a formal support statement, but I don't think it's
> controversial to say that BSD hosts are a secondary platform from a host
> point of view.
> 
> A build issue in an optional feature on a secondary platform is not
> something I'd consider a release blocker.
> 
> > release, and SLIRP broken on Windows.
> 
> This is a tough one since it's the default networking backend.  That
> said, it likely has been broken for a while (months) and no one
> noticed.  That makes me think that fixing in stable (particularly if we
> scheduled a stable release for two weeks after 1.5.0) is reasonable.

This is a bit tight. Freeze for 1.4.2 is the same day as 1.5.0, so we'd
be testing 2 stable releases at the same time.

So if we do this, I think it we should restrict it to fixing the specific
issues we're considering as potential 1.5.0 release blockers so we can
focus on those in testing rather than opening it up for general fixes.

> 
> Regards,
> 
> Anthony Liguori
> 
> >  At least the first two have
> > patches on the list, the last is bisected but no patch yet.
> >
> > Paolo
> 

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

* Re: [Qemu-devel] [PATCH] ide-test: Fix endianness problems
  2013-05-15 13:00 [Qemu-devel] [PATCH] ide-test: Fix endianness problems Kevin Wolf
  2013-05-15 13:15 ` [Qemu-devel] [PATCH for-1.5?] " Paolo Bonzini
@ 2013-05-16  9:04 ` Stefan Hajnoczi
  2013-05-16  9:12   ` Kevin Wolf
  2013-05-16 12:50 ` Anthony Liguori
  2 siblings, 1 reply; 9+ messages in thread
From: Stefan Hajnoczi @ 2013-05-16  9:04 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Kevin Wolf, qemu-devel

On Wed, May 15, 2013 at 03:00:39PM +0200, Kevin Wolf wrote:
> @@ -355,6 +364,17 @@ static void test_bmdma_teardown(void)
>      ide_test_quit();
>  }
>  
> +static void string_cpu_to_be16(uint16_t *s, size_t bytes)
> +{
> +    g_assert((bytes & 1) == 0);
> +    bytes /= 2;
> +
> +    while (bytes--) {
> +        *s = cpu_to_be16(*s);
> +        s++;
> +    }
> +}
> +
>  static void test_identify(void)
>  {
>      uint8_t data;
> @@ -389,10 +409,12 @@ static void test_identify(void)
>      assert_bit_clear(data, BSY | DF | ERR | DRQ);
>  
>      /* Check serial number/version in the buffer */
> -    ret = memcmp(&buf[10], "ettsidks            ", 20);
> +    string_cpu_to_be16(&buf[10], 20);
> +    ret = memcmp(&buf[10], "testdisk            ", 20);
>      g_assert(ret == 0);
>  
> -    ret = memcmp(&buf[23], "evsroi n", 8);
> +    string_cpu_to_be16(&buf[23], 8);
> +    ret = memcmp(&buf[23], "version ", 8);

It would have been simpler to specify string_cpu_to_be16() length in
"elements" instead of bytes.  Then you can drop the assertion and
conversion.  Not a problem though.

Anthony: Please take this patch without a pull request.  I think me
sending pull requests for a single late-rc fix doesn't add value.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

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

* Re: [Qemu-devel] [PATCH] ide-test: Fix endianness problems
  2013-05-16  9:04 ` [Qemu-devel] [PATCH] " Stefan Hajnoczi
@ 2013-05-16  9:12   ` Kevin Wolf
  0 siblings, 0 replies; 9+ messages in thread
From: Kevin Wolf @ 2013-05-16  9:12 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Anthony Liguori, qemu-devel

Am 16.05.2013 um 11:04 hat Stefan Hajnoczi geschrieben:
> Anthony: Please take this patch without a pull request.  I think me
> sending pull requests for a single late-rc fix doesn't add value.
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

It's already merged.

Kevin

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

* Re: [Qemu-devel] [PATCH] ide-test: Fix endianness problems
  2013-05-15 13:00 [Qemu-devel] [PATCH] ide-test: Fix endianness problems Kevin Wolf
  2013-05-15 13:15 ` [Qemu-devel] [PATCH for-1.5?] " Paolo Bonzini
  2013-05-16  9:04 ` [Qemu-devel] [PATCH] " Stefan Hajnoczi
@ 2013-05-16 12:50 ` Anthony Liguori
  2 siblings, 0 replies; 9+ messages in thread
From: Anthony Liguori @ 2013-05-16 12:50 UTC (permalink / raw)
  To: Kevin Wolf, qemu-devel; +Cc: Michael Roth

Applied.  Thanks.

Regards,

Anthony Liguori

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

end of thread, other threads:[~2013-05-16 12:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 13:00 [Qemu-devel] [PATCH] ide-test: Fix endianness problems Kevin Wolf
2013-05-15 13:15 ` [Qemu-devel] [PATCH for-1.5?] " Paolo Bonzini
2013-05-15 13:24   ` Kevin Wolf
2013-05-15 13:47     ` Paolo Bonzini
2013-05-15 15:37       ` Anthony Liguori
2013-05-15 16:07         ` mdroth
2013-05-16  9:04 ` [Qemu-devel] [PATCH] " Stefan Hajnoczi
2013-05-16  9:12   ` Kevin Wolf
2013-05-16 12:50 ` Anthony Liguori

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).