All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/49] VMState: Fix design faults, i2c port, x86 cpu port, ...
@ 2009-09-29 20:48 Juan Quintela
  2009-09-29 20:48 ` [Qemu-devel] [PATCH 01/49] vmstate: remove const for put operations Juan Quintela
                   ` (48 more replies)
  0 siblings, 49 replies; 67+ messages in thread
From: Juan Quintela @ 2009-09-29 20:48 UTC (permalink / raw)
  To: qemu-devel

Hi

This is the whole VMState patches from this last two weeks.  It has integrated 
the VMState design flaws and the i2c devices port.

New is:
- remove const from *_pre_save(), and port all users
- x86 cpu is ported to vmstate.
  - fpregs: it allows load/save mix of 64/80 bits floats, ugly as hell
    (it was already ugly as hell)
- field_exist() method, now we can have optional fields
- ac97 got integrated in the buch.

Comments?

Later, Juan.

>From older series.

  Subject: [PATCH v2 0/4] Fix VMState design flaws

v2:
- fix old_version field for ps2 keyboard (thanks paolo)

v1:
I know you are not going to believe it, but VMState design have flaws:

(everybody) Ooohhhhhhh!!!!

This patches fixes (some) of them:

  * When we added .pre_save() and .post_save(), we have it basically
    to change values in the variable pointed by the "void *opaque".
    Without this functions, it made sense that this variables were const,
    with them, it means that we have to do
      FooState *s = (void *)opaque
    in every pre/post_save() function.  Just remove the const.
  * Add version_id field to post_load().  Now we can assign default values
    in post_load for old versions of the state (ps2_kbd as example).
    This one is also needed for ioapic in qemu-kvm.
  * Add support for sending partial struct arrays (i.e. only some fields starting
    from the beggining) fdc cleanups for getting pc98 in need it.


>From  Subject: [PATCH 00/20] VMState: port all i2c devices

This ports all i2c_devices to vmstate.  Big changes:

- i2c->address now are uint8_t, my review of all uses is that they are always
  used as uint8_t (and that is the type that is passed on the value).  If you know
  i2c, please check.  Change 0002 looks big, but it is because as I was
  auditing the paths, I changed the types of the functios to reflect that they
  use uint8_t.  Real part of the patch is changing the struct definitions.

- qdev: there was not support for uint8_t (the i2c addresses) in qdev, now it is
  I missed this change in my 1st pass (on mips_malta)

-        qdev_prop_set_uint32(eeprom, "address", 0x50 + i);
+        qdev_prop_set_uint8(eeprom, "address", 0x50 + i);

  And qdev complained during compilation.  qdev++

- I had to fix lots of places where values of one type were sent with a different
  type.  qemu_put_byte/qemu_put_be16/qemu_put_be32 should be just baned.  Yesterday.

- tmp105: We have a winner, the 1st user of post_save().
  Can anyone explain me what we need to do _anything_ after saving

     s->faults = tmp105_faultq[(s->config >> 3) & 3];		/* F */
  I can't see why saving have to change faults, and no, I don't understand what
  that line does.

- twl922230: here we go.
  It pass all the fields of a struct tm (they are ints) as uint16_t.
  All solutions are bad (tm):
  * marshalling the struct tm in a struct tm_16bits fields, and use normal vmstate
  * up version and declare all previous versions baned.  No forward migration
    for you.
  * Do the hack that I did, new type:
     vmstate_hack_int32_as_uint16
    local to that function, and be done with it.  It is a big hack, but the
    function were already abusing the format.

- lm832x: I got an unused command (0xff) to be send as an error.  it was using an
  int, -1 means an error, and a small number meaned a command.  As the numbers of
  commands is very limited, I think this is the best solution.  Notice that
  we were doing this already when we saved/loaded the value.  Name the constant
  instead of -1 to make things easier.

- vmstate arrays shortened the save/load code for this series _a lot_.


