Author: bonefish Date: 2010-03-03 23:08:47 +0100 (Wed, 03 Mar 2010) New Revision: 35748 Changeset: http://dev.haiku-os.org/changeset/35748/haiku Modified: haiku/trunk/src/system/kernel/vm/VMDeviceCache.cpp haiku/trunk/src/system/kernel/vm/VMDeviceCache.h haiku/trunk/src/system/kernel/vm/VMNullCache.cpp haiku/trunk/src/system/kernel/vm/VMNullCache.h Log: Override Fault() method for VM{Device,Null}Cache to prevent vm_soft_fault() from inserting a clean page, if a fault happens. VMNullCaches are used by the slab's memory manager -- all page faults in slab areas are serious bugs and we want to panic() immediately. Modified: haiku/trunk/src/system/kernel/vm/VMDeviceCache.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/VMDeviceCache.cpp 2010-03-03 21:55:51 UTC (rev 35747) +++ haiku/trunk/src/system/kernel/vm/VMDeviceCache.cpp 2010-03-03 22:08:47 UTC (rev 35748) @@ -41,3 +41,10 @@ // no place to write, this will cause the page daemon to skip this store return B_OK; } + + +status_t +VMDeviceCache::Fault(struct VMAddressSpace* addressSpace, off_t offset) +{ + return B_BAD_ADDRESS; +} Modified: haiku/trunk/src/system/kernel/vm/VMDeviceCache.h =================================================================== --- haiku/trunk/src/system/kernel/vm/VMDeviceCache.h 2010-03-03 21:55:51 UTC (rev 35747) +++ haiku/trunk/src/system/kernel/vm/VMDeviceCache.h 2010-03-03 22:08:47 UTC (rev 35748) @@ -1,5 +1,5 @@ /* - * Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx * Copyright 2005-2007, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx * Distributed under the terms of the MIT License. * @@ -24,6 +24,9 @@ virtual status_t Write(off_t offset, const iovec *vecs, size_t count, uint32 flags, size_t *_numBytes); + virtual status_t Fault(struct VMAddressSpace* addressSpace, + off_t offset); + private: addr_t fBaseAddress; }; Modified: haiku/trunk/src/system/kernel/vm/VMNullCache.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/VMNullCache.cpp 2010-03-03 21:55:51 UTC (rev 35747) +++ haiku/trunk/src/system/kernel/vm/VMNullCache.cpp 2010-03-03 22:08:47 UTC (rev 35748) @@ -1,5 +1,5 @@ /* - * Copyright 2008, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx * Distributed under the terms of the MIT License. */ @@ -11,3 +11,10 @@ { return VMCache::Init(CACHE_TYPE_NULL, allocationFlags); } + + +status_t +VMNullCache::Fault(struct VMAddressSpace* addressSpace, off_t offset) +{ + return B_BAD_ADDRESS; +} Modified: haiku/trunk/src/system/kernel/vm/VMNullCache.h =================================================================== --- haiku/trunk/src/system/kernel/vm/VMNullCache.h 2010-03-03 21:55:51 UTC (rev 35747) +++ haiku/trunk/src/system/kernel/vm/VMNullCache.h 2010-03-03 22:08:47 UTC (rev 35748) @@ -1,5 +1,5 @@ /* - * Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@xxxxxxx + * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx * Copyright 2005-2007, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx * Distributed under the terms of the MIT License. * @@ -15,7 +15,10 @@ class VMNullCache : public VMCache { public: - status_t Init(uint32 allocationFlags); + status_t Init(uint32 allocationFlags); + + virtual status_t Fault(struct VMAddressSpace* addressSpace, + off_t offset); };