Skip to content

Commit

Permalink
vmmplatsupport, vpci: Fix unaligned writes
Browse files Browse the repository at this point in the history
Data of unaligned configuration space writes were masked out because of
incorrect mask.

Signed-off-by: Markku Ahvenjärvi <[email protected]>
  • Loading branch information
elmankku committed Feb 23, 2024
1 parent 4662171 commit d050fb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libsel4vmmplatsupport/src/arch/arm/devices/vpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ static void pci_cfg_write_fault(vm_vcpu_t *vcpu, uint8_t offset, size_t len, vmm
uint32_t value;
int err;

mask = get_vcpu_fault_data_mask(vcpu);
seL4_Word s = (get_vcpu_fault_address(vcpu) & 0x3) * 8;
mask = get_vcpu_fault_data_mask(vcpu) >> s;
value = get_vcpu_fault_data(vcpu) & mask;

err = dev->iowrite((void *)dev->cookie, offset, len, value);
Expand Down

0 comments on commit d050fb3

Please sign in to comment.