[ Upstream commit a340b3e229b24a56f1c7f5826b15a3af0f4b13e5 ]
For EPT-violations that are triggered by a read, the pages are also mapped with
write permissions (if their memory region is also writable). That would avoid
getting yet another fault on the same page when a write occurs.
This optimization only happens when you have a "struct page" backing the memory
region. So also enable it for memory regions that do not have a "struct page".
Cc: Paolo Bonzini <email@example.com>
Cc: Radim Krčmář <firstname.lastname@example.org>
Signed-off-by: KarimAllah Ahmed <email@example.com>
Reviewed-by: Paolo Bonzini <firstname.lastname@example.org>
Signed-off-by: Radim Krčmář <email@example.com>
Signed-off-by: Sasha Levin <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>