On 11.02.20 12:26, Will Deacon wrote: > On Mon, Feb 10, 2020 at 06:27:04PM +0100, Christian Borntraeger wrote: >> CC Marc Zyngier for KVM on ARM. Marc, see below. Will there be any >> use for this on KVM/ARM in the future? > > I can't speak for Marc, but I can say that we're interested in something > like this for potentially isolating VMs from a KVM host in Android. > However, we've currently been working on the assumption that the memory > removed from the host won't usually be touched by the host (i.e. no > KSM or swapping out), so all we'd probably want at the moment is to be > able to return an error back from arch_make_page_accessible(). Its return > code is ignored in this patch :/ I think there are two ways at the moment. One is to keep the memory away from Linux, e.g. by using the memory as device driver memory like kmalloc. This is kind of what Power does. And I understand you as you want to follow that model and do not want to use paging, file backing or so. Our approach tries to fully integrate into the existing Linux LRU methods. Back to your approach. What happens when a malicious QEMU would start direct I/O on such isolated memory? Is that what you meant by adding error checking in these hooks. For the gup.c code returning an error seems straightforward. I have no idea what to do in writeback. When somebody managed to trigger writeback on such a page, it already seems too late.