Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.17 commit in: /
Date: Fri, 29 Jun 2018 23:18:25
Message-Id: 1530314290.28232bbdc29fe4ef9f7d2a5360d7cdd000b26304.mpagano@gentoo
1 commit: 28232bbdc29fe4ef9f7d2a5360d7cdd000b26304
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 29 23:18:10 2018 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 29 23:18:10 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=28232bbd
7
8 kvmclock: Define pvclock_pvti_cpu0_va setter for X86_32. See bug #658544.
9
10 0000_README | 4 ++
11 ...ne-pvclock-pvti-cpu0-va-setter-for-X86-32.patch | 55 ++++++++++++++++++++++
12 2 files changed, 59 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index daa330b..af14401 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -67,6 +67,10 @@ Patch: 1510_fs-enable-link-security-restrictions-by-default.patch
19 From: http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/
20 Desc: Enable link security restrictions by default.
21
22 +Patch: 1700_define-pvclock-pvti-cpu0-va-setter-for-X86-32.patch
23 +From: https://marc.info/?l=kvm&m=152960320011592&w=2
24 +Desc: kvmclock: Define pvclock_pvti_cpu0_va setter for X86_32. See bug #658544.
25 +
26 Patch: 2300_enable-poweroff-on-Mac-Pro-11.patch
27 From: http://kernel.ubuntu.com/git/ubuntu/ubuntu-xenial.git/patch/drivers/pci/quirks.c?id=5080ff61a438f3dd80b88b423e1a20791d8a774c
28 Desc: Workaround to enable poweroff on Mac Pro 11. See bug #601964.
29
30 diff --git a/1700_define-pvclock-pvti-cpu0-va-setter-for-X86-32.patch b/1700_define-pvclock-pvti-cpu0-va-setter-for-X86-32.patch
31 new file mode 100644
32 index 0000000..0732c51
33 --- /dev/null
34 +++ b/1700_define-pvclock-pvti-cpu0-va-setter-for-X86-32.patch
35 @@ -0,0 +1,55 @@
36 +pvti_cpu0_va is the address of shared kvmclock data structure.
37 +
38 +pvti_cpu0_va is currently kept unset (1) on 32 bit systems, (2) when
39 +kvmclock vsyscall is disabled, and (3) if kvmclock is not stable.
40 +This poses a problem, because kvm_ptp needs pvti_cpu0_va, but (1) can
41 +work on 32 bit, (2) has little relation to the vsyscall, and (3) does
42 +not need stable kvmclock (although kvmclock won't be used for system
43 +clock if it's not stable, so kvm_ptp is pointless in that case).
44 +
45 +Expose pvti_cpu0_va whenever kvmclock is enabled to allow all users to
46 +work with it.
47 +
48 +This fixes a regression found on Gentoo: https://bugs.gentoo.org/658544.
49 +
50 +Fixes: 9f08890ab906 ("x86/pvclock: add setter for pvclock_pvti_cpu0_va")
51 +Reported-by: Andreas Steinmetz <ast@×××××.de>
52 +Signed-off-by: Radim Krčmář <rkrcmar@××××××.com>
53 +---
54 + arch/x86/kernel/kvmclock.c | 11 +++++------
55 + 1 file changed, 5 insertions(+), 6 deletions(-)
56 +
57 +diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
58 +index bf8d1eb7fca3..46ffa8327563 100644
59 +--- a/arch/x86/kernel/kvmclock.c
60 ++++ b/arch/x86/kernel/kvmclock.c
61 +@@ -319,6 +319,8 @@ void __init kvmclock_init(void)
62 + printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
63 + msr_kvm_system_time, msr_kvm_wall_clock);
64 +
65 ++ pvclock_set_pvti_cpu0_va(hv_clock);
66 ++
67 + if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT))
68 + pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT);
69 +
70 +@@ -366,14 +368,11 @@ int __init kvm_setup_vsyscall_timeinfo(void)
71 + vcpu_time = &hv_clock[cpu].pvti;
72 + flags = pvclock_read_flags(vcpu_time);
73 +
74 +- if (!(flags & PVCLOCK_TSC_STABLE_BIT)) {
75 +- put_cpu();
76 +- return 1;
77 +- }
78 +-
79 +- pvclock_set_pvti_cpu0_va(hv_clock);
80 + put_cpu();
81 +
82 ++ if (!(flags & PVCLOCK_TSC_STABLE_BIT))
83 ++ return 1;
84 ++
85 + kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK;
86 + #endif
87 + return 0;
88 +--
89 +2.18.0.rc2
90 +