From patchwork Thu Jan 6 10:41:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 530352 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp1072453imp; Thu, 6 Jan 2022 03:02:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4rw/ddv+a2RsZkHENYLzKW+T6az0L2jqPc3Ch73L4keWi3yW1jwl+EA4MdjJS9lE+Wewd X-Received: by 2002:a25:97c1:: with SMTP id j1mr71304413ybo.264.1641466971667; Thu, 06 Jan 2022 03:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641466971; cv=none; d=google.com; s=arc-20160816; b=OdzLWUYQD2JdG1nQdAYrTfk11ymOq0WwI2SNTmIGAhoDRPtjg+mq2IedDydq54rH+h GNjeUigo4OXrGeVTDMylFDUvNcOQMsP/y4ZZbHGAY6vsKmJpjDFy6zb9CAnPSeffHM7Y tRToI+8KQhLReQ4BDI8gaPXe+d4jLkKxauEadJRUUSdIcWiQ4zBUVsU0sz8/C9NYhAxw FCaH66L1z7Tgt2beELsmuiMgyUZcWpYjgyxiJLaa8qSIU2etWA+uwWOxZaRg0sBnFU2e UknlhRyWVFeKBxnsH/85DnGefk9VirfMPmBioY3s2Rer89wvXB3kgyEg6G5gwZsOnv/o UBnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=eorFRQ+OheGurRWOQuYX8O5Rv5WHimsEB/muwZlV11w=; b=pGPnHRDU4TCytoF7oX6/3QdITyumin+f1vh8NMQcmSRhDC/c23cV2CtuC1W+cnzjVK 4zAINPR8Yoi1HpGVIegBHp6DyXjDLs5ruUgPRrJoH2DcOW2IxN06MLaDxIDLzLZLvMc2 8bb3hKJhSGX+T4gqn8J4cc+bjiZSoV+8Pl+ycD9VUKWYftdNF/YIjIYyU5SVPvn8mTxR BmdG2v0hcgFb+C2U6bxbb9MfspwVE3qXFcksD93ORWaHZbXxU/wA1+Gy+s6GGBoV3Srw ROkTfSlKh+CwpLgIjAM46JdtF/rDBWjU9pWEJNEgRU0dExIW3qqVISyYHdCyH7RrYniY rZ3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 185si1043475ybw.539.2022.01.06.03.02.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jan 2022 03:02:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:44528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5QXj-0002Gw-3C for patch@linaro.org; Thu, 06 Jan 2022 06:02:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5QDZ-0007ne-Gi for qemu-devel@nongnu.org; Thu, 06 Jan 2022 05:42:01 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5QDR-0004jr-El for qemu-devel@nongnu.org; Thu, 06 Jan 2022 05:42:00 -0500 Received: from quad ([82.142.12.178]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MbC5g-1mYINz1zlw-00bYSd; Thu, 06 Jan 2022 11:41:51 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 19/27] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE Date: Thu, 6 Jan 2022 11:41:29 +0100 Message-Id: <20220106104137.732883-20-laurent@vivier.eu> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220106104137.732883-1-laurent@vivier.eu> References: <20220106104137.732883-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:1lauh6L71dtd4UvQ6MPHlgdYKC13fq8DbNE3emgtpe6t1q7k8I3 AS1g0EV4RqyYkFGHHNucHEfZ8WyqF+02c8/rrQ9axMdER9LHDHpIaAoC8hM0qzvBvmwoUJb OnD9ESsPsqV1lc1s8zjWe7biBPBSePirW0Ff9pO9TpjigCG/9ohzaf6OdB2urY2N+3p8qLI 1UDqt25vnwPBP5AmsL6mQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:JoTCOb9r2TM=:QwMel8YmCwgzyyeLCpGTGY p56kRD+OLSIrpNrumIeF8h9buLfjBmrqTkUUUud7WLFHgbzkfFgjofuoSgbER9JUnnLVc50fs xjBwQTUnADaQsaO3DIV+wZ9IIwsVFI3KpUBZVNO8SdqZWaEcS8urGMsfqXotKFYSzE19C6pwk 1Nf/hLJ4buv15BA+SOcTP9eGLTtqhDRQEky4BwskFsHujg25B9VnoJZceRS/6j6iq5ZW7tLMb 4wlXFIh/KXzyhsYWQ/Hg+d+uffvaTCgxOjSlg39LjZ5wlY7ACKwAK5OXX8mu5su4wdR/RDRU4 MSHW7QzilAYsTIciTKkxBB2RhH9BQZfYTJR1P3luS7tr4ErVHjAhubmFmBe6cMfEZIuMl+tTv znCOVK+MrACSywnKD8bbCPMRyOXbloH7SV+cLv+SBFG15ROMEY6O/Nhc04p5Y9haT1vnPSAVv Iz9wxQqnSAUZzeAKQHT15//XSc1TwU2FgyI4IJFbOvnDbU2EdVhexTmAQs4eOiE+9P0/vnGuj sDkJbU6xRvjtXCAYhUjfkj9FYhmSsZ0/mpcLPJleZDrH3y1fRkVfVvgY8q5Y4k8MPBWdYRWUR FwgSLxjvfvP8QpF6A3t+QHnrh2S7dNHGkzhnjvox2UHLlVSvewuni719CAgHUhiM4GTgQknWk 7lHft5H15epwQTlIw7h2nu0xZkmCeLBbhpZWSqBHAe2ny/RWmZC5SZrZRmW7/I4n+rsw= Received-SPF: none client-ip=212.227.126.135; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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: , Cc: Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Arm will no longer be the only target requiring a commpage, but it will continue to be the only target placing the page at the high end of the address space. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Message-Id: <20211221025012.1057923-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 767f54c76dc5..d34cd4fe43fb 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -390,11 +390,11 @@ enum { /* The commpage only exists for 32 bit kernels */ -#define ARM_COMMPAGE (intptr_t)0xffff0f00u +#define HI_COMMPAGE (intptr_t)0xffff0f00u static bool init_guest_commpage(void) { - void *want = g2h_untagged(ARM_COMMPAGE & -qemu_host_page_size); + void *want = g2h_untagged(HI_COMMPAGE & -qemu_host_page_size); void *addr = mmap(want, qemu_host_page_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0); @@ -2160,8 +2160,8 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, return sp; } -#ifndef ARM_COMMPAGE -#define ARM_COMMPAGE 0 +#ifndef HI_COMMPAGE +#define HI_COMMPAGE 0 #define init_guest_commpage() true #endif @@ -2361,7 +2361,7 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr, } loaddr &= -align; - if (ARM_COMMPAGE) { + if (HI_COMMPAGE) { /* * Extend the allocation to include the commpage. * For a 64-bit host, this is just 4GiB; for a 32-bit host we @@ -2372,14 +2372,14 @@ static void pgb_static(const char *image_name, abi_ulong orig_loaddr, if (sizeof(uintptr_t) == 8 || loaddr >= 0x80000000u) { hiaddr = (uintptr_t) 4 << 30; } else { - offset = -(ARM_COMMPAGE & -align); + offset = -(HI_COMMPAGE & -align); } } addr = pgb_find_hole(loaddr, hiaddr - loaddr, align, offset); if (addr == -1) { /* - * If ARM_COMMPAGE, there *might* be a non-consecutive allocation + * If HI_COMMPAGE, there *might* be a non-consecutive allocation * that can satisfy both. But as the normal arm32 link base address * is ~32k, and we extend down to include the commpage, making the * overhead only ~96k, this is unlikely. @@ -2400,7 +2400,7 @@ static void pgb_dynamic(const char *image_name, long align) * All we need is a commpage that satisfies align. * If we do not need a commpage, leave guest_base == 0. */ - if (ARM_COMMPAGE) { + if (HI_COMMPAGE) { uintptr_t addr, commpage; /* 64-bit hosts should have used reserved_va. */ @@ -2410,7 +2410,7 @@ static void pgb_dynamic(const char *image_name, long align) * By putting the commpage at the first hole, that puts guest_base * just above that, and maximises the positive guest addresses. */ - commpage = ARM_COMMPAGE & -align; + commpage = HI_COMMPAGE & -align; addr = pgb_find_hole(commpage, -commpage, align, 0); assert(addr != -1); guest_base = addr;