From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id DAD603858C2C for ; Fri, 8 Oct 2021 08:02:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DAD603858C2C Received: by mail-pg1-x533.google.com with SMTP id m21so2343551pgu.13 for ; Fri, 08 Oct 2021 01:02:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:from:to:cc:subject:date:mime-version :content-transfer-encoding:importance; bh=AD1tugAWBIx8yk4PVUs/vVRxBLjntUlXR/h6WwdtZW8=; b=x9SebZ5EpgywnFT3mO3rV4vuvhCmUTrCeY4+bfkL3pBJ+JWlNb+TxsSDUZSDwGnvJv xlernhVUGpq0u6Vh6Sabn+NFI/TF8MqXNGbJp1d1ePiibRGvNxLgmsL4gU4B5hfhlB3U WxcSREu+xjeAenAcEIzNFR8CC9NRxjbTefDkDyK9+T34rY3UlzoreQ6+xEMtgxu9nbnc QO3aSfC8sOK8vuAkwsIvOGPzpEPsb8zL6mYO5z+0xyGGcI5wXNDCT4DcDpk3nQaSEftl 8cWukAxt5lLPcrPdHhfi83n4F4eeO5jniPYKzwYYLuI6F5hLzKZLxHmU4hQjG5DzCY9d o6sg== X-Gm-Message-State: AOAM533lT6+3mHHli4DCvXJcIAIOnC+RFaCFq1IJkOL/mqCbLAYv/JUQ Li+YSUTrXkLnKNjiyGuzTJs2GK7Dvtg= X-Google-Smtp-Source: ABdhPJxpWLBAq9515NOnIHt9R1L0EmTZTUl+1nbqu1/WfXS8c3opoJJDwfPlrNSkMyJYfweSmeEmtQ== X-Received: by 2002:a05:6a00:138a:b0:44c:b200:38d7 with SMTP id t10-20020a056a00138a00b0044cb20038d7mr8960915pfg.5.1633680178534; Fri, 08 Oct 2021 01:02:58 -0700 (PDT) Received: from DESKTOP0OKG1VA ([202.169.113.201]) by smtp.gmail.com with ESMTPSA id d137sm1706107pfd.72.2021.10.08.01.02.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Oct 2021 01:02:57 -0700 (PDT) Message-ID: <5012E6B04F3144C092FFF1EDD86E9FA0@DESKTOP0OKG1VA> From: "Paul Edwards" To: Subject: Re: S390 should change the meaning of -m31 Date: Fri, 8 Oct 2021 19:02:53 +1100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2021 08:03:02 -0000 Hi Michael. I have sort of (I used the i370 target of GCC 3.2.3 instead of the s390 target) reproduced Jesus's work with z/PDOS which can be obtained from here: http://www.pdos.org/zpdos.zip You can see that with standard Hercules 3.13: 18:02:24 Hercules Version 3.13 18:02:24 (c)Copyright 1999-2015 by Roger Bowler, Jan Jaeger, and others 18:02:24 Built on Sep 28 2017 at 01:35:43 18:02:24 Build information: 18:02:24 Windows (MSVC) build for AMD64 This memcpy: memcpy((char *)0x7ffffffe, "\x01\x02\x03\x04", 4); straddles the 2 GiB bar, and the memory is distinct from low memory: 18:03:05 r 7ffffff0 18:03:05 R:000000007FFFFFF0:K:06=00000000 00000000 00000000 00000102 ................ 18:03:05 R:0000000080000000:K:06=03040000 00000000 00000000 00000000 ................ 18:03:05 R:0000000080000010:K:06=00000000 00000000 00000000 00000000 ................ 18:03:05 R:0000000080000020:K:06=00000000 00000000 00000000 00000000 ................ 18:03:13 r 00000000 18:03:13 R:0000000000000000:K:06=000C0000 80002000 00000000 00000000 ................ 18:03:13 R:0000000000000010:K:06=0071D4B0 00000000 00000000 00000000 ..M............. 18:03:13 R:0000000000000020:K:06=000C0001 8050327A 00000000 00000000 .....&.:........ 18:03:13 R:0000000000000030:K:06=00000000 00000000 00000000 00000000 ................ BFN. Paul. -----Original Message----- From: Paul Edwards Sent: Friday, October 1, 2021 8:01 AM To: gcc@gcc.gnu.org Cc: matz@suse.de ; jesusantonio30122016@gmail.com Subject: S390 should change the meaning of -m31 Hi Michael. Thanks for picking up this issue. I have been working with Jesus on this. >> m31 is semantically the same as the m32 option. >> >> >> The m31 option allows for 32 bit addressing and that is confusing since >> the m31 option in S390 would mean 2 GiB space addressing > Indeed that's exactly what it means, and what it's supposed to mean. On > s390, in AMODE(31) the toplevel bit of an (32bit) address is either > ignored or an indicator to switch back to 24bit addresses from the s360 > times. Either way that leaves 31 bits to generate the virtual address. On > s390 you indeed have a 2GB address space, not more. He is using z/Arch and AM64. But building with -m31. >> Code used: >> >> volatile uint64_t *gib_test = (volatile uint64_t *)0x7FFFFFFF; >> memset(gib_test, 1, 4096); >> >> >> Hercules dump: >> >> r 0x7FFFFFFF-0x800001FF >> R:000000007FFFFFFF:K:06=01 . > I'm not sure what you believe to have demonstrated here. The (virtual or > physical) address 0x7FFFFFFF is either (in AMODE(24)) equivalent to > 0x00ffffff or to 0xffffffff (in AMODE(31)), either way, the top byte of > the addressable range ... I don't think that's what Hercules does for a real memory display - it will instead say out of range. But it doesn't matter, because we're using 64-bit Hercules with 4 GiB of memory and it doesn't matter what the AMODE happens to be at any moment in time, what is important is what is in that 4 GiB of memory. > The -mXX options are supposed to reflect the address space's size, not the > size of the general purpose registers. An option that reflect AMODE(24) > would also be called -m24, despite the registers still being 32bit in > size. The code generated by -m24 would be identical to code generated by -m31 which would be identical to code generated by -m32. Why can't we just have a normal -m32 and accept -m31 and maybe -m24 too, and flag them as "obsolete"? Thanks. Paul.