Commit graph

5340 commits

Author SHA1 Message Date
Avi Kivity 9074e0e3e8 ppc405_uc: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:23:20 -05:00
Avi Kivity c76f990e8d pcie_host: convert to memory API
Assuming that mmcfg size cannot change at runtime.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:22:03 -05:00
Avi Kivity 689a1921ae onenand: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:22:03 -05:00
Avi Kivity 64066a8fb6 omap_gpmc/nseries/tusb6010: convert to memory API
Somewhat clumsy since it needs a variable sized region.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:21:57 -05:00
Avi Kivity d09871f69c tusb6010: move declarations to new file tusb6010.h
Avoid #include hell.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity fc2bf44972 gt64xxx.c: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity f69bf9d41c armv7m: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity e219dea2f3 arm_timer: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:40 -05:00
Avi Kivity 460d7c53cd arm_sysctl: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:39 -05:00
Avi Kivity 755c080225 arm_gic: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Avi Kivity 312b4234c6 apic: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Avi Kivity 3812ed0baa apb_pci: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Hervé Poussineau 145aebeca4 pcnet: fix wrong opaque (broken by bd8d6f7cad)
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:20:10 -05:00
Bjørn Mork d4044c2a6b e1000: use MII status register for link up/down
Some guests will use the standard MII status register
to verify link state.  They will not notice link changes
unless this register is updated.

Verified with Linux 3.0 and Windows XP guests.

Without this patch, ethtool will report speed and duplex as
unknown when the link is down, but still report the link as
up.  This is because the Linux e1000 driver checks the
mac_reg[STATUS] register link state before it checks speed
and duplex, but uses the phy_reg[PHY_STATUS] register for
the actual link state check.  Fix by updating both registers
on link state changes.

Linux guest before:

 (qemu) set_link e1000.0 off

 kvm-sid:~# ethtool eth0
 Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: umbg
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

 (qemu) set_link e1000.0 on

Linux guest after:

 (qemu) set_link e1000.0 off
 [   63.384221] e1000: eth0 NIC Link is Down

 kvm-sid:~# ethtool eth0
 Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: umbg
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: no

 (qemu) set_link e1000.0 on
 [   84.304582] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:51 -05:00
