summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2014-06-25 18:56:22 +0000
committerkettenis <kettenis@openbsd.org>2014-06-25 18:56:22 +0000
commit71843e79c5d112344ecc513c9ddc6fcb14ce3162 (patch)
treeaadf5bb73e34a5bab3e4632dbde312ae4a8ef27f
parentApply/fix OpenBSD tag. (diff)
downloadwireguard-openbsd-71843e79c5d112344ecc513c9ddc6fcb14ce3162.tar.xz
wireguard-openbsd-71843e79c5d112344ecc513c9ddc6fcb14ce3162.zip
So it turns out that there is AML out there that asks for an access
width that isn't compatible with the alignment of the region: OperationRegion (SATC, SystemMemory, 0xE008800A, 0x04) Field (SATC, DWordAcc, NoLock, Preserve) { STCL, 16 } DWordAcc means 4-byte access, but 0xE008800A is only 2-byte aligned. Moreover, the region itself is 4 bytes long. From this I conclude that 4-byte wide access to a 2-byte aligned address is really wanted in cases like this. ok deraadt@
-rw-r--r--sys/dev/acpi/dsdt.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 3ef1b0f0d9b..6f187c5b078 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.210 2014/06/23 18:47:41 kettenis Exp $ */
+/* $OpenBSD: dsdt.c,v 1.211 2014/06/25 18:56:22 kettenis Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -2266,10 +2266,7 @@ aml_rwgas(struct aml_value *rgn, int bpos, int blen, struct aml_value *val,
break;
}
- KASSERT(rgn->v_opregion.iobase % sz == 0);
-
- pi.addr = rgn->v_opregion.iobase + (bpos >> 3);
- pi.addr &= ~(sz - 1);
+ pi.addr = rgn->v_opregion.iobase + ((bpos >> 3) & ~(sz - 1));
bpos &= ((sz << 3) - 1);
if (rgn->v_opregion.iospace == GAS_PCI_CFG_SPACE) {