From patchwork Tue Dec 21 02:50:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 526588 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp4675045imb; Mon, 20 Dec 2021 18:54:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWhFFV3wYQx2Q53VdlNHEjUT/sa/Ky2UtqdopZvGZgEy0qG/+E2B5Yr1ifTfCQ1cqT4yZF X-Received: by 2002:a25:f211:: with SMTP id i17mr1549134ybe.239.1640055244932; Mon, 20 Dec 2021 18:54:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640055244; cv=none; d=google.com; s=arc-20160816; b=RWPWEgTR3gZqrzS38D4JOFBNodmHhiZwK0SYX5+h0QWAq/1WtqkVUeER0Twe7WzcBb ohXAUTpBnB9Wx0HLKxdKpIBqZ0YRnGUdBmbHytm3T6SaTYsyinHsCMCPietyxhjMI7/M 8KEnLTVyZA3MuM9qvd+KsYzEMQNJznJXBqFWYZ8bTeqwWb5rYRjIhFosLNKFNXNz6QzP 3jEaUCG0mAqNhtA/nW6MGarPfkPbMGZGE7yblFQTjAuQej9maEDspnmfZNolq7AuxXLK xrYLHZx/RcE8jDjac53LC0v9tHX/1BBIyMGtkbScE6CyGzQYXKjkOHTRrvCNJ0W3PZMv iz5g== 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 :dkim-signature; bh=Zi74zX03AzlDYSTcNyOeKzOi2PA59RfE+ydGeg7N9HY=; b=AfkGEe/DzNaY9xFNhz8x5XvdTCVG6RBS/xCy1xWt86UnMBIGShaH4wFu6UOtafLvSD vKo8vKaj+fgoBoYptjdlCMZLqAHuh6gqi24NelevkGdwd9VGxuyGP4uK1EBAP2o/e8Vl MFYTjolwGJjrLktfaeaiaGRAPG4NIedmGZaa8LzU7jAeH9M8Iu7d7YUq/3mhUZMmG/ex v8t6Wdj+dm5prQysJi8vnEqXAPpXjIitv/gCfDKHBYLsVhhue3VKyhzEoUVY1CoIvvAJ uwRrwELba29uCxS3mcIqAJVR90kOdVTzcG0l24FZes7H2XygjUPWnUduZ2C8SY30e+q8 eK2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fw7zeAnK; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p129si20792508ybb.550.2021.12.20.18.54.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Dec 2021 18:54:04 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Fw7zeAnK; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzVHw-0008DF-E2 for patch@linaro.org; Mon, 20 Dec 2021 21:54:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzVEK-0003ck-5t for qemu-devel@nongnu.org; Mon, 20 Dec 2021 21:50:20 -0500 Received: from [2607:f8b0:4864:20::62c] (port=38787 helo=mail-pl1-x62c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzVEI-0000AT-Gn for qemu-devel@nongnu.org; Mon, 20 Dec 2021 21:50:19 -0500 Received: by mail-pl1-x62c.google.com with SMTP id c7so801932plg.5 for ; Mon, 20 Dec 2021 18:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zi74zX03AzlDYSTcNyOeKzOi2PA59RfE+ydGeg7N9HY=; b=Fw7zeAnKqY9GgyMFP5//31pAZL4+H5ZEBINP2esOAQPdAaSQgYCkH/sALJz8g7B1lL EOiO2ylgEalGv50W52V2gnWJSkrqmHaMAidDpGOUlbOaVzLXLq3pbzX3sia5yDXGoQ7b OW+fEVcsGzl+dwA3rfuWIwHxendwJlfquk30LCfxW8v6QjNb+FqFDVxdrjoIbQQ5CK/W 58GEIBCHrehIywX98O0LQioKcxaxRCP4T6D+J1BCcI9vkYtKdhdKve9Y7EkduUsne9VJ lJ5Dp0zAFwpNsm08QRGxtESNx/wDo0bOUXOtoTlUDCcP121XSKuNW4xzBNv5Rue0/MPE zmkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zi74zX03AzlDYSTcNyOeKzOi2PA59RfE+ydGeg7N9HY=; b=0mzZYDIX9bbc+wru2hsXMmHUtyebq07Ha3Bzfwj1W/Wra+OwoVBK0ewJvMi5n4MtyM z9e3jI8+8Z3fdn6csj5w8LcQs834syqOABE2JGa0Rk7N0V4SF0Y/auviPcEzr3pgKMnX 9W5I10ukIhe1wixMe1jVuBmmFW9OWuDvg+HnZx8w/s2qRSY5xAT8brtYH3FXhMM2oWJ8 yrmXcz4fNN4NVXNDNTaUMkokVJ8MPHlAv8B7uj0aYyOh/On4PPyqynu5ezsKGm5K35UJ u9XuZvuUa4Zj9QYly+d3P99GlRoOHb97FsXqrB1pcGb/iey0kvmYco3GwwdOBeNJnigv 3uLw== X-Gm-Message-State: AOAM532V5FWt8lNWOrgoaZCsOhghs1HMS91ataEN6e4tG6/8U3c6d+ZX cZHU5XnT4XkBnVkgL8vQydkpQ31Vaj8pfw== X-Received: by 2002:a17:90a:6b44:: with SMTP id x4mr1303915pjl.27.1640055017198; Mon, 20 Dec 2021 18:50:17 -0800 (PST) Received: from localhost.localdomain ([156.19.246.20]) by smtp.gmail.com with ESMTPSA id bg23sm694025pjb.24.2021.12.20.18.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 18:50:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 3/7] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE Date: Mon, 20 Dec 2021 18:50:08 -0800 Message-Id: <20211221025012.1057923-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211221025012.1057923-1-richard.henderson@linaro.org> References: <20211221025012.1057923-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 767f54c76d..d34cd4fe43 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;