From patchwork Thu Jan 2 18:25:19 2025 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: 854739 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7909118wrq; Thu, 2 Jan 2025 10:27:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWQeJonL1shuwKNOSMDrJdspgaaVFIZUVdPEqfeOA+bDf50hq4JkE/4RsRUVp+Lg855bskmsw==@linaro.org X-Google-Smtp-Source: AGHT+IGrLg4Hg+25PfbS8d2aewuZrnq85hRqzgC5Iru0s95anlh+wQ6LyOkbRMcrRMmVPqNf5kOD X-Received: by 2002:a05:620a:600e:b0:7b6:cb81:95d with SMTP id af79cd13be357-7b9ba770bdfmr8963876785a.21.1735842453486; Thu, 02 Jan 2025 10:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735842453; cv=none; d=google.com; s=arc-20240605; b=b7ioDZUeFjr8OlF5tNZQZP/MjWyIn1P/4kOHstjFnAhP0YeqNRC6mw//m9kZDsKeN2 qxmlxVbB5aQLWxECry+8sfsLe0iAihQR+/AHdtUkbZQtAu+NQnhIxdV7C/OWArukhuxu 50nyIIn/hzSiMbiyk8jt+jCpeGQKjDHrM8zdY2ButRi4uR+xIfQa79LTVe2W8eFq7vC1 6aOAWDRmSqG0eVCKZiw+2BMF+3hKq5mzSyzJzww+0ZJmk7Jqve6RijnDkICOfYKvR4zx ncbw90Cdam5aMu3Gg8kHa1M78X1vdD4vEFQ2lI+uwA8LFIGljEsVSfY+vgH78JZ92DdX DnhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=kwDRyvTJZzNpnWnwx0B7XY3O+69910db4I16wox7BzU=; fh=efowiL6AZOegheg6QBG5RWVtD3FmOXl14QhVe5Pw/BI=; b=ClmVRN8DtDmonnEo7l7iv4mo+/J2Q0MSBsvhLOWAfWd8eKeUQoddJWV6T7xjX7ENcW Fvja4a4p8h13Q7bdjjeYKgFGDYfkqiC6aQUPEmzu119eLHFSiEInCGX4b6VezkDmr+rJ bjJZAsj38C0OktyIxMRL0cEzPvPClKXfiH36V1K4OQIsqEniswFx+2K9gum05cyuK6dw mqXPfQzTXrBq0c48Kzx6ESuYoDzKYjSIahw22Eq/yxp5lxWFCTTHAGN7mpiwKu5ikrRL dNCdmzBM25uR6JKP3m2m8yAGlQ2MJ5gS9sAuXwEpcl+odu3R4XHMYlOnWy+GG8weNl+O 7V2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SlCsZmY5; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ad69asi3603754685a.125.2025.01.02.10.27.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 10:27:33 -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=SlCsZmY5; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTPt2-0007yJ-Fx; Thu, 02 Jan 2025 13:25:37 -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 1tTPt0-0007s2-42 for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:25:34 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTPsx-0007sp-KH for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:25:33 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-385e27c75f4so8276227f8f.2 for ; Thu, 02 Jan 2025 10:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735842329; x=1736447129; darn=nongnu.org; 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=kwDRyvTJZzNpnWnwx0B7XY3O+69910db4I16wox7BzU=; b=SlCsZmY5M42hv5Eg1fcSU//IgdsdQSAybBYIMX+O1oqIBOY/3eWeXHBtKJOIHG5YkJ UuoSoXGpdrgLasQsu1WQjAFEHRx6JYj0HmIJW0pJrIYoKovOwcg9+RaYKz/6/uNDjKnp Yeuo+igp4amaFoxj+60ZYx1hH7tNpXs0UwFI7yujm4sK9L0KWH4ZYeuPFOT1dMXwogs3 ZUqFIA+m6xVNNCZnNZ4EPW6B+DxWHhvEj1debyWeptyzD8+PttwkBzdadSlbzP01amgD ENRQ0xb/tE2lexx+uZ1YINdQJHy2U98lkh5c/KChOSifjpNHaTJ9rUiCLirtidLxzauI 1Ebw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735842329; x=1736447129; 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=kwDRyvTJZzNpnWnwx0B7XY3O+69910db4I16wox7BzU=; b=osCvLFJ2rhUyveXfvow7LoHeR72w859kUAGThhuKVVM4HdW8Zeiy5c0LCunognR9XJ vFjytDE4N1utvh6R/AJENCWyWE6CoOWdMf86ZWyOFroHi5cYb8RwlyS6CFKRbRpVpLsx 9uoCHv56+iXUJ/LjpZJp16GHImIz9JayeCO0bzmKKFaTDeyHfAPvelARUtfjbJ1QBDMX kXw15dIPldvaUJFVP64smYe6kHUTGGUSPzdcz3dZCHfvTMQ+2VOcMgtJHdfU5cU30qzM 2Afm02YCd8qpx4aX/W4TeugV7YXV3QVcXZx48+JaFud4HcZDoO27x0v1DBQYjidAV0sC RV+w== X-Gm-Message-State: AOJu0Yz7/fuVtUiA64wsX07BfiY3nFVr6wkcd3arpV4Fksr8tCRgwhIC bj9kWJq8ghRy9Sw2xrHMRalXPjQWTirPNIIj9sNrAJZeu/cgBYlpH0WanvZcPhx2A85Lu9CHSEq 1CbSQSw== X-Gm-Gg: ASbGncsJA+vp+6zmQUp0VEPrp9Xxri+rajrXQ6gphbC52gWwH37olX+t6U2yIDnwrSZ +2Mjlhv+S8ul7c6S61I5eRZxU5YFGLBRDua6cfCvCtwrXlajpQwgYWY0FYA6iCwPU9LX35ptrJP Dvna6v3KuBGRkxOQ0N/1k73kwP2OPpJYyyZ47wupBU5o7ZPdDt2b9mn1eKvzw5ZrkwUrv9U97gP ZFsq1HXucXx+9rU9E9GzoeMHr0+YZRfnDtYxCw+Jso3aJdzedhW6uUG90d6CeZuCgfVSYCjSNst 3RcK2Y6X3SdO/m6trhPWrYJU/lpWNWc= X-Received: by 2002:a05:6000:704:b0:385:e9ba:acda with SMTP id ffacd0b85a97d-38a221e2738mr36306420f8f.2.1735842328903; Thu, 02 Jan 2025 10:25:28 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366e210cecsm424125855e9.2.2025.01.02.10.25.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Jan 2025 10:25:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Pierrick Bouvier , Riku Voipio , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] linux-user: Only include 'exec/tb-flush.h' header when necessary Date: Thu, 2 Jan 2025 19:25:19 +0100 Message-ID: <20250102182521.65428-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250102182521.65428-1-philmd@linaro.org> References: <20250102182521.65428-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 Very few source files require to access "exec/tb-flush.h" declarations, and except a pair, they all include it explicitly. No need to overload the generic "user-internals.h". Signed-off-by: Philippe Mathieu-Daudé --- linux-user/user-internals.h | 1 - linux-user/mmap.c | 1 + linux-user/syscall.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index b9b05c1d11f..4aa253b5663 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -20,7 +20,6 @@ #include "user/thunk.h" #include "exec/exec-all.h" -#include "exec/tb-flush.h" #include "qemu/log.h" extern char *exec_path; diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 6828b17a63f..d1f36e6f16b 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -21,6 +21,7 @@ #include "trace.h" #include "exec/log.h" #include "exec/page-protection.h" +#include "exec/tb-flush.h" #include "exec/translation-block.h" #include "qemu.h" #include "user/page-protection.h" diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 78c7c0b34ef..cbbfcf10d28 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -26,6 +26,7 @@ #include "tcg/startup.h" #include "target_mman.h" #include "exec/page-protection.h" +#include "exec/tb-flush.h" #include "exec/translation-block.h" #include #include From patchwork Thu Jan 2 18:25:20 2025 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: 854745 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7909450wrq; Thu, 2 Jan 2025 10:28:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUMsoYyVNK3GlCk5PnjNwnztvQhLlUOxWM8IZXojnd1oDG2rYdyBdKRrcfcmUurL2AX1kTN3g==@linaro.org X-Google-Smtp-Source: AGHT+IFdIpu0DjVx+S+kndSl/y/cl+JM939LeCVd8Cd0V9Yf2lKYLGyZIKodBL8bd8Ko2JOJgRxt X-Received: by 2002:a05:6214:2b84:b0:6d8:a1fe:729e with SMTP id 6a1803df08f44-6dd233af2b4mr740316906d6.46.1735842510701; Thu, 02 Jan 2025 10:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735842510; cv=none; d=google.com; s=arc-20240605; b=cdYKJ7T0FjidDRfpCb0WrCVRb/a21cxrnaxXnLoSMwTo3n55M3jD4/npSoKEi1d2Bs fLMsa3p6izOPiO4TcV6jYb3PmmBLtbxV04eEgE+cAAeXp9zn/VWURv4craxQY2Ajh03d ONrQroFkiXiB9cr7JGl3iEap2rimoMbu+WJRk2xvSkV1a0BDsKjM1qbzOIEtncDBgboJ /Iet9ZF5Bo1oF9LDuWGaoCZUUroz/A8OdU/n6ZsJ3E8QY3j/wEUwWBgbhbM7idesJT5Z ciTcdWIN9Ix8kCywXvuLfR/RnjjPZMif9l7QDKkD7ZDB9JZxwHWM1L7jHTUeEDgE5lK6 C9RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=peARTf2/KC6klqYofRoAuLkEwM6US8QQU7qQEt05x1c=; fh=efowiL6AZOegheg6QBG5RWVtD3FmOXl14QhVe5Pw/BI=; b=c73BDVxmtGEEOCDZIHUFuxETNlCeGcjal9fnkpRq74Dximvg28/mNdDyGpmfiJTOcU fTvL222hzjdtFCC+KeyQWHpnZJ8Xlfoh+QF5pffWAZ6P6AB6bUUyXBkbDbOt4s4YDI+o bku2OuR3hi3E0ae+TbPV+BpbcKjHiayM2frFmBFF3Q25NhXjhT7F8wOB2C9jXozwdFqV 25f6IGTta/addzcTOzWZCiAiZ/hasCtYP2SY6B3oS4fmbLR7RIC5UZTcjZ2p05iE7HYM ydr9YKhnZ5OanzdJ0cjUvK1jk7Me8/O+MHbaoit+cI9BWXYEC+83PHzBTdyEgNXI8Xfp 6kXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SKO6p/2Z"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18250810si346647976d6.361.2025.01.02.10.28.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 10:28:30 -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="SKO6p/2Z"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTPtu-0008Op-PL; Thu, 02 Jan 2025 13:26:31 -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 1tTPt5-00082i-BW for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:25:41 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTPt3-0007uG-LS for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:25:39 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385deda28b3so8027606f8f.0 for ; Thu, 02 Jan 2025 10:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735842335; x=1736447135; darn=nongnu.org; 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=peARTf2/KC6klqYofRoAuLkEwM6US8QQU7qQEt05x1c=; b=SKO6p/2Z38NhBURzbzssUwzCiDschSx9YPnpO0lR8QMUqzjU6QevyleU2UCi8/lhqI F34QwStX2YbbuR+hT2/QPClzxZ9XFCvCQF4UxbGsLe1dQNbdUf3y8KuD+tyhJdDbhhK6 y8Hw5QqH8XiUpTf3EtksCmQzm3rYOgLBLhbrHvq//cUq9K1OsuRIXgOvykTKaWEbXGzG VAP2Nc+1Hl1xbimmudpAUWVIhTwIN4I9a3eitX5n8BhuxTUTf6KpLZLeD9y/+m/jrW30 4n4479pOA2kzANQBETY6TmVKMy9PpYsInejJlS2kFOCAvR0njLSfNewN5wgt2GwsKj2M /VEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735842335; x=1736447135; 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=peARTf2/KC6klqYofRoAuLkEwM6US8QQU7qQEt05x1c=; b=eqRvN8KhYjJ+6RefO9HlcNjoc+IlnR43SIvnJJ1ms0zsPnui1YuGdOp/jF3dzbc0dc dKH2X9QFesvT5xEkYm6ADk4pfloquC60BF+5ygswkJ65zhvdIs9n/xkVBxPzjzosSWeT j0MuAI9YAc1yhMYzuf0EYgrnr1wey28CPzjahGWPbQII2La4mcaIrYrk2j3TZznfmonY XCknj8hv6l0+sLytVoDvBlAG8zw+YlgoUaPC033jvWmRMmd3wG4WAg0SN95nxmW6uVvR eQofOZ9Tc6WftDOJwgDE7zXJWAWwNOX0r+sdWTXWNXVtSF/IQ75DKXhg+F4ClAiwzHzb 0vgw== X-Gm-Message-State: AOJu0YxTucXV1U/dqfeR0UiW5uay4rs2XOF2ytS9A0foywryll+FGxjx bLlDCHznCvxDfx2NTHyXzHvRqmsZmpLK+buJl5t4tS2TQsWOGbf1pw1jh+Nh8y1FRvgOJb3EjMr 9oSH9wQ== X-Gm-Gg: ASbGnctn26/ICfvWnQPgD/mDgAQRGMSbxR/XSbdqRsOzpk9Jw8OHTTWqFFFS6wlY8jO aeH5Nsp40DQcYztbwTtG2pyDSycykCctH/x8owwCMI6ODUiP105t9kzX6vgwHYv6TDBsKp5M0XZ pk2ThO0OJL4SLFpqujH9W03IWB3mkEmkAI31FgbquQEjFnzKEy/C6EUj2UOcmAFgcyEaUnlv6dz TeUg2xT282yHS+BJNrp4hHY/PHTySEwS53KFoZnGegS1B2bisTmDeUEWAuEGi/fg4inWQjee5dO kG033jtYTzijwUCrIliteuzLMWU/AS8= X-Received: by 2002:a5d:6da3:0:b0:386:32ea:e70d with SMTP id ffacd0b85a97d-38a223fd30dmr29606830f8f.50.1735842335194; Thu, 02 Jan 2025 10:25:35 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e2f9sm39723531f8f.81.2025.01.02.10.25.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Jan 2025 10:25:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Pierrick Bouvier , Riku Voipio , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] accel/tcg: Factor out common tcg_exec_reset() helper Date: Thu, 2 Jan 2025 19:25:20 +0100 Message-ID: <20250102182521.65428-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250102182521.65428-1-philmd@linaro.org> References: <20250102182521.65428-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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 Since tcg_cpu_reset_hold() is a system emulation specific helper, factor tcg_exec_reset() out so we can use it from user emulation, similarly to the [un]realize() handlers. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 1 + accel/tcg/cpu-exec-common.c | 6 ++++++ accel/tcg/tcg-accel-ops.c | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index c8d714256cb..8b474fc1256 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -55,6 +55,7 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, bool tcg_exec_realizefn(CPUState *cpu, Error **errp); void tcg_exec_unrealizefn(CPUState *cpu); +void tcg_exec_reset(CPUState *cpu); /* current cflags for hashing/comparison */ uint32_t curr_cflags(CPUState *cpu); diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index 6ecfc4e7c21..72ab9c3d977 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -21,6 +21,7 @@ #include "system/cpus.h" #include "system/tcg.h" #include "qemu/plugin.h" +#include "exec/tb-flush.h" #include "internal-common.h" bool tcg_allowed; @@ -56,3 +57,8 @@ void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc) cpu->exception_index = EXCP_ATOMIC; cpu_loop_exit_restore(cpu, pc); } + +void tcg_exec_reset(CPUState *cpu) +{ + tcg_flush_jmp_cache(cpu); +} diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 6e3f1fa92b2..4fe6821b017 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -34,7 +34,6 @@ #include "qemu/timer.h" #include "exec/exec-all.h" #include "exec/hwaddr.h" -#include "exec/tb-flush.h" #include "exec/translation-block.h" #include "gdbstub/enums.h" @@ -44,6 +43,7 @@ #include "tcg-accel-ops-mttcg.h" #include "tcg-accel-ops-rr.h" #include "tcg-accel-ops-icount.h" +#include "internal-common.h" /* common functionality among all TCG variants */ @@ -83,7 +83,7 @@ int tcg_cpu_exec(CPUState *cpu) static void tcg_cpu_reset_hold(CPUState *cpu) { - tcg_flush_jmp_cache(cpu); + tcg_exec_reset(cpu); tlb_flush(cpu); } From patchwork Thu Jan 2 18:25:21 2025 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: 854741 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7909314wrq; Thu, 2 Jan 2025 10:28:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpl4pGk7Zow7THHZyRCysn5O5np9K3Bj+1TahWcReHvyS09xKalXQA5pqGP0RG69de95LGSg==@linaro.org X-Google-Smtp-Source: AGHT+IEPNKVi4GINMsN2kLfVCZJWfW6usTlrphpsl5JAzW7kmwlDjLje2oplJEin0JLJ5ZKOGs2r X-Received: by 2002:a05:620a:488c:b0:7b6:d4a2:f123 with SMTP id af79cd13be357-7b9ba6fdaf2mr6911054185a.2.1735842486571; Thu, 02 Jan 2025 10:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735842486; cv=none; d=google.com; s=arc-20240605; b=fnpOGIwcUY52fibP3gjAOOdvwj1HFxhdHTCVWXrkLaOcZcwp0Wd95U68A4NdYMejIt awgT/clp6GiRG2ab6kyGvbXCeAZ/fj+DZTGaW7JXA2hFscCvmCKV4RAyx4Auc+RGOZ5Z NwxsrVPW53iGdfwaW55foUJNkMSoDQSuepeUMLMimHZQMZDpineLXs5P9lP+6S0htV+p JYBsDDMP35DzYqvMqlByqkKCchthTBzSWbkNUALpURtMis2Wm1dFaFN0qzNGzLYHEd4r x6xWThfLdYvsY2GI/TooC/UYzc5FE5NCMSQMPGqGIIxGurgQPvzB3DMDAx7wYJhnRBKD jSOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=i5MZZuqxD622nryIdDAIydJBHEZPb4zzJ2vYHU+DCJU=; fh=efowiL6AZOegheg6QBG5RWVtD3FmOXl14QhVe5Pw/BI=; b=HqA6iMYsrmcNQvS92PQ8LNRtN/lSx4eiiy3Q3Nn5zSv4pR1lTvDTIZOckrTZABxO7Z qH+tu+8psEAHLAzJ9ecGADFSvGibwvbzi9v0OvtLicz96T3z7eEkpbBvbp6kpXOEwEky 6xlPn996QBsMbQNG6QNqurFJBA226uzQHRLd0EKx9v/YMmdpLSNbLLtaRR2/GPrlYt+j 5H2jNHTOKd42PzG1ugyYwksB6OORUuak5aXl32XqvPIQDFot7GMpERDbUYlYsQMrrCbX /GvYVtdsglPnA++Ur5GILgfdlFEvoZ2x6rVY2YlfUwl5NzwCfzvwjvrLEZ/1/1JynIBr swOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bMnCqYdY; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9b0041e1csi3301496485a.459.2025.01.02.10.28.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 10:28:06 -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=bMnCqYdY; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTPtt-0008OJ-7R; Thu, 02 Jan 2025 13:26:31 -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 1tTPtC-0008It-EZ for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:25:57 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTPtA-0007uf-Kh for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:25:46 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso122670965e9.2 for ; Thu, 02 Jan 2025 10:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735842341; x=1736447141; darn=nongnu.org; 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=i5MZZuqxD622nryIdDAIydJBHEZPb4zzJ2vYHU+DCJU=; b=bMnCqYdYWqB2o7ydaitSVSzD4oJ0StbMctbwe0+M7ZXEO17SKuClaS1VV6M3nBRz9w S8PIcBAA0qmHvU2r3F3A3HwybTDXKyDJNDSZGF6CxbyK3ALkiAbszHiVst9MK9k/zExC ONPlPp8kjUdlwBFdcuTsKY1A+lhq/rU4ugHnymmRwnXl+r1AkX21+J2E91h5ZFREE4KF gcvqAYUwYW4aMJ1iH72+k76oVZaqzAvCeSSi1NqLsUHXYqPjw3C9RCQB/yih/bH0bP8h otwh6ZWav0uGo2w1FutrqfjBlcsN7Uv2yWEZRJgM7SiK6HlL32IUR7FJf7NyTQhjRVh9 TsEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735842341; x=1736447141; 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=i5MZZuqxD622nryIdDAIydJBHEZPb4zzJ2vYHU+DCJU=; b=q3L9Ynt87Y55bg3rB2shYZ9g9PAo97YPt2ZCjtcCr4iA/9EKRDlzbXpNo3bGEKSO0D AKGvzoE7MV7Q3doNWoDW89HTdCpfwKK71AJUaRs35tSQZDzM5jkT4pc+MJv9K7VMmzF/ D3RmjYpXXWSFm4K5VJ5NYdcXIVZQxg6Wn7CDUtqj04uh7d0UGt+D4L+AfEhZ3zjvCHfR PnffqpElJEYu+F4M7Ci4s0gfA0bbl4jwKTxVWmgOTqaKhGRxIZ+wUR9HLe6dWOMoKNkk wLpHlpAJ4oz2y7c89vEBC55KohJ2T5Vi8wHaA19qxRl4zCzXTmTihufNqQWou+TmSGBu Vn4A== X-Gm-Message-State: AOJu0YwKawbzFopRFVsGlua2O88fOVBhqGTdieSO0rKL300o3rd77cie xiFSZKv8ddkDwM63JOsvJkH062OvFJlW1ju55j3PAu3KC7n9cXh2tVQt9vx6F3iv+XlobYPdRPN IzPV1Ug== X-Gm-Gg: ASbGncvSZbgkWKR/zqvp6gcPqde3NGcMD3JCdy/pDzlkUvomfXiYakdzn3YCdu4z9Dm 0KVD2yMd8WMckUKTLLqST1biUrsZ81Kq9OwQY+Iw8LD0MWrVA3fgh919UbPDuZdSpFClfFWfkWo MGrGUXbk8++pkHtnlpr6+enkRoZOZRwxdkYwtus7ej94HQ8929xPrvoKBNbgGFYIFfXJmxp3eAT AiHTP0ZAPR9M3PmWPKn5IaG4dEyTNPN/iV3x83VATfoGNwC0CGnAi6miR4IOh/bYw6QCZw09SbY jtcwM183eBCyoi2OzG0ZrVLg/AQ29ZI= X-Received: by 2002:a05:600c:468f:b0:434:a30b:5455 with SMTP id 5b1f17b1804b1-43668b78728mr375470475e9.27.1735842340670; Thu, 02 Jan 2025 10:25:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c488sm459203545e9.27.2025.01.02.10.25.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Jan 2025 10:25:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Pierrick Bouvier , Riku Voipio , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] accel/tcg: Implement cpu_exec_reset_hold() on user emulation Date: Thu, 2 Jan 2025 19:25:21 +0100 Message-ID: <20250102182521.65428-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250102182521.65428-1-philmd@linaro.org> References: <20250102182521.65428-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 bb6cf6f0168 ("accel/tcg: Factor tcg_cpu_reset_hold() out") wanted to restrict tlb_flush() to system emulation, but inadvertently also restricted tcg_flush_jmp_cache(), which was before called on user emulation via: Realize -> Reset -> cpu_common_reset_hold() Since threads (vCPUs) use a common CPUJumpCache, when many threads are created / joined, they eventually end re-using a CPUJumpCache entry, which was cleared when the first vCPU was allocated (via Realize) but then stayed dirty, leading to: Thread 1 "qemu-s390x" received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44 44 ./nptl/pthread_kill.c: No such file or directory. (gdb) bt #0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44 #1 0x00007ffff7c41e8f in __pthread_kill_internal (signo=6, threadid=) at ./nptl/pthread_kill.c:78 #2 0x00007ffff7bf2fb2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007ffff7bdd472 in __GI_abort () at ./stdlib/abort.c:79 #4 0x00007ffff7bdd395 in __assert_fail_base (fmt=0x7ffff7d51a90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5555556d71b8 "cpu->accel", file=file@entry=0x5555556d70e0 "cpu-target.c", line=line@entry=158, function=function@entry=0x5555556d7260 <__PRETTY_FUNCTION__.3> "cpu_exec_realizefn") at ./assert/assert.c:92 #5 0x00007ffff7bebeb2 in __GI___assert_fail (assertion=assertion@entry=0x5555556d71b8 "cpu->accel", file=file@entry=0x5555556d70e0 "cpu-target.c", line=line@entry=158, function=function@entry=0x5555556d7260 <__PRETTY_FUNCTION__.3> "cpu_exec_realizefn") at ./assert/assert.c:101 #6 0x00005555555d44ca in cpu_exec_realizefn (cpu=cpu@entry=0x5555557c28c0, errp=errp@entry=0x7fffffffe140) at cpu-target.c:158 #7 0x000055555559f50b in s390_cpu_realizefn (dev=0x5555557c28c0, errp=0x7fffffffe1a0) at target/s390x/cpu.c:261 #8 0x000055555563f78b in device_set_realized (obj=, value=, errp=0x7fffffffe2e0) at hw/core/qdev.c:510 #9 0x000055555564365d in property_set_bool (obj=0x5555557c28c0, v=, name=, opaque=0x5555557a9140, errp=0x7fffffffe2e0) at qom/object.c:2362 #10 0x0000555555646bbb in object_property_set (obj=obj@entry=0x5555557c28c0, name=name@entry=0x5555556e8ae2 "realized", v=v@entry=0x5555557c6650, errp=errp@entry=0x7fffffffe2e0) at qom/object.c:1471 #11 0x000055555564a45f in object_property_set_qobject (obj=obj@entry=0x5555557c28c0, name=name@entry=0x5555556e8ae2 "realized", value=value@entry=0x5555557a7a90, errp=errp@entry=0x7fffffffe2e0) at qom/qom-qobject.c:28 #12 0x0000555555647224 in object_property_set_bool (obj=0x5555557c28c0, name=name@entry=0x5555556e8ae2 "realized", value=value@entry=true, errp=errp@entry=0x7fffffffe2e0) at qom/object.c:1541 #13 0x000055555564027c in qdev_realize (dev=, bus=bus@entry=0x0, errp=errp@entry=0x7fffffffe2e0) at hw/core/qdev.c:291 #14 0x000055555559bb54 in cpu_create (typename=) at hw/core/cpu-common.c:57 #15 0x000055555559a467 in main (argc=4, argv=0x7fffffffeaa8, envp=) at linux-user/main.c:811 Have cpu_exec_reset_hold() call the common tcg_exec_reset() helper on user emulation, eventually calling tcg_flush_jmp_cache(). Fixes: bb6cf6f0168 ("accel/tcg: Factor tcg_cpu_reset_hold() out") Reported-by: Ilya Leoshkevich Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/user-exec-stub.c | 4 ---- accel/tcg/user-exec.c | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/accel/tcg/user-exec-stub.c b/accel/tcg/user-exec-stub.c index 4fbe2dbdc88..2dc6fd9c4e8 100644 --- a/accel/tcg/user-exec-stub.c +++ b/accel/tcg/user-exec-stub.c @@ -14,10 +14,6 @@ void qemu_init_vcpu(CPUState *cpu) { } -void cpu_exec_reset_hold(CPUState *cpu) -{ -} - /* User mode emulation does not support record/replay yet. */ bool replay_exception(void) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 0561c4f6dc7..92640f07ed7 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -40,6 +40,11 @@ __thread uintptr_t helper_retaddr; //#define DEBUG_SIGNAL +void cpu_exec_reset_hold(CPUState *cpu) +{ + tcg_exec_reset(cpu); +} + void cpu_interrupt(CPUState *cpu, int mask) { g_assert(bql_locked());