]> xenbits.xensource.com Git - xen.git/commit
x86/alternatives: do not BUG during apply
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 25 Nov 2024 11:16:09 +0000 (12:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2024 11:16:09 +0000 (12:16 +0100)
commit08f539a7fbb212cdce16a01aeb11f0daa710ded2
treefa558ee6fbca7613fbf2e94208a8258dc3490d2c
parentaa057dbd3f36e195d8fc5a2c746079deb7105581
x86/alternatives: do not BUG during apply

alternatives is used both at boot time, and when loading livepatch payloads.
While for the former it makes sense to panic, it's not useful for the later, as
for livepatches it's possible to fail to load the livepatch if alternatives
cannot be resolved and continue operating normally.

Relax the BUGs in _apply_alternatives() to instead return an error code.  The
caller will figure out whether the failures are fatal and panic.

Print an error message to provide some user-readable information about what
went wrong.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: aa5a06d5d6eda291afa3849ab143ffcd69b0d4e6
master date: 2024-09-26 14:18:03 +0100
xen/arch/x86/alternative.c
xen/arch/x86/include/asm/alternative.h
xen/common/livepatch.c