Anthony Liguori 903396ad3e char: remove qemu_chr_send_event()
It's dead code.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:44 -05:00
Anthony Liguori 74c0d6f020 char: rename qemu_chr_get_msgfd() -> qemu_chr_fe_get_msgfd()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:44 -05:00
Anthony Liguori 70f24fb6c6 char: rename qemu_chr_close() -> qemu_chr_delete()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:43 -05:00
Anthony Liguori 27143a445b char: rename qemu_chr_open() -> qemu_chr_new()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:43 -05:00
Anthony Liguori 41084f1bad char: qemu_chr_ioctl() -> qemu_chr_fe_ioctl()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:37 -05:00
Anthony Liguori 2817822dce char: rename qemu_chr_guest_close() -> qemu_chr_fe_close()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori c9d830eddc char: rename qemu_chr_guest_open() -> qemu_chr_fe_open()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori 909cda12b5 char: rename qemu_chr_can_read() -> qemu_chr_be_can_read()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori fa5efccb2a char: rename qemu_chr_read() -> qemu_chr_be_write()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:16 -05:00
Anthony Liguori e7e71b0ec6 char: rename qemu_chr_printf() -> qemu_chr_fe_printf()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:15 -05:00
Anthony Liguori 2cc6e0a142 char: rename qemu_chr_write() -> qemu_chr_fe_write()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-22 10:17:15 -05:00
Anthony Liguori f1a7104a5f Merge remote-tracking branch 'pmaydell/armhw-for-upstream' into staging 2011-08-21 18:34:33 -05:00
Blue Swirl 30c2f2388a escc: replace DPRINTFs with tracepoints
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:02:02 +00:00
Blue Swirl 42c812b98b m48t59: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct M48t59State {
	uint32_t                   type;                 /*     0     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   IRQ;                  /*     8     8 */
	uint32_t                   io_base;              /*    16     4 */
	uint32_t                   size;                 /*    20     4 */
	time_t                     time_offset;          /*    24     8 */
	time_t                     stop_time;            /*    32     8 */
	struct tm                  alarm;                /*    40    56 */
	/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
	struct QEMUTimer *         alrm_timer;           /*    96     8 */
	struct QEMUTimer *         wd_timer;             /*   104     8 */
	uint8_t                    lock;                 /*   112     1 */

	/* XXX 1 byte hole, try to pack */

	uint16_t                   addr;                 /*   114     2 */

	/* XXX 4 bytes hole, try to pack */

	uint8_t *                  buffer;               /*   120     8 */
	/* --- cacheline 2 boundary (128 bytes) --- */

	/* size: 128, cachelines: 2 */
	/* sum members: 119, holes: 3, sum holes: 9 */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:02:01 +00:00
Blue Swirl d7b9553489 escc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct ChannelState {
...
	ChnType                    type;                 /*    32     4 */

	/* XXX 4 bytes hole, try to pack */
...
	uint8_t                    rregs[16];            /*    66    16 */

	/* XXX 2 bytes hole, try to pack */
...
	/* size: 392, cachelines: 7 */
	/* sum members: 382, holes: 2, sum holes: 6 */
	/* padding: 4 */
	/* last cacheline: 8 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:01:59 +00:00
Blue Swirl 242cca4fdf fdc: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct FDCtrl {
	uint8_t                    version;              /*     0     1 */

	/* XXX 7 bytes hole, try to pack */

	qemu_irq                   irq;                  /*     8     8 */
	int                        dma_chann;            /*    16     4 */

	/* XXX 4 bytes hole, try to pack */
...
	uint8_t                    status2;              /*    42     1 */

	/* XXX 5 bytes hole, try to pack */

	uint8_t *                  fifo;                 /*    48     8 */
...
	uint8_t                    pwrd;                 /*    76     1 */

	/* XXX 3 bytes hole, try to pack */

	int                        sun4m;                /*    80     4 */
	uint8_t                    num_floppies;         /*    84     1 */

	/* XXX 3 bytes hole, try to pack */

	FDrive                     drives[2];            /*    88    64 */
	/* --- cacheline 2 boundary (128 bytes) was 24 bytes ago --- */
	int                        reset_sensei;         /*   152     4 */

	/* size: 160, cachelines: 3 */
	/* sum members: 134, holes: 5, sum holes: 22 */
	/* padding: 4 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 20:01:57 +00:00
Blue Swirl fe87aa83c6 pcnet: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct PCNetState_st {
...
	uint16_t                   bcr[32];              /*   340    64 */

	/* XXX 4 bytes hole, try to pack */
...
	int                        tx_busy;              /*  4520     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   irq;                  /*  4528     8 */
	void                       (*phys_mem_read)(void *, target_phys_addr_t, uint8_t *, int, int); /*  4536     8 */
	/* --- cacheline 71 boundary (4544 bytes) --- */
	void                       (*phys_mem_write)(void *, target_phys_addr_t, uint8_t *, int, int); /*  4544     8 */
	void *                     dma_opaque;           /*  4552     8 */
	int                        looptest;             /*  4560     4 */

	/* size: 4568, cachelines: 72 */
	/* sum members: 4556, holes: 2, sum holes: 8 */
	/* padding: 4 */
	/* last cacheline: 24 bytes */
};	/* definitions: 2 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:38 +00:00
Blue Swirl 9a975d6356 esp: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct ESPState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	uint32_t                   it_shift;             /*  5648     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   irq;                  /*  5656     8 */
	uint8_t                    rregs[16];            /*  5664    16 */
	uint8_t                    wregs[16];            /*  5680    16 */
	/* --- cacheline 89 boundary (5696 bytes) --- */
	int32_t                    ti_size;              /*  5696     4 */
	uint32_t                   ti_rptr;              /*  5700     4 */
	uint32_t                   ti_wptr;              /*  5704     4 */
	uint8_t                    ti_buf[16];           /*  5708    16 */
	uint32_t                   status;               /*  5724     4 */
	uint32_t                   dma;                  /*  5728     4 */

	/* XXX 4 bytes hole, try to pack */

	SCSIBus                    bus;                  /*  5736  2120 */
	/* --- cacheline 122 boundary (7808 bytes) was 48 bytes ago --- */
	SCSIDevice *               current_dev;          /*  7856     8 */
	SCSIRequest *              current_req;          /*  7864     8 */
	/* --- cacheline 123 boundary (7872 bytes) --- */
	uint8_t                    cmdbuf[16];           /*  7872    16 */
	uint32_t                   cmdlen;               /*  7888     4 */
	uint32_t                   do_cmd;               /*  7892     4 */
	uint32_t                   dma_left;             /*  7896     4 */
	uint32_t                   dma_counter;          /*  7900     4 */
	uint8_t *                  async_buf;            /*  7904     8 */
	uint32_t                   async_len;            /*  7912     4 */

	/* XXX 4 bytes hole, try to pack */

	ESPDMAMemoryReadWriteFunc  dma_memory_read;      /*  7920     8 */
	ESPDMAMemoryReadWriteFunc  dma_memory_write;     /*  7928     8 */
	/* --- cacheline 124 boundary (7936 bytes) --- */
	void *                     dma_opaque;           /*  7936     8 */
	int                        dma_enabled;          /*  7944     4 */

	/* XXX 4 bytes hole, try to pack */

	void                       (*dma_cb)(ESPState *); /*  7952     8 */

	/* size: 7960, cachelines: 125 */
	/* sum members: 7944, holes: 4, sum holes: 16 */
	/* last cacheline: 24 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:36 +00:00
Blue Swirl 61999750d3 sun4m: avoid structure holes spotted by pahole
Edited report from pahole on amd64 host:
struct sun4c_hwdef {
...
	uint8_t                    nvram_machine_id;     /*   112     1 */

	/* XXX 1 byte hole, try to pack */
...
	/* size: 136, cachelines: 3 */
	/* sum members: 135, holes: 1, sum holes: 1 */
	/* last cacheline: 8 bytes */
};	/* definitions: 1 */

