qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 32/32] ahci: Add test_identify case to ahci-t


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v3 32/32] ahci: Add test_identify case to ahci-test.
Date: Thu, 14 Aug 2014 17:52:05 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Aug 13, 2014 at 05:56:15PM -0400, John Snow wrote:
> +    /* Copy the existing Command #0 structure from the CLB into local memory,
> +     * and build a new command #0. */
> +    memread(clb, &cmd, sizeof(cmd));
> +    cmd.b1 = 5;    /* reg_h2d_fis is 5 double-words long */
> +    cmd.b2 = 0x04; /* clear PxTFD.STS.BSY when done */
> +    cmd.prdtl = 1; /* One PRD table entry. */

What about endianness?  This will be copied into guest memory, we should
use cpu_to_X() to ensure the correct endianness.

> +    cmd.prdbc = 0;
> +    cmd.ctba = table;
> +    cmd.ctbau = 0;
> +
> +    /* Construct our PRD, noting that DBC is 0-indexed. */
> +    prd.dba = data_ptr;

Endianness

> +    reg = px_rreg(i, AHCI_PX_TFD);
> +    g_assert_cmphex((reg & AHCI_PX_TFD_ERR), ==, pio->error);
> +    g_assert_cmphex((reg & AHCI_PX_TFD_STS), ==, pio->status);
> +    /* PIO FIS contains a "bytes read" field, it should match up. */
> +    g_assert_cmphex(pio->res4, ==, cmd.prdbc);

Endianness

Attachment: pgpEKZ9CWkqUq.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]