1. 17 5月, 2017 2 次提交
    • E
      fdc: Remove user_creatable flag from sysbus-fdc & SUNW,fdtwo · 8ca97a1f
      Eduardo Habkost 提交于
      sysbus-fdc and SUNW,fdtwo devices need IRQs to be wired and mmio
      to be mapped, and can't be used with -device. Unset
      user_creatable on their device classes.
      
      Cc: John Snow <jsnow@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-6-ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      8ca97a1f
    • E
      sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE · e4f4fb1e
      Eduardo Habkost 提交于
      commit 33cd52b5 unset
      cannot_instantiate_with_device_add_yet in TYPE_SYSBUS, making all
      sysbus devices appear on "-device help" and lack the "no-user"
      flag in "info qdm".
      
      To fix this, we can set user_creatable=false by default on
      TYPE_SYS_BUS_DEVICE, but this requires setting
      user_creatable=true explicitly on the sysbus devices that
      actually work with -device.
      
      Fortunately today we have just a few has_dynamic_sysbus=1
      machines: virt, pc-q35-*, ppce500, and spapr.
      
      virt, ppce500, and spapr have extra checks to ensure just a few
      device types can be instantiated:
      
      * virt supports only TYPE_VFIO_CALXEDA_XGMAC, TYPE_VFIO_AMD_XGBE.
      * ppce500 supports only TYPE_ETSEC_COMMON.
      * spapr supports only TYPE_SPAPR_PCI_HOST_BRIDGE.
      
      This patch sets user_creatable=true explicitly on those 4 device
      classes.
      
      Now, the more complex cases:
      
      pc-q35-*: q35 has no sysbus device whitelist yet (which is a
      separate bug). We are in the process of fixing it and building a
      sysbus whitelist on q35, but in the meantime we can fix the
      "-device help" and "info qdm" bugs mentioned above. Also, despite
      not being strictly necessary for fixing the q35 bug, reducing the
      list of user_creatable=true devices will help us be more
      confident when building the q35 whitelist.
      
      xen: We also have a hack at xen_set_dynamic_sysbus(), that sets
      has_dynamic_sysbus=true at runtime when using the Xen
      accelerator. This hack is only used to allow xen-backend devices
      to be dynamically plugged/unplugged.
      
      This means today we can use -device with the following 22 device
      types, that are the ones compiled into the qemu-system-x86_64 and
      qemu-system-i386 binaries:
      
      * allwinner-ahci
      * amd-iommu
      * cfi.pflash01
      * esp
      * fw_cfg_io
      * fw_cfg_mem
      * generic-sdhci
      * hpet
      * intel-iommu
      * ioapic
      * isabus-bridge
      * kvmclock
      * kvm-ioapic
      * kvmvapic
      * SUNW,fdtwo
      * sysbus-ahci
      * sysbus-fdc
      * sysbus-ohci
      * unimplemented-device
      * virtio-mmio
      * xen-backend
      * xen-sysdev
      
      This patch adds user_creatable=true explicitly to those devices,
      temporarily, just to keep 100% compatibility with existing
      behavior of q35. Subsequent patches will remove
      user_creatable=true from the devices that are really not meant to
      user-creatable on any machine, and remove the FIXME comment from
      the ones that are really supposed to be user-creatable. This is
      being done in separate patches because we still don't have an
      obvious list of devices that will be whitelisted by q35, and I
      would like to get each device reviewed individually.
      
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Beniamino Galvani <b.galvani@gmail.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Frank Blaschka <frank.blaschka@de.ibm.com>
      Cc: Gabriel L. Somlo <somlo@cmu.edu>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: John Snow <jsnow@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Pierre Morel <pmorel@linux.vnet.ibm.com>
      Cc: Prasad J Pandit <pjp@fedoraproject.org>
      Cc: qemu-arm@nongnu.org
      Cc: qemu-block@nongnu.org
      Cc: qemu-ppc@nongnu.org
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Shannon Zhao <zhaoshenglong@huawei.com>
      Cc: sstabellini@kernel.org
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-3-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [ehabkost: Small changes at sysbus_device_class_init() comments]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e4f4fb1e
  2. 24 4月, 2017 1 次提交
  3. 01 3月, 2017 3 次提交
  4. 28 10月, 2016 3 次提交
    • K
      fdc: Move qdev properties to FloppyDrive · a92bd191
      Kevin Wolf 提交于
      This makes the FloppyDrive qdev object actually useful: Now that it has
      all properties that don't belong to the controller, you can actually
      use '-device floppy' and get a working result.
      
      Command line semantics is consistent with CD-ROM drives: By default you
      get a single empty floppy drive. You can override it with -drive and
      using the same index, but if you use -drive to add a floppy to a
      different index, you get both of them. However, as soon as you use any
      '-device floppy', even to a different slot, the default drive is
      disabled.
      
      Using '-device floppy' without specifying the unit will choose the first
      free slot on the controller.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Message-id: 1477386868-21826-4-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      a92bd191
    • K
      fdc: Add a floppy drive qdev · 394ea2ca
      Kevin Wolf 提交于
      Floppy controllers automatically create two floppy drive devices in qdev
      now. (They always created two drives, but managed them only internally.)
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1477386868-21826-3-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      394ea2ca
    • K
      fdc: Add a floppy qbus · 51e6e90e
      Kevin Wolf 提交于
      This adds a qbus to the floppy controller that should contain the floppy
      drives eventually. At the moment it just exists and is empty.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1477386868-21826-2-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      51e6e90e
  5. 08 9月, 2016 1 次提交
  6. 12 5月, 2016 1 次提交
  7. 23 3月, 2016 2 次提交
    • R
      Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND · 73bcb24d
      Rutuja Shah 提交于
      This patch replaces get_ticks_per_sec() calls with the macro
      NANOSECONDS_PER_SECOND. Also, as there are no callers, get_ticks_per_sec()
      is then removed.  This replacement improves the readability and
      understandability of code.
      
      For example,
      
          timer_mod(fdctrl->result_timer,
      	      qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() / 50));
      
      NANOSECONDS_PER_SECOND makes it obvious that qemu_clock_get_ns
      matches the unit of the expression on the right side of the plus.
      Signed-off-by: NRutuja Shah <rutu.shah.26@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      73bcb24d
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  8. 11 3月, 2016 1 次提交
  9. 11 2月, 2016 1 次提交
  10. 04 2月, 2016 3 次提交
  11. 03 2月, 2016 1 次提交
    • M
      Revert "hw/block/fdc: Implement tray status" · abb3e55b
      Max Reitz 提交于
      This reverts the changes that commit
      2e1280e8 applied to hw/block/fdc.c;
      also, an additional case of drv->media_inserted use has crept in since,
      which is replaced by a call to blk_is_inserted().
      
      That commit changed tests/fdc-test.c, too, because after it, one less
      TRAY_MOVED event would be emitted when executing 'change' on an empty
      drive. However, now, no TRAY_MOVED events will be emitted at all, and
      the tray_open status returned by query-block will always be false,
      necessitating (different) changes to tests/fdc-test.c and iotest 118,
      which is why this patch is not a pure revert of said commit.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 1454096953-31773-4-git-send-email-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      abb3e55b
  12. 26 1月, 2016 11 次提交
    • J
      fdc: change auto fallback drive for ISA FDC to 288 · 4812fa27
      John Snow 提交于
      The 2.88 drive is more suitable as a default because
      it can still read 1.44 images correctly, but the reverse
      is not true.
      
      Since there exist virtio-win drivers that are shipped on
      2.88 floppy images, this patch will allow VMs booted without
      a floppy disk inserted to later insert a 2.88MB floppy and
      have that work.
      
      This patch has been tested with msdos, freedos, fedora,
      windows 8 and windows 10 without issue: if problems do
      arise for certain guests being unable to cope with 2.88MB
      drives as the default, they are in the minority and can use
      type=144 as needed (or insert a proper boot medium and omit
      type=144/288 or use type=auto) to obtain different drive types.
      
      As icing, the default will remain auto/144 for any pre-2.6
      machine types, hopefully minimizing the impact of this change
      in legacy hw to basically zero.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-13-git-send-email-jsnow@redhat.com
      4812fa27
    • J
      fdc: rework pick_geometry · f31937aa
      John Snow 提交于
      This one is the crazy one.
      
      fd_revalidate currently uses pick_geometry to tell if the diskette
      geometry has changed upon an eject/insert event, but it won't allow us
      to insert a 1.44MB diskette into a 2.88MB drive. This is inflexible.
      
      The new algorithm applies a new heuristic to guessing disk geometries
      that allows us to switch diskette types as long as the physical size
      matches before falling back to the old heuristic.
      
      The old one is roughly:
       - If the size (sectors) and type matches, choose it.
       - Fall back to the first geometry that matched our type.
      
      The new one is:
       - If the size (sectors) and type matches, choose it.
       - If the size (sectors) and physical size match, choose it.
       - Fall back to the first geometry that matched our type.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1453495865-9649-11-git-send-email-jsnow@redhat.com
      f31937aa
    • J
      fdc: add physical disk sizes · 109c17bc
      John Snow 提交于
      2.88MB capable drives can accept 1.44MB floppies,
      for instance. To rework the pick_geometry function,
      we need to know if our current drive can even accept
      the type of disks we're considering.
      
      NB: This allows us to distinguish between all of the
      "total sectors" collisions between 1.20MB and 1.44MB
      diskette types, by using the physical drive size as a
      differentiator.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-10-git-send-email-jsnow@redhat.com
      109c17bc
    • J
      fdc: add drive type option · fff4687b
      John Snow 提交于
      This patch adds a new explicit Floppy Drive Type option. The existing
      behavior in QEMU is to automatically guess a drive type based on the
      media inserted, or if a diskette is not present, arbitrarily assign one.
      
      This behavior can be described as "auto." This patch adds the option
      to pick an explicit behavior: 120, 144, 288 or none. The new "auto"
      option is intended to mimic current behavior, while the other types
      pick one explicitly.
      
      Set the type given by the CLI during fd_init. If the type remains the
      default (auto), we'll attempt to scan an inserted diskette if present
      to determine a type. If auto is selected but no diskette is present,
      we fall back to a predetermined default (currently 1.44MB to match
      legacy QEMU behavior.)
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-9-git-send-email-jsnow@redhat.com
      fff4687b
    • J
      fdc: Add fallback option · a73275dd
      John Snow 提交于
      Currently, QEMU chooses a drive type automatically based on the inserted
      media. If there is no disk inserted, it chooses a 1.44MB drive type.
      
      Change this behavior to be configurable, but leave it defaulted to 1.44.
      
      This is not earnestly intended to be used by a user or a management
      library, but rather exists so that pre-2.6 board types can configure it
      to be a legacy value.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-8-git-send-email-jsnow@redhat.com
      a73275dd
    • J
      fdc: add pick_drive · d5d47efc
      John Snow 提交于
      Split apart pick_geometry by creating a pick_drive routine that will only
      ever called during device bring-up instead of relying on pick_geometry to
      be used in both cases.
      
      With this change, the drive field is changed to be 'write once'. It is
      not altered after the initialization routines exit.
      
      media_validated does not need to be migrated. The target VM
      will just revalidate the media on post_load anyway.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-7-git-send-email-jsnow@redhat.com
      d5d47efc
    • J
      fdc: Throw an assertion on misconfigured fd_formats table · 69ce1ac2
      John Snow 提交于
      pick_geometry is a convoluted function that makes it difficult to tell
      at a glance what QEMU's current behavior for choosing a floppy drive
      type is when it can't quite identify the diskette.
      
      The code iterates over all entries in the candidate geometry table
      ("fd_formats") and if our specific drive type matches a row in the table,
      then either "match" is set to that entry (an exact match) and the loop
      exits, or "first_match" will be non-negative (the first such entry that
      shares the same drive type), and the loop continues. If our specific
      drive type is NONE, then all drive types in the candidate geometry table
      are considered. After iteration, if "match" was not set, we fall back to
      "first match".
      
      This means that either "match" was set, or we exited the loop without an
      exact match, in which case:
      
      - If drive type is NONE, the default is truly fd_formats[0], a 1.44MB
        type, because "first_match" will always get set to the first item.
      
      - If drive type is not NONE, pick_geometry's iteration was fussier and
        only looked at rows that matched our drive type. However, since all
        possible drive types are represented in the table, we still know that
        "first match" was set.
      
      - If drive type is not NONE and the fd_formats table lists no options for
        our drive type, we choose fd_formats[1], an incomprehensibly bizarre
        choice that can never happen anyway.
      
      Correct this: If first_match is -1, it can ONLY mean we didn't edit our
      fd_formats table correctly. Throw an assertion instead.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-6-git-send-email-jsnow@redhat.com
      69ce1ac2
    • J
      fdc: add disk field · 16c1e3ec
      John Snow 提交于
      Currently, 'drive' is used both to represent the current diskette
      type as well as the current drive type.
      
      This patch adds a 'disk' field that is updated explicitly to match
      the type of the disk.
      
      As of this patch, disk and drive are always the same, but forthcoming
      patches to change the behavior of pick_geometry will invalidate this
      assumption.
      
      disk does not need to be migrated because it is not user-visible state
      nor is it currently used for any calculations. It is purely informative,
      and will be rebuilt automatically via fd_revalidate on the new host.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-5-git-send-email-jsnow@redhat.com
      16c1e3ec
    • J
      fdc: add drive type qapi enum · 2da44dd0
      John Snow 提交于
      Change the floppy drive type to a QAPI enum type, to allow us to
      specify the floppy drive type from the CLI in a forthcoming patch.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-4-git-send-email-jsnow@redhat.com
      2da44dd0
    • J
      fdc: reduce number of pick_geometry arguments · 21862658
      John Snow 提交于
      Modify this function to operate directly on FDrive objects instead of
      unpacking and passing all of those parameters manually. Reduces the
      complexity in the caller and reduces the number of args to just one.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-3-git-send-email-jsnow@redhat.com
      21862658
    • J
      fdc: move pick_geometry · 9a972233
      John Snow 提交于
      Code motion: I want to refactor this function to work with FDrive
      directly, so shuffle it below that definition.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1453495865-9649-2-git-send-email-jsnow@redhat.com
      9a972233
  13. 20 1月, 2016 1 次提交
  14. 13 1月, 2016 1 次提交
  15. 24 10月, 2015 1 次提交
  16. 09 9月, 2015 1 次提交
    • P
      i8257: rewrite DMA_schedule to avoid hooking into the CPU loop · 19d2b5e6
      Paolo Bonzini 提交于
      The i8257 DMA controller uses an idle bottom half, which by default
      does not cause the main loop to exit.  Therefore, the DMA_schedule
      function is there to ensure that the CPU relinquishes the iothread
      mutex to the iothread.
      
      However, this is not enough since the iothread will call
      aio_compute_timeout() and go to sleep again.  In the iothread
      world, forcing execution of the idle bottom half is much simpler,
      and only requires a call to qemu_notify_event().  Do it, removing
      the need for the "cpu_request_exit" pseudo-irq.  The next patch
      will remove it.
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      19d2b5e6
  17. 12 6月, 2015 1 次提交
    • J
      migration: Use normal VMStateDescriptions for Subsections · 5cd8cada
      Juan Quintela 提交于
      We create optional sections with this patch.  But we already have
      optional subsections.  Instead of having two mechanism that do the
      same, we can just generalize it.
      
      For subsections we just change:
      
      - Add a needed function to VMStateDescription
      - Remove VMStateSubsection (after removal of the needed function
        it is just a VMStateDescription)
      - Adjust the whole tree, moving the needed function to the corresponding
        VMStateDescription
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      5cd8cada
  18. 03 6月, 2015 5 次提交
    • K
      fdc: Fix MSR.RQM flag · 6cc8a11c
      Kevin Wolf 提交于
      The RQM bit in MSR should be set whenever the guest is supposed to
      access the FIFO, and it should be cleared in all other cases. This is
      important so the guest can't continue writing/reading the FIFO beyond
      the length that it's suppossed to access (see CVE-2015-3456).
      
      Commit e9077462 fixed the CVE by adding code that avoids the buffer
      overflow; however it doesn't correct the wrong behaviour of the floppy
      controller which should already have cleared RQM.
      
      Currently, RQM stays set all the time and during all phases while a
      command is being processed. This is error-prone because the command has
      to explicitly clear the flag if it doesn't need data (and indeed, the
      two buggy commands that are the culprits for the CVE just forgot to do
      that).
      
      This patch clears RQM immediately as soon as all bytes that are expected
      have been received. If the the FIFO is used in the next phase, the flag
      has to be set explicitly there.
      
      It also clear RQM after receiving all bytes even if the phase transition
      immediately sets it again. While it's technically not necessary at the
      moment because the state between clearing and setting RQM is not
      observable by the guest, this is more explicit and matches how real
      hardware works. It will actually become necessary in qemu once
      asynchronous code paths are introduced.
      
      This alone should have been enough to fix the CVE, but now we have two
      lines of defense - even better.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1432214378-31891-8-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      6cc8a11c
    • K
      fdc: Disentangle phases in fdctrl_read_data() · f6c2d1d8
      Kevin Wolf 提交于
      This commit makes similar improvements as have already been made to the
      write function: Instead of relying on a flag in the MSR to distinguish
      controller phases, use the explicit phase that we store now. Assertions
      of the right MSR flags are added.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1432214378-31891-7-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      f6c2d1d8
    • K
      fdc: Code cleanup in fdctrl_write_data() · d275b33d
      Kevin Wolf 提交于
      Factor out a few common lines of code, reformat, improve comments.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1432214378-31891-6-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      d275b33d
    • K
      fdc: Use phase in fdctrl_write_data() · 5b0a25e8
      Kevin Wolf 提交于
      Instead of relying on a flag in the MSR to distinguish controller phases,
      use the explicit phase that we store now. Assertions of the right MSR
      flags are added.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1432214378-31891-5-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      5b0a25e8
    • K
      fdc: Introduce fdctrl->phase · 85d291a0
      Kevin Wolf 提交于
      The floppy controller spec describes three different controller phases,
      which are currently not explicitly modelled in our emulation. Instead,
      each phase is represented by a combination of flags in registers.
      
      This patch makes explicit in which phase the controller currently is.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1432214378-31891-4-git-send-email-kwolf@redhat.com
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      85d291a0