Juan Quintela (49):
  vmstate: remove const for put operations
  vmstate: add version_id argument to post_load
  vmstate: remove const from pre_save() functions
  vmstate: remove ps2_kbd_load_old()
  vmstate: Add support for sending partial arrays
  qdev: Add support for uint8_t
  i2c: addresses are load/save as uint8_t values, change types to
    reflect this
  vmstate: port i2c_bus device
  vmstate: port i2c_slave device
  vmstate: add uint8 array
  vmstate: create VMSTATE_I2C_SLAVE
  vmstate: port wm8750 device
  vmstate: port max7310 device
  vmstate: create VMSTATE_STRUCT_POINTER
  vmstate: port pxa2xx_i2c device
  vmstate: port ssd0303 device
  vmstate: create VMSTATE_INT16_ARRAY
  tmp105: change len and alorm to uint8_t
  vmstate: port tmp105 device
  twl92230: change pwrbtn_state to uint8_t
  vmstate: port twl92230 device
  vmstate: add support for arrays of pointers
  lm832x: make fields to have the same types that they are saved/loaded
  vmstate: port lm832x device
  vmstate: remove i2c_slave_load/save
  vmstate: port audio/audio.c
  ac97: add active to the state
  vmstate: port ac97 device
  x86: hflags is not modified at all, just save it directly
  x86: make a20_mask int32_t
  x86: fpuc is uint16_t not unsigned int
  x86: fpus is uint16_t not unsigned int
  x86: add fptag_vmstate to the state
  x86: add pending_irq_vmstate to the state
  x86: add fpregs_format_vmstate
  x86: mce_banks always have the same size
  x86: send mce_banks as an array
  x86: mcg_cap is never 0
  x86: split FPReg union
  x86: split MTRRVar union
  Add *TL functions to vmstate
  x86: port segments to vmstate
  x86: factor out cpu_pre_save()
  x86: factor out cpu_pre/post_load()
  x86: factor out cpu_get/put_xmm_reg()
  x86: factor out cpu_get/put_mttr_var()
  x86: factor out cpu_get/put_fpreg()
  vmstate: Add suppot for field_exist() test
  x86: port cpu to vmstate

 audio/audio.c         |   26 +--
 exec.c                |    6 +-
 hw/ac97.c             |  136 ++++-----
 hw/acpi.c             |    2 +-
 hw/cirrus_vga.c       |    2 +-
 hw/dma.c              |    2 +-
 hw/fdc.c              |    6 +-
 hw/hpet.c             |    6 +-
 hw/hw.h               |  114 ++++++++-
 hw/i2c.c              |   64 +++--
 hw/i2c.h              |   10 +-
 hw/lm832x.c           |  148 ++++------
 hw/max7310.c          |   51 ++---
 hw/mips_malta.c       |    2 +-
 hw/pc.c               |    2 +-
 hw/pci.c              |    2 +-
 hw/piix_pci.c         |    2 +-
 hw/ps2.c              |   16 +-
 hw/ptimer.c           |    4 +-
 hw/pxa2xx.c           |   54 ++--
 hw/qdev-properties.c  |   33 +++
 hw/qdev.h             |    5 +
 hw/serial.c           |    6 +-
 hw/slavio_intctl.c    |    2 +-
 hw/smbus.c            |   18 +-
 hw/smbus.h            |   18 +-
 hw/ssd0303.c          |   65 ++---
 hw/tcx.c              |    2 +-
 hw/tmp105.c           |   60 ++---
 hw/twl92230.c         |  200 ++++++--------
 hw/vmmouse.c          |    2 +-
 hw/wm8750.c           |  120 +++-----
 savevm.c              |   87 ++++---
 target-i386/cpu.h     |   40 ++-
 target-i386/helper.c  |    9 +-
 target-i386/machine.c |  725 ++++++++++++++++++++++++++++---------------------
 36 files changed, 1083 insertions(+), 964 deletions(-)

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

