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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0B1EC33C8C for ; Mon, 6 Jan 2020 11:32:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A138D2072E for ; Mon, 6 Jan 2020 11:32:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="YnrsUegj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A138D2072E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioQd0-00031A-IN for qemu-devel@archiver.kernel.org; Mon, 06 Jan 2020 06:32:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33416) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioQZA-0001vY-Rp for qemu-devel@nongnu.org; Mon, 06 Jan 2020 06:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioQZ9-0007wj-5Q for qemu-devel@nongnu.org; Mon, 06 Jan 2020 06:29:00 -0500 Received: from mout.gmx.net ([212.227.17.22]:34303) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioQZ8-0007uu-S7 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 06:28:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1578310132; bh=4EYg356QN5R2u1xqUE3cRs1u5Fs4X3VhLZDQrx86Qnc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=YnrsUegjep9ZPVGR9SnHQPEipHBj6UpxZn7JM5nXTLvWAmIQArOwTTGVKAvjKK8TX F9HD0ypI/jnf2jB18MYJvFmh30rmcxN0+dXdFgRfPzDxofigDCtiOAgkrC4fxCserZ LaGaoD8aaFpIgbXAGXye8loAEkRmtq8Bk4XrbblU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.165.237]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MtOGU-1jiB3407e2-00usJ3; Mon, 06 Jan 2020 12:28:52 +0100 Subject: Re: [PATCH v2] hppa: allow max ram size upto 4Gb To: Igor Mammedov , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= References: <27c3e31d-82ae-e62f-caba-a0a3fbd55e7c@redhat.com> <1577987162-150529-1-git-send-email-imammedo@redhat.com> <2f226aa4-5f61-6e6d-d6b9-a98685a79e8c@gmx.de> <20200103105434.050d28ea@redhat.com> <6fa7bcd3-ee67-cc84-fd4e-d3677e3ae51a@redhat.com> <20200106114828.6bc96b23@redhat.com> From: Helge Deller Autocrypt: addr=deller@gmx.de; keydata= mQINBF3Ia3MBEAD3nmWz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ntdzdYl72SjJ HnsUYypLPeKEXwCqAQDB69QCjXHPmQ/340v6jONRMH6eLuGOdIBx8D+oBp8+BGLiD/9qu5H/ eGe0rrmE5lLFRlnm5QqKKi4gKt2WHMEdGi7fXggOTZbuKJA9+DzPxcf9ShuQMJRQDkgzv/VD V1fvOdaIMlM1EjMxIS2fyyI+9KZD7WwFYK3VIOsC7PtjOLYHSr7o7vDHNqTle7JYGEPlxuE6 hjMU7Ew2Ni4SBio8PILVXE+dL/BELp5JzOcMPnOnVsQtNbllIYvXRyX0qkTD6XM2Jbh+xI9P xajC+ojJ/cqPYBEALVfgdh6MbA8rx3EOCYj/n8cZ/xfo+wR/zSQ+m9wIhjxI4XfbNz8oGECm xeg1uqcyxfHx+N/pdg5Rvw9g+rtlfmTCj8JhNksNr0NcsNXTkaOy++4Wb9lKDAUcRma7TgMk Yq21O5RINec5Jo3xeEUfApVwbueBWCtq4bljeXG93iOWMk4cYqsRVsWsDxsplHQfh5xHk2Zf GAUYbm/rX36cdDBbaX2+rgvcHDTx9fOXozugEqFQv9oNg3UnXDWyEeiDLTC/0Gei/Jd/YL1p XzCscCr+pggvqX7kI33AQsxo1DT19sNYLU5dJ5Qxz1+zdNkB9kK9CcTVFXMYehKueBkk5MaU ou0ZH9LCDjtnOKxPuUWstxTXWzsinSpLDIpkP//4fN6asmPo2cSXMXE0iA5WsWAXcK8uZ4jD c2TFWAS8k6RLkk41ZUU8ENX8+qZx/Q== Message-ID: <8ef57947-dba6-9273-0b1e-7f0c052795da@gmx.de> Date: Mon, 6 Jan 2020 12:28:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200106114828.6bc96b23@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:LJtlKGH/2Zdc4FDA06roHNd5HGgTlEXIrYdQ5Iy+D5cIOn3OEVE 3h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hkNmLIDWkwXc5uCM5YxfSFDRzm AtuKorveVTTgf3SD9LnNqK+sQtNxUjiLQeSU3sjf90RO2Z6CygNswfSXHHtfvKRell2BQckzp se3bTffIOn3T4Em9UVcjZ/WwDuZ8E4kbk/OKxDaS5rdaZzze7nVbn8p2KQWDMLr3eOfNwYdy4 4kXp0UCsS+bkNkZyLM/YHWOOIhSDW/FEECQEg00O1+2KIG83YNZ/M5MEUeLkqNpilQX7w/NUD 4lZ9/tSgKjI4ZpxAZ4ZDxj0uhlH99N7H0XTgR1Q7iug7aKPjT1fo0nOsIuuW3JrmVjh9T2nMq D8L47pMmHpYwOLHeeNxh2LwTBFHIAq9zj/Fnfvnr6m9ZGdKAXDytc5r1NEZ4VQyWvMBIMYK3Y KDaSd2uGKq1Lxx6L47fJwOffh0R7MKA2Hg1KI0Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.22 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 06.01.20 11:48, Igor Mammedov wrote: > On Sat, 4 Jan 2020 16:00:19 +0100 > Philippe Mathieu-Daud=C3=A9 wrote: > >> On 1/3/20 10:54 AM, Igor Mammedov wrote: >>> On Thu, 2 Jan 2020 21:22:12 +0100 >>> Helge Deller wrote: >>> >>>> On 02.01.20 18:46, Igor Mammedov wrote: >>>>> Previous patch drops silent ram_size fixup and makes >>>>> QEMU error out with: >>>>> >>>>> "RAM size more than 3840m is not supported" >>>>> >>>>> when user specified -m X more than supported value. >>>>> >>>>> User shouldn't be bothered with starting QEMU with valid CLI, >>>>> so for the sake of user convenience allow using -m 4G vs -m 3840M. >>>>> >>>>> Requested-by: Helge Deller >>>>> Signed-off-by: Igor Mammedov >>>>> --- >>>>> v2: >>>>> - make main ram -1 prio, so it wouldn't conflict with other regio= ns >>>>> starting from 0xf9000000 >>>>> >>>>> I dislike it but if you feel it's really necessary feel free to ack = it. >> >> Hard to find the v2 buried in the other series with my email client. >> >>>>> >>>>> should be applied on top of: >>>>> "hppa: drop RAM size fixup" >>>> >>>> Hello Igor, >>>> I appreciate that you are trying to make it more cleaner. >>>> But, can't you merge both of your patches to one patch? >>>> Right now you have one patch "hppa: drop RAM size fixup", which is >>>> what I think is wrong. Then you add another one which somehow >>>> fixes it up again and adds other stuff. >>> 1st patch bring it in line with other boards adding >>> proper error check but without changing RAM size. >>> While 2nd is changing device model (mapped RAM size) and >>> clearly documents that it's a hack for user convenience, >>> Hence I'd prefer to keep both separated. >>> >>>> Having everything in one single patch makes your full change more >>>> understandable. >>>> >>>> Is it necessary to introduce clamped_ram_size and not continue with >>>> ram_size (even if you would add it as static local variable)? >>> it's necessary since ram_size is global which should be kept =3D=3D Ma= chineState::ram_size. >>> Later on I plan to remove the former altogether and maybe >>> MachineState::ram_size aa well, since it could be read with >>> memory_region_size(MachineState::ram). >> >> Why insist on clamping the ram? We recommend to model what the hardware >> does, and the hardware uses a full DIMM of DRAM, so 4GB, not less. > I'm not adding 4Gb support here (it's out of scope of this series), > all this patch does is making pre-existing global ram_size fixup, > this board only business and naming it clamped_ram_size to match > its current usage Ok. > (along with explicitly documenting the deviation from > other boards why it was requested to keep fixup 'for user convenience' > instead of going for correct and simpler error message telling > how much RAM user could specify on CLI). No, here you are wrong. This machine, same as all 32-bit x86 based machines, expect users to insert memory modules of e.g. 1GB, 2GB and so on. And ROM memory and other regions overlap the RAM in some regions if required. So, it's not "user convenience", but it's correct behaviour of the code to simply allow 4GB and then don't blend in the memory which can't be accessed. Giving a error message that "you can only insert 3841MB" would be WRONG. >> What are the new problem introduced by using 4GB? I only see advantages >> doing so. This doesn't break your series. This doesn't break the CLI. >> Am I missing something? > > Well, board was fixing up global ram_size and then used it to > - pass clamped value to guest via register > - pass it to load load_image_targphys() > - perform various checks > - affects reset sequence ... which is all OK, because it mimics the real hardware. > This patch keeps all of that in the same state > (I'd suspect changing above points, would break guest) Yep (unless I change the SeaBIOS ROM code). Anyway, I'm tired to discuss this. Your patch isn't wrong by itself, I just think it's changing unnecessary too much code and uses wrong wording for the commit message. But just apply it as long as it doesn't break anything. Helge > If you have an alternative patch that enables to use full 4Gb, > I'd include on respin as far as it doesn't change user supplied > global ram_size && ms->ram_size && uses generic ms->ram && > preferably on top of > "[PATCH 44/86] hppa: use memdev for RAM" > so it would be easier to drop it if there would opposition to it > without affecting series. > >>>>> --- >>>>> hw/hppa/machine.c | 21 +++++++++++---------- >>>>> 1 file changed, 11 insertions(+), 10 deletions(-) >>>>> >>>>> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c >>>>> index ebbf44f..0302983 100644 >>>>> --- a/hw/hppa/machine.c >>>>> +++ b/hw/hppa/machine.c >>>>> @@ -54,6 +54,7 @@ static uint64_t cpu_hppa_to_phys(void *opaque, uin= t64_t addr) >>>>> >>>>> static HPPACPU *cpu[HPPA_MAX_CPUS]; >>>>> static uint64_t firmware_entry; >>>>> +static ram_addr_t clamped_ram_size; >>>>> >>>>> static void machine_hppa_init(MachineState *machine) >>>>> { >>>>> @@ -74,8 +75,6 @@ static void machine_hppa_init(MachineState *machin= e) >>>>> long i; >>>>> unsigned int smp_cpus =3D machine->smp.cpus; >>>>> >>>>> - ram_size =3D machine->ram_size; >>>>> - >>>>> /* Create CPUs. */ >>>>> for (i =3D 0; i < smp_cpus; i++) { >>>>> char *name =3D g_strdup_printf("cpu%ld-io-eir", i); >>>>> @@ -90,12 +89,14 @@ static void machine_hppa_init(MachineState *mach= ine) >>>>> } >>>>> >>>>> /* Limit main memory. */ >>>>> - if (ram_size > FIRMWARE_START) { >>>>> - error_report("RAM size more than %d is not supported", FIRM= WARE_START); >>>>> + if (machine->ram_size > 4 * GiB) { >>>>> + error_report("RAM size more than 4Gb is not supported"); >>>>> exit(EXIT_FAILURE); >>>>> } >>>>> + clamped_ram_size =3D machine->ram_size > FIRMWARE_START ? >>>>> + FIRMWARE_START : machine->ram_size; >>>>> >>>>> - memory_region_add_subregion(addr_space, 0, machine->ram); >>>>> + memory_region_add_subregion_overlap(addr_space, 0, machine->ram= , -1); >>>>> >>>>> /* Init Dino (PCI host bus chip). */ >>>>> pci_bus =3D dino_init(addr_space, &rtc_irq, &serial_irq); >>>>> @@ -151,7 +152,7 @@ static void machine_hppa_init(MachineState *mach= ine) >>>>> qemu_log_mask(CPU_LOG_PAGE, "Firmware loaded at 0x%08" PRIx64 >>>>> "-0x%08" PRIx64 ", entry at 0x%08" PRIx64 ".\n", >>>>> firmware_low, firmware_high, firmware_entry); >>>>> - if (firmware_low < ram_size || firmware_high >=3D FIRMWARE_END)= { >>>>> + if (firmware_low < clamped_ram_size || firmware_high >=3D FIRMW= ARE_END) { >>>>> error_report("Firmware overlaps with memory or IO space"); >>>>> exit(1); >>>>> } >>>>> @@ -204,7 +205,7 @@ static void machine_hppa_init(MachineState *mach= ine) >>>>> (1) Due to sign-extension problems and PDC, >>>>> put the initrd no higher than 1G. >>>>> (2) Reserve 64k for stack. */ >>>>> - initrd_base =3D MIN(ram_size, 1 * GiB); >>>>> + initrd_base =3D MIN(clamped_ram_size, 1 * GiB); >>>>> initrd_base =3D initrd_base - 64 * KiB; >>>>> initrd_base =3D (initrd_base - initrd_size) & TARGET_P= AGE_MASK; >>>>> >>>>> @@ -232,7 +233,7 @@ static void machine_hppa_init(MachineState *mach= ine) >>>>> * various parameters in registers. After firmware initializat= ion, >>>>> * firmware will start the Linux kernel with ramdisk and cmdli= ne. >>>>> */ >>>>> - cpu[0]->env.gr[26] =3D ram_size; >>>>> + cpu[0]->env.gr[26] =3D clamped_ram_size; >> >> Helge, is this the code using this register? >> >> https://github.com/hdeller/seabios-hppa/blob/parisc-qemu-5.0/src/parisc= /head.S#L139 >> >>>>> cpu[0]->env.gr[25] =3D kernel_entry; >>>>> >>>>> /* tell firmware how many SMP CPUs to present in inventory tab= le */ >>>>> @@ -255,11 +256,11 @@ static void hppa_machine_reset(MachineState *m= s) >>>>> } >>>>> >>>>> /* already initialized by machine_hppa_init()? */ >>>>> - if (cpu[0]->env.gr[26] =3D=3D ram_size) { >>>>> + if (cpu[0]->env.gr[26] =3D=3D clamped_ram_size) { >>>>> return; >>>>> } >>>>> >>>>> - cpu[0]->env.gr[26] =3D ram_size; >>>>> + cpu[0]->env.gr[26] =3D clamped_ram_size; >>>>> cpu[0]->env.gr[25] =3D 0; /* no firmware boot menu */ >>>>> cpu[0]->env.gr[24] =3D 'c'; >>>>> /* gr22/gr23 unused, no initrd while reboot. */ >>>>> >>>> >>> >> >