1. 15 12月, 2015 4 次提交
    • G
      fw_cfg: avoid calculating invalid current entry pointer · 66f8fd9d
      Gabriel L. Somlo 提交于
      When calculating a pointer to the currently selected fw_cfg item, the
      following is used:
      
        FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
      
      When s->cur_entry is FW_CFG_INVALID, we are calculating the address of
      a non-existent element in s->entries[arch][...], which is undefined.
      
      This patch ensures the resulting entry pointer is set to NULL whenever
      s->cur_entry is FW_CFG_INVALID.
      Reported-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Message-id: 1446733972-1602-5-git-send-email-somlo@cmu.edu
      Cc: Marc Marí <markmb@redhat.com>
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      66f8fd9d
    • G
      fw_cfg: remove offset argument from callback prototype · 3f8752b4
      Gabriel L. Somlo 提交于
      Read callbacks are now only invoked at item selection, before any
      data is read. As such, the value of the offset argument passed to
      the callback will always be 0. Also, the two callback instances
      currently in use both leave their offset argument unused.
      
      This patch removes the offset argument from the fw_cfg read callback
      prototype, and from the currently available instances. The unused
      (write) callback prototype is also removed (write support was removed
      earlier, in commit 023e3148).
      
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Marc Marí <markmb@redhat.com>
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1446733972-1602-4-git-send-email-somlo@cmu.edu
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3f8752b4
    • G
      fw_cfg: amend callback behavior spec to once per select · 3bef7e8a
      Gabriel L. Somlo 提交于
      Currently, the fw_cfg internal API specifies that if an item was set up
      with a read callback, the callback must be run each time a byte is read
      from the item. This behavior is both wasteful (most items do not have a
      read callback set), and impractical for bulk transfers (e.g., DMA read).
      
      At the time of this writing, the only items configured with a callback
      are "/etc/table-loader", "/etc/acpi/tables", and "/etc/acpi/rsdp". They
      all share the same callback functions: virt_acpi_build_update() on ARM
      (in hw/arm/virt-acpi-build.c), and acpi_build_update() on i386 (in
      hw/i386/acpi.c). Both of these callbacks are one-shot (i.e. they return
      without doing anything at all after the first time they are invoked with
      a given build_state; since build_state is also shared across all three
      items mentioned above, the callback only ever runs *once*, the first
      time either of the listed items is read).
      
      This patch amends the specification for fw_cfg_add_file_callback() to
      state that any available read callback will only be invoked once each
      time the item is selected. This change has no practical effect on the
      current behavior of QEMU, and it enables us to significantly optimize
      the behavior of fw_cfg reads during guest firmware setup, eliminating
      a large amount of redundant callback checks and invocations.
      
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Marc Marí <markmb@redhat.com>
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1446733972-1602-3-git-send-email-somlo@cmu.edu
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3bef7e8a
    • G
      fw_cfg: move internal function call docs to header file · 9c4a5c55
      Gabriel L. Somlo 提交于
      Move documentation for fw_cfg functions internal to qemufrom
      docs/specs/fw_cfg.txt to the fw_cfg.h header file, next to
      their prototype declarations, formatted as doc-comments.
      
      NOTE: Documentation for fw_cfg_add_callback() is completely
      dropped by this patch, as that function has been eliminated
      by commit 023e3148.
      Suggested-by: NPeter Maydell <peter.maydell@linaro.org>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Marc Marí <markmb@redhat.com>
      Cc: Jordan Justen <jordan.l.justen@intel.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1446733972-1602-2-git-send-email-somlo@cmu.edu
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9c4a5c55
  2. 12 12月, 2015 1 次提交
  3. 11 12月, 2015 2 次提交
  4. 10 12月, 2015 4 次提交
  5. 08 12月, 2015 4 次提交
  6. 07 12月, 2015 7 次提交
  7. 05 12月, 2015 3 次提交
  8. 04 12月, 2015 15 次提交