devices: Don't return bar info if memory/io is disabled

get_bar_configuration() returnis bar's info, this ignores memory/io enable
bit. Usually driver disable memory/io first, then wrtie 0xFFFFFFFF to
probe bar's existence and size, finally write real address and enable
memory/io.

if get_bar_configuration is called after mmio/io disabled, current
it may return invalid info. In order to filter these invalid info,
this commit checks memory/io enable bit, only return info at memory/io
enabled.

BUG=b:174705996
TEST=carto test -p devices

Change-Id: Ib8bf1a7f7f959025117f319f8f6c5a9e5efea2e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3252779
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
3 files changed
tree: befa7fbdd6f681223736a699dbdec9a96f7414ec
  1. .devcontainer/
  2. .github/
  3. aarch64/
  4. acpi_tables/
  5. arch/
  6. bin/
  7. bit_field/
  8. ci/
  9. common/
  10. crosvm-fuzz/
  11. crosvm_plugin/
  12. devices/
  13. disk/
  14. docs/
  15. fuse/
  16. gpu_display/
  17. hypervisor/
  18. integration_tests/
  19. kernel_cmdline/
  20. kernel_loader/
  21. kvm/
  22. kvm_sys/
  23. libcras_stub/
  24. libcrosvm_control/
  25. libvda/
  26. linux_input_sys/
  27. logo/
  28. net_sys/
  29. net_util/
  30. power_monitor/
  31. protos/
  32. qcow_utils/
  33. resources/
  34. rutabaga_gfx/
  35. seccomp/
  36. src/
  37. system_api_stub/
  38. tests/
  39. third_party/
  40. tools/
  41. tpm2/
  42. tpm2-sys/
  43. usb_sys/
  44. usb_util/
  45. vfio_sys/
  46. vhost/
  47. virtio_sys/
  48. vm_control/
  49. vm_memory/
  50. x86_64/
  51. .dockerignore
  52. .gitignore
  53. .gitmodules
  54. .rustfmt.toml
  55. ARCHITECTURE.md
  56. Cargo.toml
  57. CONTRIBUTING.md
  58. LICENSE
  59. navbar.md
  60. OWNERS
  61. README.md
  62. run_tests
  63. rust-toolchain
  64. setup_cros_cargo.sh
  65. test_all
  66. unblocked_terms.txt
README.md

crosvm - The Chrome OS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.

Logo