Skip to content

Commit 72906f3

Browse files
committed
Merge branch 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 hyperv update from Ingo Molnar: "Enable PCID support on Hyper-V guests" * 'x86-hyperv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/hyperv: Stop suppressing X86_FEATURE_PCID
2 parents 3ccabd6 + 617ab45 commit 72906f3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

arch/x86/hyperv/mmu.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ static void hyperv_flush_tlb_others(const struct cpumask *cpus,
137137
}
138138

139139
if (info->mm) {
140+
/*
141+
* AddressSpace argument must match the CR3 with PCID bits
142+
* stripped out.
143+
*/
140144
flush->address_space = virt_to_phys(info->mm->pgd);
145+
flush->address_space &= CR3_ADDR_MASK;
141146
flush->flags = 0;
142147
} else {
143148
flush->address_space = 0;
@@ -219,7 +224,12 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
219224
}
220225

221226
if (info->mm) {
227+
/*
228+
* AddressSpace argument must match the CR3 with PCID bits
229+
* stripped out.
230+
*/
222231
flush->address_space = virt_to_phys(info->mm->pgd);
232+
flush->address_space &= CR3_ADDR_MASK;
223233
flush->flags = 0;
224234
} else {
225235
flush->address_space = 0;
@@ -278,8 +288,6 @@ void hyperv_setup_mmu_ops(void)
278288
if (!(ms_hyperv.hints & HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED))
279289
return;
280290

281-
setup_clear_cpu_cap(X86_FEATURE_PCID);
282-
283291
if (!(ms_hyperv.hints & HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED)) {
284292
pr_info("Using hypercall for remote TLB flush\n");
285293
pv_mmu_ops.flush_tlb_others = hyperv_flush_tlb_others;

0 commit comments

Comments
 (0)