mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 10:32:10 +00:00
vcpu: restore behavior of reading unpopulated Bus regions
When handling a MMIO or IO read vcpu exit, we don't want to report an
error if there is nothing on the Bus at that location. Instead, we
should just return all zeroes. This matches the previous behavior before
https://crrev.com/c/3606975 and removes an error message during
integration_tests:boot.
BUG=b:213150327
TEST=tools/dev_container tools/presubmit --all
Fixes: 06c00d580d
("hypervisor: Trait changes for windows hypervisors support")
Change-Id: I6c955ece9184f253b1173e46465cd9a6dafe25bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3631029
Reviewed-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
f94281434b
commit
13e2950632
1 changed files with 4 additions and 1 deletions
|
@ -69,7 +69,10 @@ fn bus_io_handler(bus: &Bus) -> impl FnMut(IoParams) -> Option<[u8; 8]> + '_ {
|
|||
error!("unsupported Read size of {} bytes", size);
|
||||
size = data.len();
|
||||
}
|
||||
bus.read(address, &mut data[..size]).then(|| data)
|
||||
// Ignore the return value of `read()`. If no device exists on the bus at the given
|
||||
// location, return the initial value of data, which is all zeroes.
|
||||
let _ = bus.read(address, &mut data[..size]);
|
||||
Some(data)
|
||||
}
|
||||
IoOperation::Write { data } => {
|
||||
if size > data.len() {
|
||||
|
|
Loading…
Reference in a new issue