Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3892612pxj; Mon, 24 May 2021 18:04:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKqdEPyp4pYKI17WTYUCj8S2Jd6eaPdplPor3ZAA0JHFlu8Qrc4guNV3U1nPtGwk57Txhh X-Received: by 2002:a17:906:bcf9:: with SMTP id op25mr26718230ejb.453.1621904659442; Mon, 24 May 2021 18:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621904659; cv=none; d=google.com; s=arc-20160816; b=ziOYK6IYqV3fvys1lXfWBEbbJ47RECCeKutjAihAU8Qii/Z2DnjMWq39d/dvznKBdB gQhnuD1v+62bhlmNZYbeQXr1p0wiZ7BIhfMtGHz89GksfzvJtX5B/MM918Q6TuxNqDXN qsmF2yTgj4qQCDd+dVMyzwywPct0WltoJDnFPq8/9t2uLHlr7ma0AtoVLFt/pUfdqhxa Wdzxa3Q5jfh/v7U6F68fnI2++7NMbAixtSIqUdsgjLk1t/ZIdP0nd1d6X97P+fZ0ue3a oFL3ZLVxf3iOo6Pd7fUYfq+/IYasU8FuGkhf114z7feseXAuT2CYXrmWg51KX4mahSpq mTnw== 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=Z58QfC5D6YeFAbzSgFuFnv7cuq5vhjfp0Kxje8RxtIo=; b=TlzCvsob9qdvDbBZRHRHi5h2rY1C5PpiAAYwIlE2/X2oVSNqgseFdZBDQnFf34uPk5 6OcSkP8X37VMpkd92vYCaFGp5HyYKfkJXFRfsTyV+jRcxQtNyI7GTKthGX8Y4kcXYyK5 BjyQH0E2xeZwJ1kC/ZgMU2RsN1uHmS+7xeiK7LEPF2yDtRxYHWDzkDvF5f8c1F+3u1X3 dCOQp9qs97k/i4sPRVRLr0miPad1Xi2BRY2r8ZSE9/6ZB6wSJs8xM8RHU1Fr5u5jSm79 zp4pNl6iBnoX6fd5pTrCY8j0lKM/1BGEQ0RvNDfUMnYmivWRWS3zcY8BZTEMUjxxUe9n jYhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=W+B3bpON; 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 r22si4528217ejy.129.2021.05.24.18.03.56; Mon, 24 May 2021 18:04:19 -0700 (PDT) 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=W+B3bpON; 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 S229600AbhEYBE2 (ORCPT + 99 others); Mon, 24 May 2021 21:04:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbhEYBE2 (ORCPT ); Mon, 24 May 2021 21:04:28 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C927C061574 for ; Mon, 24 May 2021 18:02:58 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id m124so21377518pgm.13 for ; Mon, 24 May 2021 18:02:58 -0700 (PDT) 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=Z58QfC5D6YeFAbzSgFuFnv7cuq5vhjfp0Kxje8RxtIo=; b=W+B3bpONTpGdLIhDuxN26qGvLBjiytIUAf4B7oENMOFgCrlz6Q+Ybrm9jrsflLeJm5 rcCnaEuGr2lC/mn11sX0oH5IM73f2dlBowVs1UXKTXeGqM+g3JP9ps0l8SIwWTB8ihDq aUEU4szrh2FCBAHV6gQWxAakJjUgdIuzHxCC7QRwlgvlistXUVTZTITy4F3+EH1fWF5m 4ET9qis/9K3bAFK43k9U7SHr73rE6SY6bebeTKb2ipuWfCC9EIh/l+NDu30IsorkZXfK 5zJlE137c6UTrUx0t9w+xZBb80U3N6HmUN4liigml7SDZUY1yxuAdqWhaIjISooGS5g/ 4a1w== 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=Z58QfC5D6YeFAbzSgFuFnv7cuq5vhjfp0Kxje8RxtIo=; b=GA3YIoqRxcDpi+hixLrJfG8/PRwGV0Z6wMddJe38qFB0fEaZvVYLwrs8+PnsnXVl/C unXYdLiCvVhy8Nx63UO3Y1Wq8marlGEwyErKZ8Dx7DN9Bt83Rx3FkVfd6Yuot5aUQ2/D qLnDSjjXoBJm0Bjdhy0qdp46sqVT1kT5wCdRN8iK9QVi6gR7aWrdCTbeSvdb/P9wtD9Z IBYYbVlGrkd4EHh+EOeRzFKFkngmesf8ZjufWHGFdpOcTRvhShckpjjwSP0Q9GgpoCjf RUT3PvZkAVpMygDDvpT1Up3fZ54NlDJ4HYF8pn7CtbfF7uDf80NOibA7IJ5tETWukFpl puIQ== X-Gm-Message-State: AOAM533q+zpt+hW92x02yhFBDFT5/T9mEkV1uKfC2yrBS0ZhVY/54k74 1oQLkQWBBtcCHhI9cEEr4qHnDA== X-Received: by 2002:a05:6a00:84f:b029:2be:3b80:e9eb with SMTP id q15-20020a056a00084fb02902be3b80e9ebmr27677157pfk.39.1621904577837; Mon, 24 May 2021 18:02:57 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id s5sm6567319pjo.10.2021.05.24.18.02.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 18:02:57 -0700 (PDT) Date: Tue, 25 May 2021 01:02:53 +0000 From: Sean Christopherson To: Jim Mattson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm list , LKML Subject: Re: [PATCH 42/43] KVM: VMX: Drop VMWRITEs to zero fields at vCPU RESET Message-ID: References: <20210424004645.3950558-1-seanjc@google.com> <20210424004645.3950558-43-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021, Jim Mattson wrote: > On Mon, May 24, 2021 at 3:28 PM Sean Christopherson wrote: > > That said, I'm not against switching to VMWRITE for everything, but regardless > > of which route we choose, we should commit to one or the other. I.e. double down > > on memset() and bet that Intel won't break KVM, or replace the memset() in > > alloc_vmcs_cpu() with a sequence that writes all known (possible?) fields. The > > current approach of zeroing the memory in software but initializing _some_ fields > > is the worst option, e.g. I highly doubt vmcs01 and vmcs02 do VMWRITE(..., 0) on > > the same fields. > > The memset should probably be dropped, unless it is there to prevent > information leakage. However, it is not necessary to VMWRITE all known > (or possible) fields--just those that aren't guarded by an enable bit. Yeah, I was thinking of defense-in-depth, e.g. better to have VM-Enter consume '0' than random garbage because KVM botched an enabling sequence. We essentially get that today via the memset(). I'll fiddle with the sequence and see how much overhead a paranoid and/or really paranoid approach would incur.