[ Upstream commit a340b3e2 ]
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 <firstname.lastname@example.org>
Cc: Radim Krčmář <email@example.com>
Signed-off-by: KarimAllah Ahmed <firstname.lastname@example.org>
Reviewed-by: Paolo Bonzini <email@example.com>
Signed-off-by: Radim Krčmář <firstname.lastname@example.org>
Signed-off-by: Sasha Levin <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>