• Ralf Ramsauer's avatar
    x86/jailhouse: Improve setup data version comparison · 0935e5f7
    Ralf Ramsauer authored
    Soon, setup_data will contain information on passed-through platform
    UARTs. This requires some preparational work for the sanity check of the
    header and the check of the version.
    
    Use the following strategy:
    
      1. Ensure that the header declares at least enough space for the
         version and the compatible_version as it must hold that fields for
         any version. The location and semantics of header+version fields
         will never change.
    
      2. Copy over data -- as much as as possible. The length is either
         limited by the header length or the length of setup_data.
    
      3. Things are now in place -- sanity check if the header length
         complies the actual version.
    
    For future versions of the setup_data, only step 3 requires alignment.
    Signed-off-by: default avatarRalf Ramsauer <ralf.ramsauer@oth-regensburg.de>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    Cc: Baoquan He <bhe@redhat.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: jailhouse-dev@googlegroups.com
    Cc: Juergen Gross <jgross@suse.com>
    Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: x86-ml <x86@kernel.org>
    Link: https://lkml.kernel.org/r/20191010102102.421035-2-ralf.ramsauer@oth-regensburg.de
    0935e5f7
bootparam.h 7.66 KB