Re: [PATCH v2 2/4] mm: x86: Invoke hypercall when page encryption status is changed

From: Paolo Bonzini
Date: Wed May 19 2021 - 09:44:27 EST


On 19/05/21 14:06, Ashish Kalra wrote:
Now these buffers have very short life and only used for immediate I/O
and then freed, so they may not be of major concern for SEV
migration ?

Well, they are a concern because they do break migration. But it may be indeed good enough to just have a WARN ("bad things may happen and you get to keep both pieces") and not disable future migration.

A BUG must always be avoided unless you're sure that something *worse* will happen in the future, e.g. a BUG is acceptable if you have detected a use-after-free or a dangling pointer. This is not the case.

Paolo

So disabling migration for failure of address lookup or mapping failures
on such pages will really be an overkill.
Might be in favor of Steve's thoughts above of doing a BUG() here
instead.