Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 2  
13 Jul 17 05:25
Rohan Kumbhar
xxxxxx@gmail.com
Join Date: 01 Aug 2014
Posts To This List: 73
Shared Copy-On-Write Memory

Hello, I am learning to use Intel Virtualization Extensions VMX and EPT. I have allocated Paging - Tables & Directory for one vmcs in memory, and loaded toy os in it. Next I have created another vmcs, and paging using ept. I want to share toy os paging with newly allocated paging tables & directories as "copy-on-write". I was searching for VirtualProtect(Ex) equivalent in kernel. Unable to find it. So my question is: How can I change memory protection value of page from kernel driver? The memory is kernel memory: NonPaged I am doing it on windows.
  Message 2 of 2  
14 Jul 17 07:31
Slava Imameev
xxxxxx@hotmail.com
Join Date: 13 Sep 2013
Posts To This List: 197
Shared Copy-On-Write Memory

<QUOTE> I want to share toy os paging with newly allocated paging tables & directories as "copy-on-write". [...] How can I change memory protection value of page from kernel driver? The memory is kernel memory: NonPaged </QUOTE> You can't mark most of the system(kernel) space as COW. The idea of COW is that a page is considered as writable but has write access disabled in PTE with CopyOnWrite flag being set in PTE ( as a software reserved bit ). When this COW page is being written the page fault handler allocates a private page for a particular virtual address and allows write access in PTE. The page fault handler doesn't invoke copy-on-write processing ( MiCopyOnWrite or MiCopyOnWriteEx ) for virtual address ranges accessible for mapping from a driver with standard API like MmMapLockedPagesSpecifyCache instead the system will bugcheck on write to read-only virtual address range even if you somehow set CopyOnWrite flag for a PTE. The page fault handler performs copy-on-write for special ranges like the session space but in that case a private page mapping made by COW is valid only in the context of a particular process/session and as far as I know the session space range is not accessible for mapping from third party drivers.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 05:49.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license