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 140D3C433FE for ; Thu, 29 Sep 2022 10:33:02 +0000 (UTC) Received: from localhost ([::1]:42068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odqqi-0003di-1d for qemu-devel@archiver.kernel.org; Thu, 29 Sep 2022 06:33:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odqlj-0001Gr-HD for qemu-devel@nongnu.org; Thu, 29 Sep 2022 06:27:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odqlf-0002ax-M1 for qemu-devel@nongnu.org; Thu, 29 Sep 2022 06:27:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664447266; 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=S2MTmuut3UpFN8JM4EGneIMhXbXwpb8297pJeuov8nQ=; b=LFUziYxZdMk2+pMT1kVJ4H7FbCXK6wxcK+rqX73zojjCXhlVE4ivPppRqYAyUL9XL941oH f1AGKDLhQMUvPo7h3cB8YPbD40rLxxH+1mTrukXUZJmWTcuQkqWKDCz740MnOnWnRN/QT9 IAWSK9UCQiqjLEgBCjXggJLTKMug3/Y= 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-141-ZID10jGnMYq7njBpvdre5Q-1; Thu, 29 Sep 2022 06:27:40 -0400 X-MC-Unique: ZID10jGnMYq7njBpvdre5Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB3FE88B7A7; Thu, 29 Sep 2022 10:27:39 +0000 (UTC) Received: from localhost (unknown [10.39.193.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A64A4EA5F; Thu, 29 Sep 2022 10:27:37 +0000 (UTC) From: Cornelia Huck To: Gavin Shan , eric.auger@redhat.com, qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, maz@kernel.org, zhenyzha@redhat.com, richard.henderson@linaro.org, peter.maydell@linaro.org, shan.gavin@gmail.com Subject: Re: [PATCH v3 5/5] hw/arm/virt: Add 'highmem-compact' property In-Reply-To: <7656c827-58ce-85c2-87fe-e88206d6f022@redhat.com> Organization: Red Hat GmbH References: <20220921231349.274049-1-gshan@redhat.com> <20220921231349.274049-6-gshan@redhat.com> <2e8ace49-b900-de7e-2d81-7bb6c081146e@redhat.com> <7656c827-58ce-85c2-87fe-e88206d6f022@redhat.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 29 Sep 2022 12:27:35 +0200 Message-ID: <87bkqyeaqw.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass client-ip=170.10.129.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 Thu, Sep 29 2022, Gavin Shan wrote: > Hi Eric, > > On 9/28/22 10:22 PM, Eric Auger wrote: >> On 9/22/22 01:13, Gavin Shan wrote: >>> After the improvement to high memory region address assignment is >>> applied, the memory layout is changed. For example, VIRT_HIGH_PCIE_MMIO >> s/the memory layout is changed./the memory layout is changed, >> introducing possible migration breakage. > > Ok, much clearer. > >>> memory region is enabled when the improvement is applied, but it's >>> disabled if the improvement isn't applied. >>> >>> pa_bits = 40; >>> vms->highmem_redists = false; >>> vms->highmem_ecam = false; >>> vms->highmem_mmio = true; >>> >>> # qemu-system-aarch64 -accel kvm -cpu host \ >>> -machine virt-7.2 -m 4G,maxmem=511G \ >>> -monitor stdio >>> >>> In order to keep backwords compatibility, we need to disable the >>> optimization on machines, which is virt-7.1 or ealier than it. It >>> means the optimization is enabled by default from virt-7.2. Besides, >>> 'highmem-compact' property is added so that the optimization can be >> I would rather rename the property into compact-highmem even if the vms >> field is name highmem_compact to align with other highmem fields > > Ok, but I would love to know why. Note that we already have > 'highmem=on|off'. 'highmem_compact=on|off' seems consistent > to me. FWIW, I initially misread 'highmem_compact' as 'highmem_compat' (and had to re-read because I got confused). At least to me, 'compact_highmem' has less chance of being parsed incorrectly :) (although that is probably a personal thing.) > >>> explicitly enabled or disabled on all machine types by users. >>> >>> Signed-off-by: Gavin Shan >>> --- >>> docs/system/arm/virt.rst | 4 ++++ >>> hw/arm/virt.c | 33 +++++++++++++++++++++++++++++++++ >>> include/hw/arm/virt.h | 2 ++ >>> 3 files changed, 39 insertions(+) >>> >>> diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst >>> index 20442ea2c1..f05ec2253b 100644 >>> --- a/docs/system/arm/virt.rst >>> +++ b/docs/system/arm/virt.rst >>> @@ -94,6 +94,10 @@ highmem >>> address space above 32 bits. The default is ``on`` for machine types >>> later than ``virt-2.12``. >>> >>> +highmem-compact >>> + Set ``on``/``off`` to enable/disable compact space for high memory regions. >>> + The default is ``on`` for machine types later than ``virt-7.2`` >> I think you should document what is compact layout versus legacy one, >> both in the commit msg and maybe as a comment in a code along with the >> comment in hw/arm/virt.c starting with 'Highmem IO Regions: ' > > Ok, I will add this into the commit log in v4. I don't think it's necessary > to add duplicate comment in the code. People can check the commit log for > details if needed. Rather explain it in this file here, maybe? I'd prefer to be able to find out what 'compact' means without digging through the commit log.