From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753120AbbIPXdU (ORCPT ); Wed, 16 Sep 2015 19:33:20 -0400 Received: from mail.kernel.org ([198.145.29.136]:44715 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbbIPXdS (ORCPT ); Wed, 16 Sep 2015 19:33:18 -0400 From: Andy Lutomirski To: x86@kernel.org Cc: Paolo Bonzini , Peter Zijlstra , KVM list , Arjan van de Ven , xen-devel , linux-kernel@vger.kernel.org, Andy Lutomirski Subject: [PATCH 0/3] x86/paravirt: Fix baremetal paravirt MSR ops Date: Wed, 16 Sep 2015 16:33:11 -0700 Message-Id: X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Setting CONFIG_PARAVIRT=y has an unintended side effect: it silently turns all rdmsr and wrmsr operations into the safe variants without any checks that the operations actually succeed. This is IMO awful: it papers over bugs. In particular, KVM gueests might be unwittingly depending on this behavior because CONFIG_KVM_GUEST currently depends on CONFIG_PARAVIRT. I'm not aware of any such problems, but applying this series would be a good way to shake them out. Fix it so that the MSR operations work the same on CONFIG_PARAVIRT=n and CONFIG_PARAVIRT=y as long as Xen isn't being used. The Xen maintainers are welcome to make a similar change on top of this. Since there's plenty of time before the next merge window, I think we should apply and fix anything that breaks. Doing this is probably a prerequisite to sanely decoupling CONFIG_KVM_GUEST and CONFIG_PARAVIRT, which would probably make Arjan and the rest of the Clear Containers people happy :) Andy Lutomirski (3): x86/paravirt: Add _safe to the read_msr and write_msr PV hooks x86/paravirt: Add paravirt_{read,write}_msr x86/paravirt: Make "unsafe" MSR accesses unsafe even if PARAVIRT=y arch/x86/include/asm/paravirt.h | 45 +++++++++++++++++++++-------------- arch/x86/include/asm/paravirt_types.h | 12 +++++++--- arch/x86/kernel/paravirt.c | 6 +++-- arch/x86/xen/enlighten.c | 27 +++++++++++++++++++-- 4 files changed, 65 insertions(+), 25 deletions(-) -- 2.4.3