From patchwork Wed Dec 21 05:03:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 635595 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3319337pvb; Tue, 20 Dec 2022 21:05:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+83xIZdlsJpphPyEGQjiJC8LkBjFlNKtW5FRIMLamEUfM7etBUbKSNeKshcw07hkQESDm X-Received: by 2002:a0c:ed34:0:b0:4d8:42df:19d7 with SMTP id u20-20020a0ced34000000b004d842df19d7mr254604qvq.36.1671599101113; Tue, 20 Dec 2022 21:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671599101; cv=none; d=google.com; s=arc-20160816; b=pI9qnZGx7Y1Z0ohCN8Hkw2neSBMjHOmIjnX0s7e3QzQcHALvwh/Geju1T+SAWSlNfW RfmzvdX4rsam5Sm6gPVTHiYM8QYyZiIoin6mQPAuLAEb0owQrsqkNoveuzxfVhE7LVUC E7wgATzG9JxYwzd2+Ay2hRjjk71nlBRMg1hohj1ecW6dY8Txnn0/BMVgtXP1GJliOyQy wSFtfGr3978cn6hWjYLoZ9EwoyqfNa6wrmjkr/kuYF9Af3kHV1W14Ge0sgdX6x0V5zUt J7eKYHByLkJo0ZRVrmZ4GIvVuioKQqbHEGgq+gBS/axXi7Vu3HPW+Wbv0m1FHGcojJeG yYfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=AAUonYiwjRnP6N+RJ7H0Na3sdK2hQtHKLKMXocwrETk=; b=U2xcTQV8CHFOT5Kc/dqD1Rm+zE4KOWnMcaDpS1Jj8CV6rYstKDo76GBFtyWgIVgABw cc0w/KyIpcj03zQrCEUMKyYjJYugS/EkGRR0SjZ6qHr8ByDc23xuNPgRTc7M/2ZtciDd YLGuUofcg6yARiFN4wetZR4+wLQZtEXnZvNM2bStC1jYwEYgEbhKeY7oHimNDkN0vudY lHmusdyNb1b4OBYlRwbNAZd/e2DYZNRY5D9ONWgGYsDYn9/9KRIKDRK9lDTabUC4ne7e 1uNqtvlpfMKtu1L56luurZI6rxpy9JbbpKICy4xFD5RSYYO9ulhVcsiU+OsrIBAKOGr0 jNyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="v92p0/Yr"; 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 i11-20020ad45c6b000000b004bba8a1d203si5977290qvh.218.2022.12.20.21.05.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Dec 2022 21:05:01 -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="v92p0/Yr"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7rGJ-0002Gy-5I; Wed, 21 Dec 2022 00:03:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7rGF-0002DC-SQ for qemu-devel@nongnu.org; Wed, 21 Dec 2022 00:03:23 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7rGE-0003NV-4z for qemu-devel@nongnu.org; Wed, 21 Dec 2022 00:03:23 -0500 Received: by mail-pj1-x102f.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so1024518pjj.2 for ; Tue, 20 Dec 2022 21:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AAUonYiwjRnP6N+RJ7H0Na3sdK2hQtHKLKMXocwrETk=; b=v92p0/YrHnSCADhlHANPMHJMa2Pzmku7kOA+tOv7VBDKqnEhFvRxe/91KpHDeEeyFy 3JdyezwknguGZ8eT2YSAQOnryC9Ys806w3Zck73goC+3J5U5CwR1cz2emy3U7LzAlJEP l9U/mHVUq4BhXbDECDFYHIGx7nDncvlJ6i66w0XVx6FZWNLj7bKhN7XLP07aeYnGCK6A PcGx3Xy9dJ37oiVLJpJZugs7VrkKtr6e6HjTcViTxDvqNrvLZTpPybzX/szcSArAeRXI i0B1mGT+GTmklaPCeeWlp8ayo/QLHvWOuy5Kqml/sWUFlIqbJX5XDRW0XdYF9Db5gIFY 1I4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AAUonYiwjRnP6N+RJ7H0Na3sdK2hQtHKLKMXocwrETk=; b=AV9phfl3SxoRUr1Ff+sSbIa96nJUCQULSoY02JHAE/k1JkqcdcdwceNDOl5NFqOLgq GZdisrb9I7OchcBxDVXweHybuN1iksu/8n42ZgVC6vyCOA9kminuyZFhUmJkmGIjHLop +n3R3qhzTRGOCmTzVpE4IVH+3GPWU91ne/MZf9zAykQTQtpFV8a0Yl5uHtZcQBALKyUU dzIrSy7y5C4jvqACwZHoCeRYgCAdlXxSQiX33ZhgoL2U7z7NlnxLxTQuOkKVyXDVLlBe cJPymyoe0FOUCZlyedZogBi9na9cohbpnn7KaU8pbNNqILsK6MQB4LJKKKm4Awxcj5nZ PYuw== X-Gm-Message-State: AFqh2kqeHq+sC48K1QfvHft2Qf78CXrFIk2XBQhyd0PO20Cgk92/F/IU Wg1ppU0Kx66eXJkNWWb/FAaBP827KjhQ9TH5 X-Received: by 2002:a17:90b:794:b0:220:f82d:b938 with SMTP id l20-20020a17090b079400b00220f82db938mr17369828pjz.23.1671599000786; Tue, 20 Dec 2022 21:03:20 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:3efa:624c:5fb:32c0]) by smtp.gmail.com with ESMTPSA id a8-20020a17090a688800b002135e8074b1sm390645pjd.55.2022.12.20.21.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 21:03:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Warner Losh , =?utf-8?q?Alex_B?= =?utf-8?q?enn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PULL v2 05/14] accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD Date: Tue, 20 Dec 2022 21:03:04 -0800 Message-Id: <20221221050313.2950701-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221221050313.2950701-1-richard.henderson@linaro.org> References: <20221221050313.2950701-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Make bsd-user match linux-user in not marking host pages as reserved. This isn't especially effective anyway, as it doesn't take into account any heap memory that qemu may allocate after startup. Reviewed-by: Warner Losh Tested-by: Warner Losh Reviewed-by: Alex Bennée Tested-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 65 --------------------------------------- 1 file changed, 65 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index b964ea44d7..48e9d70b4e 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -354,71 +354,6 @@ void page_init(void) { page_size_init(); page_table_config_init(); - -#if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY) - { -#ifdef HAVE_KINFO_GETVMMAP - struct kinfo_vmentry *freep; - int i, cnt; - - freep = kinfo_getvmmap(getpid(), &cnt); - if (freep) { - mmap_lock(); - for (i = 0; i < cnt; i++) { - unsigned long startaddr, endaddr; - - startaddr = freep[i].kve_start; - endaddr = freep[i].kve_end; - if (h2g_valid(startaddr)) { - startaddr = h2g(startaddr) & TARGET_PAGE_MASK; - - if (h2g_valid(endaddr)) { - endaddr = h2g(endaddr); - page_set_flags(startaddr, endaddr, PAGE_RESERVED); - } else { -#if TARGET_ABI_BITS <= L1_MAP_ADDR_SPACE_BITS - endaddr = ~0ul; - page_set_flags(startaddr, endaddr, PAGE_RESERVED); -#endif - } - } - } - free(freep); - mmap_unlock(); - } -#else - FILE *f; - - last_brk = (unsigned long)sbrk(0); - - f = fopen("/compat/linux/proc/self/maps", "r"); - if (f) { - mmap_lock(); - - do { - unsigned long startaddr, endaddr; - int n; - - n = fscanf(f, "%lx-%lx %*[^\n]\n", &startaddr, &endaddr); - - if (n == 2 && h2g_valid(startaddr)) { - startaddr = h2g(startaddr) & TARGET_PAGE_MASK; - - if (h2g_valid(endaddr)) { - endaddr = h2g(endaddr); - } else { - endaddr = ~0ul; - } - page_set_flags(startaddr, endaddr, PAGE_RESERVED); - } - } while (!feof(f)); - - fclose(f); - mmap_unlock(); - } -#endif - } -#endif } PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc)