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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7BE0C43387 for ; Mon, 7 Jan 2019 09:35:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 748EE2070C for ; Mon, 7 Jan 2019 09:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546853722; bh=gntu+VRv3i7vL6rycIpJ80XiRtKbkVf+G3gbrTs13qU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=KBOD93sJ4+GQgyJO9vzdwjym5B+DHgRJBj+KPhcDiy6lP+PyyZzyLjl13imoSpse+ ly58zXx7LoHpW4iWWNVBZfjCnIz4bEnfPyl34MTQ1wYg+AKTcpIMw6Yx81nuYV6+lL PIF49GuccbCWiJU/v/9q6swYJnspNeh3DpVD5+Wo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbfAGJfV (ORCPT ); Mon, 7 Jan 2019 04:35:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:33902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726273AbfAGJfV (ORCPT ); Mon, 7 Jan 2019 04:35:21 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 220E22070C; Mon, 7 Jan 2019 09:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546853720; bh=gntu+VRv3i7vL6rycIpJ80XiRtKbkVf+G3gbrTs13qU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TlXuB56Awtcu5UTD7SXoKGztHmHTyw6ifEZ5T7zxaNWPjtNTDqsx0GP+IDjis+Idn 3iZ33UzqA1qRdnEGLg6LyYU4RBuePO6+rAr+JrCV+7jlSDoPEAypXvM24e+aadZoLK +ckndPTzFSN1/dpoxftv6RN7ysVlWfvUkdnuYGDY= Date: Mon, 7 Jan 2019 10:35:18 +0100 From: Greg KH To: Mike Haboustak Cc: stable@vger.kernel.org Subject: Re: [PATCH 4.9] x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested Message-ID: <20190107093518.GA9554@kroah.com> References: <20180526132226.GA16378@kroah.com> <20190106185724.3vhot2b6nwfrhowg@hbstk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190106185724.3vhot2b6nwfrhowg@hbstk> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sun, Jan 06, 2019 at 01:57:24PM -0500, Mike Haboustak wrote: > [ Backport of upstream commit d391f1207067268261add0485f0f34503539c5b0 ] > > I was investigating an issue with seabios >= 1.10 which stopped working > for nested KVM on Hyper-V. The problem appears to be in > handle_ept_violation() function: when we do fast mmio we need to skip > the instruction so we do kvm_skip_emulated_instruction(). This, however, > depends on VM_EXIT_INSTRUCTION_LEN field being set correctly in VMCS. > However, this is not the case. > > Intel's manual doesn't mandate VM_EXIT_INSTRUCTION_LEN to be set when > EPT MISCONFIG occurs. While on real hardware it was observed to be set, > some hypervisors follow the spec and don't set it; we end up advancing > IP with some random value. > > I checked with Microsoft and they confirmed they don't fill > VM_EXIT_INSTRUCTION_LEN on EPT MISCONFIG. > > Fix the issue by doing instruction skip through emulator when running > nested. > > Fixes: 68c3b4d1676d870f0453c31d5a52e7e65c7448ae > Suggested-by: Radim Krčmář > Suggested-by: Paolo Bonzini > Signed-off-by: Vitaly Kuznetsov > Acked-by: Michael S. Tsirkin > Signed-off-by: Radim Krčmář > Signed-off-by: Sasha Levin > [mhaboustak: backport to 4.9.y] > Signed-off-by: Mike Haboustak > --- > arch/x86/kvm/vmx.c | 19 +++++++++++++++++-- > arch/x86/kvm/x86.c | 3 ++- > 2 files changed, 19 insertions(+), 3 deletions(-) Now queued up, thanks. greg k-h