Re: [RFC PATCH v2 4/6] KVM: gmem: Add ioctl to inject memory failure on guest memfd

From: Sean Christopherson
Date: Thu Sep 21 2023 - 17:55:54 EST


On Thu, Sep 21, 2023, isaku.yamahata@xxxxxxxxx wrote:
> + if (!pfn_valid(pfn))
> + return -ENXIO;
> + return memory_failure(pfn, MF_SW_SIMULATED);

memory_failure is defined iff CONFIG_MEMORY_FAILURE=y. All of this code would
need to be conditioned on that (in addition to the injection configs).

address_space_operations.error_remove_page() arguably should be conditioned on
that as well, but that's a much bigger change and not a problem that needs to be
solved anytime soon.