end of thread, other threads:[~2009-09-30 21:19 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29 20:48 [Qemu-devel] [PATCH 00/49] VMState: Fix design faults, i2c port, x86 cpu port, Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 01/49] vmstate: remove const for put operations Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 02/49] vmstate: add version_id argument to post_load Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 03/49] vmstate: remove const from pre_save() functions Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 04/49] vmstate: remove ps2_kbd_load_old() Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 05/49] vmstate: Add support for sending partial arrays Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 06/49] qdev: Add support for uint8_t Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 07/49] i2c: addresses are load/save as uint8_t values, change types to reflect this Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 08/49] vmstate: port i2c_bus device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 09/49] vmstate: port i2c_slave device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 10/49] vmstate: add uint8 array Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 11/49] vmstate: create VMSTATE_I2C_SLAVE Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 12/49] vmstate: port wm8750 device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 13/49] vmstate: port max7310 device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 14/49] vmstate: create VMSTATE_STRUCT_POINTER Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 15/49] vmstate: port pxa2xx_i2c device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 16/49] vmstate: port ssd0303 device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 17/49] vmstate: create VMSTATE_INT16_ARRAY Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 18/49] tmp105: change len and alorm to uint8_t Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 19/49] vmstate: port tmp105 device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 20/49] twl92230: change pwrbtn_state to uint8_t Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 21/49] vmstate: port twl92230 device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 22/49] vmstate: add support for arrays of pointers Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 23/49] lm832x: make fields to have the same types that they are saved/loaded Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 24/49] vmstate: port lm832x device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 25/49] vmstate: remove i2c_slave_load/save Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 26/49] vmstate: port audio/audio.c Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 27/49] ac97: add active to the state Juan Quintela
2009-09-30 10:37   ` malc
2009-09-30 11:37     ` [Qemu-devel] " Juan Quintela
2009-09-30 11:47       ` malc
2009-09-30 12:05         ` Juan Quintela
2009-09-30 12:17           ` malc
2009-09-30 13:07             ` Juan Quintela
2009-09-30 13:12               ` malc
2009-09-30 13:37                 ` Juan Quintela
2009-09-30 13:44                   ` malc
2009-09-30 13:57                     ` Juan Quintela
2009-09-30 14:53                       ` malc
2009-09-30 15:02                         ` Juan Quintela
2009-09-30 15:08         ` Anthony Liguori
2009-09-30 15:22           ` Juan Quintela
2009-09-30 15:24           ` malc
2009-09-30 21:11             ` Anthony Liguori
2009-09-30 21:19               ` malc
2009-09-29 20:48 ` [Qemu-devel] [PATCH 28/49] vmstate: port ac97 device Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 29/49] x86: hflags is not modified at all, just save it directly Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 30/49] x86: make a20_mask int32_t Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 31/49] x86: fpuc is uint16_t not unsigned int Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 32/49] x86: fpus " Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 33/49] x86: add fptag_vmstate to the state Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 34/49] x86: add pending_irq_vmstate " Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 35/49] x86: add fpregs_format_vmstate Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 36/49] x86: mce_banks always have the same size Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 37/49] x86: send mce_banks as an array Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 38/49] x86: mcg_cap is never 0 Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 39/49] x86: split FPReg union Juan Quintela
2009-09-29 20:48 ` [Qemu-devel] [PATCH 40/49] x86: split MTRRVar union Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 41/49] Add *TL functions to vmstate Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 42/49] x86: port segments " Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 43/49] x86: factor out cpu_pre_save() Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 44/49] x86: factor out cpu_pre/post_load() Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 45/49] x86: factor out cpu_get/put_xmm_reg() Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 46/49] x86: factor out cpu_get/put_mttr_var() Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 47/49] x86: factor out cpu_get/put_fpreg() Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 48/49] vmstate: Add suppot for field_exist() test Juan Quintela
2009-09-29 20:49 ` [Qemu-devel] [PATCH 49/49] x86: port cpu to vmstate Juan Quintela

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.