Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1424438pxb; Wed, 4 Nov 2020 08:33:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx50MtOfz5moogJdOnJzKFzhPO4DCIPfYTcVyMNpJkusGbLuYphW37nJ19jrSnYnB7Zjj7O X-Received: by 2002:aa7:d351:: with SMTP id m17mr10674279edr.215.1604507634142; Wed, 04 Nov 2020 08:33:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604507634; cv=none; d=google.com; s=arc-20160816; b=d65+N6VK4zoRHoD3i9+u/3HW70d4s5rWXdQV95/lbTnwmMANzlLEITefZbaki/tB7x BAYxBwApPdeyFmxLl3wGat3rM64b741muopB2fNMa8eubbdDrCXmQWElj5uQpn/vyTro 0mqome6L4atNsI9VdlQ2K02/4d9qVUYJl2KGnqAlRRFWZvmabsBES+DvY18Q+BbLV655 DfW/kfMcmykePtrPPcQhLSyqUci8LMkVtYzOi+jdlwbEtHydhJJncocpcPDVsqcuD5If EdCfpZMVVg5py7S8TsCidh/CW9ZN2wSM7UUVV0VRpSHkSXR0jCcvIjAVP5bZOrUwNDEa 1HWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=sYaj2UXtsTt0xHMWJvAK4qSBAxg5IaDjFNjZ783AMQs=; b=sy4Unv0uoJq0Aw9zQC09JXL9TJoLYNNLn0E+5GFh+5b4aaznoSrmH2KdfpN6QehxWq vONiyl2x3vioLE5Or6e0FEDz/l/NmFJHtH2TA8LmX/E/V0ZvOxZGH7XCmIYRPTbi7+9Z ud5wHisiuCrPLHyMnok8BCqpBs80YPRApHEON8Q4SMWKQnkOxDiHgJ87FtZ7PaScGEXw tRJV2MCnLu9lzoQIgz+ttFpDj+i8l9rNQ/hWXYfUY98T4Ba6NncaYaso8sTfTfuKdQ79 2cElk1D3/m7ILH2hffiOTOB2DRFZbw2hkUR5mlALG18vJXOsDH/dxI5fGiFbmzcOPOQo akxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="hS5PzTx/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx3si1812799ejb.709.2020.11.04.08.33.29; Wed, 04 Nov 2020 08:33:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="hS5PzTx/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730751AbgKDQcE (ORCPT + 99 others); Wed, 4 Nov 2020 11:32:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49865 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgKDQcE (ORCPT ); Wed, 4 Nov 2020 11:32:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604507522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sYaj2UXtsTt0xHMWJvAK4qSBAxg5IaDjFNjZ783AMQs=; b=hS5PzTx/qTiMzegT1no5+0zx7JIHm/E9O1i5+/F2GuLVp6NlSochRhb0yTMUKnlhWBkwwX 4JY7nAUnImzVH4FKDN5Ps8AJVv0ifTx8ckA24mVVI0siDEoTtfFu1EieD3Bwt/XLKUtRDM U3M/e1Zb0faxfe1xOeNNv342GKWsBZg= 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-455-JbqCzlhHMgqZWGBdniYdUQ-1; Wed, 04 Nov 2020 11:32:01 -0500 X-MC-Unique: JbqCzlhHMgqZWGBdniYdUQ-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 802551084C9E; Wed, 4 Nov 2020 16:31:57 +0000 (UTC) Received: from ovpn-112-92.rdu2.redhat.com (ovpn-112-92.rdu2.redhat.com [10.10.112.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D2994DA35; Wed, 4 Nov 2020 16:31:55 +0000 (UTC) Message-ID: <247d36e9a0f2b06c8a4008c634d008ef4403c579.camel@redhat.com> Subject: Re: [PATCH] KVM: x86: use positive error values for msr emulation that causes #GP From: Qian Cai To: Maxim Levitsky , kvm@vger.kernel.org, Paolo Bonzini Cc: Borislav Petkov , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Thomas Gleixner , Vitaly Kuznetsov , Joerg Roedel , "H. Peter Anvin" , Sean Christopherson , Wanpeng Li , Jim Mattson , Ingo Molnar Date: Wed, 04 Nov 2020 11:31:54 -0500 In-Reply-To: <20201101115523.115780-1-mlevitsk@redhat.com> References: <20201101115523.115780-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-11-01 at 13:55 +0200, Maxim Levitsky wrote: > Recent introduction of the userspace msr filtering added code that uses > negative error codes for cases that result in either #GP delivery to > the guest, or handled by the userspace msr filtering. > > This breaks an assumption that a negative error code returned from the > msr emulation code is a semi-fatal error which should be returned > to userspace via KVM_RUN ioctl and usually kill the guest. > > Fix this by reusing the already existing KVM_MSR_RET_INVALID error code, > and by adding a new KVM_MSR_RET_FILTERED error code for the > userspace filtered msrs. > > Fixes: 291f35fb2c1d1 ("KVM: x86: report negative values from wrmsr emulation > to userspace") > Reported-by: Qian Cai > Signed-off-by: Maxim Levitsky Apparently, it does not apply cleanly on today's linux-next. Paolo, is it possible to toss this into -next soon, so our CI won't be blocked because of this bug?