From patchwork Mon Feb 27 12:36:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656970 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2328886wrb; Mon, 27 Feb 2023 04:46:16 -0800 (PST) X-Google-Smtp-Source: AK7set8leMRjSjZPVnqiXXtB2PyQRrLPbetaBFKsrTGVyaWfO6DbEouj/SunHPzL/vylP8/Iqj2o X-Received: by 2002:a05:6214:4011:b0:537:9e59:3997 with SMTP id kd17-20020a056214401100b005379e593997mr45282926qvb.51.1677501976071; Mon, 27 Feb 2023 04:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677501976; cv=none; d=google.com; s=arc-20160816; b=DCPubNwgrgIvNjWXlcE3f6ngUwNPpEMbCmqVPUxTCAX9bkxHOCVjOAOU4CYdj1vcgI aCiHGLiyK3ZG0UzfKXjxhI0xg3sfdoyzzpV/CGwe3u3gGGLz/Ooj5F+5kp0Yc5FCO0NI FtCOntpFOE9RDNR+duqCpo0KIREcwxGDXZTG0+55bvJUeLKeQ00fo/8jfAOA384n6DcH Ay9vwuRbwJk5BMrBCWO1oz0EAeAvNCr0j8hBovg0dSnJGo+juEruub6lteDzsT82f3AW OjAtlfTCCtgKzEX4UPzQ+lr61Hl0Y4AMY4870sAgmsVrSBtkhxwiTxZLw6/tECbk8Ga6 Z5Dg== 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=Pf4dkpomuShNtDbIGeS4jqeuc3YeC/+4/WK63QVYcPo=; b=FP1M7h9xVQ0J9ijKH6Xv0gXgjxHyig5APz+Gqbi0/FfVuqvrape86icaVg1yq3di4B aXn610tdoNu9qHzgYcCp66xZqoIviOqlWn/06Z6WGOqJep5HCoAcOAh25J6gIViZSar1 8avNJRwttc/CvlzjJqof+B+wSt4fKLHkCglCV4RoDKaoV3ayXAm6r7EEsvZqbYR4D9UK aPFiEA+Gt5sDJpjnF9AED5IoU8aBLe8mUEqv2MLnBJmmqXFUYE4ccFULA5/QkPDrSw4N g2e/llj6L6Nn7XaJmsxnzNoAusgImTDFaqzQGOzcLbIOKcH+6c2fIVwOTYxEaoA8HUKQ 99Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KygtJaO2; 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 r12-20020a0ccc0c000000b0056ea07a83edsi6212364qvk.272.2023.02.27.04.46.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 04:46:16 -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=KygtJaO2; 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 1pWcmh-0002Id-6E; Mon, 27 Feb 2023 07:39:15 -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 1pWcmf-0002I9-No for qemu-devel@nongnu.org; Mon, 27 Feb 2023 07:39:13 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWcme-00019u-3w for qemu-devel@nongnu.org; Mon, 27 Feb 2023 07:39:13 -0500 Received: by mail-wm1-x335.google.com with SMTP id o11-20020a05600c4fcb00b003eb33ea29a8so3225763wmq.1 for ; Mon, 27 Feb 2023 04:39:11 -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=Pf4dkpomuShNtDbIGeS4jqeuc3YeC/+4/WK63QVYcPo=; b=KygtJaO2t+6gK523+gLGwBeEc6ySuw81LzDx60R3KU2laBg2gQ8rYEa4vtyzk0a64W ldR2ZTSS5JY83VXlbJKin3rkEz4EtiW0adnG96cq+Mez2iB/Rj1ld1Wc9VwYiH5eSwPE jQdxKo4tOWadqvwZq6Z3vRMEsJXaxZt1uazCxnog3hhcVc3wkS2ogFx2P0WyC/gc92XQ 8rXvrFiGMOIJZ51TX/p6xmzlhvhbKK03L0B3h7K3gfGz5ccyddurD73CunkPn8YSQv2q X93jd+oR481cO6Z+nfMU1F+aASvqLk6+R7uXPkdupuKDHZ54nqlTtdDl/LpsAK/iPnlL IjCA== 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=Pf4dkpomuShNtDbIGeS4jqeuc3YeC/+4/WK63QVYcPo=; b=1Fd/UczuVxz/NcgnSUvKVCmivNFwKKVQzkceaSMYBBUWHEhFBali5SeraGHhmmeWNa gP6aU48fD7ArROpz34/kNKFXAXQh2NygKA0ph4U+9qaqliGoG78Tu6DppCEgmwXL3WFe Kj16lzXnYp22/J4wqJzI+1XWqEH4pPhms7rCmcoJoCaEA0wg6HWwu+KyfvCdEuY4ZgxS V6iQhlXPxtusBfQxO5CKyV5yKov5p0RoMIn6bziO2aqq3a2JJUu69/bt9Xm6LDwEhxdp W9yxZRCBshE1dZB5LY9xgftqNfHjgi/L/no+y4laIYCMvKcEWKpX/t1qKp+IDszIC/5B PHHA== X-Gm-Message-State: AO0yUKU9goY88w33S20c21WT7ihoWoNBWHCVlu3++DE5fBKbwpSV8aDH KOaefeqnB2krf6Q0A2N0FKl2K5c/YFqBcHCL X-Received: by 2002:a05:600c:2cd8:b0:3ea:d610:f068 with SMTP id l24-20020a05600c2cd800b003ead610f068mr10147239wmc.33.1677501550290; Mon, 27 Feb 2023 04:39:10 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k22-20020a7bc416000000b003dc521f336esm8764583wmi.14.2023.02.27.04.39.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Feb 2023 04:39:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Peter Maydell , John Snow , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 003/123] cputlb: Restrict SavedIOTLB to system emulation Date: Mon, 27 Feb 2023 13:36:47 +0100 Message-Id: <20230227123847.27110-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230227123847.27110-1-philmd@linaro.org> References: <20230227123847.27110-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 Commit 2f3a57ee47 ("cputlb: ensure we save the IOTLB data in case of reset") added the SavedIOTLB structure -- which is system emulation specific -- in the generic CPUState structure. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221216215519.5522-3-philmd@linaro.org> --- include/hw/core/cpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 671f041bec..56cbe9e678 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -222,7 +222,7 @@ struct CPUWatchpoint { QTAILQ_ENTRY(CPUWatchpoint) entry; }; -#ifdef CONFIG_PLUGIN +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY) /* * For plugins we sometime need to save the resolved iotlb data before * the memory regions get moved around by io_writex. @@ -409,9 +409,11 @@ struct CPUState { #ifdef CONFIG_PLUGIN GArray *plugin_mem_cbs; +#if !defined(CONFIG_USER_ONLY) /* saved iotlb data from io_writex */ SavedIOTLB saved_iotlb; -#endif +#endif /* !CONFIG_USER_ONLY */ +#endif /* CONFIG_PLUGIN */ /* TODO Move common fields from CPUArchState here. */ int cpu_index;