Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1896686pxb; Mon, 18 Jan 2021 02:53:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQn5Ynopb2BxLSMAeWW2qo4WoNbLFYsfJTvXO6OPRg22oun/ez9WrGtK3EOy82XIzu5MEL X-Received: by 2002:a17:906:9345:: with SMTP id p5mr16504038ejw.40.1610967183430; Mon, 18 Jan 2021 02:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610967183; cv=none; d=google.com; s=arc-20160816; b=q+O9G49W/rUZyifcgOqhXpRDd1RANmxKMPuyDKoSte++/aFc3IFDOK3wfsPDG/Wu0k 1U7rKPbG6PyOaWBOqV+XbJHCgk5xlppYzmB/mqXdBVOkeGB/QT95MtUl7G6lfddR7DZ7 7EEAsmmzM2jDxquM9y58PgsyRrah8+GFDULXuj795oRW2itTMZPLku9WL3WR2M2wukCJ mdVsJyUvZra9OHbhrRYZbJn3z/ZpO8GF0kG4lsm2k3vWlwKX3T1EziNl2H1aE+j8YqI3 sC86LQSt2fMWJRX+SKC0nb75DMYux2mg9+JAGzJnd5bVGhSsopfZAXFoAqU9PmDbTazo ttnA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=RpFlhXoCi3L1BBKHKCd/6ZVAAft9GBSKHZM8kwXaep8=; b=O1cuDWBM31Jp4Ux/Wl7pse9Vx43Kj52CZxo4Yy3p90gLRPiwTVEJ7+R/qUD4MQrFKP aVFboZ3y0Z09iF1eEXhwzA0u3iOY/plRuhow/+f426thp7W+pKChy/kKKhV3umCSYxV9 JSp9PnDpvpBExap7wlQh9WVuL6Lo+LHOvJhil02RphRJZBeZUFhQ19vcSha2kv7AvLn9 Zegk6QSBNpWQLrw9WES3uwVqz/KfV0GMHS/2C2wAYU+v14lT5CE3OhN6FkgEq9n3UzYa NzNFH5TUutyWzpDkCyOF8584V0bYL3rIgmf/5h7sHryf3MJb7pm6GqvTeEsF2iwsw4uz Iebg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bLkAEnp+; 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 v26si6660632ejc.336.2021.01.18.02.52.40; Mon, 18 Jan 2021 02:53:03 -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=bLkAEnp+; 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 S2388945AbhARKuR (ORCPT + 99 others); Mon, 18 Jan 2021 05:50:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60577 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390095AbhARKXs (ORCPT ); Mon, 18 Jan 2021 05:23:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610965342; 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=RpFlhXoCi3L1BBKHKCd/6ZVAAft9GBSKHZM8kwXaep8=; b=bLkAEnp+o4AwvZdotWh4qsbHdu2m426EDxVfUoa9pyZx55+gRnzCCXBS2+Y8hZuG1eX+gS oahTGS0h4d1Z/qpbf1t3cAwOEKOg/4VxF1qGh+ScpZubpgoc1wjK92cXgGc59M7rA5s+AO 4o2EmLbHE6fh/cruuWKWmveZIFiwGAU= 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-262-Me9VOK4bNmKeCSDyuYamrQ-1; Mon, 18 Jan 2021 05:22:20 -0500 X-MC-Unique: Me9VOK4bNmKeCSDyuYamrQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02687107ACE4; Mon, 18 Jan 2021 10:22:19 +0000 (UTC) Received: from [10.40.208.57] (unknown [10.40.208.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 053F060BFA; Mon, 18 Jan 2021 10:22:11 +0000 (UTC) Message-ID: <11bb013a6beb7ccb3a5f5d5112fbccbf3eb64705.camel@redhat.com> Subject: Re: [PATCH] KVM: x86: VMX: Make smaller physical guest address space support user-configurable From: Mohammed Gamal To: Jim Mattson , Paolo Bonzini Cc: kvm list , LKML , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , Aaron Lewis , Sean Christopherson Date: Mon, 18 Jan 2021 12:18:05 +0200 In-Reply-To: References: <20200903141122.72908-1-mgamal@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.2 (3.38.2-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-01-15 at 16:08 -0800, Jim Mattson wrote: > On Thu, Sep 3, 2020 at 7:12 AM Mohammed Gamal > wrote: > > > > This patch exposes allow_smaller_maxphyaddr to the user as a module > > parameter. > > > > Since smaller physical address spaces are only supported on VMX, > > the parameter > > is only exposed in the kvm_intel module. > > Modifications to VMX page fault and EPT violation handling will > > depend on whether > > that parameter is enabled. > > > > Also disable support by default, and let the user decide if they > > want to enable > > it. > > > > Signed-off-by: Mohammed Gamal > > --- > >  arch/x86/kvm/vmx/vmx.c | 15 ++++++--------- > >  arch/x86/kvm/vmx/vmx.h |  3 +++ > >  arch/x86/kvm/x86.c     |  2 +- > >  3 files changed, 10 insertions(+), 10 deletions(-) > > > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > > index 819c185adf09..dc778c7b5a06 100644 > > --- a/arch/x86/kvm/vmx/vmx.c > > +++ b/arch/x86/kvm/vmx/vmx.c > > @@ -129,6 +129,9 @@ static bool __read_mostly > > enable_preemption_timer = 1; > >  module_param_named(preemption_timer, enable_preemption_timer, > > bool, S_IRUGO); > >  #endif > > > > +extern bool __read_mostly allow_smaller_maxphyaddr; > > Since this variable is in the kvm module rather than the kvm_intel > module, its current setting is preserved across "rmmod kvm_intel; > modprobe kvm_intel." That is, if set to true, it doesn't revert to > false after "rmmod kvm_intel." Is that the intended behavior? > IIRC, this is because this setting was indeed not intended to be just VMX-specific, but since AMD has an issue with PTE accessed-bits being set by hardware and thus we can't yet enable this feature on it, it might make sense to move the variable to the kvm_intel module for now. Paolo, what do you think?