From patchwork Wed Dec 21 05:03:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 635599 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3320388pvb; Tue, 20 Dec 2022 21:08:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8quNDQ9SW77Nv2wgXc1hdNdxHeWhsWTK5EOj4EboSXY1eVFpmXeAyKBmxj+mntac72tgj X-Received: by 2002:ac8:7c7:0:b0:3a8:26b1:336a with SMTP id m7-20020ac807c7000000b003a826b1336amr496397qth.17.1671599316910; Tue, 20 Dec 2022 21:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671599316; cv=none; d=google.com; s=arc-20160816; b=ZQdaIe3DtBWmyLxw5fPkojwDLngor4A2Spm8b8rxPXeNJ/D4lo03lkPqvyx7GcMwHU htfJd0yktV9N55xkYrHDN6UmOeeKiH32c2eFpS2KFeZKOZzjGZ7XDXsoNrE0a8TA0c08 Wb7ZMwTZC1LJ1pOrPi/pPWx4rpTL9KSV1WA8IIpZ5yaOmoeWNVeRUobAqeVvVmpSlbmz yi7wiEo3nYQ19Yaf79pJPqw10lQWrNWZddBKLCoXnCMCdm9k7we72bo3t+NY1ie5CFMF FhHK5Fb20D40emC+ntqZaSgHhzjl8BK5J8ipaqhcq8lBuxh68xBjYqrtCHu0nYaDHOlE Z3PA== 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=+vlIhK8RBdnajCC8bpvbYLAUqtt9KGeNEpdZJB0XJn4=; b=Zc7+wKwcM4igCnrt6lND6cd2CLT3vqzSH6r7r/mqZVcKiwZCdo+xUH6yGzU4AkLdOb OMXimZpMcWoI/MkIoNilp3j4HXqfHSR0LwvswXEgNZYZWVWEs9FOjUZtHKkCXN0W+3VZ 3M/kmOpwptJ06bISkH6gO1zN9VFIUM1i44LN/37rwmG7AAWr0zJUgSkcyz5M969wueMg BWjG1H3uQXB2/DqENd6e9ERu3vXkA/WjSoXUv/3RyoRNrhP3rpqZ/pZQdjrnLTVOKlbm /v2WbD37xRUlrr3/2teRKGXVJzaLdjOMPvq3ya8QT7lnyS0doEC3qI52dmFejJYK748t eotA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zf+Teg/e"; 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 l21-20020ac848d5000000b00398723ee40asi5856722qtr.291.2022.12.20.21.08.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Dec 2022 21:08:36 -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="zf+Teg/e"; 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 1p7rGR-0002Kx-N1; Wed, 21 Dec 2022 00:03:35 -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 1p7rGP-0002JT-U8 for qemu-devel@nongnu.org; Wed, 21 Dec 2022 00:03:33 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7rGN-0003Pq-QQ for qemu-devel@nongnu.org; Wed, 21 Dec 2022 00:03:33 -0500 Received: by mail-pj1-x1032.google.com with SMTP id gt4so14611102pjb.1 for ; Tue, 20 Dec 2022 21:03:31 -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=+vlIhK8RBdnajCC8bpvbYLAUqtt9KGeNEpdZJB0XJn4=; b=zf+Teg/eq0T4CQrn51amcRmgxqMrvA2gXPX2I9UeZMfxHqeQKydAa8QLoGn97mPixy WIlkmJkF6gm8KMp+nJK1EcP78PbLmSG0lkWBnZ6eHv6yFwTCvtkfvfx6b18WESEh/vPU WoBIMQ3bOVC0Dw8evEwRHOY4nusQw+jNTTn5QQGqWiPz/Vz4fQZpwzdmnQSJMbabXjyJ HwEvHKVpsmzXMtUicNtLi55T1tPeQrvG5Ie13TiYXGaP2cJbIJtXQyr2yjisnl7nfZGN CYwroiKTNj6GbzFfjw6mQIGRxtwS+yt3nMHbV1NjSVg6dLL83Es3xdksO6d6F6UKlzhB DdwQ== 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=+vlIhK8RBdnajCC8bpvbYLAUqtt9KGeNEpdZJB0XJn4=; b=Fseopc/RZAZVaUI5bfxpquVBISGeCOXr4EOeZ+UAHmI5/58z9RGPDyviX0AeveQMdr e/dHWje4iwB01jmeBxk2y/xWbDBQi4Kq9KzxAKsupUBAQpLb1uwjBBDCGkxoBDbM+++q 1hDl7Irket5nJ2c4HcmgsXhqfIODYbrSCPzfNtfa7SCglHK5U/PQ0/Gg9qIZrB/Ge7hP lBefxEf3khgtqmHywT/CF1jHpR1KDXD4NxlJAYYMSG8Us4fMMk2nnnslz+Kf8G7pI2Fe /lOWloV/K7DqKCJXmmU4bEKRRJOZN7wVhujFLIrNFeVUbm209hiuh/sH8jtF2uw+VctT JGSQ== X-Gm-Message-State: AFqh2kqG1Uf1tGHNe3xbgu67Bwc7xWVI+cyrlFl5BAS9lt+yrag8On4i fhDZOd7M9/75ZNBHlhI7IedUFBnFq5SD6cBP X-Received: by 2002:a17:90a:730a:b0:225:a132:f193 with SMTP id m10-20020a17090a730a00b00225a132f193mr686737pjk.6.1671599010289; Tue, 20 Dec 2022 21:03:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 21:03:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= Subject: [PULL v2 14/14] accel/tcg: Restrict page_collection structure to system TB maintainance Date: Tue, 20 Dec 2022 21:03:13 -0800 Message-Id: <20221221050313.2950701-15-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::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 From: Philippe Mathieu-Daudé Only the system emulation part of TB maintainance uses the page_collection structure. Restrict its declaration (and the functions requiring it) to tb-maint.c. Convert the 'len' argument of tb_invalidate_phys_page_fast__locked() from signed to unsigned. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20221209093649.43738-6-philmd@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 7 ------- accel/tcg/tb-maint.c | 15 +++++++-------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 8f8c44d06b..6edff16fb0 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -36,16 +36,9 @@ void page_table_config_init(void); #endif #ifdef CONFIG_SOFTMMU -struct page_collection; -void tb_invalidate_phys_page_fast__locked(struct page_collection *pages, - tb_page_addr_t start, int len, - uintptr_t retaddr); -struct page_collection *page_collection_lock(tb_page_addr_t start, - tb_page_addr_t end); void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, unsigned size, uintptr_t retaddr); -void page_collection_unlock(struct page_collection *set); G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); #endif /* CONFIG_SOFTMMU */ diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index d557013f00..1b8e860647 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -513,8 +513,8 @@ static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata) * intersecting TBs. * Locking order: acquire locks in ascending order of page index. */ -struct page_collection * -page_collection_lock(tb_page_addr_t start, tb_page_addr_t end) +static struct page_collection *page_collection_lock(tb_page_addr_t start, + tb_page_addr_t end) { struct page_collection *set = g_malloc(sizeof(*set)); tb_page_addr_t index; @@ -558,7 +558,7 @@ page_collection_lock(tb_page_addr_t start, tb_page_addr_t end) return set; } -void page_collection_unlock(struct page_collection *set) +static void page_collection_unlock(struct page_collection *set) { /* entries are unlocked and freed via page_entry_destroy */ g_tree_destroy(set->tree); @@ -1186,9 +1186,9 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end) /* * Call with all @pages in the range [@start, @start + len[ locked. */ -void tb_invalidate_phys_page_fast__locked(struct page_collection *pages, - tb_page_addr_t start, int len, - uintptr_t retaddr) +static void tb_invalidate_phys_page_fast__locked(struct page_collection *pages, + tb_page_addr_t start, + unsigned len, uintptr_t ra) { PageDesc *p; @@ -1198,8 +1198,7 @@ void tb_invalidate_phys_page_fast__locked(struct page_collection *pages, } assert_page_locked(p); - tb_invalidate_phys_page_range__locked(pages, p, start, start + len, - retaddr); + tb_invalidate_phys_page_range__locked(pages, p, start, start + len, ra); } /*