x86/boot: Fix latent memory corruption with early_boot_opts_t
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 6 Jun 2019 12:09:37 +0000 (14:09 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Jun 2019 12:09:37 +0000 (14:09 +0200)
commit10a732930762f1c34f7d46cbda0d2d76b31c5e23
tree1934db99d3bf7d29354a6eafb413f19341ae9f72
parent4f2d189bb9f2e80300a1434b1b1070d86e2fdff2
x86/boot: Fix latent memory corruption with early_boot_opts_t

c/s ebb26b509f "xen/x86: make VGA support selectable" added an #ifdef
CONFIG_VIDEO into the middle the backing space for early_boot_opts_t,
but didn't adjust the structure definition in cmdline.c

This only functions correctly because the affected fields are at the end
of the structure, and cmdline.c doesn't write to them in this case.

To retain the slimming effect of compiling out CONFIG_VIDEO, adjust
cmdline.c with enough #ifdef-ary to make C's idea of the structure match
the declaration in asm.  This requires adding __maybe_unused annotations
to two helper functions.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 30596213617fcf4dd7b71d244e16c8fc0acf456b
master date: 2019-05-13 10:35:38 +0100
xen/arch/x86/boot/cmdline.c
xen/arch/x86/boot/defs.h