From nobody Fri Apr 19 09:28:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1592396970; cv=none; d=zohomail.com; s=zohoarc; b=gcFVvMY17QNaMJm0mx453o5CVmw4mY0KshGzlQABojAop9EgzUr3RO6tkpoREA98HEEkqLiYz7EDeWOb75LpOPFTEAbbEKkc+q9NOVE3H3IUd+c8mzP9hpCNcI2E4KJqJvXvXwrOPLkwwDaPObR0fzPOUdBYNIuBant4P4ggwCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592396970; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zb2O4LSZD2edy8bGwjrUcS/0sbskbMKnSoDc3GN7pZo=; b=g1twcu3luXq81AsRGoWmWc+LcatVMMCTzCuukOYx/X+9Mjq8IyLrEXaoiEXFlfw7yKFXscUQCLSxmzejbPHbEtUfJQBx6qIYFjy9doC/oTPETCRDZIIyd6XqO0tiXHXvioQaF39/FaMpwVTLiaqjOfTUgA78Q+X+SpJf+nUipEw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1592396970543259.7092100686691; Wed, 17 Jun 2020 05:29:30 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBt-00070b-B4; Wed, 17 Jun 2020 12:29:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBr-00070F-W2 for xen-devel@lists.xenproject.org; Wed, 17 Jun 2020 12:29:16 +0000 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 2826993a-b096-11ea-8496-bc764e2007e4; Wed, 17 Jun 2020 12:29:15 +0000 (UTC) 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-164-_dMmP07cP0WQCOcEEX7-_A-1; Wed, 17 Jun 2020 08:29:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAE79134D5; Wed, 17 Jun 2020 12:29:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5291F5D9D3; Wed, 17 Jun 2020 12:29:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A32FE1750C; Wed, 17 Jun 2020 14:29:01 +0200 (CEST) X-Inumbo-ID: 2826993a-b096-11ea-8496-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592396955; 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=zb2O4LSZD2edy8bGwjrUcS/0sbskbMKnSoDc3GN7pZo=; b=L2pGyrMsf3p95xbE9KH3T3jhVNMsik0HSHZuDHhONqkZhAaGQq3onZE5apd6HRpUQYfBBk 0jRoZ0aXtThVZRk0X5NeeEMvmOGsJy7hPoQDjp3/Be67nabdc06/2w9LHqOcUXTLngRgiV NwWFZlCW231584FXOvWsF7CPCAJ9upc= X-MC-Unique: _dMmP07cP0WQCOcEEX7-_A-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 1/4] microvm: use 3G split unconditionally Date: Wed, 17 Jun 2020 14:28:58 +0200 Message-Id: <20200617122901.13327-2-kraxel@redhat.com> In-Reply-To: <20200617122901.13327-1-kraxel@redhat.com> References: <20200617122901.13327-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Paul Durrant , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Looks like the logic was copied over from q35. q35 does this for backward compatibility, there is no reason to do this on microvm though. Also microvm doesn't need much mmio space, 1G is more than enough. Using an mmio window smaller than 1G is bad for gigabyte alignment and hugepages though. So split @ 3G unconditionally. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Igor Mammedov Acked-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Message-id: 20200529073957.8018-2-kraxel@redhat.com --- hw/i386/microvm.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 937db10ae6a5..44f940813b07 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -170,23 +170,9 @@ static void microvm_memory_init(MicrovmMachineState *m= ms) MemoryRegion *ram_below_4g, *ram_above_4g; MemoryRegion *system_memory =3D get_system_memory(); FWCfgState *fw_cfg; - ram_addr_t lowmem; + ram_addr_t lowmem =3D 0xc0000000; /* 3G */ int i; =20 - /* - * Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory - * and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping - * also known as MMCFG). - * If it doesn't, we need to split it in chunks below and above 4G. - * In any case, try to make sure that guest addresses aligned at - * 1G boundaries get mapped to host addresses aligned at 1G boundaries. - */ - if (machine->ram_size >=3D 0xb0000000) { - lowmem =3D 0x80000000; - } else { - lowmem =3D 0xb0000000; - } - /* * Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). --=20 2.18.4 From nobody Fri Apr 19 09:28:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1592396975; cv=none; d=zohomail.com; s=zohoarc; b=HymUlgBVKy8YEzMD7FxOAtCntkA4aITH/mn0BZDtUGeaHiI+U2OGzFIqypj7v1hkjs8ppcJ7LarrM+JblU4u/kQmj7I1WfAvDt/DHx5UHlDIsE7UFCzCQytgv/C9w6Z7nR84bcn3IVoyokMqoeHeyj7dfnrO2GFLqUNRITs/lC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592396975; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YPFJFaMrpuHpn0jwnWZgZ+54i5WkkV9FY9G9bgKap2I=; b=BGFORt70NXYwLlvljBrJmMaGg/lhlB7Iul1AmBXNImCZy7UXIOPbXO+pIhdE6NcSndkczEbTBfbFh2CX5YxbO6fiiq63Ubu4hMzY8O93S5+1IRwkAhN5ZUxro/W/kgRffHTZyVtAPV2KXju4/nP9hKsC1IsaXEpvZriNIlNFnVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 159239697591829.243784113371248; Wed, 17 Jun 2020 05:29:35 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBx-00072O-UP; Wed, 17 Jun 2020 12:29:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBw-00070F-Tk for xen-devel@lists.xenproject.org; Wed, 17 Jun 2020 12:29:20 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 28402c42-b096-11ea-8496-bc764e2007e4; Wed, 17 Jun 2020 12:29:15 +0000 (UTC) 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-427-dhvMQHhgMGCBolP3iquecA-1; Wed, 17 Jun 2020 08:29:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C31421009625; Wed, 17 Jun 2020 12:29:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CA177BA14; Wed, 17 Jun 2020 12:29:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AC3581753C; Wed, 17 Jun 2020 14:29:01 +0200 (CEST) X-Inumbo-ID: 28402c42-b096-11ea-8496-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592396955; 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=YPFJFaMrpuHpn0jwnWZgZ+54i5WkkV9FY9G9bgKap2I=; b=ddlMiZ/4277tMrCbFJW8EiK5LL4Cuafv1OgLSBJYQcHRMArt9uNqiQLAfjk4en314a2xZk zWZ/0Cmt/G+FtnPoqSJJjCeC6WH4xZVqX4ZOnUuvTDYhclNucAFTC/LXJnWiuOVjKI0VSc IpBaddoxftIlPTW4tJPu5bvV9Ea1sjs= X-MC-Unique: dhvMQHhgMGCBolP3iquecA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/4] microvm: drop max-ram-below-4g support Date: Wed, 17 Jun 2020 14:28:59 +0200 Message-Id: <20200617122901.13327-3-kraxel@redhat.com> In-Reply-To: <20200617122901.13327-1-kraxel@redhat.com> References: <20200617122901.13327-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Paul Durrant , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Not useful for microvm and allows users to shoot themself into the foot (make ram + mmio overlap). Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Acked-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Message-id: 20200529073957.8018-3-kraxel@redhat.com --- hw/i386/microvm.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 44f940813b07..5e931975a06d 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -173,25 +173,6 @@ static void microvm_memory_init(MicrovmMachineState *m= ms) ram_addr_t lowmem =3D 0xc0000000; /* 3G */ int i; =20 - /* - * Handle the machine opt max-ram-below-4g. It is basically doing - * min(qemu limit, user limit). - */ - if (!x86ms->max_ram_below_4g) { - x86ms->max_ram_below_4g =3D 4 * GiB; - } - if (lowmem > x86ms->max_ram_below_4g) { - lowmem =3D x86ms->max_ram_below_4g; - if (machine->ram_size - lowmem > lowmem && - lowmem & (1 * GiB - 1)) { - warn_report("There is possibly poor performance as the ram siz= e " - " (0x%" PRIx64 ") is more then twice the size of" - " max-ram-below-4g (%"PRIu64") and" - " max-ram-below-4g is not a multiple of 1G.", - (uint64_t)machine->ram_size, x86ms->max_ram_below_= 4g); - } - } - if (machine->ram_size > lowmem) { x86ms->above_4g_mem_size =3D machine->ram_size - lowmem; x86ms->below_4g_mem_size =3D lowmem; --=20 2.18.4 From nobody Fri Apr 19 09:28:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1592396977; cv=none; d=zohomail.com; s=zohoarc; b=Fxi+JtiZ71N2v4JgGLm/f8FjtWQMd/SZwwMq/22d94U3x/eqQ72BNU876N56Z5hX/arvJ5xFAZ/Wp6/UNs5xFGnNiIGvYbcnGEW08OglWuj9aQ4RIZlOwVrKnbMjtNoSISw8y84IMQMU7hGDTwNnAAvI834OU7vADYrJCrTlv80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592396977; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7m5RRVrZvMI+hYy8ktqweMxRA2Yf3dzvRQTzQqdINX4=; b=QHn0qe6uj/mkHe2FiN5GSFPFk9VDLIWg64shUX4WKj0eIlcgZ6BGQDQ1bihxMjX64ykdVi9FeVamgor4NFCDRM+tYZmP0bdA+o/IDcs6QxXmbqIg9Zg6TmAZ1YqKJ6UKr4Giq24WgIb0FuKeE7FNR1kljTNb9qw2LY6AjJKyBe4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1592396977154369.1564969392698; Wed, 17 Jun 2020 05:29:37 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBx-00071x-KS; Wed, 17 Jun 2020 12:29:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBw-00070A-8l for xen-devel@lists.xenproject.org; Wed, 17 Jun 2020 12:29:20 +0000 Received: from us-smtp-delivery-1.mimecast.com (unknown [207.211.31.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 2990f3a7-b096-11ea-b9d6-12813bfff9fa; Wed, 17 Jun 2020 12:29:17 +0000 (UTC) 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-387-sth5Ug6LM0eMfV0zwjpDBA-1; Wed, 17 Jun 2020 08:29:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E57E188362E; Wed, 17 Jun 2020 12:29:12 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50D7C7BA19; Wed, 17 Jun 2020 12:29:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BEC2A1753D; Wed, 17 Jun 2020 14:29:01 +0200 (CEST) X-Inumbo-ID: 2990f3a7-b096-11ea-b9d6-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592396957; 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=7m5RRVrZvMI+hYy8ktqweMxRA2Yf3dzvRQTzQqdINX4=; b=fXfNxl0O8/tOFbMGgTgfqOfHgRIvIaQg9GkDwFDWiAXVHs0tTUvaHIapS6x6KKqgSMTAro RZscUHWJ+eDa+LG8p45/ZqUiI2Md7oH4MUem81rZm313/Cc997HFswusTdS1I0m36LLxVA nxfP6NfWBaOToW1303eIx/qNynUlyYc= X-MC-Unique: sth5Ug6LM0eMfV0zwjpDBA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 3/4] x86: move max-ram-below-4g to pc Date: Wed, 17 Jun 2020 14:29:00 +0200 Message-Id: <20200617122901.13327-4-kraxel@redhat.com> In-Reply-To: <20200617122901.13327-1-kraxel@redhat.com> References: <20200617122901.13327-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Paul Durrant , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Move from X86MachineClass to PCMachineClass so it disappears from microvm machine type property list. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Reviewed-by: Igor Mammedov Reviewed-by: Paul Durrant Message-id: 20200529073957.8018-4-kraxel@redhat.com --- include/hw/i386/pc.h | 2 ++ include/hw/i386/x86.h | 4 ---- hw/i386/pc.c | 46 +++++++++++++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 10 +++++----- hw/i386/pc_q35.c | 10 +++++----- hw/i386/x86.c | 46 ------------------------------------------- hw/i386/xen/xen-hvm.c | 2 +- 7 files changed, 59 insertions(+), 61 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8d764f965cd3..e6135c34d656 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -35,6 +35,7 @@ struct PCMachineState { PFlashCFI01 *flash[2]; =20 /* Configuration options: */ + uint64_t max_ram_below_4g; OnOffAuto vmport; =20 bool acpi_build_enabled; @@ -51,6 +52,7 @@ struct PCMachineState { }; =20 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" +#define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g" #define PC_MACHINE_DEVMEM_REGION_SIZE "device-memory-region-size" #define PC_MACHINE_VMPORT "vmport" #define PC_MACHINE_SMBUS "smbus" diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index b52285481687..b79f24e28545 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -51,9 +51,6 @@ typedef struct { qemu_irq *gsi; GMappedFile *initrd_mapped_file; =20 - /* Configuration options: */ - uint64_t max_ram_below_4g; - /* RAM information (sizes, addresses, configuration): */ ram_addr_t below_4g_mem_size, above_4g_mem_size; =20 @@ -82,7 +79,6 @@ typedef struct { AddressSpace *ioapic_as; } X86MachineState; =20 -#define X86_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g" #define X86_MACHINE_SMM "smm" #define X86_MACHINE_ACPI "acpi" =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ec39741c87ac..d103b8c0ab82 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1857,6 +1857,45 @@ static void pc_machine_set_pit(Object *obj, bool val= ue, Error **errp) pcms->pit_enabled =3D value; } =20 +static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + PCMachineState *pcms =3D PC_MACHINE(obj); + uint64_t value =3D pcms->max_ram_below_4g; + + visit_type_size(v, name, &value, errp); +} + +static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + PCMachineState *pcms =3D PC_MACHINE(obj); + Error *error =3D NULL; + uint64_t value; + + visit_type_size(v, name, &value, &error); + if (error) { + error_propagate(errp, error); + return; + } + if (value > 4 * GiB) { + error_setg(&error, + "Machine option 'max-ram-below-4g=3D%"PRIu64 + "' expects size less than or equal to 4G", value); + error_propagate(errp, error); + return; + } + + if (value < 1 * MiB) { + warn_report("Only %" PRIu64 " bytes of RAM below the 4GiB boundary= ," + "BIOS may not work with less than 1MiB", value); + } + + pcms->max_ram_below_4g =3D value; +} + static void pc_machine_initfn(Object *obj) { PCMachineState *pcms =3D PC_MACHINE(obj); @@ -1866,6 +1905,7 @@ static void pc_machine_initfn(Object *obj) #else pcms->vmport =3D ON_OFF_AUTO_OFF; #endif /* CONFIG_VMPORT */ + pcms->max_ram_below_4g =3D 0; /* use default */ /* acpi build is enabled by default if machine supports it */ pcms->acpi_build_enabled =3D PC_MACHINE_GET_CLASS(pcms)->has_acpi_buil= d; pcms->smbus_enabled =3D true; @@ -1964,6 +2004,12 @@ static void pc_machine_class_init(ObjectClass *oc, v= oid *data) mc->numa_mem_supported =3D true; mc->default_ram_id =3D "pc.ram"; =20 + object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, + NULL, NULL); + object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, + "Maximum ram below the 4G boundary (32bit boundary)"); + object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int", pc_machine_get_device_memory_region_size, NULL, NULL, NULL); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 054d3aa9f7ae..1497d0e4ae94 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -129,11 +129,11 @@ static void pc_init1(MachineState *machine, if (xen_enabled()) { xen_hvm_init(pcms, &ram_memory); } else { - if (!x86ms->max_ram_below_4g) { - x86ms->max_ram_below_4g =3D 0xe0000000; /* default: 3.5G */ + if (!pcms->max_ram_below_4g) { + pcms->max_ram_below_4g =3D 0xe0000000; /* default: 3.5G */ } - lowmem =3D x86ms->max_ram_below_4g; - if (machine->ram_size >=3D x86ms->max_ram_below_4g) { + lowmem =3D pcms->max_ram_below_4g; + if (machine->ram_size >=3D pcms->max_ram_below_4g) { if (pcmc->gigabyte_align) { if (lowmem > 0xc0000000) { lowmem =3D 0xc0000000; @@ -142,7 +142,7 @@ static void pc_init1(MachineState *machine, warn_report("Large machine and max_ram_below_4g " "(%" PRIu64 ") not a multiple of 1G; " "possible bad performance.", - x86ms->max_ram_below_4g); + pcms->max_ram_below_4g); } } } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 18d2fad9c513..46cd06524c68 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -156,18 +156,18 @@ static void pc_q35_init(MachineState *machine) /* Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). */ - if (!x86ms->max_ram_below_4g) { - x86ms->max_ram_below_4g =3D 4 * GiB; + if (!pcms->max_ram_below_4g) { + pcms->max_ram_below_4g =3D 4 * GiB; } - if (lowmem > x86ms->max_ram_below_4g) { - lowmem =3D x86ms->max_ram_below_4g; + if (lowmem > pcms->max_ram_below_4g) { + lowmem =3D pcms->max_ram_below_4g; if (machine->ram_size - lowmem > lowmem && lowmem & (1 * GiB - 1)) { warn_report("There is possibly poor performance as the ram siz= e " " (0x%" PRIx64 ") is more then twice the size of" " max-ram-below-4g (%"PRIu64") and" " max-ram-below-4g is not a multiple of 1G.", - (uint64_t)machine->ram_size, x86ms->max_ram_below_= 4g); + (uint64_t)machine->ram_size, pcms->max_ram_below_4= g); } } =20 diff --git a/hw/i386/x86.c b/hw/i386/x86.c index bb31935f7017..34229b45c759 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -846,45 +846,6 @@ void x86_bios_rom_init(MemoryRegion *rom_memory, bool = isapc_ram_fw) bios); } =20 -static void x86_machine_get_max_ram_below_4g(Object *obj, Visitor *v, - const char *name, void *opaqu= e, - Error **errp) -{ - X86MachineState *x86ms =3D X86_MACHINE(obj); - uint64_t value =3D x86ms->max_ram_below_4g; - - visit_type_size(v, name, &value, errp); -} - -static void x86_machine_set_max_ram_below_4g(Object *obj, Visitor *v, - const char *name, void *opaqu= e, - Error **errp) -{ - X86MachineState *x86ms =3D X86_MACHINE(obj); - Error *error =3D NULL; - uint64_t value; - - visit_type_size(v, name, &value, &error); - if (error) { - error_propagate(errp, error); - return; - } - if (value > 4 * GiB) { - error_setg(&error, - "Machine option 'max-ram-below-4g=3D%"PRIu64 - "' expects size less than or equal to 4G", value); - error_propagate(errp, error); - return; - } - - if (value < 1 * MiB) { - warn_report("Only %" PRIu64 " bytes of RAM below the 4GiB boundary= ," - "BIOS may not work with less than 1MiB", value); - } - - x86ms->max_ram_below_4g =3D value; -} - bool x86_machine_is_smm_enabled(X86MachineState *x86ms) { bool smm_available =3D false; @@ -958,7 +919,6 @@ static void x86_machine_initfn(Object *obj) =20 x86ms->smm =3D ON_OFF_AUTO_AUTO; x86ms->acpi =3D ON_OFF_AUTO_AUTO; - x86ms->max_ram_below_4g =3D 0; /* use default */ x86ms->smp_dies =3D 1; =20 x86ms->apicid_from_cpu_idx =3D x86_apicid_from_cpu_idx; @@ -980,12 +940,6 @@ static void x86_machine_class_init(ObjectClass *oc, vo= id *data) x86mc->save_tsc_khz =3D true; nc->nmi_monitor_handler =3D x86_nmi; =20 - object_class_property_add(oc, X86_MACHINE_MAX_RAM_BELOW_4G, "size", - x86_machine_get_max_ram_below_4g, x86_machine_set_max_ram_below_4g, - NULL, NULL); - object_class_property_set_description(oc, X86_MACHINE_MAX_RAM_BELOW_4G, - "Maximum ram below the 4G boundary (32bit boundary)"); - object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", x86_machine_get_smm, x86_machine_set_smm, NULL, NULL); diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 628bde5fac0c..cde981bad667 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -205,7 +205,7 @@ static void xen_ram_init(PCMachineState *pcms, ram_addr_t block_len; uint64_t user_lowmem =3D object_property_get_uint(qdev_get_machine(), - X86_MACHINE_MAX_RAM_BELOW_4G, + PC_MACHINE_MAX_RAM_BELOW_4G, &error_abort); =20 /* Handle the machine opt max-ram-below-4g. It is basically doing --=20 2.18.4 From nobody Fri Apr 19 09:28:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1592396972; cv=none; d=zohomail.com; s=zohoarc; b=g5s3FexehLypjQEO82hBOlgs49pXL/WTMtlAbQRkl8a9EdFl5rmJS3gspdTjoilPg5o1wxxM0iCBAqi9RiYYbWITtwvj/DCpuv8ZtPnd0f45rhjsOXsoko061aiGtsfeu2zHwWC+rcCt0RFann7DiR5Ab5eWf3bGVreiH8UI4GI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592396972; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wUr9c1FJi7A1aTjG8v2DGsv6CTJYWqCn2CZCN7xc4cw=; b=iJJnkDl9sITgpC2CVtz78n7i7mQCa9nq5PDYJXjvClkbFKscNLgJSCsbPSNYusxkz19HCvXald1smuav8yswz6laHGVixbP2lGY3JG+rImzd+KPo2WPE+jT+L8DACu2/J/h8bGGZTRuE8vqWLDeOBIvXdT1fzfz3g5QCq6L2AGQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1592396972289479.50239940737106; Wed, 17 Jun 2020 05:29:32 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBs-00070K-3b; Wed, 17 Jun 2020 12:29:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jlXBr-00070A-E0 for xen-devel@lists.xenproject.org; Wed, 17 Jun 2020 12:29:15 +0000 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 27ec9168-b096-11ea-b9d6-12813bfff9fa; Wed, 17 Jun 2020 12:29:15 +0000 (UTC) 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-312-SRuNPBTVOlyeotJDUcrfYQ-1; Wed, 17 Jun 2020 08:29:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2D94107B472; Wed, 17 Jun 2020 12:29:11 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5782379302; Wed, 17 Jun 2020 12:29:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C7C0A9D8F; Wed, 17 Jun 2020 14:29:01 +0200 (CEST) X-Inumbo-ID: 27ec9168-b096-11ea-b9d6-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592396954; 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=wUr9c1FJi7A1aTjG8v2DGsv6CTJYWqCn2CZCN7xc4cw=; b=BSg/OGnVFfzojhq5jt/hE4vfcjEikuNGZQ0Y+b6w955oH8E4MEW6dudDgnKyNX6YB7RnaF e6EuJmatv2gjCvvO7NRL6pSpkWn17KS8ZFnRzskUf4YreVY4kr5+UkuwV3OH5GXiD7xvFY Yj1M5MizUeRfR0ekJnGMsw2UuJ7WxkE= X-MC-Unique: SRuNPBTVOlyeotJDUcrfYQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 4/4] microvm: move virtio base to 0xfeb00000 Date: Wed, 17 Jun 2020 14:29:01 +0200 Message-Id: <20200617122901.13327-5-kraxel@redhat.com> In-Reply-To: <20200617122901.13327-1-kraxel@redhat.com> References: <20200617122901.13327-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , Sergio Lopez , "Michael S. Tsirkin" , Paul Durrant , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Place virtio-mmio devices near the other mmio regions, next ioapic is at @ 0xfec00000. Signed-off-by: Gerd Hoffmann Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Igor Mammedov Reviewed-by: Paul Durrant Acked-by: Paolo Bonzini Message-id: 20200529073957.8018-5-kraxel@redhat.com --- include/hw/i386/microvm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h index ba68d1f22bb3..fd34b78e0d2a 100644 --- a/include/hw/i386/microvm.h +++ b/include/hw/i386/microvm.h @@ -26,7 +26,7 @@ #include "hw/i386/x86.h" =20 /* Platform virtio definitions */ -#define VIRTIO_MMIO_BASE 0xc0000000 +#define VIRTIO_MMIO_BASE 0xfeb00000 #define VIRTIO_IRQ_BASE 5 #define VIRTIO_NUM_TRANSPORTS 8 #define VIRTIO_CMDLINE_MAXLEN 64 --=20 2.18.4