struct sun4d_hwdef {
...
	uint8_t                    nvram_machine_id;     /*   128     1 */

	/* XXX 1 byte hole, try to pack */
...
	/* size: 152, cachelines: 3 */
	/* sum members: 151, holes: 1, sum holes: 1 */
	/* last cacheline: 24 bytes */
};	/* definitions: 1 */

struct sun4m_hwdef {
...
	uint8_t                    nvram_machine_id;     /*   260     1 */

	/* XXX 1 byte hole, try to pack */

	uint16_t                   machine_id;           /*   262     2 */
	uint32_t                   iommu_version;        /*   264     4 */

	/* XXX 4 bytes hole, try to pack */
...
	/* size: 288, cachelines: 5 */
	/* sum members: 283, holes: 2, sum holes: 5 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

Fix by rearranging the structures to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:35 +00:00
Blue Swirl 427a66c3a5 tcx: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct TCXState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	target_phys_addr_t         addr;                 /*  5648     8 */
	DisplayState *             ds;                   /*  5656     8 */
	uint8_t *                  vram;                 /*  5664     8 */
	uint32_t *                 vram24;               /*  5672     8 */
	uint32_t *                 cplane;               /*  5680     8 */
	ram_addr_t                 vram_offset;          /*  5688     8 */
	/* --- cacheline 89 boundary (5696 bytes) --- */
	ram_addr_t                 vram24_offset;        /*  5696     8 */
	ram_addr_t                 cplane_offset;        /*  5704     8 */
	uint32_t                   vram_size;            /*  5712     4 */
	uint16_t                   width;                /*  5716     2 */
	uint16_t                   height;               /*  5718     2 */
	uint16_t                   depth;                /*  5720     2 */
	uint8_t                    r[256];               /*  5722   256 */
	/* --- cacheline 93 boundary (5952 bytes) was 26 bytes ago --- */
	uint8_t                    g[256];               /*  5978   256 */
	/* --- cacheline 97 boundary (6208 bytes) was 26 bytes ago --- */
	uint8_t                    b[256];               /*  6234   256 */

	/* XXX 2 bytes hole, try to pack */

