]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/alternatives: do not BUG during apply
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 26 Sep 2024 10:14:30 +0000 (12:14 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 26 Sep 2024 13:18:03 +0000 (14:18 +0100)
commitaa5a06d5d6eda291afa3849ab143ffcd69b0d4e6
tree0f1bdf4de7cc147235dbea36151071d52e24a664
parentfa49f4be413cdabde5b2264fc85d2710b15ea691
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>
xen/arch/x86/alternative.c
xen/arch/x86/include/asm/alternative.h
xen/common/livepatch.c