Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3802377pxk; Tue, 29 Sep 2020 06:42:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxW3r8UlDhUMfEX5AHgNNhveoNY+mW4bKaxV1RSkoTt0zSUY5B1H4cskEtV32mkusOeNnM X-Received: by 2002:aa7:d750:: with SMTP id a16mr3405446eds.362.1601386944776; Tue, 29 Sep 2020 06:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601386944; cv=none; d=google.com; s=arc-20160816; b=tXgvnN3UnbXhNEvybquq0fLisD/a25v3U8NBqmPjz0IuB3ZF2xValPGFVFM/mI/dnV CX5dhEAPJiJTavEs7CuWtH02QaxZl26xz+3wAqrqo0V6awWd81XbKug2O1XwQjsVPX8b Z48OS197SYxWDMqsJzNfpXru3FSGgbHTO48JKbmL7LDlnGqr/3kdtWETBt1Ja9uKJu7X 3wRa63bLmD6Zgu1HquhhWyB/p+9vB8r+AyuZnFKsZUQaAomeXdsMGzi4Mv3rRD2VOHo5 GcImbyY66Rbo5WT1W/dM21xJk717BjAa6ieyYm9giYauVl7iKzIguFSZRk/cEPbLyeN9 RCdQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=B9TkhrmyyZDsjRPmcvznIh/VnqkIyiWZGCewhMqECL4=; b=uP27oTvrbEgGM89kx79uMk3ySO/3xJSKrje1gymSECGmx5N1IXg0dVO15hUiq06r+a AQFYU6PJs/7q8T6IbJh6fGR4S/FRWLJxQltUJex0xojYnCWcL4aCD5qv47+Ubb1cKaVX Uhvmi3OzH3l4n0sBwrfwBppBzx0CoC6s6+Ln6PEfq3XXiEICTdOz6MfurzvHeZbpnXtw 4M82hKRTTaH+7BaK3QraG+FWXpDVxBicdJ5AMTkxg1qhQeqolFPjTeP9sd8jTcXFMvY8 ZDACp/9A6iECXWuvzKp6cNwUAJDuEXbfBgbKqwfXcADcAkCxjlSEvhC2RQJqhRIWzUXG QsPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LtjS6UKM; 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 m27si2769748ejb.476.2020.09.29.06.42.00; Tue, 29 Sep 2020 06:42:24 -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=LtjS6UKM; 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 S1730395AbgI2Nj5 (ORCPT + 99 others); Tue, 29 Sep 2020 09:39:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42927 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730422AbgI2Nj5 (ORCPT ); Tue, 29 Sep 2020 09:39:57 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601386796; 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=B9TkhrmyyZDsjRPmcvznIh/VnqkIyiWZGCewhMqECL4=; b=LtjS6UKMPZrGBTxdgeCHrBuQCRtJKLtZhjP0+NNi1GjN4h77s6fVtgIJBV3rRxd+c6t/RU u67+uIwG9tRbFpHsOIKhvMh3J12/71ttZMtxUcff0qlNib6v7D90RdK/6QzdZORz4CZ+hY zE952hzqpvod5gUkxzuausQqgEjKzE8= 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-459-SeQCGutKOAuvTDSF4FFZew-1; Tue, 29 Sep 2020 09:39:54 -0400 X-MC-Unique: SeQCGutKOAuvTDSF4FFZew-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 D80AE10A7AED; Tue, 29 Sep 2020 13:39:51 +0000 (UTC) Received: from ovpn-66-32.rdu2.redhat.com (ovpn-66-32.rdu2.redhat.com [10.10.66.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FAE873663; Tue, 29 Sep 2020 13:39:47 +0000 (UTC) Message-ID: <2063b592f82f680edf61dad575f7c092d11d8ba3.camel@redhat.com> Subject: Re: [PATCH] KVM: x86: VMX: Make smaller physical guest address space support user-configurable From: Qian Cai To: Paolo Bonzini , Mohammed Gamal , kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, sean.j.christopherson@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, Stephen Rothwell , linux-next@vger.kernel.org, Linus Torvalds Date: Tue, 29 Sep 2020 09:39:46 -0400 In-Reply-To: References: <20200903141122.72908-1-mgamal@redhat.com> <1f42d8f084083cdf6933977eafbb31741080f7eb.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-09-29 at 14:26 +0200, Paolo Bonzini wrote: > On 29/09/20 13:59, Qian Cai wrote: > > WARN_ON_ONCE(!allow_smaller_maxphyaddr); > > > > I noticed the origin patch did not have this WARN_ON_ONCE(), but the > > mainline > > commit b96e6506c2ea ("KVM: x86: VMX: Make smaller physical guest address > > space > > support user-configurable") does have it for some reasons. > > Because that part of the code should not be reached. The exception > bitmap is set up with > > if (!vmx_need_pf_intercept(vcpu)) > eb &= ~(1u << PF_VECTOR); > > where > > static inline bool vmx_need_pf_intercept(struct kvm_vcpu *vcpu) > { > if (!enable_ept) > return true; > > return allow_smaller_maxphyaddr && > cpuid_maxphyaddr(vcpu) < boot_cpu_data.x86_phys_bits; > } > > We shouldn't get here if "enable_ept && !allow_smaller_maxphyaddr", > which implies vmx_need_pf_intercept(vcpu) == false. So the warning is > genuine; I've sent a patch. Care to provide a link to the patch? Just curious.