	/* --- cacheline 101 boundary (6464 bytes) was 28 bytes ago --- */
	uint32_t                   palette[256];         /*  6492  1024 */
	/* --- cacheline 117 boundary (7488 bytes) was 28 bytes ago --- */
	uint8_t                    dac_index;            /*  7516     1 */
	uint8_t                    dac_state;            /*  7517     1 */

	/* size: 7520, cachelines: 118 */
	/* sum members: 7516, holes: 1, sum holes: 2 */
	/* padding: 2 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:33 +00:00
Blue Swirl 149e1ea154 sun4m_iommu: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct IOMMUState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	uint32_t                   regs[4096];           /*  5648 16384 */
	/* --- cacheline 344 boundary (22016 bytes) was 16 bytes ago --- */
	target_phys_addr_t         iostart;              /* 22032     8 */
	uint32_t                   version;              /* 22040     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   irq;                  /* 22048     8 */

	/* size: 22056, cachelines: 345 */
	/* sum members: 22052, holes: 1, sum holes: 4 */
	/* last cacheline: 40 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:32 +00:00
Blue Swirl 07dd0035d8 slavio_intctl: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct SLAVIO_INTCTLState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	uint32_t                   intregm_pending;      /*  5648     4 */
	uint32_t                   intregm_disabled;     /*  5652     4 */
	uint32_t                   target_cpu;           /*  5656     4 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   cpu_irqs[16][16];     /*  5664  2048 */
	/* --- cacheline 120 boundary (7680 bytes) was 32 bytes ago --- */
	SLAVIO_CPUINTCTLState      slaves[16];           /*  7712   384 */
	/* --- cacheline 126 boundary (8064 bytes) was 32 bytes ago --- */

	/* size: 8096, cachelines: 127 */
	/* sum members: 8092, holes: 1, sum holes: 4 */
	/* last cacheline: 32 bytes */
};	/* definitions: 1 */

struct SLAVIO_CPUINTCTLState {
	uint32_t                   intreg_pending;       /*     0     4 */

	/* XXX 4 bytes hole, try to pack */

	struct SLAVIO_INTCTLState * master;              /*     8     8 */
	uint32_t                   cpu;                  /*    16     4 */
	uint32_t                   irl_out;              /*    20     4 */

	/* size: 24, cachelines: 1 */
	/* sum members: 20, holes: 1, sum holes: 4 */
	/* last cacheline: 24 bytes */
};	/* definitions: 1 */

Fix by rearranging the structures to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:31 +00:00
Blue Swirl 97bbb109b1 slavio_misc: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct MiscState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	qemu_irq                   irq;                  /*  5648     8 */
	uint32_t                   dummy;                /*  5656     4 */
	uint8_t                    config;               /*  5660     1 */
	uint8_t                    aux1;                 /*  5661     1 */
	uint8_t                    aux2;                 /*  5662     1 */
	uint8_t                    diag;                 /*  5663     1 */
	uint8_t                    mctrl;                /*  5664     1 */
	uint8_t                    sysctrl;              /*  5665     1 */
	uint16_t                   leds;                 /*  5666     2 */

	/* XXX 4 bytes hole, try to pack */

	qemu_irq                   fdc_tc;               /*  5672     8 */

	/* size: 5680, cachelines: 89 */
	/* sum members: 5676, holes: 1, sum holes: 4 */
	/* last cacheline: 48 bytes */
};	/* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:29 +00:00
Blue Swirl f90074f493 slavio_timer: avoid structure holes spotted by pahole
Report from pahole on amd64 host:
struct SLAVIO_TIMERState {
	SysBusDevice               busdev;               /*     0  5648 */
	/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
	uint32_t                   num_cpus;             /*  5648     4 */

	/* XXX 4 bytes hole, try to pack */

	CPUTimerState              cputimer[17];         /*  5656   816 */
	/* --- cacheline 101 boundary (6464 bytes) was 8 bytes ago --- */
	uint32_t                   cputimer_mode;        /*  6472     4 */

	/* size: 6480, cachelines: 102 */
	/* sum members: 6472, holes: 1, sum holes: 4 */
	/* padding: 4 */
	/* last cacheline: 16 bytes */
};	/* definitions: 1 */

