Skip to content

Commit

Permalink
patch the physmem for virtio-pci-net
Browse files Browse the repository at this point in the history
  • Loading branch information
dingelish committed Oct 7, 2024
1 parent e68976e commit 876e262
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions system/physmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2899,6 +2899,14 @@ MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr,
MemTxResult result = MEMTX_OK;
FlatView *fv;

hwaddr detect_bit = (hwaddr)1 << 50; // virtio-net-pci req comes with this
if (addr & detect_bit) {
hwaddr patch_bit = (hwaddr)1 << 51; // but cbit is missing
if (!(addr & patch_bit)) {
addr |= patch_bit;
}
}

if (len > 0) {
RCU_READ_LOCK_GUARD();
fv = address_space_to_flatview(as);
Expand All @@ -2915,6 +2923,14 @@ MemTxResult address_space_write(AddressSpace *as, hwaddr addr,
MemTxResult result = MEMTX_OK;
FlatView *fv;

hwaddr detect_bit = (hwaddr)1 << 50; // virtio-net-pci req comes with this
if (addr & detect_bit) {
hwaddr patch_bit = (hwaddr)1 << 51; // but cbit is missing
if (!(addr & patch_bit)) {
addr |= patch_bit;
}
}

if (len > 0) {
RCU_READ_LOCK_GUARD();
fv = address_space_to_flatview(as);
Expand Down

0 comments on commit 876e262

Please sign in to comment.