Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2050945pxb; Mon, 8 Mar 2021 12:46:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP+TIyeGZohdldbfJgmc0/xZVA3vz8xAq4xYr4WQDxBST0AhckrVjeqAtiGoayaZM9Rcm2 X-Received: by 2002:a17:906:f210:: with SMTP id gt16mr16459042ejb.206.1615236367569; Mon, 08 Mar 2021 12:46:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615236367; cv=none; d=google.com; s=arc-20160816; b=R3fhLaKOemlueZ/yPFTZsUbjSS9FK9tUWroVlY+lCTsQrPI1ojufEmOQziMoKccaj8 VmIHiSjG7s7cqESeD1mF+B0qD5ZOa6UmCxp44yV5yizpfG8LXH1KrufaBHgNKIpa+Ldk Ceavj9TNwrYtaap/7mx0MRNnCLOBskAjbjsp/wDsPrZJt+ZW4SFyHLI+GgiI5ts91LXj nWlvYdIpC6XwePMaOTuFv0+vGeIoWf2A194/S4NOe77k0dwX5GgJDFfKGy8qKZCcVLn+ 7204zktFs/Ow88orIiLryCPc9gpfgtoYhoANhVjvKXa+vvNhSCZkSWGa08lAWQ91WHxT FX7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JCHmoEg1VJCxXwurok5RvQWW77Zv+Hi+TrTBhfG3tOU=; b=fGfwaae02DprtIjJQMDbeZ7qL0XKkMmM6cHQaqOFhrZlgLaetBXTqorhByFfD5JQAI 3+0rPOV90Ts+HKEc89bjLj7FWXJYc6MZfex6BHUbk6teMLiVVrGZB9VQMATikR1YX10v HPvEWxcmhAkWlmFRsRgwrZ7rfXgTZ9eXpJqcMrn+xBFvNF5Qs4gNnkY38hxFpePrEITN yd71aeTKniGXgqowpBI5QhkgNFx2tcCIcVSK0tDlZgBmMre5CzYyD5PG4Fy5sYgW2et2 SgR6KvUKw3hWxi1nUfUMXd1gtIYPw174HC3UA1eYFglo3bz3+9BwGO3JgZgy98vBY1Eq jB3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VQbnvxaq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si8538248edj.194.2021.03.08.12.45.45; Mon, 08 Mar 2021 12:46:07 -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=@google.com header.s=20161025 header.b=VQbnvxaq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231301AbhCHUn7 (ORCPT + 99 others); Mon, 8 Mar 2021 15:43:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbhCHUnz (ORCPT ); Mon, 8 Mar 2021 15:43:55 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86EC2C06175F for ; Mon, 8 Mar 2021 12:43:55 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id ba1so5466533plb.1 for ; Mon, 08 Mar 2021 12:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JCHmoEg1VJCxXwurok5RvQWW77Zv+Hi+TrTBhfG3tOU=; b=VQbnvxaqwj8CRvemi3vkE8V6VJmjTntB0m1/c217PqSaJ2cevn5dorMbRHGhFdNySY 9QnF9vDDmIMKPG5/fBtc9sguELN11DKOuA6RwTWrRMKD96GAc6Chji9wxRTYOc+KRts0 XZQ4qLSLrJrw3RvxH7JR8Li8H04xOupvvcHhYLSXw1eQG+KFXXG14EegeZ4fgmFyQcbx fBuwpn7LBJ+8OUWgNXhglUlV8oegvVnr4C6JHH6MNrcBd8iB3yGpoSFAHlcc26MJSK49 oQmYornvXyQCnfFeEfZNB/xMGk1XiCNngdHc79GhpkMAFVaR1O4lxAZ7ZYDWVP4HgVxi VfZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JCHmoEg1VJCxXwurok5RvQWW77Zv+Hi+TrTBhfG3tOU=; b=U+EoO7esQsVVj9Sn9BKmXBxFTD7ocQ8VtFjlAQ9ShbPseg39ZAImt5ZTX0zWxExRyD 3A1VkxtAo0tjR7IXhbE3nmwV3YUZg1LFlyTr9VrSZPKtzxuKbnA7J3X4hrDYj6rHH0wO DZB6CoKaZc6zS46UA3QVKEBjgFNP39YXgGUCok2hbLH9wIZQHKwoHpkBttY4ES8cxkJB 9vGU7IzN1DXvWzkGf82x1HvlFmC1by12mqNwr7s/1NWa0QfhykJHLGVIzdQeXCfSplkX Yc9XAB2a4X5al9vtoJj19UJED4b4unoNrBCd7ajVLDQXePjA1OW+nAVI9tbaAmTzaOEK YYVQ== X-Gm-Message-State: AOAM533QqU9oGhfSVo+Nw4BBKsXXsBrKyFVnUX6fcL4HOvWZfoXJa8a/ +de4h5bf3QkkOtuzrQfcwEOJxnLtHFlLsA== X-Received: by 2002:a17:90a:8417:: with SMTP id j23mr756073pjn.224.1615236235012; Mon, 08 Mar 2021 12:43:55 -0800 (PST) Received: from google.com ([2620:15c:f:10:8:847a:d8b5:e2cc]) by smtp.gmail.com with ESMTPSA id ha8sm241837pjb.6.2021.03.08.12.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 12:43:54 -0800 (PST) Date: Mon, 8 Mar 2021 12:43:48 -0800 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, vkuznets@redhat.com, mlevitsk@redhat.com, Jim Mattson Subject: Re: [PATCH 03/28] KVM: nSVM: inject exceptions via svm_check_nested_events Message-ID: References: <006be822-697e-56d5-84a7-fa51f5087a34@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006be822-697e-56d5-84a7-fa51f5087a34@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 08, 2021, Paolo Bonzini wrote: > On 08/03/21 17:44, Sean Christopherson wrote: > > VMCALL is also probably ok > > in most scenarios, but patching L2's code from L0 KVM is sketchy. > > I agree that patching is sketchy and I'll send a patch. However... > > > > The same is true for the VMware #GP interception case. > > > > I highly doubt that will ever work out as intended for the modified IO #GP > > behavior. The only way emulating #GP in L2 is correct if L1 wants to pass > > through the capabilities to L2, i.e. the I/O access isn't intercepted by L1. > > That seems unlikely. > > ... not all hypervisors trap everything. In particular in this case the > VMCS12 I/O permission bitmap should be consulted (which we do in > vmx_check_intercept_io), but if the I/O is not trapped by L1 it should > bypass the IOPL and TSS-bitmap checks in my opinion. I agree, _if_ it's not trapped. But bypassing the checks when it is trapped is clearly wrong.