Skip to content

Disable write protect when writing #14

@jpenalbae

Description

@jpenalbae

It would be useful to be able to disable write protect bit on intel (and its equivalent on arm if there is one), prior to any write operation and enable it again just after writing.

Something like an evar could be added, maybe r2k.disable_writeprotect or something like, and whenever the evar is set to true, disable the WP bit on cr0 prior any writing operation, and set it back after the write.

Do not leave the bit changed after writing, in order to not interfere with normal system operations. Also I would disable preemption during the operation, just to be on the safe side, to avoid being scheduled out, and end up in a different cpu whenever the execution is resumed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions