From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D45BC433F5 for ; Mon, 8 Nov 2021 15:28:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67CB861360 for ; Mon, 8 Nov 2021 15:28:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240766AbhKHPbQ (ORCPT ); Mon, 8 Nov 2021 10:31:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45110 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231453AbhKHPbM (ORCPT ); Mon, 8 Nov 2021 10:31:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636385307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sh0jeoaaV6hR+Zk6dI8yO0WLid/uTuPNM9688vfZlag=; b=Zu1oDOC3A/rBO2z00EnIdn6O3eEfAjUqFCEfaa010xOXiHC7oSP6WQY1Y9W7D+brmUc1ko OY0ChgFPflsWCoIiw4YpJigMibZR1nFN9MeqemXdhdlXssQW7+PkYSh8t6xqkeH0DZQEMn gvB7LandWLBFDIZDVTdixR4fMehqIxg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-5Z0ArhbNPzCZjDsBRGzHjg-1; Mon, 08 Nov 2021 10:28:24 -0500 X-MC-Unique: 5Z0ArhbNPzCZjDsBRGzHjg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 218CC1DDF0; Mon, 8 Nov 2021 15:28:23 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.192.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id E28E3794A4; Mon, 8 Nov 2021 15:28:20 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Li RongQing , linux-kernel@vger.kernel.org Subject: [PATCH 0/2] KVM: x86: Sanitize writes to MSR_KVM_PV_EOI_EN Date: Mon, 8 Nov 2021 16:28:17 +0100 Message-Id: <20211108152819.12485-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a continuation of work started by Li RongQing with "[PATCH] KVM: x86: disable pv eoi if guest gives a wrong address": https://lore.kernel.org/kvm/1636078404-48617-1-git-send-email-lirongqing@baidu.com/ Instead of resetting 'KVM_MSR_ENABLED' when a bogus address was written to MSR_KVM_PV_EOI_EN I suggest we refuse to update MSR at all, this aligns with #GP which is being injected on such writes. Vitaly Kuznetsov (2): KVM: x86: Rename kvm_lapic_enable_pv_eoi() KVM: x86: Don't update vcpu->arch.pv_eoi.msr_val when a bogus value was written to MSR_KVM_PV_EOI_EN arch/x86/kvm/hyperv.c | 4 ++-- arch/x86/kvm/lapic.c | 23 ++++++++++++++--------- arch/x86/kvm/lapic.h | 2 +- arch/x86/kvm/x86.c | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) -- 2.31.1