[tip:x86/boot] x86/xen: Fix the boot loader version reported for PVH guests

From: tip-bot for Juergen Gross
Date: Tue Dec 12 2017 - 05:58:19 EST


Commit-ID: 88750a6c33f813b815516990f01fb5ee488c477e
Gitweb: https://git.kernel.org/tip/88750a6c33f813b815516990f01fb5ee488c477e
Author: Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Fri, 8 Dec 2017 16:11:38 +0100
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Mon, 11 Dec 2017 15:14:20 +0100

x86/xen: Fix the boot loader version reported for PVH guests

The boot loader version reported via sysfs is wrong in case of the
kernel being booted via the Xen PVH boot entry. it should be 2.12
(0x020c), but it is reported to be 2.18 (0x0212).

As the current way to set the version is error prone use the more
readable variant (2 << 8) | 12.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx> # 4.12
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: boris.ostrovsky@xxxxxxxxxx
Cc: corbet@xxxxxxx
Cc: lenb@xxxxxxxxxx
Cc: linux-acpi@xxxxxxxxxxxxxxx
Cc: rjw@xxxxxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
Link: http://lkml.kernel.org/r/20171208151139.30213-4-jgross@xxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
arch/x86/xen/enlighten_pvh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 436c4f0..6e6430c 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -69,7 +69,7 @@ static void __init init_pvh_bootparams(void)
* Version 2.12 supports Xen entry point but we will use default x86/PC
* environment (i.e. hardware_subarch 0).
*/
- pvh_bootparams.hdr.version = 0x212;
+ pvh_bootparams.hdr.version = (2 << 8) | 12;
pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */
}