From patchwork Fri Dec 16 21:55:16 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: 634465 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1081630pvb; Fri, 16 Dec 2022 14:14:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf4PjRI13yM829PZN0fA1iInwmHO92lS6OvCiwkQjn64zJCzVPnjp5IYgx1d3Y/RL2CJQc0I X-Received: by 2002:ad4:4b2a:0:b0:4c7:257:3da5 with SMTP id s10-20020ad44b2a000000b004c702573da5mr44482596qvw.34.1671228896904; Fri, 16 Dec 2022 14:14:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671228896; cv=none; d=google.com; s=arc-20160816; b=aXqg6w0U69MGFrbu7QF0dOybz/pntK7iwdU2kb2esP2tRVcdAxr4n5FuhgBrjTt6Sf v5701TjBxBc4yRbGME/8zNy2KB4TivwrCnvJLa+vX4tCn1MomXWQqXVoIQ9M+5+PKfra IRvywpPPRCisnizgcLZ5Ps4zEpAh9lDtJYOWjWEi7J2/P4ok9Il9WxkndLeXQawE4Tg3 ak9KUNyE9lE6A0qM0lToO3VQ1w2uUB6liDpfhXqM2KMxkNo81qGnjwN47Nlmi359LiDn tI+ukIl11JiWDNrYUG2L7K6oGxquVYGPrskHD9kDLmRDnkpaZKIfa/VtSMbpF8rwL83E HYPw== 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=nvZo37ZGtVvWlqFUnT7DRRxDMf6Z0v34B1J4o3P2gxo=; b=a+ym0EOutGQK3jnc7MvRnMWsDppb+JTjKewPsThTcn5UMQ5v7Vu3sER9GYnQNMwas0 Im4NXZb8HDqQ+xswH5RfIEIBM4+xyUqmsBU3jqr3DGG8PTVA/enmDX3D79HjN/jBQfPd n02PcoKx7ZeGOZIr6KR9Cj6ThlAtRNlpfNmk0n2gZfCbLbuPEiiHeLItQeTuSEuudoi1 VTxNzw7PF93/KXaFFtolWEAUc5b3TmLWRVoGQftrxv0LoQcc5pHryeC2tPZTc+UhdFpe 8FXYdejbZywKQCliCf3bJQBUjbn302FBSdH+ZmxAJR+70Wbn7jRoEKHWc9P+roAqfIW4 u8ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QS0A4bcm; 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 q11-20020a05621419eb00b004bb7966e90esi1640081qvc.399.2022.12.16.14.14.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Dec 2022 14:14:56 -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=QS0A4bcm; 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 1p6IgS-0003wZ-EZ; Fri, 16 Dec 2022 16:56:00 -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 1p6Ig9-0003is-9d for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:55:41 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6Ig6-0003Ae-Gt for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:55:40 -0500 Received: by mail-ed1-x52f.google.com with SMTP id c66so5479194edf.5 for ; Fri, 16 Dec 2022 13:55:38 -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=nvZo37ZGtVvWlqFUnT7DRRxDMf6Z0v34B1J4o3P2gxo=; b=QS0A4bcmsLrLzAvLNYrOY5w8cZdoY1wwxif6xMojgWQOAiFtUT0tyaroPGfboOpQ2M 9tTkUTUiUIvNuaxXdEl79rqJPjrVybuh5vKsJrfjDWzWk/3saSRlFFqHnJp4MAJrOX8y /ORKMsnJ9Xbrv0tjAgP7a65XJR0xgndOa8Hc12o+v4ZHAsJNmSGQKK7pMY9zrikKGhy5 gMx3W4y4qmn8yUBQJfvGteoFvNMU+DJXU2QDEOefmTnGQfb+v6778f+oNfaGDVbVBkAu zRV6hWtnAaMFaCOXfSpnNctLyz2SDDScekUo/i5qbeEyy7GQ0s4N1/3cDFH5OVYtr3FL y2Xw== 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=nvZo37ZGtVvWlqFUnT7DRRxDMf6Z0v34B1J4o3P2gxo=; b=VsiMyilMtU7L+vtWbf70mwpKI7LGZYsrYX3W//pjrZzAxF/6g2mLIgqdJY+izTf2c5 cNxbXNZ3XQ+/KHwxSb3ef4cOvpZK8bCRrHD/4WDukAhbIZJHsJ67EOkKaOxoEGPpIBV4 YsTbXP+inTutzBv0qYsRKM6nip+1yFRRm93RwZtL8jScGTN6T028D9Tvh26PwM5d7v3K AoaUCOCQepyGeI4QBjZy5kkev8g6T9d1uWXHIee+og74dwSnyqf8H9SMxnym+p7TgyU9 9s5fvKowFJytt/mKSqjZxMRY/e7yqPxkr4s7BD3BGVuLHRvwjVhLFxqyvbbyZBkPx896 OM/Q== X-Gm-Message-State: ANoB5pltOhQFRPdqYCOmdspY2ZBu+SMij0AfpIzkcpQvHAYq1yDUlDaQ PL3nDuwtPRy2uBKx+c8vf8kPq7dhAt9tu3aM0a4= X-Received: by 2002:a05:6402:2989:b0:467:4df0:7185 with SMTP id eq9-20020a056402298900b004674df07185mr27588064edb.4.1671227736819; Fri, 16 Dec 2022 13:55:36 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id cq21-20020a056402221500b004678b543163sm1338647edb.0.2022.12.16.13.55.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Dec 2022 13:55:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Greg Kurz , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Yanan Wang , Artyom Tarasenko , Mark Cave-Ayland , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , qemu-arm@nongnu.org, Laurent Vivier , Palmer Dabbelt , Max Filippov , Alistair Francis , Yoshinori Sato , "Edgar E. Iglesias" , David Gibson , Marcel Apfelbaum , Marek Vasut , Bin Meng , Eduardo Habkost , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-riscv@nongnu.org, kvm@vger.kernel.org, Stafford Horne , Peter Maydell , Chris Wulff Subject: [PATCH v3 2/5] cputlb: Restrict SavedIOTLB to system emulation Date: Fri, 16 Dec 2022 22:55:16 +0100 Message-Id: <20221216215519.5522-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221216215519.5522-1-philmd@linaro.org> References: <20221216215519.5522-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.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. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- 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 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;