Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2605785pxb; Fri, 17 Sep 2021 13:54:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygkQmMLl8ux+HAXDsYr+1+7V1Z0IC5S0jQXlNYjEXnyQznx8+xAzq5YHgMU/PBqtvJQmeW X-Received: by 2002:a05:6e02:1aac:: with SMTP id l12mr5779121ilv.318.1631912062463; Fri, 17 Sep 2021 13:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631912062; cv=none; d=google.com; s=arc-20160816; b=FkUk5n/LlM/9rtK2NlSnwBRLmZzeXMD/8wrTC1Zkz1BVWCsUGjUSDRMn6igt4Rnv5i p4AGbLZWpFQU9d1HNP70BwQruwkcc4rZ0V45b1asDkH3oeb8/oE4YZtRNMdkbcJAPkZa 0XyxfDiJiAkhprLXbltpPDKykJ/PXRJlVwk01wtmMQRdMPqRx5sNtvwOHnGG4QSffTmu M7I1kVhKcI8V/Bb971x/dYw8b7NmbtXBiRe2z+iXVJqnb4P6BitvFD95ahfly11VI7Jq WVDIqyIXVX1E4g2SbJDoP7mF2fm1SL9j+H8sjl5hSaRRssdeca7G80dhVhNSKE//KpS9 pC4Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=WxWLEKn1ue95t53L74j0yPmGdXY5xsCCO/BiwvJrdqA=; b=EoPE2/msSDIU054d1H0APXRjNQrQMJ3VFCmRP1eG21+QQRQWnnlaudp/TpP1qv547c Q7udEIpaD6g3nCpmer9dGlX9Koil7MDllwf0tavVk5H5mKGY9S+fCzMdD9BQ6wqF3d3K r6PHd7BXX0a6S4CQG2WA+SjJfENIpYPI0lBQ60lNTeOXvnl2N8vgZOGHxrecsW0YH/vc JwKbH9x2XHnsyMYkcklJLW9QgJGXCsFs/EVbC0EXXP+i82o/C211xujI7ZiAWAyEMc1e xoFILS164Jqt7ZgV3LY2n5WEJsMHvRQBleL5f+PHDtH36aEWYgbyeHjOo493d6839u5M 5ClQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fvAek/DS"; 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 i12si7651641ilu.99.2021.09.17.13.54.11; Fri, 17 Sep 2021 13:54:22 -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=@redhat.com header.s=mimecast20190719 header.b="fvAek/DS"; 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 S243817AbhIQMwJ (ORCPT + 99 others); Fri, 17 Sep 2021 08:52:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53765 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236399AbhIQMwG (ORCPT ); Fri, 17 Sep 2021 08:52:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631883043; 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=WxWLEKn1ue95t53L74j0yPmGdXY5xsCCO/BiwvJrdqA=; b=fvAek/DSO5gGfsHGSRfTl18JWchSTvOcvXISnoqfZ69y6O7HjiFZSdKexhCaCoVSpF9v/2 +lcGmgREWERngrQYn4WiEeoexDh3oVxy4VLCFx+jaoeQ3Uj2RaA6/BePOKcc+zNIX/hviV DekyIIwtmDBnzDJCsF9ZDUYXLxGgegI= 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-407-y8DVo9IYNIOkCCnl43prUw-1; Fri, 17 Sep 2021 08:50:42 -0400 X-MC-Unique: y8DVo9IYNIOkCCnl43prUw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1177F196632F; Fri, 17 Sep 2021 12:50:41 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB8DF60C2B; Fri, 17 Sep 2021 12:50:38 +0000 (UTC) From: Emanuele Giuseppe Esposito To: kvm@vger.kernel.org Cc: Paolo Bonzini , Maxim Levitsky , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Emanuele Giuseppe Esposito Subject: [RFC PATCH 0/2] KVM: nSVM: use vmcb_ctrl_area_cached instead Date: Fri, 17 Sep 2021 08:49:54 -0400 Message-Id: <20210917124956.2042052-1-eesposit@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Similar to what is being done for svm save area in the nested state (svm->nested.save), svm->nested.ctl contains some fields that are not used. This introduces the possibility of passing around uninitialized values, producing unnecessary bugs. RFC: changing svm->nested.ctl however means that all functions called with svm->nested.ctl or a normal vmcb control area struct will need to be modified to handle the new struct. This is the case of vmcb_is_intercept(), which results in an additional function definition. And this looks a little bit ugly IMO. Therefore, the aim of this serie is to gather feedback to see if there is a better way to change svm->nested.ctl or if it's even worth doing it. Based-on: <20210917120329.2013766-1-eesposit@redhat.com> Suggested-by: Maxim Levitsky Signed-off-by: Emanuele Giuseppe Esposito Emanuele Giuseppe Esposito (2): nSVM: introduce struct vmcb_ctrl_area_cached nSVM: use vmcb_ctrl_area_cached instead of vmcb_control_area in svm_nested_state arch/x86/kvm/svm/nested.c | 74 +++++++++++++++++++++++++++++---------- arch/x86/kvm/svm/svm.c | 4 +-- arch/x86/kvm/svm/svm.h | 39 ++++++++++++++++++--- 3 files changed, 93 insertions(+), 24 deletions(-) -- 2.27.0