From patchwork Wed Dec 7 17:41:26 2022 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: 631555 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp419802pvb; Wed, 7 Dec 2022 09:42:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uL0p+zFHnk028zq8z9HiCgKL1U4EOW3EFfx5vVoaZsrop1bsWBjtCxlyu/8arCY2qnhg5 X-Received: by 2002:a05:620a:1236:b0:6fe:d299:cca4 with SMTP id v22-20020a05620a123600b006fed299cca4mr8661665qkj.701.1670434952287; Wed, 07 Dec 2022 09:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670434952; cv=none; d=google.com; s=arc-20160816; b=CVwXPPJEW7clp5IRHPhgZkFUXzqX/LlPqaeidGlp0x1AiiGvF9t6nOXj5y+rw4vFXj 4KmkDvExK6AHfjnk/xBk8/L4XFdNG2rBXtLfksZIMP32UQn1WLJdbzC9oqUwUb698X+r lzPtV9bOOmxebUYaSpVT+mhFdbVwUD7zAiZzBBc4oiScabgXJE3wEcWWR8Ls2nQzRL/9 wxSmCZTC1Ep08cbHF9E96fVt9hDaWRuclhOHNeDne9lfVR8+255F2CSGBtwiPcv5Hlbc SGE6mhTCQC9q8ihj892Qy3x/ZlzzC9r0IAF5Q73c4MndZohVK12hElaa0YXZri1S2zTp h82Q== 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=HprJgxpG2xWV0l1kcFBdaZiE2sB4TDOLYNMLAL73SA4=; b=uZqm+oVw1mcFL57MmDESR2NNZ9KZ+qcjNReBJvNtIehRBoTNWrhW3m6S4KVq0RVRpr 6zZtJIqup5+hTvZufKRosIueooNaODk6AjYuxf3AkYfRe0l4YDyQ7jLAyO7LQuZwAd2L +CuwiK4yQozD8PkSGkkXz94bKuOuipZfT2PacNFY+6U8RJYyFWf/MQvuCsFxRNkqk03L Ss2PX/9MUVXdwC2FqLVYpU0bLFbW3b1qI7CFlaKKCew8kXqfWmKchFDFggQFDfErsyuV 82qJpWKeC3zNef3RS3qOZB4DhXvdKAZ7FXE4zCITUMQZchxF6x1KPsk1fkAd1iAZcoq2 AVgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nCmn0kA4; 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 f128-20020a37d286000000b006fa2b1c3c01si9941755qkj.243.2022.12.07.09.42.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Dec 2022 09:42:32 -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=nCmn0kA4; 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 1p2yQS-0004dO-8o; Wed, 07 Dec 2022 12:41:44 -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 1p2yQQ-0004cu-6w for qemu-devel@nongnu.org; Wed, 07 Dec 2022 12:41:42 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2yQO-0001o4-GW for qemu-devel@nongnu.org; Wed, 07 Dec 2022 12:41:41 -0500 Received: by mail-wm1-x334.google.com with SMTP id n9-20020a05600c3b8900b003d0944dba41so1613102wms.4 for ; Wed, 07 Dec 2022 09:41:40 -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=HprJgxpG2xWV0l1kcFBdaZiE2sB4TDOLYNMLAL73SA4=; b=nCmn0kA4q53OJwwr/afzFMrpn4JqrHcOCXhhWEQz9tS60mFP08JAjhfQI0rUCYyq7Y BAn56lddQ5m4PSHbyRiN1RMkl7blEcfRYeO6jkWa+E39tQ0QOHoP++P6IIjhNHNIQitK rEbO8NgwUjWBvUBIorzjPFUuorswpULfJgj0/eqCJMIbElTar74bZiJZfsUulXph/YiR LJIlgjDKXxv2QE10F9Fap1glaajxKAhe+lCJ4hMaQ9LaSXRDxd5no5JzPpMgdcz9Pm+H XBEqleyu/6svC+dfh+C0cacXCCaJkNh+fYarDK1vh09VFAuwvbe24NDOWcNIxv1c3OB1 hd3w== 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=HprJgxpG2xWV0l1kcFBdaZiE2sB4TDOLYNMLAL73SA4=; b=XkBqYDTJvFCH9J47P5+Q4tCki6LYuM9gk8n12Y1rVfkpyeT8wsx4DmF0tT4zP6W69f TYAKnQFvfnf538xrX9cKTOuReJFFAej7+2/BVZv7lx7M6dZH2fkCPx55mPS2/CEMzNVU uDy1wZ9gUNZxiHG1CPjE6jAqcwmtJOR+hcWSx4zKCWRE45XNzIMTjw1ldfsJ2+G97pVc JN/iByTNWL0Y4z//XpG/jC3Gd6VSOjm2A48wejtoZ04NgL25feXt4yQGuBAx+LE5vmxa kjYWuCDUReKQnGgd3EMsQP8EhSPs0pNb69inRoaFlB+TxKIfFMyh9LHkpvJjKNUED/17 stuw== X-Gm-Message-State: ANoB5pk6kSyNHpM3NM8IdZbSRo8j7qHNIMB42RcPHBiVaqL456ddof7l XeSF9Oe3miamf9xKFxDxBaj4IbWDTeGgHDgs0q8= X-Received: by 2002:a05:600c:1907:b0:3cf:7981:9a7 with SMTP id j7-20020a05600c190700b003cf798109a7mr66799556wmq.87.1670434898527; Wed, 07 Dec 2022 09:41:38 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z5-20020a05600c0a0500b003b4cba4ef71sm3063858wmp.41.2022.12.07.09.41.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Dec 2022 09:41:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Stafford Horne , =?utf-8?q?Alex_Benn=C3=A9e?= , Yoshinori Sato , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Marek Vasut , Laurent Vivier , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Yanan Wang , Mark Cave-Ayland , Fabiano Rosas , Daniel Henrique Barboza , Richard Henderson , Paolo Bonzini , Marcel Apfelbaum , Max Filippov , Greg Kurz , Artyom Tarasenko , Anton Johansson , qemu-ppc@nongnu.org, Chris Wulff , "Edgar E. Iglesias" , David Gibson Subject: [PATCH-for-8.0 1/4] cputlb: Restrict SavedIOTLB to system emulation Date: Wed, 7 Dec 2022 18:41:26 +0100 Message-Id: <20221207174129.77593-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221207174129.77593-1-philmd@linaro.org> References: <20221207174129.77593-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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=unavailable 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. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cputlb.c | 4 ++-- include/hw/core/cpu.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 6f1c00682b..0ea96fbcdf 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1395,7 +1395,7 @@ static uint64_t io_readx(CPUArchState *env, CPUTLBEntryFull *full, static void save_iotlb_data(CPUState *cs, MemoryRegionSection *section, hwaddr mr_offset) { -#ifdef CONFIG_PLUGIN +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY) SavedIOTLB *saved = &cs->saved_iotlb; saved->section = section; saved->mr_offset = mr_offset; @@ -1699,7 +1699,7 @@ tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr, return qemu_ram_addr_from_host_nofail(p); } -#ifdef CONFIG_PLUGIN +#if defined(CONFIG_PLUGIN) && !defined(CONFIG_USER_ONLY) /* * Perform a TLB lookup and populate the qemu_plugin_hwaddr structure. * This should be a hot path as we will have just looked this path up diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 8830546121..bc3229ae13 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. @@ -406,9 +406,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;