1. 16 2月, 2015 4 次提交
    • J
      qtest/ahci: Store hba_base in AHCIQState · 6100ddb0
      John Snow 提交于
      Store the HBA memory base address in the new state object, to simplify
      function prototypes and encourage a more functional testing style.
      
      This causes a lot of churn, but this patch is as "simplified" as I could
      get it to be. This patch is therefore fairly mechanical and straightforward:
      Any case where we pass "hba_base" has been consolidated into the AHCIQState
      object and we pass the one unified parameter.
      
      Any case where we reference "ahci" and "hba_state" have been modified to use
      "ahci->dev" for the PCIDevice and "ahci->hba_state" to get at the base memory
      address, accordingly.
      
      Notes:
      
       - A needless return is removed from start_ahci_device.
      
       - For ease of reviewing, this patch can be reproduced (mostly) by:
         # Replace (ahci, hba_base) prototypes with unified parameter
         's/(QPCIDevice \*ahci, void \*\?\*hba_base/(AHCIQState *ahci/'
      
         # Replace (ahci->dev, hba_base) calls with unified parameter
         's/(ahci->dev, &\?hba_base)/(ahci)/'
      
         # Replace calls to PCI config space using "ahci" with "ahci->dev"
         's/qpci_config_\(read\|write\)\(.\)(ahci,/qpci_config_\1\2(ahci->dev,/'
      
         After these, the remaining differences are easy to review by hand.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1421698563-6977-9-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      6100ddb0
    • J
      libqos: add pc specific interface · 90e5add6
      John Snow 提交于
      Create an operations structure so that the libqos interface can be
      architecture agnostic, and create a pc-specific interface to functions
      like qtest_boot.
      
      Move the libqos object in the Makefile from being ahci-test only to
      being linked with all tests that utilize the libqos features.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1421698563-6977-8-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      90e5add6
    • J
      libqos: create libqos.c · dd0029c0
      John Snow 提交于
      The intent of this file is to serve as a misc. utilities file to be
      shared amongst tests that are utilizing libqos facilities.
      
      In a later patch, migration test helpers will be added to libqos.c that
      will allow simplified testing of migration cases where libqos is
      "Just Enough OS" for migrations testing.
      
      The addition of the AHCIQState structure will also allow us to eliminate
      global variables inside of qtests to manage allocators and test instances
      in a better, more functional way.
      
      libqos.c:
              - Add qtest_boot
              - Add qtest_shutdown
      
      libqos.h:
              - Create QOSState structure for allocator and QTestState.
      
      ahci-test.c:
              - Move qtest_boot and qtest_shutdown to libqos.c/h
              - Create AHCIQState to interface with new qtest_boot/shutdown prototypes
              - Modify tests slightly to use new types.
      
      For now, the new object file is only linked to ahci-test, because it still
      relies on pc architecture specific code in libqos. The next two patches will
      reorganize the code to be more general.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1421698563-6977-4-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      dd0029c0
    • J
      qtest/ahci: Create ahci.h · 90fc5e09
      John Snow 提交于
      Extract defines and other information to ahci.h, to be shared with other
      tests if they so please.
      
      At the very least, reduce clutter in the test file itself.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1421698563-6977-3-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      90fc5e09
  2. 15 1月, 2015 1 次提交
  3. 10 12月, 2014 1 次提交
  4. 22 9月, 2014 6 次提交
    • J
      ahci: Add test_identify case to ahci-test. · 0fa781e3
      John Snow 提交于
      Utilizing all of the bring-up code in pci_enable and hba_enable,
      this test issues a simple IDENTIFY command via the HBA and retrieves
      the response via the PIO receive mechanisms of the HBA.
      
      Bugs: The DPS interrupt (Descriptor Processed Status) does not
      currently get set. This will need to be adjusted in a future
      patch series when the AHCI DMA pathways are reworked to allow
      the feature, which may be utilized by OSX guests.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1408643079-30675-9-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0fa781e3
    • J
      ahci: Add test_hba_enable to ahci-test. · dbc180e5
      John Snow 提交于
      This test engages the HBA functionality and initializes
      values to sane defaults to allow for minimal HBA functionality.
      
      Buffers are allocated and pointers are updated to allow minimal
      I/O commands to complete as expected. Error registers and responses
      are sanity checked for specification adherence.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1408643079-30675-8-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      dbc180e5
    • J
      ahci: Add test_hba_spec to ahci-test. · c2f3029f
      John Snow 提交于
      Add a test routine that checks the boot-up values of the HBA
      configuration memory space against the AHCI 1.3 specification
      and Intel ICH9 data sheet (for Q35 machines) for adherence and
      sane values.
      
      The HBA is not yet engaged or put into the idle state.
      
      [Replaced g_assert_false(...) with g_assert(!...) for glib <2.38
      compatibility, reported by Peter Maydell <peter.maydell@linaro.org>.
      --Stefan]
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1408643079-30675-7-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c2f3029f
    • J
      ahci: add test_pci_enable to ahci-test. · 96d6d3ba
      John Snow 提交于
      This adds a test wherein we engage the PCI AHCI
      device and ensure that the memory region for the
      HBA functionality is now accessible.
      
      Under Q35 environments, additional PCI configuration
      is performed to ensure that the HBA functionality
      will become usable.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1408643079-30675-5-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      96d6d3ba
    • J
      ahci: Add test_pci_spec to ahci-test. · 8840a843
      John Snow 提交于
      Adds a specification adherence test for AHCI
      where the boot-up values for the PCI configuration space
      are compared against the AHCI 1.3 specification.
      
      This test does not itself attempt to engage the device.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1408643079-30675-4-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      8840a843
    • J
      ahci: Adding basic functionality qtest. · 1cd1031d
      John Snow 提交于
      Currently, there is no qtest to test the functionality of
      the AHCI functionality present within the Q35 machine type.
      
      This patch adds a skeleton for an AHCI test suite,
      and adds a simple sanity-check test case where we
      identify that the AHCI device is present, then
      disengage the virtual machine.
      Signed-off-by: NJohn Snow <jsnow@redhat.com>
      Message-id: 1408643079-30675-2-git-send-email-jsnow@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      1cd1031d