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

Sean Christopherson
2023-09-21T21:55:54Z

On Thu, Sep 21, 2023, isaku.yamahata@intel.com 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.