From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B34F4ECAAA1 for ; Fri, 2 Sep 2022 06:08:34 +0000 (UTC) Received: from localhost ([::1]:47834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTzqz-0007ii-7k for qemu-devel@archiver.kernel.org; Fri, 02 Sep 2022 02:08:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTzq0-0006xb-2n for qemu-devel@nongnu.org; Fri, 02 Sep 2022 02:07:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTzpw-0006SK-E3 for qemu-devel@nongnu.org; Fri, 02 Sep 2022 02:07:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662098846; 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: in-reply-to:in-reply-to:references:references; bh=82wuyHzBOyyNo34hJPzgjvvIX5BeEzD7ABQiSbeaZ+c=; b=NK/kMDlIrVVl3LS9yNnZ2VvxNISCemmVceDiVg1Hcicgf7mPjvk0k05w9KAMDPPLT6y6Gl LzoF2ZxUlqvuiQIXJMEYIyeOzldUfl/FpoeuVioFmBl7JVih6yTF037uroxy3RPG1sSPnd LvM9xDxV1E3b2vHhLjXyXAdAupxraqQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-596-Fg4TKC_ZPWmbUov6y6TQ1w-1; Fri, 02 Sep 2022 02:07:23 -0400 X-MC-Unique: Fg4TKC_ZPWmbUov6y6TQ1w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BB4CD811E81; Fri, 2 Sep 2022 06:07:22 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.195.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 655A4492C3B; Fri, 2 Sep 2022 06:07:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 108A518003AB; Fri, 2 Sep 2022 08:07:20 +0200 (CEST) Date: Fri, 2 Sep 2022 08:07:20 +0200 From: Gerd Hoffmann To: Xiaoyao Li Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Marcelo Tosatti , Marcel Apfelbaum , Eduardo Habkost , Paolo Bonzini , Richard Henderson , "Michael S. Tsirkin" , Sergio Lopez Subject: Re: [PATCH 0/2] expose host-phys-bits to guest Message-ID: <20220902060720.xruqoxc2iuszkror@sirius.home.kraxel.org> References: <20220831125059.170032-1-kraxel@redhat.com> <957f0cc5-6887-3861-2b80-69a8c7cdd098@intel.com> <20220901135810.6dicz4grhz7ye2u7@sirius.home.kraxel.org> <20220901161741.dadmguwv25sk4h6i@sirius.home.kraxel.org> <34be4132-53f4-8779-1ada-68aa554e0eac@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34be4132-53f4-8779-1ada-68aa554e0eac@intel.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, Sep 02, 2022 at 08:10:00AM +0800, Xiaoyao Li wrote: > On 9/2/2022 12:17 AM, Gerd Hoffmann wrote: > > On Thu, Sep 01, 2022 at 10:36:19PM +0800, Xiaoyao Li wrote: > > > On 9/1/2022 9:58 PM, Gerd Hoffmann wrote: > > > > > > > > Anyway, IMO, guest including guest firmware, should always consult from > > > > > CPUID leaf 0x80000008 for physical address length. > > > > > > > > It simply can't for the reason outlined above. Even if we fix qemu > > > > today that doesn't solve the problem for the firmware because we want > > > > backward compatibility with older qemu versions. Thats why I want the > > > > extra bit which essentially says "CPUID leaf 0x80000008 actually works". > > > > > > I don't understand how it backward compatible with older qemu version. Old > > > QEMU won't set the extra bit you introduced in this series, and all the > > > guest created with old QEMU will become untrusted on CPUID leaf 0x80000008 ? > > > > Correct, on old qemu firmware will not trust CPUID leaf 0x80000008. > > That is not worse than the situation we have today, currently the > > firmware never trusts CPUID leaf 0x80000008. > > > > So the patches will improves the situation for new qemu only, but I > > don't see a way around that. > > > > I see. > > But IMHO, I don't think it's good that guest firmware workaround the issue > on its own. Instead, it's better to just trust CPUID leaf 0x80000008 and > fail if the given physical address length cannot be virtualized/supported. > > It's just the bug of VMM to virtualize the physical address length. The > correction direction is to fix the bug not the workaround to hide the bug. I'm starting to repeat myself. "just trust CPUID leaf 0x80000008" doesn't work because you simply can't with current qemu versions. I don't like the dance with the new bit very much either, but I don't see a better way without massive fallout due to compatibility problems. I'm open to suggestions though. take care, Gerd