Date: Wed, 12 Oct 2011 21:12:17 +0530 From: "Jayachandran C." <jchandra@freebsd.org> To: freebsd-mips@freebsd.org Subject: [PATCH] Fix for crash on reading /dev/mem in 64 bit. Message-ID: <CA%2B7sy7BUA3f1N7QpnF-ppD5go5=Vm4o%2Bzz09941Dc=5XXTifhw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--0016364c7e6d776c6704af1bde80 Content-Type: text/plain; charset=ISO-8859-1 The crash happens because memrw() calls uiomove_fromphys() with a vm_page that is allocated in stack. This page does not have the md.pv_list initialized, and when uiomove_fromphys() calls pmap_flush_pvcache(), it results in a kernel crash. The attached patch fixes this bug. Also looking at the code of uiomove_fromphys(), I'm not sure why we need the wbinv and flush pvcache and then another wbinv - any ideas? If there are no comments, I'm planning to check it in later this week. JC. --0016364c7e6d776c6704af1bde80 Content-Type: text/x-patch; charset=US-ASCII; name="mips-dev-mem.patch" Content-Disposition: attachment; filename="mips-dev-mem.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gtohmej60 ZGlmZiAtLWdpdCBhL3N5cy9taXBzL21pcHMvbWVtLmMgYi9zeXMvbWlwcy9taXBzL21lbS5jCmlu ZGV4IDc1MjlhOWUuLmQ0MGM0MjQgMTAwNjQ0Ci0tLSBhL3N5cy9taXBzL21pcHMvbWVtLmMKKysr IGIvc3lzL21pcHMvbWlwcy9tZW0uYwpAQCAtODcsNiArODcsNyBAQCBtZW1ydyhzdHJ1Y3QgY2Rl diAqZGV2LCBzdHJ1Y3QgdWlvICp1aW8sIGludCBmbGFncykKIAogCUdJQU5UX1JFUVVJUkVEOwog CisJcG1hcF9wYWdlX2luaXQoJm0pOwogCXdoaWxlICh1aW8tPnVpb19yZXNpZCA+IDAgJiYgIWVy cm9yKSB7CiAJCWlvdiA9IHVpby0+dWlvX2lvdjsKIAkJaWYgKGlvdi0+aW92X2xlbiA9PSAwKSB7 Cg== --0016364c7e6d776c6704af1bde80--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B7sy7BUA3f1N7QpnF-ppD5go5=Vm4o%2Bzz09941Dc=5XXTifhw>