diff options
| author | Brijesh Singh <brijesh.singh@amd.com> | 2022-04-26 17:46:18 +0000 |
|---|---|---|
| committer | Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> | 2022-07-13 17:27:26 -0500 |
| commit | 91bda2dfb5cbdd4b2e934db7acdcbcacabc9d735 (patch) | |
| tree | cb0b8bf3250a0369c733bd8945ffb677033207fc /include/linux/mm.h | |
| parent | a56b41f7cb657f72e35d4fd4380bc20ca5ba46e4 (diff) | |
| download | cachepc-linux-91bda2dfb5cbdd4b2e934db7acdcbcacabc9d735.tar.gz cachepc-linux-91bda2dfb5cbdd4b2e934db7acdcbcacabc9d735.zip | |
x86/fault: Add support to handle the RMP fault for user address
When SEV-SNP is enabled globally, a write from the host goes through the
RMP check. When the host writes to pages, hardware checks the following
conditions at the end of page walk:
1. Assigned bit in the RMP table is zero (i.e page is shared).
2. If the page table entry that gives the sPA indicates that the target
page size is a large page, then all RMP entries for the 4KB
constituting pages of the target must have the assigned bit 0.
3. Immutable bit in the RMP table is not zero.
The hardware will raise page fault if one of the above conditions is not
met. Try resolving the fault instead of taking fault again and again. If
the host attempts to write to the guest private memory then send the
SIGBUS signal to kill the process. If the page level between the host and
RMP entry does not match, then split the address to keep the RMP and host
page levels in sync.
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Diffstat (limited to 'include/linux/mm.h')
| -rw-r--r-- | include/linux/mm.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index cf3d0d673f6b..02e5bc1a17ac 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -463,7 +463,8 @@ static inline bool fault_flag_allow_retry_first(enum fault_flag flags) { FAULT_FLAG_USER, "USER" }, \ { FAULT_FLAG_REMOTE, "REMOTE" }, \ { FAULT_FLAG_INSTRUCTION, "INSTRUCTION" }, \ - { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" } + { FAULT_FLAG_INTERRUPTIBLE, "INTERRUPTIBLE" }, \ + { FAULT_FLAG_PAGE_SPLIT, "PAGESPLIT" } /* * vm_fault is filled by the pagefault handler and passed to the vma's |
