1. 22 8月, 2011 1 次提交
    • B
      esp: avoid structure holes spotted by pahole · 9a975d63
      Blue Swirl 提交于
      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: NBlue Swirl <blauwirbel@gmail.com>
      9a975d63
  2. 12 8月, 2011 1 次提交
  3. 19 7月, 2011 1 次提交
  4. 13 7月, 2011 1 次提交
  5. 03 7月, 2011 1 次提交
  6. 26 5月, 2011 10 次提交
  7. 11 12月, 2010 1 次提交
    • A
      Add endianness as io mem parameter · 2507c12a
      Alexander Graf 提交于
      As stated before, devices can be little, big or native endian. The
      target endianness is not of their concern, so we need to push things
      down a level.
      
      This patch adds a parameter to cpu_register_io_memory that allows a
      device to choose its endianness. For now, all devices simply choose
      native endian, because that's the same behavior as before.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      2507c12a
  8. 12 9月, 2010 1 次提交
    • B
      ESP: fix ESP DMA access when DMA is not enabled · 73d74342
      Blue Swirl 提交于
      Sending ESP a command caused it to trigger DMA immediately
      even if DMA was not enabled at the DMA controller.
      
      Add a signal from DMA controller to ESP to tell ESP about changes in
      DMA enable bit. Also use the correct function for setting up GPIO outputs.
      
      This fixes NetBSD 1.6.1 through 3.0 boot.
      
      Thanks to Artyom Tarasenko for extensive debugging of the problem.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      73d74342
  9. 02 7月, 2010 1 次提交
  10. 11 6月, 2010 1 次提交
  11. 07 2月, 2010 1 次提交
  12. 16 1月, 2010 1 次提交
  13. 09 11月, 2009 2 次提交
  14. 07 11月, 2009 1 次提交
  15. 25 10月, 2009 1 次提交
  16. 07 10月, 2009 1 次提交
    • M
      New qdev_init_nofail() · e23a1b33
      Markus Armbruster 提交于
      Like qdev_init(), but terminate program via hw_error() instead of
      returning an error value.
      
      Use it instead of qdev_init() where terminating the program on failure
      is okay, either because it's during machine construction, or because
      we know that failure can't happen.
      
      Because relying in the latter is somewhat unclean, and the former is
      not always obvious, it would be nice to go back to qdev_init() in the
      not-so-obvious cases, only with proper error handling.  I'm leaving
      that for another day, because it involves making sure that error
      values are properly checked by all callers.
      
      Patchworks-ID: 35168
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e23a1b33
  17. 05 10月, 2009 1 次提交
  18. 02 10月, 2009 2 次提交
  19. 19 9月, 2009 1 次提交
  20. 10 9月, 2009 1 次提交
  21. 05 9月, 2009 1 次提交
  22. 01 9月, 2009 1 次提交
  23. 28 8月, 2009 1 次提交
    • G
      qdev: add return value to init() callbacks. · 81a322d4
      Gerd Hoffmann 提交于
      Sorry folks, but it has to be.  One more of these invasive qdev patches.
      
      We have a serious design bug in the qdev interface:  device init
      callbacks can't signal failure because the init() callback has no
      return value.  This patch fixes it.
      
      We have already one case in-tree where this is needed:
      Try -device virtio-blk-pci (without drive= specified) and watch qemu
      segfault.  This patch fixes it.
      
      With usb+scsi being converted to qdev we'll get more devices where the
      init callback can fail for various reasons.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      81a322d4
  24. 26 8月, 2009 1 次提交
  25. 22 8月, 2009 2 次提交
  26. 09 8月, 2009 1 次提交
  27. 31 7月, 2009 1 次提交
  28. 17 7月, 2009 1 次提交
    • G
      qdev: rework device properties. · ee6847d1
      Gerd Hoffmann 提交于
      This patch is a major overhaul of the device properties.  The properties
      are saved directly in the device state struct now, the linked list of
      property values is gone.
      
      Advantages:
        * We don't have to maintain the list with the property values.
        * The value in the property list and the value actually used by
          the device can't go out of sync any more (used to happen for
          the pci.devfn == -1 case) because there is only one place where
          the value is stored.
        * A record describing the property is required now, you can't set
          random properties any more.
      
      There are bus-specific and device-specific properties.  The former
      should be used for properties common to all bus drivers.  Typical
      use case is bus addressing, i.e. pci.devfn and i2c.address.
      
      Properties have a PropertyInfo struct attached with name, size and
      function pointers to parse and print properties.  A few common property
      types have PropertyInfos defined in qdev-properties.c.  Drivers are free
      to implement their own very special property parsers if needed.
      
      Properties can have default values.  If unset they are zero-filled.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ee6847d1