struct CPUTimerState {
	qemu_irq                   irq;                  /*     0     8 */
	ptimer_state *             timer;                /*     8     8 */
	uint32_t                   count;                /*    16     4 */
	uint32_t                   counthigh;            /*    20     4 */
	uint32_t                   reached;              /*    24     4 */

	/* XXX 4 bytes hole, try to pack */

	uint64_t                   limit;                /*    32     8 */
	uint32_t                   running;              /*    40     4 */

	/* size: 48, cachelines: 1 */
	/* sum members: 40, holes: 1, sum holes: 4 */
	/* padding: 4 */
	/* last cacheline: 48 bytes */
};	/* definitions: 1 */

Fix by rearranging the structures to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21 19:52:27 +00:00
Anthony Liguori 7267c0947d Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20 23:01:08 -05:00
Blue Swirl 02fa69b6e8 scsi-disk: fix DPRINTF
The variable 'status' does not exist anymore, adjust DPRINTF
accordingly.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-20 09:22:52 +00:00
Engin AYDOGAN dc804ab776 hw/stellaris: Add support for RCC2 register
Add support for the RCC2 register on Fury class devices.
Based on a patch by Vijay Kumar.

Signed-off-by: Engin AYDOGAN <engin@bzzzt.biz>
[Peter Maydell: fixed comment typos, minor cleanup of unreachable code]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-17 23:02:15 +00:00
Peter Maydell b3aaff11ec hw/pl061.c: Support GPIOAMSEL register
Support the GPIOAMSEL register found on some Stellaris boards.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-17 23:01:47 +00:00
Peter Maydell a35faa94c8 hw/pl061: Convert to VMState
Convert the PL061 to VMState. We choose to widen the struct members
to uint32_t rather than the other two options of breaking migration
compatibility or using vmstate hacks to read/write a 32 bit value
into an 8 bit struct field.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-17 23:01:41 +00:00
Peter Maydell acb9b72240 vexpress, realview: Use pl111, not pl110
The Versatile Express, Realview EB, PBX A9 and PB A8 boards all
use a PL111 for their graphics, not a PL110. Now we model the
PL111, use it on these board models.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-17 23:01:27 +00:00
Peter Maydell 242ea2c6bc versatilepb: Implement SYS_CLCD mux control register bits
On the Versatile PB, PL110 graphics adaptor only natively supports
5551 pixel format; an external mux swaps bits around to allow
RGB565 and BGR565, under the control of bits [1:0] in the SYS_CLCD
system register.

Implement these SYS_CLCD register bits, and use a gpio line to
feed them out of the system register model, across the versatilepb
board and into the pl110 so we can select the right format.

This is necessary as recent Linux versatile kernels default to
programming the CLCD and mux for 16 bit BGR rather than 16 bit RGB.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-17 23:01:21 +00:00
Peter Maydell 4fbf55568b hw/pl110: Model the PL111 CLCD controller
Model the PL111 CLCD controller. This is a minor variation
on the PL110; the major programmer visible differences are
support for hardware cursor (unimplemented) and two new
pixel formats.

Since syborg_fb.c borrows the pl11x pixel drawing routines,
we also update it to cope with the new slightly larger array
of function pointers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-08-17 23:01:11 +00:00
Paolo Bonzini 8b2a04eeb9 scsi: do not overwrite memory on REQUEST SENSE commands with a large buffer
Other scsi_target_reqops commands were careful about not using r->cmd.xfer
directly, and instead always cap it to a fixed length.  This was not done
for REQUEST SENSE, and this patch fixes it.

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-16 19:11:51 +00:00
Peter Maydell 3b6ffe5030 hw/scsi-bus.c: Fix use of uninitialised variable
Don't use req before it has been initialised in scsi_req_new().
This fixes a compile failure due to gcc complaining about this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-14 19:34:25 +00:00
Paolo Bonzini 98254542f9 scsi: add special traces for common commands
Can be useful when debugging the device scan phase.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:28 -05:00
Paolo Bonzini c7b488721d scsi: report unit attention on reset
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12 08:31:28 -05:00