From patchwork Mon May 6 12:37:01 2024 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: 794993 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901084wra; Mon, 6 May 2024 05:38:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQDWPfw77pSvdeQ0RN8RBMdcP7wUUyfdXFnJi/QxnzUAM2HT5T8+aoeARXJGjIfk2au8LHToa/M/K2kBr5tLUu X-Google-Smtp-Source: AGHT+IEC1zJpBYl57zHexa6LgsjBG0aGh+KMeRtd5dDo3en7U82otuXuCG2e1FPqJQZQA2Q0NVno X-Received: by 2002:ad4:5aea:0:b0:6a0:d4dd:cb44 with SMTP id c10-20020ad45aea000000b006a0d4ddcb44mr11762771qvh.62.1714999115215; Mon, 06 May 2024 05:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999115; cv=none; d=google.com; s=arc-20160816; b=PrWlqrevWNSBG8fEKbuvQgRgV/UUz0A6E+v3KGYkaALRUgrlFASTWJAD198UsmaJ66 TRtE4og9oSoGkohBmFJR3Luc0Q/bjbrI475fMOkWRbXgHW4uKPVkzHYfC6/+vWXKgIIw iUQdvJL+i1E0t6Qdir1xUBoWBG3ecUfEH7gIni+JzvleKFPyFzb1rAgpyOlBraCMUzBc ozIPHqgk/6VhkTp0e9T9EDNtlfWdnGXXJfr2tG3fTvql1rN5yPjCc6tQXe2ErXGAESOX ojPirI6vsYeCcWMQQ7WR9PO4KaOFUpYATMZEfWJ9MfkuZXzkYligsL4Hw+AAjS87UKds zMPQ== 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=ms63JUeYQatGE3m9Aklqy6cJtKRUtl0Fpr26HXH+Ppg=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=HBcUTZZpHZkbUw7ZWzjaqiOSqecVh1dDDj9Npr5Anwu5zcMu8xVdG//2Pf7yc0mjAu cfoktBmr2sLKBldypkLQ69Yi96fikGf6PZ3mQolRbV7YmvHElaOk3Rh8WW+YrkfcMmYu +GHcQJjH1VtrJPrzWHMnZJsmWzLYR9HhiU2yaSKFrA9uJeIQoZa7w6is+BG8hc755A6H Sd6xXqZNCRbXuDnI6G1lp0rwudWIc5mkMKek5xuZTryxBmwB2WaEgoqqGQOdgnQxV4EO qEQoFe3NANSj+Lc3stWvf8GOejbyQcUyhC8h64REASFHrDgN2wBHravwAfmNznxNvHey o+IQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yJl95uhK; 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 gw1-20020a0562140f0100b00698ebf6b7ecsi9417521qvb.203.2024.05.06.05.38.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:38:35 -0700 (PDT) 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=yJl95uhK; 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 1s3xbJ-00015V-Hw; Mon, 06 May 2024 08:37:50 -0400 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 1s3xbB-00014Q-CF for qemu-devel@nongnu.org; Mon, 06 May 2024 08:37:41 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xb9-0001vQ-Ij for qemu-devel@nongnu.org; Mon, 06 May 2024 08:37:41 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-34dc9065606so1000711f8f.1 for ; Mon, 06 May 2024 05:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999058; x=1715603858; 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=ms63JUeYQatGE3m9Aklqy6cJtKRUtl0Fpr26HXH+Ppg=; b=yJl95uhKu3XnnmZ+O2az6cjAje8ewLyCDTo18UXuYzhLyhQZw1OrINE4guC/qJz11n 1lO7dsySJqwldGoPSwFf1a/SLIzra5+7OdyKH/4/6Og8gcBNE90aSMMu3eDoZVmqNYN5 NXXfYqdxLhTfz51KIXHophVUSD+1ZgTm0Pei/ZcmNEkimdZl6FyUUwjp52sPzsd8MG4e jo3e8XZVt8hYQ3DYL3voZTL94QNW47H7LhuMzEfkBiQt5MFkdPxMvkvf8KeVEp4w9BT2 RwEipIS14rT2knUeCR3wsgBUpHSfeb6kG3eE6dZ2scOnVVRWiGd2HFz32j6ojSihx55X KNYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999058; x=1715603858; 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=ms63JUeYQatGE3m9Aklqy6cJtKRUtl0Fpr26HXH+Ppg=; b=pjMsF/9+oCePwbgG9bOXm6XP1IAUzSDmJ1Pm48gryX/a5V73hdd3p34F3ESeMwYvCj 8Rltdq5KIe6GFq1rPxOBATp8XOqlbz0MCq/PM4+itO2YnLJCaNUs6oTwPRn+csGC/vko wFI6am4ByYNaPv53KEMXecsFDwUEEaIdcYpauI0Ns0npFC4t7TIcCR62XGM8Weis/VXY JFqH4UUgOmDo8rowq5l6UCUEpnfrYGfyHQPsV++PSA6m+HqzzLjM/8cals31D55LB2Fc CDpK02favKs4wBKBCZ+6YhK1RNgj04QZWARhzr3kRqTLo4hnCl4nvCAViwdhMC21ofgF UG7g== X-Gm-Message-State: AOJu0YxcAcTswyFH7W+WswlkWYE8t6x9+4ijtgwNmUFWUYJUKEtkCZrU 3UNC8+tlMwHMQpLC+NJxqjNWlhJs+iHpAvCeH3t2aNg9mJOBC6rGVGRHOLohPqWN3KD3UsFzmgT o X-Received: by 2002:a5d:4c91:0:b0:34d:a37d:d383 with SMTP id z17-20020a5d4c91000000b0034da37dd383mr11873247wrs.22.1714999057721; Mon, 06 May 2024 05:37:37 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id t3-20020a05600001c300b0034df7313bf1sm10715987wrx.0.2024.05.06.05.37.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:37:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 01/28] exec/cpu: Indent TARGET_PAGE_foo definitions Date: Mon, 6 May 2024 14:37:01 +0200 Message-ID: <20240506123728.65278-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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 The TARGET_PAGE_foo definitions are defined with multiple level of #ifdef'ry. Indent it a bit for clarity. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240427155714.53669-6-philmd@linaro.org> --- include/exec/cpu-all.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 032c6d990e..14fd40046d 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -139,19 +139,20 @@ static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val #ifdef TARGET_PAGE_BITS_VARY # include "exec/page-vary.h" extern const TargetPageBits target_page; -#ifdef CONFIG_DEBUG_TCG -#define TARGET_PAGE_BITS ({ assert(target_page.decided); target_page.bits; }) -#define TARGET_PAGE_MASK ({ assert(target_page.decided); \ - (target_long)target_page.mask; }) +# ifdef CONFIG_DEBUG_TCG +# define TARGET_PAGE_BITS ({ assert(target_page.decided); \ + target_page.bits; }) +# define TARGET_PAGE_MASK ({ assert(target_page.decided); \ + (target_long)target_page.mask; }) +# else +# define TARGET_PAGE_BITS target_page.bits +# define TARGET_PAGE_MASK ((target_long)target_page.mask) +# endif +# define TARGET_PAGE_SIZE (-(int)TARGET_PAGE_MASK) #else -#define TARGET_PAGE_BITS target_page.bits -#define TARGET_PAGE_MASK ((target_long)target_page.mask) -#endif -#define TARGET_PAGE_SIZE (-(int)TARGET_PAGE_MASK) -#else -#define TARGET_PAGE_BITS_MIN TARGET_PAGE_BITS -#define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS) -#define TARGET_PAGE_MASK ((target_long)-1 << TARGET_PAGE_BITS) +# define TARGET_PAGE_BITS_MIN TARGET_PAGE_BITS +# define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS) +# define TARGET_PAGE_MASK ((target_long)-1 << TARGET_PAGE_BITS) #endif #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) From patchwork Mon May 6 12:37:02 2024 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: 794995 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901085wra; Mon, 6 May 2024 05:38:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXKaoXVH3lmg3EVM8KDKh+9Z9k1lX2bDuN8jTtsFSmKveKKO6gGzV8WDJW8+3OyaWGj+hHgH9CRNAHwh9PCgmd+ X-Google-Smtp-Source: AGHT+IFiJqd3PKwCLco/TC16HDbZdYHIGmXJUrgF+5KarWh/Vw8fI/N0JouWxAk4JQR15w7b2rHT X-Received: by 2002:a37:db0a:0:b0:792:9b08:e36 with SMTP id e10-20020a37db0a000000b007929b080e36mr2218798qki.44.1714999115377; Mon, 06 May 2024 05:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999115; cv=none; d=google.com; s=arc-20160816; b=sCqWhR8SVoJDEGnmyvkhsG8JgpD0mwGoQLVrmxv/bY5T/dtHVKOAyLO0oLM05xPEOn Zv08NmyzyEzB661cYm8FvFCInRsN1K/Bpe0sg8OqOZiEGX4g22yQ4pPPGMOJ7Lhy19yx YYpH3ve3XVztYDAuKI0lcyJqcEMQFEvrecgxH2ZC+ctbXS+NLL1cjbkT3oRag3QlQ6eA SARtNinY1g0U7p/c1mgdSvmGSegwGg6lDzppmRVPD50IpZDJdJy9yAmtjATqzuwKp6h6 ysChCc1s+/y1Qb7dqLcmkqpltK88Ccfr/nAiep0xLbApH3U2sWRai9SRdWvQlU2xdHld omBQ== 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=ZCUBMQRGERL5OWJijRjLr72zABwTKcx4Ah85U5dJp20=; fh=q+SLrIU9WSNby7l8Yebg2WVkWjeYEsYPqIVLP302GxM=; b=vcTesH7OgXhnQ4onimJr/95zpH6g0eeI6B3QJd3YriU9aIiY/J2pzdTiV5Jq5aH2ZN GhSDTHPBh8a6P/UqnMoUGC9rt8A5xUXfvasg8qd1w88zWRqcjFX5bMngCUyDybu1SCuY PDl/SAFtDZiYLsMp/T5c/u8mjgnW0egbmFwqqEHHou50DQu1S1A3PMpwrmcjFvnciAh4 Ssd7aFW4MsOagazmjexkTmn04hkJKW/t4ivDLQsxZdLTw60OL2Wq0NwO1/sNfHerflim 68upW1Wu5mFX+9i7NUizjUHkKQhA7RkeG3RakPDELdxxF721bbgiwv8EEEdKVwRPz4XV wEeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k1uhOOT/"; 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 az12-20020a05620a170c00b0078f1bfcca35si9676894qkb.386.2024.05.06.05.38.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:38:35 -0700 (PDT) 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="k1uhOOT/"; 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 1s3xbO-000192-AJ; Mon, 06 May 2024 08:37:54 -0400 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 1s3xbM-000171-0u for qemu-devel@nongnu.org; Mon, 06 May 2024 08:37:53 -0400 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 1s3xbJ-0001w3-2S for qemu-devel@nongnu.org; Mon, 06 May 2024 08:37:50 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-34dc9065606so1000840f8f.1 for ; Mon, 06 May 2024 05:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999067; x=1715603867; 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=ZCUBMQRGERL5OWJijRjLr72zABwTKcx4Ah85U5dJp20=; b=k1uhOOT//esL4aBxB2DvMB20Ge6ka2w+db3JmW06vDsnfQXd+w3LzBLoPf2tt7GTvU 8AI7UImEux3tOAGiUe4zqd8afQzaLJh/bjesJb+ACZ2YFYBQB46c7P4k3aOBBkps0T/9 /WCyMimbWgSGKd9aHN6tsZrLpcwm7WkUcsK4JC3vddiQZGF+K0I/gxB4GE+/HjPtNztO gpXyKG04gmRpvWJMJKbISeN0aTaZxQW2tqPmNTjV/ZfsVIkT2DiWr7a5pxUR9347WsPR CNDQY/JU6aKwNnpkdL8k8qRlR+HydRTCm5Y7rBOvExaOemnlg85giS7PThm6t5HcwodG 28pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999067; x=1715603867; 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=ZCUBMQRGERL5OWJijRjLr72zABwTKcx4Ah85U5dJp20=; b=SpL1b6ogQz/oWJqXo4EidbUdmByCw96nyxV554TWEyIRXRH+dfXc+UgJe8BQ1O79N7 J5JCu2bnTp64jjJVJZ2eq7H77SqgcOWqIXk0pN7cCZgtN7kASS7FAUky1ia255fnocWa cPHzFZ1GqSy4EZVL6Iu5ii5tFphjI1iHYtd7SMOqHvfyUxYWTsCipW8W9n63Z7M48p4O kwyyKUkGBnZUk44lhbX1nZ/vt9bQM1SOxmzbZ5RLs+p3jYlA725yCdXQcDigQv3t2Yxk fEzeSYVQVacDm7BHV9ygX5JwNjc4NBE/h10rV1gjjWhwZNUGtNfERjy4l54N65zEQqZy RyHw== X-Gm-Message-State: AOJu0Yztd7+4pPzig+1ZkABvz+W8G6tGLd5IlJB4i6V5lfjILpT+J0k/ qhD/u5mp7SwzFrCC0N59u7B4m0L/hxAsFCyNXJELe/ghSEmmgXdCxWbJGQ8PGjLVnFbAvnrxo/T u X-Received: by 2002:a5d:6a11:0:b0:34c:ce6a:96fa with SMTP id m17-20020a5d6a11000000b0034cce6a96famr11528646wru.34.1714999067021; Mon, 06 May 2024 05:37:47 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id k5-20020a05600c1c8500b0041bab13cd74sm15943592wms.17.2024.05.06.05.37.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:37:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 02/28] exec/cpu: Rename PAGE_BITS macro to PAGE_RWX Date: Mon, 6 May 2024 14:37:02 +0200 Message-ID: <20240506123728.65278-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 From: BALATON Zoltan This macro can be used to abbreviate PAGE_READ | PAGE_WRITE | PAGE_EXEC for which PAGE_RWX is a better name and renaming it also shows it is not related to TARGET_PAGE_BITS. Signed-off-by: BALATON Zoltan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240505121008.44A0D4E602D@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h | 2 +- accel/tcg/user-exec.c | 2 +- bsd-user/mmap.c | 6 +++--- linux-user/elfload.c | 2 +- linux-user/mmap.c | 2 +- target/cris/mmu.c | 4 ++-- target/microblaze/helper.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 8812ba744d..a4bb4e6680 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -212,7 +212,7 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); #define PAGE_READ 0x0001 #define PAGE_WRITE 0x0002 #define PAGE_EXEC 0x0004 -#define PAGE_BITS (PAGE_READ | PAGE_WRITE | PAGE_EXEC) +#define PAGE_RWX (PAGE_READ | PAGE_WRITE | PAGE_EXEC) #define PAGE_VALID 0x0008 /* * Original state of the write flag (used when tracking self-modifying code) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 1c621477ad..a81e3cc920 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -765,7 +765,7 @@ int page_unprotect(target_ulong address, uintptr_t pc) if (prot & PAGE_EXEC) { prot = (prot & ~PAGE_EXEC) | PAGE_READ; } - mprotect((void *)g2h_untagged(start), len, prot & PAGE_BITS); + mprotect((void *)g2h_untagged(start), len, prot & PAGE_RWX); } mmap_unlock(); diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 3ef11b2807..c785615392 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -96,7 +96,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot) end = host_end; } ret = mprotect(g2h_untagged(host_start), - qemu_host_page_size, prot1 & PAGE_BITS); + qemu_host_page_size, prot1 & PAGE_RWX); if (ret != 0) goto error; host_start += qemu_host_page_size; @@ -107,7 +107,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot) prot1 |= page_get_flags(addr); } ret = mprotect(g2h_untagged(host_end - qemu_host_page_size), - qemu_host_page_size, prot1 & PAGE_BITS); + qemu_host_page_size, prot1 & PAGE_RWX); if (ret != 0) goto error; host_end -= qemu_host_page_size; @@ -174,7 +174,7 @@ static int mmap_frag(abi_ulong real_start, return -1; prot1 = prot; } - prot1 &= PAGE_BITS; + prot1 &= PAGE_RWX; prot_new = prot | prot1; if (fd != -1) { diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f9461d2844..41fae2b520 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2361,7 +2361,7 @@ static bool zero_bss(abi_ulong start_bss, abi_ulong end_bss, if (start_bss < align_bss) { int flags = page_get_flags(start_bss); - if (!(flags & PAGE_BITS)) { + if (!(flags & PAGE_RWX)) { /* * The whole address space of the executable was reserved * at the start, therefore all pages will be VALID. diff --git a/linux-user/mmap.c b/linux-user/mmap.c index be3b9a68eb..66a1631094 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -117,7 +117,7 @@ static void shm_region_rm_complete(abi_ptr start, abi_ptr last) static int validate_prot_to_pageflags(int prot) { int valid = PROT_READ | PROT_WRITE | PROT_EXEC | TARGET_PROT_SEM; - int page_flags = (prot & PAGE_BITS) | PAGE_VALID; + int page_flags = (prot & PAGE_RWX) | PAGE_VALID; #ifdef TARGET_AARCH64 { diff --git a/target/cris/mmu.c b/target/cris/mmu.c index b574ec6e5b..c25c31c9f8 100644 --- a/target/cris/mmu.c +++ b/target/cris/mmu.c @@ -333,7 +333,7 @@ int cris_mmu_translate(struct cris_mmu_result *res, if (!cris_mmu_enabled(env->sregs[SFR_RW_GC_CFG])) { res->phy = vaddr; - res->prot = PAGE_BITS; + res->prot = PAGE_RWX; goto done; } @@ -344,7 +344,7 @@ int cris_mmu_translate(struct cris_mmu_result *res, miss = 0; base = cris_mmu_translate_seg(env, seg); res->phy = base | (0x0fffffff & vaddr); - res->prot = PAGE_BITS; + res->prot = PAGE_RWX; } else { miss = cris_mmu_translate_page(res, env, vaddr, access_type, is_user, debug); diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index d25c9eb4d3..ff5f86ddc2 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -51,7 +51,7 @@ bool mb_cpu_tlb_fill(CPUState *cs, vaddr address, int size, if (mmu_idx == MMU_NOMMU_IDX) { /* MMU disabled or not available. */ address &= TARGET_PAGE_MASK; - prot = PAGE_BITS; + prot = PAGE_RWX; tlb_set_page_with_attrs(cs, address, address, attrs, prot, mmu_idx, TARGET_PAGE_SIZE); return true; From patchwork Mon May 6 12:37:03 2024 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: 794992 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901073wra; Mon, 6 May 2024 05:38:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXm7D2WLaYTR8Gp3hBoX1fV3V26yHLcN4szm8NCKxyRWTtL/7nrVpxx17tAeR5MLYeUKP/j5AhwbYoPMrh+WTUl X-Google-Smtp-Source: AGHT+IEMP8Cz37a7mPX2F4OYClEE6sMsUn2Krn6ZczWW4gRbS4WnE54eDh2brCcyYZv1cDpH7eXj X-Received: by 2002:a05:6214:cae:b0:691:8b3a:5acb with SMTP id s14-20020a0562140cae00b006918b3a5acbmr12019043qvs.13.1714999114586; Mon, 06 May 2024 05:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999114; cv=none; d=google.com; s=arc-20160816; b=aUuk2jOv/k70Gc7VQ/e5tfMDbyteVMaMn6aVSn0diiLjq/UTRCHyoLODJUlmLz1EvC JVuxBF6T/vuNf3yQ/dIT/jpPifg7tSQvWzx64HerU8tMgj8RJqVsaij4p8gA9k7Isb7a MAUVWVvZbUw9TXUkcFxDZXm9YlFPawoip6uvQOPR+1teLTOWZAyy1yo4ohdMay/wiUM3 4vzhFoyfbiUPiO6bNyP70BQApBB2ULoQx/75Xka86cf/OH6QdpVlUK7k2jladu+N3U7K SPFK36D7ng2m8/OFwI4SzZuymAE24c82zKphPMH4ikNDIx6kLNMePakYetx8zQsttaNX RNzw== 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=5ffJQxiDj3N9yVpQm4QJxpwM7+oszAI+ZoVpwTJT6ns=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=u24il2g3uWqUjU8s4hsDl2Ie9j0ETfR+k/N88xwegdRWqc/njyRdty/IpHeEHKSRFu 685heVd4GeTJBXmqg63lTGMOP2WYm9Q/1QM3ditE9rOzPRcarK9x4mgBgg35ge9uErbl 209IxmPMWcX+9FCvVtXW6uhbu2FtPxe37WtMtzMm/3FadaOhr62J+ojDk1IcD4OTn5iX tvCUC2xfx+dq3U32hE97HNiJ1SJnYp3AuRiOeCs/xkEjDIARA5X14i3XyXSdWBX7Nd2n vRWZQhWsCWEcpq4xW8y3xlMRl4akS1pQ8bTK/naTKK+mihu399m04Bby4M1/2Jz+7akY 5Teg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jKQOncH6; 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 g13-20020a0562140acd00b006a0d23b177asi9379236qvi.560.2024.05.06.05.38.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:38:34 -0700 (PDT) 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=jKQOncH6; 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 1s3xbs-0001I5-TK; Mon, 06 May 2024 08:38:24 -0400 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 1s3xbX-0001BS-Oe for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:07 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xbU-0001xC-5B for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:01 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-41dc9f98e8dso23312145e9.1 for ; Mon, 06 May 2024 05:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999078; x=1715603878; 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=5ffJQxiDj3N9yVpQm4QJxpwM7+oszAI+ZoVpwTJT6ns=; b=jKQOncH69/KFFgWyMY8ma9sq1Gz/UfQ9rGSC16eVfRVqwKcI2H2rPINSGwTsHHqlBW +LPa9v5u2I7PFl6Cu2WecADURIgyZb0+NkeeIrCVq9tW9Sc1yee9sTXWZiEUvbY0OW7U 1iqbdJAQgvmRA8TkkEWUPAhi8eKHsged2FQo0quun8qDf/e6Qe9HlGvYfN+GRDGsLYRQ aPxDs0RIjYpzL8B1OvlaUm8XjTB8dbW1j+1Sqr80Rz2K643w42jV/UtnzyOwYnCu++af +4A+ZoxsrIyLGLJnDRJ6W8MFnkl+MXgVG+tE+b8h7cfP5akcMqi9vRHSOt6Kikj8S9Ru 8gEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999078; x=1715603878; 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=5ffJQxiDj3N9yVpQm4QJxpwM7+oszAI+ZoVpwTJT6ns=; b=WIDaV6hjXHx0Q9Qhb6x//sHE82Ke3wQqFMlI6VPVa5DoaEXr7XRsv/hAfyfyCsxpAH 1+eYjaqCoNAwnlPLgsRhO0ykCM/2L2+7z2904JAuxfqcYAXGQrcDVi962x0c9+teqHeX h/fT1VH7rWxkzetFGEsTajSqFXUWjcVspE36hFSJHa+cpquS2sTE0Fw5uCCUFV2oZjTf UHuJKy3V8UZ78P0M+p2cY4sfFIqfaFRmMAMSyJ75qfTDOkorJjHQfzECg+rW890jZiWo ADsPeN1FfxImv2ZmCyLBx10H1IgSm+P26fuWFqdcKvam1zfeN7IANO6yfpNl2Vfvwf4g Y7gQ== X-Gm-Message-State: AOJu0Yy/gRFiYg4wH6WSAmaP7tGUHz4gUos4dy3oOTMveqUkPUrRaY8q bl980G9BzHlvCm8t5Xd4T8ufF/1yMSIr0DZ0lOBEE66lZJ19QEjwAzhy3eHvKmr+0/m7Bb8KTF2 X X-Received: by 2002:a05:600c:3b1b:b0:418:f5a:580b with SMTP id m27-20020a05600c3b1b00b004180f5a580bmr11733206wms.18.1714999078325; Mon, 06 May 2024 05:37:58 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id m9-20020a05600c4f4900b0041bf7da4200sm16058113wmq.33.2024.05.06.05.37.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:37:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 03/28] exec/cpu: Remove obsolete PAGE_RESERVED definition Date: Mon, 6 May 2024 14:37:03 +0200 Message-ID: <20240506123728.65278-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 We stopped using the PAGE_RESERVED definition in commit 50d25c8aec ("accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD"). This completes commit 2e9a5713f0 ("Remove PAGE_RESERVED"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240427155714.53669-7-philmd@linaro.org> --- include/exec/cpu-all.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 14fd40046d..104c5dd2da 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -157,10 +157,6 @@ extern const TargetPageBits target_page; #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) -#if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY) -/* FIXME: Code that sets/uses this is broken and needs to go away. */ -#define PAGE_RESERVED 0x0100 -#endif /* * For linux-user, indicates that the page is mapped with the same semantics * in both guest and host. From patchwork Mon May 6 12:37:04 2024 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: 794996 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901171wra; Mon, 6 May 2024 05:38:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbXzKUt/xSvykevvECT4n4zi/sqFEGbk2Zib66Ym5/V5UNtR3NxPItiRF/g/1oA+n/+3G3FPAHC+ZWdwgDM7Wv X-Google-Smtp-Source: AGHT+IHFAh1QUqAUMMrh5DTRXQMl2csYYlwJwe0CQsntWe5zN6IrYgaj9m6RN4hhvxpnsj1RBy78 X-Received: by 2002:a05:6870:c0d1:b0:229:8216:6972 with SMTP id e17-20020a056870c0d100b0022982166972mr12223135oad.33.1714999130723; Mon, 06 May 2024 05:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999130; cv=none; d=google.com; s=arc-20160816; b=blj8l/wCaC5qyfT7RM1OP6fR4HT1wxsx8Hf90SGyUTcdLiBXGQF2kSTtQRTvJMmewa JcaAdiuIAwYFhLmfsET4/0JnxNCQOlj1AQALYJiNdYH0skdkPrt2/x6oEDmPCmZoWsgh nwB73fdBRR64BQRa3bor2f8tr9HwNFMJtsi2zR/ON3AZ2iLGvnVs4nQQx8+9oX6lYHkT s33PdaHMQLtU/1/FC6xiqGxNyTGVPgWsKg8F0Reg1A9/Pe1zLDBkdblvNXNrAL4DRLJg IPzJSFDG+4HF6kQ647tvM/T5eLnwKJk19cBc6BRcYV/wHa+sO04tntsLTChePakwyQcm MLTw== 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=15MBw/M3WTCtNRZ5kPDhx5DhGKWOE30iPpFmTieH1zg=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=gE5aO3cU+bgmDFOy7orfeWbYwjTOIz6k/DNy4Vxha48iSD5cyVuK9adghkUbcwKQYE fO0IHVoRwmxQdh9J8xTqrbg1pthTNv9xfIxuxgzs5r6OIEPrUCQhG9z4gboieyoLEsog F5MaKscSxpyZ7b1QjonAOn7ltgQOct5ygjIx8YNyI1/3jxqi7Bs6oEgDfPPqyiNmalk6 boXT1vPA/4neftzhQ6MAzRTnlit4PYkfcF4CHbin3JustCaX67RncC8TcN2aJeEEAjdK KK+2Hw2hQtqKFcYItK3AWKbMA2Cdz4wQaz0xC030B607K2l27mjOxWISIOfHtTRVdj0h Pcsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ulfr9+hF; 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 x14-20020a05620a448e00b007929602e42esi2862024qkp.463.2024.05.06.05.38.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:38:50 -0700 (PDT) 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=Ulfr9+hF; 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 1s3xby-0001Ji-2a; Mon, 06 May 2024 08:38:31 -0400 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 1s3xbj-0001FU-DM for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:20 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xbg-0001y9-2G for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:14 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-34db6a29998so1157035f8f.0 for ; Mon, 06 May 2024 05:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999089; x=1715603889; 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=15MBw/M3WTCtNRZ5kPDhx5DhGKWOE30iPpFmTieH1zg=; b=Ulfr9+hFM/7FKHO2u5IALgiIcuO1dRGPCS71WP8dKlw5//nbCSCUMHC1EQwgHSgYNz AZqSxq9SEfEc9EavOq/1xS5D4rusMbGXCot6HmKftLvj6irrxJDQ42mDhYctIGkRksY/ Ox5+AWTWVtSHvGSnvcwbi8odl+a36hDungH/I/iEcqPf3YLJU7fXeff2GPiR2LZ9LntT j53vjb00RCZVsTmlu+xSMNHySHCI0D9tN/Zv0zolbJuLJ2TwNcUmAbDgc5dohhLt3v2r 0BvqMl95PJqjSN3D1B+KRNnUopupo8Jm/M4vzCGE78reMxCH5wY8wTV325JtxaKtb012 zqHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999089; x=1715603889; 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=15MBw/M3WTCtNRZ5kPDhx5DhGKWOE30iPpFmTieH1zg=; b=PEUSvwM4vHDOp43q4BvlL9BQhIU9Lmvid61ycuTj65AEmRFuuxhKniwHoGyDY9/OWI e3hiBGPS+NDvubYAau5ISklAPrCMPxUoX0glqVm9JP8uj8q06p0JNffXchmj4j9B1fnf qK6NUO0EJHQDNMfH9qjF02neog8MoKlkjOQEFcmE8UrJ+gNUb6VDBQrHZtyKOrJeaKqD xGQVHtIjkmSuBlsewGPiEvzmO0aw+PJr+ZLH51Zy9DP+ZyxEdBtyD6e01rcQbBCMKlE1 ku9GTYcUS8jb8Xip9vy5ZCqflMcQYitTvHCsLB5XiEtXl4C/1zCCRSo3DBijx8FfifwF AgEQ== X-Gm-Message-State: AOJu0Yxjo8ixPE8ZJbR1jIEKofJ1eu0qJxESQjxLEQ+6zwKRq5rm/bMA eD+AFnSp8CWPbfmcRsS6VXlgqTi1EwWYKzOCKGoHZhE5x4iSFAPaevdnDumQcewOgseFviFeLYZ Q X-Received: by 2002:adf:a18f:0:b0:34c:b31e:18de with SMTP id u15-20020adfa18f000000b0034cb31e18demr6845895wru.35.1714999089417; Mon, 06 May 2024 05:38:09 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id k3-20020adff5c3000000b00349a5b8eba6sm10555499wrp.34.2024.05.06.05.38.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 04/28] exec/cpu: Remove duplicated PAGE_PASSTHROUGH definition Date: Mon, 6 May 2024 14:37:04 +0200 Message-ID: <20240506123728.65278-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Missed in commit 58771921af ("include/exec: Move PAGE_* macros to common header"), PAGE_PASSTHROUGH ended being defined twice. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240427155714.53669-8-philmd@linaro.org> --- include/exec/cpu-all.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 104c5dd2da..c4dada5b44 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -157,12 +157,6 @@ extern const TargetPageBits target_page; #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) -/* - * For linux-user, indicates that the page is mapped with the same semantics - * in both guest and host. - */ -#define PAGE_PASSTHROUGH 0x0800 - #if defined(CONFIG_USER_ONLY) void page_dump(FILE *f); From patchwork Mon May 6 12:37:05 2024 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: 794997 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901288wra; Mon, 6 May 2024 05:39:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWZeOXNJ/18op+3CI3yvx8r9fSjb6zzL6rNroOIUSOz8UMh60U4mp5eNJ2xjA9/sFR9ppaM+hyDujQoKl8vjh7J X-Google-Smtp-Source: AGHT+IEz6lON9miiQzlefbvCoBtZvzAscpv9VcWlH/mBmEo7jukmJtJy+5xl5RDv8jljMGm9Kbc7 X-Received: by 2002:a05:620a:4708:b0:790:92bc:7a57 with SMTP id bs8-20020a05620a470800b0079092bc7a57mr22508981qkb.36.1714999149793; Mon, 06 May 2024 05:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999149; cv=none; d=google.com; s=arc-20160816; b=R/GMLO/k0JYjh4Z+Ge0rvO+FmsoQZXF0MJ8dBUYoHyMJ+CPRZ/S7gdcjNAUroYtGwe vHPfH+haPqokIdm3lVwEbchQQl4/iEuzLSnvJkzFVE0XTFhtVA3Ml9bQZ6gpm/HolJpv 9qDldxqEb+xPt4byGdJU2fhIyivD7++GYD+xVnAalQJBO+IL7s92zcSUKY6dyl6942y+ /FYqJV3xBAus5i2JJpMOlJ+chBGnmwqWwRSjJQzCvpUF8RkUDXnhMmq50K66aKu+yhZh uXvZQsqIzoMa20r+qZoJtJvxOo9v7zxvuvUQzbrqDpXLiwzrbxOyhS8LRqS6O5otF7MI k3hQ== 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=ao6HS9qQ48Yyp30k9ch0ReuFpZiEVqKkF3nRl1K4uLk=; fh=I1nWKuLmDPH6FXvjYkuAYOQ77EM43C2Dy8YQx/Psor4=; b=WKMv1Bg0sepznYP3UBsm77yv2rlADPa0Jtu7F2uAr+ZBad2nUIrjhyPnZdWcdRfja2 dXbBtI2yowQcvmvJ7YTXekfzoQ8bmoQ/I/rVAF/ccGweMm2I5Nwn0DbyndG39lm2aUVb bSHitmu0LBNB6ikr9phFB3kilTNdQSWSkJdL1ZsfmUoy3OXvrMJ4ecm5DEr4zWjM2/wa D4T7xEieH/jJX4U6HHLStsqNIlvliYyTdygu7Noqz6MXNmlGX3LUDGKzqWsen2jGIXvS 37wVXYEIxQKBI7xG0O59x3wSbe1B61Z4RCpDkx3gUB9BzKC9eFlz/e2A+1duldvxPoLe Misg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q5UkQGtg; 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 z2-20020ae9f442000000b0079294ce0a1asi2898341qkl.682.2024.05.06.05.39.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:09 -0700 (PDT) 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=Q5UkQGtg; 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 1s3xcN-0001xg-NF; Mon, 06 May 2024 08:38:56 -0400 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 1s3xbz-0001KT-K0 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:31 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xbn-0001yc-2A for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:30 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-41b5dd5af48so15224875e9.0 for ; Mon, 06 May 2024 05:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999096; x=1715603896; 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=ao6HS9qQ48Yyp30k9ch0ReuFpZiEVqKkF3nRl1K4uLk=; b=Q5UkQGtgdAlKwz4F7jDegjwT3nNPGE9NpgyDRxUgBHxCFD/Pd1eKh6IS0+jREQHY8k ugeFCJIDMkatfdgK4Blqsbjyww1GYg9K7lCfwFBk7QvQ+hwt2fU9gVAnDGCSzs9ZaNV8 ZdCCmgkP+LyLLxmWspY7GmevHlhGe47hcO9FeAhm81owXyY/t0ER12x+Ntujb/K3n3Ex mF32ln21PpoBMGFp0fI1icbqSdIYra5tB93n1X1K+RUC/+MchkHjRYntsfJij8qzuAqG SJ3lifWRzj9e//SlWcpNZkvFHh895MnXXErGWrxK8maWB/RC0ns0eui/tDSZZhkpv5e7 CfMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999096; x=1715603896; 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=ao6HS9qQ48Yyp30k9ch0ReuFpZiEVqKkF3nRl1K4uLk=; b=D5Ijq8JGOv+HTcbR3vWzvK/0i6Xe8uCo4NWDnLwzUuMvCoaL+44DT8d6x36Ku0wAzt P4u7ISOA/WL/lUtt8zyojmPLVcWVuZ+LqChLjKiYS+Dh8NsLFK+lrNs4ck0MPFKm+eIQ 4GXmbk3VCg4Zgi5fuyiIXyahUrKQxYVvtaOypc8h2tH4/0jNrzsELzoJhBaWBvp/efnB 9UH2qSXVqG0jFxFHE74Kwq3jSRAjmF8x35QXLnftzUt9mG4sKTz4Na+NKeJW6fkhFrnl RMTjtr5IMTLQSnD+nPdKlVR+ckx38yetXxNRB9fe/mNJMnh4VRP47K9F2tdSsjyJXWtF quDw== X-Gm-Message-State: AOJu0YzD8KK99jZSOJWOL0O65uIB6RstEi65U2Gnm24dMe77jyJ30Suz DHkuqis/pBjd8VPc6nzXFkRfjRdUe9xSxn/S1LV7Empg4AVfdxYl041uLJ0yll5hPZChHDOlUx3 5 X-Received: by 2002:a5d:5511:0:b0:34d:74cb:c0be with SMTP id b17-20020a5d5511000000b0034d74cbc0bemr6786202wrv.35.1714999095988; Mon, 06 May 2024 05:38:15 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id o9-20020a5d47c9000000b0034d7a555047sm10585574wrc.96.2024.05.06.05.38.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Richard Henderson Subject: [PULL 05/28] exec/cpu: Extract page-protection definitions to page-protection.h Date: Mon, 6 May 2024 14:37:05 +0200 Message-ID: <20240506123728.65278-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 Extract page-protection definitions from "exec/cpu-all.h" to "exec/page-protection.h". The list of files requiring the new header was generated using: $ git grep -wE \ 'PAGE_(READ|WRITE|EXEC|RWX|VALID|ANON|RESERVED|TARGET_.|PASSTHROUGH)' Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin Acked-by: Richard Henderson Message-Id: <20240427155714.53669-3-philmd@linaro.org> --- MAINTAINERS | 1 + bsd-user/bsd-mem.h | 1 + bsd-user/qemu.h | 1 + include/exec/cpu-all.h | 1 + include/exec/cpu-common.h | 31 +-------------------- include/exec/page-protection.h | 41 ++++++++++++++++++++++++++++ include/semihosting/uaccess.h | 1 + target/arm/cpu.h | 1 + target/ppc/internal.h | 1 + target/ppc/mmu-radix64.h | 2 ++ accel/tcg/cputlb.c | 1 + accel/tcg/tb-maint.c | 1 + accel/tcg/user-exec.c | 1 + bsd-user/mmap.c | 1 + bsd-user/signal.c | 1 + cpu-target.c | 1 + hw/ppc/ppc440_bamboo.c | 1 + hw/ppc/sam460ex.c | 1 + hw/ppc/virtex_ml507.c | 1 + linux-user/arm/cpu_loop.c | 1 + linux-user/elfload.c | 1 + linux-user/mmap.c | 1 + linux-user/signal.c | 1 + linux-user/syscall.c | 1 + system/physmem.c | 1 + target/alpha/helper.c | 1 + target/arm/ptw.c | 1 + target/arm/tcg/m_helper.c | 1 + target/arm/tcg/mte_helper.c | 1 + target/arm/tcg/sve_helper.c | 1 + target/avr/helper.c | 1 + target/cris/mmu.c | 1 + target/hppa/mem_helper.c | 1 + target/hppa/translate.c | 1 + target/i386/tcg/sysemu/excp_helper.c | 1 + target/loongarch/tcg/tlb_helper.c | 1 + target/m68k/helper.c | 1 + target/microblaze/helper.c | 1 + target/microblaze/mmu.c | 1 + target/mips/sysemu/physaddr.c | 1 + target/mips/tcg/sysemu/tlb_helper.c | 1 + target/openrisc/mmu.c | 1 + target/ppc/mmu-hash32.c | 1 + target/ppc/mmu-hash64.c | 1 + target/ppc/mmu-radix64.c | 1 + target/ppc/mmu_common.c | 1 + target/ppc/mmu_helper.c | 1 + target/riscv/cpu_helper.c | 1 + target/riscv/pmp.c | 1 + target/riscv/vector_helper.c | 1 + target/rx/cpu.c | 1 + target/s390x/mmu_helper.c | 1 + target/s390x/tcg/mem_helper.c | 1 + target/sh4/helper.c | 1 + target/sparc/ldst_helper.c | 1 + target/sparc/mmu_helper.c | 1 + target/tricore/helper.c | 1 + target/xtensa/mmu_helper.c | 1 + target/xtensa/op_helper.c | 1 + 59 files changed, 100 insertions(+), 30 deletions(-) create mode 100644 include/exec/page-protection.h diff --git a/MAINTAINERS b/MAINTAINERS index 2f08cc528e..595808fc96 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -167,6 +167,7 @@ F: include/exec/target_long.h F: include/exec/helper*.h F: include/exec/helper*.h.inc F: include/exec/helper-info.c.inc +F: include/exec/page-protection.h F: include/sysemu/cpus.h F: include/sysemu/tcg.h F: include/hw/core/tcg-cpu-ops.h diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h index 21d9bab889..eef6b222d9 100644 --- a/bsd-user/bsd-mem.h +++ b/bsd-user/bsd-mem.h @@ -56,6 +56,7 @@ #include #include "qemu-bsd.h" +#include "exec/page-protection.h" extern struct bsd_shm_regions bsd_shm_regions[]; extern abi_ulong target_brk; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index a916724de9..322177de16 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -34,6 +34,7 @@ extern char **environ; #include "target_os_signal.h" #include "target.h" #include "exec/gdbstub.h" +#include "exec/page-protection.h" #include "qemu/clang-tsa.h" #include "qemu-os.h" diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index c4dada5b44..6f09b86e7f 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -19,6 +19,7 @@ #ifndef CPU_ALL_H #define CPU_ALL_H +#include "exec/page-protection.h" #include "exec/cpu-common.h" #include "exec/memory.h" #include "exec/tswap.h" diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index a4bb4e6680..78f2c381b1 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -14,6 +14,7 @@ #endif #include "hw/core/cpu.h" #include "tcg/debug-assert.h" +#include "exec/page-protection.h" #define EXCP_INTERRUPT 0x10000 /* async interruption */ #define EXCP_HLT 0x10001 /* hlt instruction reached */ @@ -208,36 +209,6 @@ G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); G_NORETURN void cpu_loop_exit(CPUState *cpu); G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); -/* same as PROT_xxx */ -#define PAGE_READ 0x0001 -#define PAGE_WRITE 0x0002 -#define PAGE_EXEC 0x0004 -#define PAGE_RWX (PAGE_READ | PAGE_WRITE | PAGE_EXEC) -#define PAGE_VALID 0x0008 -/* - * Original state of the write flag (used when tracking self-modifying code) - */ -#define PAGE_WRITE_ORG 0x0010 -/* - * Invalidate the TLB entry immediately, helpful for s390x - * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs() - */ -#define PAGE_WRITE_INV 0x0020 -/* For use with page_set_flags: page is being replaced; target_data cleared. */ -#define PAGE_RESET 0x0040 -/* For linux-user, indicates that the page is MAP_ANON. */ -#define PAGE_ANON 0x0080 - -/* Target-specific bits that will be used via page_get_flags(). */ -#define PAGE_TARGET_1 0x0200 -#define PAGE_TARGET_2 0x0400 - -/* - * For linux-user, indicates that the page is mapped with the same semantics - * in both guest and host. - */ -#define PAGE_PASSTHROUGH 0x0800 - /* accel/tcg/cpu-exec.c */ int cpu_exec(CPUState *cpu); diff --git a/include/exec/page-protection.h b/include/exec/page-protection.h new file mode 100644 index 0000000000..c43231af8b --- /dev/null +++ b/include/exec/page-protection.h @@ -0,0 +1,41 @@ +/* + * QEMU page protection definitions. + * + * Copyright (c) 2003 Fabrice Bellard + * + * SPDX-License-Identifier: LGPL-2.1+ + */ +#ifndef EXEC_PAGE_PROT_COMMON_H +#define EXEC_PAGE_PROT_COMMON_H + +/* same as PROT_xxx */ +#define PAGE_READ 0x0001 +#define PAGE_WRITE 0x0002 +#define PAGE_EXEC 0x0004 +#define PAGE_RWX (PAGE_READ | PAGE_WRITE | PAGE_EXEC) +#define PAGE_VALID 0x0008 +/* + * Original state of the write flag (used when tracking self-modifying code) + */ +#define PAGE_WRITE_ORG 0x0010 +/* + * Invalidate the TLB entry immediately, helpful for s390x + * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs() + */ +#define PAGE_WRITE_INV 0x0020 +/* For use with page_set_flags: page is being replaced; target_data cleared. */ +#define PAGE_RESET 0x0040 +/* For linux-user, indicates that the page is MAP_ANON. */ +#define PAGE_ANON 0x0080 + +/* Target-specific bits that will be used via page_get_flags(). */ +#define PAGE_TARGET_1 0x0200 +#define PAGE_TARGET_2 0x0400 + +/* + * For linux-user, indicates that the page is mapped with the same semantics + * in both guest and host. + */ +#define PAGE_PASSTHROUGH 0x0800 + +#endif diff --git a/include/semihosting/uaccess.h b/include/semihosting/uaccess.h index dd289af8dd..c2fa5a655d 100644 --- a/include/semihosting/uaccess.h +++ b/include/semihosting/uaccess.h @@ -17,6 +17,7 @@ #include "exec/cpu-common.h" #include "exec/cpu-defs.h" #include "exec/tswap.h" +#include "exec/page-protection.h" #define get_user_u64(val, addr) \ ({ uint64_t val_ = 0; \ diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a550bcd25f..c17264c239 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -26,6 +26,7 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h" #include "exec/gdbstub.h" +#include "exec/page-protection.h" #include "qapi/qapi-types-common.h" #include "target/arm/multiprocessing.h" #include "target/arm/gtimer.h" diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 601c0b533f..98b41a970c 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -20,6 +20,7 @@ #include "exec/breakpoint.h" #include "hw/registerfields.h" +#include "exec/page-protection.h" /* PM instructions */ typedef enum { diff --git a/target/ppc/mmu-radix64.h b/target/ppc/mmu-radix64.h index 4c768aa5cc..c5c04a1527 100644 --- a/target/ppc/mmu-radix64.h +++ b/target/ppc/mmu-radix64.h @@ -3,6 +3,8 @@ #ifndef CONFIG_USER_ONLY +#include "exec/page-protection.h" + /* Radix Quadrants */ #define R_EADDR_MASK 0x3FFFFFFFFFFFFFFF #define R_EADDR_VALID_MASK 0xC00FFFFFFFFFFFFF diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 953c437ba9..cdb3e12dfb 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -21,6 +21,7 @@ #include "qemu/main-loop.h" #include "hw/core/tcg-cpu-ops.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/memory.h" #include "exec/cpu_ldst.h" #include "exec/cputlb.h" diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index da39a43bd8..19ae6793f3 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -23,6 +23,7 @@ #include "exec/cputlb.h" #include "exec/log.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/tb-flush.h" #include "exec/translate-all.h" #include "sysemu/tcg.h" diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index a81e3cc920..d34313a612 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -25,6 +25,7 @@ #include "qemu/rcu.h" #include "exec/cpu_ldst.h" #include "exec/translate-all.h" +#include "exec/page-protection.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" #include "trace/trace-root.h" diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index c785615392..f3a4f1712d 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -17,6 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" +#include "exec/page-protection.h" #include "qemu.h" diff --git a/bsd-user/signal.c b/bsd-user/signal.c index b2faf1d0dd..8b6654b91d 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qemu.h" +#include "exec/page-protection.h" #include "user/tswap-target.h" #include "gdbstub/user.h" #include "signal-common.h" diff --git a/cpu-target.c b/cpu-target.c index f88649c299..5af120e8aa 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -21,6 +21,7 @@ #include "qapi/error.h" #include "exec/target_page.h" +#include "exec/page-protection.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "qemu/error-report.h" diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index e18f57efce..73f80cf706 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -15,6 +15,7 @@ #include "qemu/units.h" #include "qemu/datadir.h" #include "qemu/error-report.h" +#include "exec/page-protection.h" #include "net/net.h" #include "hw/pci/pci.h" #include "hw/boards.h" diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index d42b677898..8dc75fb9f0 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -21,6 +21,7 @@ #include "kvm_ppc.h" #include "sysemu/device_tree.h" #include "sysemu/block-backend.h" +#include "exec/page-protection.h" #include "hw/loader.h" #include "elf.h" #include "exec/memory.h" diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index d02f330650..c49da1f46f 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/datadir.h" #include "qemu/units.h" +#include "exec/page-protection.h" #include "cpu.h" #include "hw/sysbus.h" #include "hw/char/serial.h" diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index db1a41e27f..ec665862d9 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -24,6 +24,7 @@ #include "cpu_loop-common.h" #include "signal-common.h" #include "semihosting/common-semi.h" +#include "exec/page-protection.h" #include "target/arm/syndrome.h" #define get_user_code_u32(x, gaddr, env) \ diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 41fae2b520..746e22b275 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -8,6 +8,7 @@ #include "qemu.h" #include "user/tswap-target.h" +#include "exec/page-protection.h" #include "user/guest-base.h" #include "user-internals.h" #include "signal-common.h" diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 66a1631094..72b30279a2 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -20,6 +20,7 @@ #include #include "trace.h" #include "exec/log.h" +#include "exec/page-protection.h" #include "qemu.h" #include "user-internals.h" #include "user-mmap.h" diff --git a/linux-user/signal.c b/linux-user/signal.c index 05dc4afb52..63ac2df53b 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "qemu/bitops.h" #include "gdbstub/user.h" +#include "exec/page-protection.h" #include "hw/core/tcg-cpu-ops.h" #include diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 41659b63f5..6a492c9d35 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -25,6 +25,7 @@ #include "qemu/plugin.h" #include "tcg/startup.h" #include "target_mman.h" +#include "exec/page-protection.h" #include #include #include diff --git a/system/physmem.c b/system/physmem.c index 1a81c226ba..44e477a1a5 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -31,6 +31,7 @@ #endif /* CONFIG_TCG */ #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/target_page.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" diff --git a/target/alpha/helper.c b/target/alpha/helper.c index c5e4958f8b..2f1000c99f 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -21,6 +21,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "fpu/softfloat-types.h" #include "exec/helper-proto.h" #include "qemu/qemu-print.h" diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 31ae43f60e..4476b32ff5 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -11,6 +11,7 @@ #include "qemu/range.h" #include "qemu/main-loop.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "cpu.h" #include "internals.h" #include "cpu-features.h" diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index d1f1e02acc..23d7f73035 100644 --- a/target/arm/tcg/m_helper.c +++ b/target/arm/tcg/m_helper.c @@ -16,6 +16,7 @@ #include "qemu/bitops.h" #include "qemu/log.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #ifdef CONFIG_TCG #include "exec/cpu_ldst.h" #include "semihosting/common-semi.h" diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index d971b81370..037ac6dd60 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "internals.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/ram_addr.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h" diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 6853f58c19..dd49e67d7a 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "internals.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" diff --git a/target/avr/helper.c b/target/avr/helper.c index eeca415c43..345708a1b3 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -24,6 +24,7 @@ #include "cpu.h" #include "hw/core/tcg-cpu-ops.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "exec/address-spaces.h" #include "exec/helper-proto.h" diff --git a/target/cris/mmu.c b/target/cris/mmu.c index c25c31c9f8..d51008c541 100644 --- a/target/cris/mmu.c +++ b/target/cris/mmu.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "mmu.h" #ifdef DEBUG diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 84785b5a5c..d09877afd7 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -21,6 +21,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/helper-proto.h" #include "hw/core/cpu.h" #include "trace.h" diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 42fa480950..6d45611888 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -22,6 +22,7 @@ #include "disas/disas.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "tcg/tcg-op.h" #include "tcg/tcg-op-gvec.h" #include "exec/helper-proto.h" diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c index 7a57b7dd10..8fb05b1f53 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "exec/cpu_ldst.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "tcg/helper-tcg.h" typedef struct TranslateParams { diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c index 57f5308632..d6331f9b0b 100644 --- a/target/loongarch/tcg/tlb_helper.c +++ b/target/loongarch/tcg/tlb_helper.c @@ -13,6 +13,7 @@ #include "internals.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "exec/log.h" #include "cpu-csr.h" diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 7a91f33b17..7967ad13cb 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "gdbstub/helpers.h" diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index ff5f86ddc2..5d3259ce31 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "qemu/host-utils.h" #include "exec/log.h" diff --git a/target/microblaze/mmu.c b/target/microblaze/mmu.c index 234006634e..2423ac6172 100644 --- a/target/microblaze/mmu.c +++ b/target/microblaze/mmu.c @@ -22,6 +22,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" static unsigned int tlb_decode_size(unsigned int f) { diff --git a/target/mips/sysemu/physaddr.c b/target/mips/sysemu/physaddr.c index 5c5184e136..505781d84c 100644 --- a/target/mips/sysemu/physaddr.c +++ b/target/mips/sysemu/physaddr.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "../internal.h" static int is_seg_am_mapped(unsigned int am, bool eu, int mmu_idx) diff --git a/target/mips/tcg/sysemu/tlb_helper.c b/target/mips/tcg/sysemu/tlb_helper.c index 119eae771e..3ba6d369a6 100644 --- a/target/mips/tcg/sysemu/tlb_helper.c +++ b/target/mips/tcg/sysemu/tlb_helper.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "internal.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "exec/log.h" #include "exec/helper-proto.h" diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c index 603c26715e..c632d5230b 100644 --- a/target/openrisc/mmu.c +++ b/target/openrisc/mmu.c @@ -22,6 +22,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "gdbstub/helpers.h" #include "qemu/host-utils.h" #include "hw/loader.h" diff --git a/target/ppc/mmu-hash32.c b/target/ppc/mmu-hash32.c index 3976416840..6dfedab11d 100644 --- a/target/ppc/mmu-hash32.c +++ b/target/ppc/mmu-hash32.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "sysemu/kvm.h" #include "kvm_ppc.h" #include "internal.h" diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index d645c0bb94..5a0d80feda 100644 --- a/target/ppc/mmu-hash64.c +++ b/target/ppc/mmu-hash64.c @@ -21,6 +21,7 @@ #include "qemu/units.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "sysemu/hw_accel.h" diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index 690dff7a49..8daf71d2db 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" #include "kvm_ppc.h" diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index 751403f1c8..4fde7fd3bf 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -25,6 +25,7 @@ #include "mmu-hash64.h" #include "mmu-hash32.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/log.h" #include "helper_regs.h" #include "qemu/error-report.h" diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index c071b4d5e2..b35a93c198 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -25,6 +25,7 @@ #include "mmu-hash64.h" #include "mmu-hash32.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/log.h" #include "helper_regs.h" #include "qemu/error-report.h" diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index fc090d729a..8ad546a45a 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -24,6 +24,7 @@ #include "internals.h" #include "pmu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "instmap.h" #include "tcg/tcg-op.h" #include "trace.h" diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index 2a76b611a0..9eea397e72 100644 --- a/target/riscv/pmp.c +++ b/target/riscv/pmp.c @@ -25,6 +25,7 @@ #include "cpu.h" #include "trace.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" static bool pmp_write_cfg(CPURISCVState *env, uint32_t addr_index, uint8_t val); diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index fa139040f8..1b4d5a8e37 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -23,6 +23,7 @@ #include "exec/memop.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" +#include "exec/page-protection.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "tcg/tcg-gvec-desc.h" diff --git a/target/rx/cpu.c b/target/rx/cpu.c index e3dfb09722..c1a592e893 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "migration/vmstate.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "hw/loader.h" #include "fpu/softfloat.h" #include "tcg/debug-assert.h" diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index fbb2f1b4d4..f3a2f25a5c 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -24,6 +24,7 @@ #include "sysemu/kvm.h" #include "sysemu/tcg.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "trace.h" #include "hw/hw.h" #include "hw/s390x/storage-keys.h" diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 557831def4..6a308c5553 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -25,6 +25,7 @@ #include "tcg_s390x.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "hw/core/tcg-cpu-ops.h" #include "qemu/int128.h" diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 7c6f9d374a..6702910627 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/log.h" #if !defined(CONFIG_USER_ONLY) diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 2846a86cc4..7bdf99e0c0 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -23,6 +23,7 @@ #include "tcg/tcg.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "asi.h" diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index ad1591d9fd..9ff06026b8 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -21,6 +21,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "qemu/qemu-print.h" #include "trace.h" diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 76bd226370..7014255f77 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -20,6 +20,7 @@ #include "hw/registerfields.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "fpu/softfloat-helpers.h" #include "qemu/qemu-print.h" diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c index 47063b0a57..997b21d389 100644 --- a/target/xtensa/mmu_helper.c +++ b/target/xtensa/mmu_helper.c @@ -33,6 +33,7 @@ #include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #define XTENSA_MPU_SEGMENT_MASK 0x0000001f #define XTENSA_MPU_ACC_RIGHTS_MASK 0x00000f00 diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c index 496754ba57..028d4e0a1c 100644 --- a/target/xtensa/op_helper.c +++ b/target/xtensa/op_helper.c @@ -28,6 +28,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/page-protection.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" #include "qemu/atomic.h" From patchwork Mon May 6 12:37:06 2024 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: 795003 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901508wra; Mon, 6 May 2024 05:39:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXtTOrLzA6qPAGIM3JQMsCiOpYqrl7Zz7QacUzRdm4GmnzKp8KSKrPblhQ4XiRilzOO4tZQ4MkUpVtbAF9BQoqx X-Google-Smtp-Source: AGHT+IEQdtbErDFdFl/K/2NzRwcpHdZ8V3ysydc8kq1kBXq8kGHGzMxLVVyV6m7uymi9yDgvGU7G X-Received: by 2002:a05:620a:3709:b0:790:945e:6f0 with SMTP id de9-20020a05620a370900b00790945e06f0mr13028230qkb.55.1714999180149; Mon, 06 May 2024 05:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999180; cv=none; d=google.com; s=arc-20160816; b=KX/gQyLN1tSHCeHLFDKZxAkj4Dl3zMKTqVSR6a59qnIp62rRoKhWEc7gjRtejn2MNK HM2pgDRNEL4PUUO7q+IihG/pDunb7FgVsbmwaFIpo539gFHsIgUq35KmekpwBDcF5IZR YNCbnk4DJ7dkwjzloWhj3IpnD6DQMrVhYiySB07rBtNxbOJm0/Gpz2HYn583Al4fIm2M VOB9eI91rizYutulbPmo38XRlgrlKomniTrckBv180qqKzUzw+ka1yUKY2RCFitQ75gC EWXt9jgk8lnKGoOnDiwlk4vfyBJYWelnPT63wbiPWXze0sTVhEaz07hSHAhx2551/qHi FKgA== 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=1xKUlJq4altC6gXgMzk8h7ZuMjWZxGoEWR8S+Y8f728=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=CODbvsIAxTPTakXXLxARIAIQgLCngGxeD0jZGBwkrmVDd5qyEn/K7dPJfbiA6yIZAZ 4HBXByO/PHSvoC+XtNz9T5SRbU5ea/Ov7O/D3lDvNi4Qv+71qB+5XX/ISHVvo+JIjq3H kY7k/jAN8vbGHCqSVU6IprChKjxcc7rMjkhGmC+nG2KeRxk6jMaCNG0ansnKZCuZT8cn cMMOUcQXIQrtTcLPN+pTxZdOyc5p47TGAi2depWZ8LKiaaaZZ93Qp0y/y+luHJWoR24o pIpqZdWe8gfvHnVNLQtYlFFrIsUMBeJjktDI+/85Znam7rBR50Dy5nLCa1BMVNPiw8Xd XbPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uR1rA6Ba; 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 bq36-20020a05620a46a400b0078ef1622a70si9895617qkb.68.2024.05.06.05.39.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:40 -0700 (PDT) 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=uR1rA6Ba; 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 1s3xcW-0002SA-KR; Mon, 06 May 2024 08:39:04 -0400 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 1s3xbz-0001KQ-AZ for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:31 -0400 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 1s3xbr-00020O-Mo for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:31 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41ba1ba5592so12608155e9.1 for ; Mon, 06 May 2024 05:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999101; x=1715603901; 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=1xKUlJq4altC6gXgMzk8h7ZuMjWZxGoEWR8S+Y8f728=; b=uR1rA6Ba6NGMxIpkAdx2yWzANPGRl/9JGOYUIoccvpKV4eaEuoCszad4gxByHItzyh LWfXBoMmAlwD6ukzkzxGDnhN2paOp2o2AIndC/mSnNJaa4cZ11jrelZo2vjD0zKgoEie PQEjNSuGB42XChxly+3lTz6ocOZqM100FhLznMESKjoayF2JyTyBjciwAhpjMKz+ITVu UYIGpai87y7C7/u6tF5QztokE6KPn+VJ8b0Ft6jmVGpvMsyVVRbvKyihNTktZ/oyEYVe GRGQNNir8JGvRtAS2dY/x/oyWbhxkYiGiXHp3D5yRKiSyIA569shvtz/vID0bu/ESept h4/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999101; x=1715603901; 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=1xKUlJq4altC6gXgMzk8h7ZuMjWZxGoEWR8S+Y8f728=; b=I3VGreDmyDe4D96GL67DbW320nKr6su+MBddhohmRJDc7txbhZNAd1dANt3Vk9S3Nf s6zdYHC5UOobkOMRfb+rst5cCS7FXT61D8C7mDLrQRR0GOeXRFUSVlZdXVSs5eJyFQjd aGyNgjpqdRlPJKrYIG3PyPuC1mBEIUeTo9bhC3gekJEOT92ALtH3EPMUOEM5MDmicjsT ahNTB6wFuiq5E1p5FeMTKjhTqBEP7ouWe2F7vp+bXJrA/lsa3jqWmU4X+x+1q1+Gu0qa q/FeO+3U/GU+4Lbg2dhUfdFSLB1TgwCLDVblWofWynucsVw89n2ENtfJE2Ytdj8g6l3q EDWQ== X-Gm-Message-State: AOJu0YzWOH58T2m93wRDd6xXNOwUp1LAEvtgfGPYAAr6BgpXYSvILcBa gBTKeDmSKgpNYwNExD+aDTNQrlXi++iwygZLGAhMJzhqG8vbkzRg7soNdTBKJ2arNaXWsZO2flS G X-Received: by 2002:adf:f6c6:0:b0:34d:963a:12cf with SMTP id y6-20020adff6c6000000b0034d963a12cfmr9146299wrp.50.1714999101595; Mon, 06 May 2024 05:38:21 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id c4-20020a5d5284000000b0034b1a91be72sm10608400wrv.14.2024.05.06.05.38.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 06/28] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_tb() Date: Mon, 6 May 2024 14:37:06 +0200 Message-ID: <20240506123728.65278-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 Do not open-code cpu_loop_exit_requested(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428214915.10339-9-philmd@linaro.org> --- accel/tcg/cpu-exec.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 225e5fbd3e..c18a7e2b85 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -900,8 +900,6 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, vaddr pc, TranslationBlock **last_tb, int *tb_exit) { - int32_t insns_left; - trace_exec_tb(tb, pc); tb = cpu_tb_exec(cpu, tb, tb_exit); if (*tb_exit != TB_EXIT_REQUESTED) { @@ -910,8 +908,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, } *last_tb = NULL; - insns_left = qatomic_read(&cpu->neg.icount_decr.u32); - if (insns_left < 0) { + if (cpu_loop_exit_requested(cpu)) { /* Something asked us to stop executing chained TBs; just * continue round the main loop. Whatever requested the exit * will also have set something else (eg exit_request or @@ -928,7 +925,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, /* Ensure global icount has gone forward */ icount_update(cpu); /* Refill decrementer and continue execution. */ - insns_left = MIN(0xffff, cpu->icount_budget); + int32_t insns_left = MIN(0xffff, cpu->icount_budget); cpu->neg.icount_decr.u16.low = insns_left; cpu->icount_extra = cpu->icount_budget - insns_left; From patchwork Mon May 6 12:37:07 2024 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: 795001 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901476wra; Mon, 6 May 2024 05:39:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUY0Dfc3D6JMhw9Uh75qqDjWo9/2B9M+PEAoskSTV28sbmQdxD3IzsOEmFrzUOxUpDbpuxdWYIMJNSVXivjPTRs X-Google-Smtp-Source: AGHT+IFnzlehHvnK5C97Zxqyy/IWSxuFjP3dKuvxDUvMLay4i/2dCHd0Ucxl+elfEwTL2cg3ytpu X-Received: by 2002:a05:622a:454:b0:43a:a8ad:7954 with SMTP id o20-20020a05622a045400b0043aa8ad7954mr11527620qtx.28.1714999175358; Mon, 06 May 2024 05:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999175; cv=none; d=google.com; s=arc-20160816; b=VbDWqmk5Ql0NPAkNlpkPNRQXq/vL2AyI2xO0yQPKcqiGOl9S0eFNaWArakwGhVpxlp e+e/LdwuY+Jfzh7dJROYj8LSwtbfb7h6IlWm/MGrTDouqhUDy4sA+hiusNu2J/7S3Myy XZaund0WAs29oLH566+770tGXsyb0EzvwUbN6n38XAL8YjCknobaEdb2zvCSbY1JiHvN GltdgdthAx+hjXqX4H6rTm7c5VVIUAoKKkyoFxTvfb4yDwVQyEorSoLGx4iJtaaY8dqh bTTjflGHOb/BuGBGk+HfykymPf7TDcRmAIOluwUNR+aa9LGaaXTmOABRRes/wphPN/9n ec4w== 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=L6uicuNXM1zCeQNR1mjKMJ1odcYWti2ZKucvzgTpxJI=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=dhewR5boFr+2og7/nmpsJj4PsvBjr7fXjAdctboVLm7+wzb5IrU8o2tvALyvVBp3Fd jjiMfjDxu+0UxcwjKl0cu8S5QhmFUpv0wTGECoGRnCyAjrcpdZiPt76OyC+V1h+s+KLs DBrxmtCbiNwQEedNAv54OIxgJgMBX3ZmMudWGvgcbOzwg/jYVA2nqwXChSQyT3jm6tkD P/Ly+t130ZXVuprHfvW99zpABdBWmG8iSXIT6P8w6yDRTK9pg0ZGFtCXgY61qB9r1ALN zaS0VRXFvBvwkxfhx78DeIR9anq+pPwVnk7uXSJ+O6eh9Tm9imLSvrVoVPwn3I619KVg nWAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aVVKqajL; 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 ec10-20020a05622a5b8a00b0043afbd13035si7274600qtb.695.2024.05.06.05.39.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:35 -0700 (PDT) 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=aVVKqajL; 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 1s3xcN-0001zG-Mw; Mon, 06 May 2024 08:38:56 -0400 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 1s3xc0-0001QX-AV for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:39 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xbx-00021E-I8 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:31 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-34c1fff534fso1594354f8f.1 for ; Mon, 06 May 2024 05:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999107; x=1715603907; 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=L6uicuNXM1zCeQNR1mjKMJ1odcYWti2ZKucvzgTpxJI=; b=aVVKqajLl6nPm7PthXunvITGSpQ9FcoHGHoH4Fq5B16xorYmaT2asspFujQfZj+dBF D5UC5GRxF5TXlGIHQwipNWVaKit6E+QKeND2b9KwDMmVrGCf1tfgXd1VswFtizvEiG8w oMAdKDvfRlxvoPmWq8UvsOgIUM2nQjcwH+2Gx02yc9vlCHxuaIj4P5Ubwml3a4G2gOmw KekDRQ+MkfQ3VwbGQ8rxi3OLtYL9gxbRnh9hSl5omvav1F+iBZWwXjGJsPp/osWwfKyR /yZVhRcjjUP7q0wiYaBMzHeoUZmLmR8oCzhex0xdRcwomWpIOhTc0WerJ6oj94HrXSWk 8a9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999107; x=1715603907; 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=L6uicuNXM1zCeQNR1mjKMJ1odcYWti2ZKucvzgTpxJI=; b=EYk5QsYu+/wJjAJt3Br3s82FYuwosOgRMt3Qvksy6yTZZth+eTS+b64oo0v8uWHZpM 5ad+bvSIsA3ZzZ6anotMgcP/JGwYcAxlIsRwRW54HiIBllCQN3YlnfwKT80cy2GBAzzs t0NdrguMB8q28dENhxuDp7jZf8upH5Th5YFC/hrlfwFkzJsR1Y4FCi6oknWHfs0Tg2c3 +1s1yOQ56NrBwH5DkM4iYlbGZ2BR7mxdPaw2shhdNKTJJGGIrUDJ8+flRw7pBFFxaZY/ /YUjEkTJn6SUwZyD3gP7nC1rkap6RcWHjOZ/d2UabbZ4APMPKKu6+HawBq0XgCxupJ2E fMxA== X-Gm-Message-State: AOJu0Ywdy7AbRVxlpx3RBRnYlHqfYMbUvyh7Z/7T6bZ5ddYgSfYuXpwU CBXWelRiEh429BI8yst6AXmlcUmRyOz2vqtRfo0aqhljpLMF/XouOoHftJpoVN9dNQgvZIlNAUm 0 X-Received: by 2002:a05:6000:1145:b0:347:9bec:9ba3 with SMTP id d5-20020a056000114500b003479bec9ba3mr6899527wrx.66.1714999107465; Mon, 06 May 2024 05:38:27 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id a7-20020adfed07000000b0034d839bed92sm10581414wro.64.2024.05.06.05.38.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 07/28] accel/tcg: Access tcg_cflags with getter / setter Date: Mon, 6 May 2024 14:37:07 +0200 Message-ID: <20240506123728.65278-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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 Access the CPUState::tcg_cflags via tcg_cflags_has() and tcg_cflags_set() helpers. Mechanical change using the following Coccinelle spatch script: @@ expression cpu; expression flags; @@ - cpu->tcg_cflags & flags + tcg_cflags_has(cpu, flags) @@ expression cpu; expression flags; @@ - (tcg_cflags_has(cpu, flags)) + tcg_cflags_has(cpu, flags) @@ expression cpu; expression flags; @@ - cpu->tcg_cflags |= flags; + tcg_cflags_set(cpu, flags); Then manually moving the declarations, and adding both tcg_cflags_has() and tcg_cflags_set() definitions. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240427155714.53669-15-philmd@linaro.org> --- accel/tcg/internal-common.h | 3 ++- include/exec/cpu-common.h | 7 +++++++ include/exec/exec-all.h | 3 --- accel/tcg/cpu-exec.c | 10 ++++++++++ accel/tcg/tcg-accel-ops.c | 2 +- linux-user/mmap.c | 8 ++++---- linux-user/syscall.c | 4 ++-- target/arm/cpu.c | 2 +- target/avr/cpu.c | 2 +- target/hexagon/cpu.c | 2 +- target/hppa/cpu.c | 2 +- target/i386/cpu.c | 2 +- target/i386/helper.c | 2 +- target/loongarch/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/tcg/exception.c | 2 +- target/mips/tcg/sysemu/special_helper.c | 2 +- target/openrisc/cpu.c | 2 +- target/riscv/tcg/tcg-cpu.c | 4 ++-- target/rx/cpu.c | 2 +- target/sh4/cpu.c | 4 ++-- target/sparc/cpu.c | 2 +- target/tricore/cpu.c | 2 +- 23 files changed, 44 insertions(+), 29 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index edefd0dcb7..ead53cb8a5 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -9,6 +9,7 @@ #ifndef ACCEL_TCG_INTERNAL_COMMON_H #define ACCEL_TCG_INTERNAL_COMMON_H +#include "exec/cpu-common.h" #include "exec/translation-block.h" extern int64_t max_delay; @@ -20,7 +21,7 @@ extern int64_t max_advance; */ static inline bool cpu_in_serial_context(CPUState *cs) { - return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs); + return !tcg_cflags_has(cs, CF_PARALLEL) || cpu_in_exclusive_context(cs); } #endif diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 78f2c381b1..8bc397e251 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -178,6 +178,13 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, void list_cpus(void); #ifdef CONFIG_TCG + +bool tcg_cflags_has(CPUState *cpu, uint32_t flags); +void tcg_cflags_set(CPUState *cpu, uint32_t flags); + +/* current cflags for hashing/comparison */ +uint32_t curr_cflags(CPUState *cpu); + /** * cpu_unwind_state_data: * @cpu: the cpu context diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 4c5e470581..2cd7b8f61b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -510,9 +510,6 @@ static inline void tb_set_page_addr1(TranslationBlock *tb, #endif } -/* current cflags for hashing/comparison */ -uint32_t curr_cflags(CPUState *cpu); - /* TranslationBlock invalidate API */ void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index c18a7e2b85..9af66bc191 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -147,6 +147,16 @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu) } #endif /* CONFIG USER ONLY */ +bool tcg_cflags_has(CPUState *cpu, uint32_t flags) +{ + return cpu->tcg_cflags & flags; +} + +void tcg_cflags_set(CPUState *cpu, uint32_t flags) +{ + cpu->tcg_cflags |= flags; +} + uint32_t curr_cflags(CPUState *cpu) { uint32_t cflags = cpu->tcg_cflags; diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 2c7b0cc09e..1433e38f40 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -62,7 +62,7 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel) cflags |= parallel ? CF_PARALLEL : 0; cflags |= icount_enabled() ? CF_USE_ICOUNT : 0; - cpu->tcg_cflags |= cflags; + tcg_cflags_set(cpu, cflags); } void tcg_cpu_destroy(CPUState *cpu) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 72b30279a2..4d09a72fad 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -960,8 +960,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int target_prot, */ if (ret != -1 && (flags & MAP_TYPE) != MAP_PRIVATE) { CPUState *cpu = thread_cpu; - if (!(cpu->tcg_cflags & CF_PARALLEL)) { - cpu->tcg_cflags |= CF_PARALLEL; + if (!tcg_cflags_has(cpu, CF_PARALLEL)) { + tcg_cflags_set(cpu, CF_PARALLEL); tb_flush(cpu); } } @@ -1400,8 +1400,8 @@ abi_ulong target_shmat(CPUArchState *cpu_env, int shmid, * supported by the host -- anything that requires EXCP_ATOMIC will not * be atomic with respect to an external process. */ - if (!(cpu->tcg_cflags & CF_PARALLEL)) { - cpu->tcg_cflags |= CF_PARALLEL; + if (!tcg_cflags_has(cpu, CF_PARALLEL)) { + tcg_cflags_set(cpu, CF_PARALLEL); tb_flush(cpu); } diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6a492c9d35..1b42e80f9a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6583,8 +6583,8 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, * generate code for parallel execution and flush old translations. * Do this now so that the copy gets CF_PARALLEL too. */ - if (!(cpu->tcg_cflags & CF_PARALLEL)) { - cpu->tcg_cflags |= CF_PARALLEL; + if (!tcg_cflags_has(cpu, CF_PARALLEL)) { + tcg_cflags_set(cpu, CF_PARALLEL); tb_flush(cpu); } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index fdc3eda318..77f8c9c748 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1941,7 +1941,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) #if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) /* Use pc-relative instructions in system-mode */ - cs->tcg_cflags |= CF_PCREL; + tcg_cflags_set(cs, CF_PCREL); #endif /* If we needed to query the host kernel for the CPU features diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 71ce62a4c2..f53e1192b1 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -55,7 +55,7 @@ static int avr_cpu_mmu_index(CPUState *cs, bool ifetch) static void avr_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu_env(cs)->pc_w = tb->pc / 2; /* internally PC points to words */ } diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index a56bb4b075..64cc05cca7 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -257,7 +257,7 @@ static vaddr hexagon_cpu_get_pc(CPUState *cs) static void hexagon_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu_env(cs)->gpr[HEX_REG_PC] = tb->pc; } diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 3831cb6db2..393a81988d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -48,7 +48,7 @@ static void hppa_cpu_synchronize_from_tb(CPUState *cs, { HPPACPU *cpu = HPPA_CPU(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); #ifdef CONFIG_USER_ONLY cpu->env.iaoq_f = tb->pc; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index aa3b2d8391..25c0702ca1 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7371,7 +7371,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) #if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) /* Use pc-relative instructions in system-mode */ - cs->tcg_cflags |= CF_PCREL; + tcg_cflags_set(cs, CF_PCREL); #endif if (cpu->apic_id == UNASSIGNED_APIC_ID) { diff --git a/target/i386/helper.c b/target/i386/helper.c index 23ccb23a5b..48d1513a35 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -523,7 +523,7 @@ static inline target_ulong get_memio_eip(CPUX86State *env) } /* Per x86_restore_state_to_opc. */ - if (cs->tcg_cflags & CF_PCREL) { + if (tcg_cflags_has(cs, CF_PCREL)) { return (env->eip & TARGET_PAGE_MASK) | data[0]; } else { return data[0] - env->segs[R_CS].base; diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 1ebba043f4..96da1a685e 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -336,7 +336,7 @@ static bool loongarch_cpu_exec_interrupt(CPUState *cs, int interrupt_request) static void loongarch_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); set_pc(cpu_env(cs), tb->pc); } diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 9eb7374ccd..41ad47d04c 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -99,7 +99,7 @@ static void mb_cpu_synchronize_from_tb(CPUState *cs, { MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu->env.pc = tb->pc; cpu->env.iflags = tb->flags & IFLAGS_TB_MASK; } diff --git a/target/mips/tcg/exception.c b/target/mips/tcg/exception.c index 13275d1ded..4886d087b2 100644 --- a/target/mips/tcg/exception.c +++ b/target/mips/tcg/exception.c @@ -81,7 +81,7 @@ void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { CPUMIPSState *env = cpu_env(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); env->active_tc.PC = tb->pc; env->hflags &= ~MIPS_HFLAG_BMASK; env->hflags |= tb->flags & MIPS_HFLAG_BMASK; diff --git a/target/mips/tcg/sysemu/special_helper.c b/target/mips/tcg/sysemu/special_helper.c index 5baa25348e..9ce5e2ceac 100644 --- a/target/mips/tcg/sysemu/special_helper.c +++ b/target/mips/tcg/sysemu/special_helper.c @@ -93,7 +93,7 @@ bool mips_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb) CPUMIPSState *env = cpu_env(cs); if ((env->hflags & MIPS_HFLAG_BMASK) != 0 - && !(cs->tcg_cflags & CF_PCREL) && env->active_tc.PC != tb->pc) { + && !tcg_cflags_has(cs, CF_PCREL) && env->active_tc.PC != tb->pc) { env->active_tc.PC -= (env->hflags & MIPS_HFLAG_B16 ? 2 : 4); env->hflags &= ~MIPS_HFLAG_BMASK; return true; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index d711035cf5..fdaaa09fc8 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -45,7 +45,7 @@ static void openrisc_cpu_synchronize_from_tb(CPUState *cs, { OpenRISCCPU *cpu = OPENRISC_CPU(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu->env.pc = tb->pc; } diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index b5b95e052d..40054a391a 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -96,7 +96,7 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs, CPURISCVState *env = &cpu->env; RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); if (xl == MXL_RV32) { env->pc = (int32_t) tb->pc; @@ -890,7 +890,7 @@ static bool riscv_tcg_cpu_realize(CPUState *cs, Error **errp) CPURISCVState *env = &cpu->env; Error *local_err = NULL; - CPU(cs)->tcg_cflags |= CF_PCREL; + tcg_cflags_set(CPU(cs), CF_PCREL); if (cpu->cfg.ext_sstc) { riscv_timer_init(cpu); diff --git a/target/rx/cpu.c b/target/rx/cpu.c index c1a592e893..8a584f0a11 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -46,7 +46,7 @@ static void rx_cpu_synchronize_from_tb(CPUState *cs, { RXCPU *cpu = RX_CPU(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu->env.pc = tb->pc; } diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 43e35ec2ca..618aa7154e 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -47,7 +47,7 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs, { SuperHCPU *cpu = SUPERH_CPU(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu->env.pc = tb->pc; cpu->env.flags = tb->flags & TB_FLAG_ENVFLAGS_MASK; } @@ -74,7 +74,7 @@ static bool superh_io_recompile_replay_branch(CPUState *cs, CPUSH4State *env = cpu_env(cs); if ((env->flags & (TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND)) - && !(cs->tcg_cflags & CF_PCREL) && env->pc != tb->pc) { + && !tcg_cflags_has(cs, CF_PCREL) && env->pc != tb->pc) { env->pc -= 2; env->flags &= ~(TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND); return true; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 485d416925..685485c654 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -702,7 +702,7 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs, { SPARCCPU *cpu = SPARC_CPU(cs); - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu->env.pc = tb->pc; cpu->env.npc = tb->cs_base; } diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 8f9b72c3a0..bdefb84511 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -47,7 +47,7 @@ static vaddr tricore_cpu_get_pc(CPUState *cs) static void tricore_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { - tcg_debug_assert(!(cs->tcg_cflags & CF_PCREL)); + tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); cpu_env(cs)->PC = tb->pc; } From patchwork Mon May 6 12:37:08 2024 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: 795006 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901575wra; Mon, 6 May 2024 05:39:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWwfkoQSLS3LRgctBNPEi4bL9JRXBemtdqSVTO1ydBgAMBluPPs5Sd44NB3lRbtHYVMyK4q9v0FkbwQSeDA0M+h X-Google-Smtp-Source: AGHT+IGosURUIKwIxPlZ51CyF48AfQfaoW6DCn5hetiEzWG/vSPgOt0nfhfuvy5Mfi7Nz+7Rmstz X-Received: by 2002:a05:6830:2b20:b0:6f0:2a66:3391 with SMTP id l32-20020a0568302b2000b006f02a663391mr7267751otv.11.1714999188579; Mon, 06 May 2024 05:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999188; cv=none; d=google.com; s=arc-20160816; b=vd/uuLLJ1fFfVuNlnreuKXtjS6Eer8k9Af25QEW3izZsdrXvN1B74LErROzdk7IQoo TeHTmROC5LrZvFzDbTrJwscPw/YFBxgNr3Jm8jDxWb6DwoZ2M2CcUTZjCoNUkNasAXTq KkOR+mwQfLAYfwSR2QrIKmZdOlnuZkFUwt5ML3QpZr4IIvlVpKPaT0lzN+fGWQ7UOfEj RFgCE0uh+QNc6Qao22mmD1YclEUqiRst2CsxxDgmoVslgfJVIXbQth0PvjFdSC8Ca6Pn AYv9mHYmTcg8ZfCubpsZ5ipQOSQ6LA+P5IAXa7YiKsYMcjSLNgk4NETonIaLKnaOmJkL /SFg== 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=JRaulFrVbkjbtSZtw7OLq918oPDYvf4Hs2z9z8eLBTc=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=i0DWTftSB9QyRpMJNdWLkS1moBVQKtlsYuQrylh+WrwsOHm/chjRYmYnkJfZMJROPw iSMj5gMxaMTRKjkraT2DLFjK380q5gcAnMENNRSXJaoQ19vIRDEsGe1eCTQvEQybJ4/B S7Ud1K02WPe4GJNGmN/GqTZFKSyNGAfmvinsjtb8c7abqUZT/SXxpgSQKbEPnZMbsLFK RhXLRoYx9kaXXNAY4ldJhbxppaPIoamlaAXfYXLxoqNxK6Fy/oyqs3aIRGCemaQvBupr QOgcD2yCSHkQdJ8WqND+5f1jMP9yHG+xjVEnOx+BkGivJhYk51H+aeKO1nLbEl2fQHRf Z50w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gzmMQyf8; 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 19-20020ac85753000000b0043adac956cfsi8943792qtx.88.2024.05.06.05.39.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:48 -0700 (PDT) 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=gzmMQyf8; 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 1s3xcY-0002ii-Tk; Mon, 06 May 2024 08:39:06 -0400 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 1s3xc6-0001l7-1I for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:42 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xc4-00021p-Ey for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:37 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-34f0e55787aso822513f8f.2 for ; Mon, 06 May 2024 05:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999113; x=1715603913; 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=JRaulFrVbkjbtSZtw7OLq918oPDYvf4Hs2z9z8eLBTc=; b=gzmMQyf8Bi7+T1ssq1FFZpGVmwXjQ1SyOVcFtj44J9XMJ+lPD92ipdMRvjoh2dJq/E JqKatqH62UrNSivCLLeeuRRMKbEsDc/SYyGFuqyL5iybyUVQsnYgAcWn/1sMUdfHjCpP dxLZR/mX2rDS+61NzXaAfLUm/qsMhFP0QFJjXX1KmtphAgC8AOj2bAke3Zvt2F3fdltE iS3ck5A5Ud57MJXybtilKqnCyfz4Y2pQXqvMbxcbSXRqX1Lb6+k1q6in0GNEH/r2uMv+ sIyw+il1TdJxQCvs4GUlhuCBMXXjM0+ezFJ4Af1M9ebd8F/cQbDlG3ub7xAhwvhwMbTQ bmsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999113; x=1715603913; 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=JRaulFrVbkjbtSZtw7OLq918oPDYvf4Hs2z9z8eLBTc=; b=D1rA7ev9YHMgdiix5plVHYyuZ39KUyjw92hG9olvANWU6MFiIv9QWC2dCOhBUZJYGC Z2HxT6LPetRyhT4ij+SEE8ZLRMUltp5tCDr5q7hIgvEYzRaUuZI1IV+5J5I4VmZek25D yh2nkhyR4RYcYaTdXZza4S9XE+OLZzmXF2pgugpS7BZs8oynpkHgBiUipSkdJheXCdZd 28wWDwMDqHKA3+e3Kd2IHzRxOMVkBEnIJ5qJDg0ZkBePA92WKdc9y1fO/qwlH1m5x415 R9mrXxwPdNTrSWSIvacmkAqe9iFhNOVs0qsIuzbStXsnY4pNmgn0nX4/J3VfDYfcFkIM TvZg== X-Gm-Message-State: AOJu0Yzs9t8+k7j858anM/h3EQ5Af//RitesmnAbw+0PNe6wWxGPxiKP YzegMukD3motPJT0nnvakgpknI7hq+NIvshizBcexssKkn3zpXdpeuSAB3q0dPGQCWEnKmgzvke n X-Received: by 2002:a5d:678b:0:b0:348:b435:273b with SMTP id v11-20020a5d678b000000b00348b435273bmr7293332wru.54.1714999113584; Mon, 06 May 2024 05:38:33 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id g4-20020a5d5404000000b0034ca136f0e9sm10605321wrv.88.2024.05.06.05.38.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 08/28] accel/tcg: Move user definition of cpu_interrupt() to user-exec.c Date: Mon, 6 May 2024 14:37:08 +0200 Message-ID: <20240506123728.65278-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-4-philmd@linaro.org> --- accel/tcg/translate-all.c | 9 --------- accel/tcg/user-exec.c | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 83cc14fbde..fdf6d8ac19 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -644,15 +644,6 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) cpu_loop_exit_noexc(cpu); } -#else /* CONFIG_USER_ONLY */ - -void cpu_interrupt(CPUState *cpu, int mask) -{ - g_assert(bql_locked()); - cpu->interrupt_request |= mask; - qatomic_set(&cpu->neg.icount_decr.u16.high, -1); -} - #endif /* CONFIG_USER_ONLY */ /* diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index d34313a612..80d24540ed 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -24,6 +24,7 @@ #include "qemu/bitops.h" #include "qemu/rcu.h" #include "exec/cpu_ldst.h" +#include "qemu/main-loop.h" #include "exec/translate-all.h" #include "exec/page-protection.h" #include "exec/helper-proto.h" @@ -38,6 +39,13 @@ __thread uintptr_t helper_retaddr; //#define DEBUG_SIGNAL +void cpu_interrupt(CPUState *cpu, int mask) +{ + g_assert(bql_locked()); + cpu->interrupt_request |= mask; + qatomic_set(&cpu->neg.icount_decr.u16.high, -1); +} + /* * Adjust the pc to pass to cpu_restore_state; return the memop type. */ From patchwork Mon May 6 12:37:09 2024 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: 794999 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901417wra; Mon, 6 May 2024 05:39:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVvmirchebYpiFfkC7CtVW6f/PnOJem2upE6f5xyL2cwBc3cdjdFaZi0Lt9B6I1OAvIPdJuTWiZW3EZetEO15Rr X-Google-Smtp-Source: AGHT+IE8xAwAIBYSdHhdeNMJjRlxOok/gwbIPhbe1S0MxKgfGAxAs0jBpnoybj2D/+aj70nQuxGE X-Received: by 2002:ac8:5fc7:0:b0:43a:cfd5:c8f5 with SMTP id k7-20020ac85fc7000000b0043acfd5c8f5mr12583002qta.41.1714999168146; Mon, 06 May 2024 05:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999168; cv=none; d=google.com; s=arc-20160816; b=YXAgKSFTVCoVoab3gRFDh+6uYCSRUbY1ugWdZSxQCCt7+fWEB16pgSeYSLN40ZYqU5 NKga287WOaCGdQaWVKRtbBpa4GddXTA3m4pfcmMeH/dBTPC8u4icbernWZzs7aX+Omm+ kQUtIGEXLyy3zlhRAveJ4vrhj1mVwLCQ3FmaDn3pSMldK4h/DOFGzCAeKcHYBLEfil6O GzTYSN0HaKy+SKFlnw4sZi1J/yMm0CshoaUZvTCj6hZg8AlyxqpmjFIs0bIp7S1iDDbV k4idUy3Ptqe8OZY+ZwtwZLk3Dt4Lc367FdhDQ9lIlSDDV6Vv7yxm/ME06tKxpiPBfsEX oTJw== 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=NLt7aSiKdJSjR9IsbCYiGtAu0ptRlqr/9IF1r+scoR0=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=RrL1lPrJuxGv/7Gbp4ZISdSsWRzNDJmnv0LNFdzIoDRcPVZL5xADXtxXFYK1a5n6kH NDPb5LyK6Na9o+VZCboBh3GfZyBayUfswgwDttz+WcehDOJZvbOko7Ty403SJMswEKdL 7QWed1ZA/75gcamvo/YVlC42yvxu3Uj2fF3snsi0A9BKAL7L0bLpmujORVquWeq9c7ke kmJhmmTZH3viwWc6mWsvVgF4OuVoQmXGCX6fo/uZ0pyLjVQ8075E1GD+RQuRTHBUS09n +OaHPGBaAMZOOlorTr1UNy9Y87RTSNOezXZhXveFXXVaqoeSOAP6bGnPl11nHZawzDh1 eTcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nx723U75; 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 y19-20020ac85f53000000b00436969aaa1esi9628594qta.171.2024.05.06.05.39.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:28 -0700 (PDT) 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=Nx723U75; 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 1s3xca-0002u2-Mt; Mon, 06 May 2024 08:39:08 -0400 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 1s3xcJ-00022Z-Lw for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:54 -0400 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 1s3xc9-00022v-P2 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:51 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41b21ed19f5so12254555e9.2 for ; Mon, 06 May 2024 05:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999119; x=1715603919; 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=NLt7aSiKdJSjR9IsbCYiGtAu0ptRlqr/9IF1r+scoR0=; b=Nx723U75kLSvie/QkmlkkjVVoOPQUFmsPm41nEbyn1lqj2SjlZdIUNMK5SDVLjmENg GWag2BUr7ZYcrbFaAS/Uhdx13VHR3JULs7NDc5MmYLiHkaOP/lb+aBDVi72dTdMo2Yql fpZQHFWhFxWkr3qJZFHn4FqJqqlpNcmlQ1upcV9K2V4BAmS2hnrb3YM+Jy/ZN7wYZwo9 bT1cx7ZvbSxAkPcpvE5L7pnUkVFKjPrnFZMGS89diRpBs65U2M8t4ULc3rkItNRzxC7x uAukOs0ew6sr8Va7lTPJYWFLt327+LZ1kHMVx5Z2ZmQ9pwITuOCuTITlw2CqeVenJ28Y GT6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999119; x=1715603919; 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=NLt7aSiKdJSjR9IsbCYiGtAu0ptRlqr/9IF1r+scoR0=; b=rIqMBQEDibugAJR1SiNrdDBpbXWsIO54NEPuhlPovpWc3WBtvpwlthF11v+N4oklDc LJ0DtY8JxkajTt3w2EAFC1cEhRjRnVEBz4MQpciHdjXYvH0McK3TkMc0zNueRsW2wbYA +rlDQLEfgLGez+0nc+Uv7JkS2O79D1B0hSzLuA4B+KPv3fajP58tCDK21ssLzWdY0cZA 5XkdVzynhZFtctWkX9JTm9qTBSQD0xuniQlf3HE/ZemMkRSxUATGzjibHQCpQCpZLTjb KvGV/l5rKSD6d5BkxcLTyO7G3cuCsMfNganWGagwmRbyvMCUb/fz0thmtToFHqBgcGUt etmg== X-Gm-Message-State: AOJu0YwISwC2rMNFCbT9LW3o6F49IIpYEsPZrB6CerojgGg65KLPo6qi PablkJNQZZkuP3qMUMvuRrR/q11Or6VI7eu3PVSyNUR9XIxB+bQ4xpI2FfTHDNuDrIBx08Hv5s9 4 X-Received: by 2002:a05:600c:4ed2:b0:41b:f30a:41f1 with SMTP id g18-20020a05600c4ed200b0041bf30a41f1mr8222863wmq.7.1714999119594; Mon, 06 May 2024 05:38:39 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id fl25-20020a05600c0b9900b0041e9c1d6f4esm6712931wmb.48.2024.05.06.05.38.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 09/28] accel/tcg: Update CPUNegativeOffsetState::can_do_io field documentation Date: Mon, 6 May 2024 14:37:09 +0200 Message-ID: <20240506123728.65278-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 The @can_do_io field got moved from CPUState to CPUNegativeOffsetState in commit 464dacf609 ("accel/tcg: Move can_do_io to CPUNegativeOffsetState"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-14-philmd@linaro.org> --- include/hw/core/cpu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 46b99a7ea5..173349b0bd 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -338,9 +338,10 @@ typedef union IcountDecr { } u16; } IcountDecr; -/* - * Elements of CPUState most efficiently accessed from CPUArchState, - * via small negative offsets. +/** + * CPUNegativeOffsetState: Elements of CPUState most efficiently accessed + * from CPUArchState, via small negative offsets. + * @can_do_io: True if memory-mapped IO is allowed. */ typedef struct CPUNegativeOffsetState { CPUTLB tlb; @@ -400,7 +401,6 @@ struct qemu_work_item; * @crash_occurred: Indicates the OS reported a crash (panic) for this CPU * @singlestep_enabled: Flags for single-stepping. * @icount_extra: Instructions until next timer event. - * @neg.can_do_io: True if memory-mapped IO is allowed. * @cpu_ases: Pointer to array of CPUAddressSpaces (which define the * AddressSpaces this CPU has) * @num_ases: number of CPUAddressSpaces in @cpu_ases From patchwork Mon May 6 12:37:10 2024 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: 795000 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901473wra; Mon, 6 May 2024 05:39:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV8hKWW9sNLobxGUb7sDbiC97JQYuEJGjkVNmmyvRA1+xgK5+5Al2P4BlBmxvcd96YHLNtIL231ALgLGOS0LxJj X-Google-Smtp-Source: AGHT+IEFwltNstP8TI6l0ZX2aeT5I6CkRhhi7QjqEcisSSS8+OWDKz5JmjIBbv83IXN30lqpv+WJ X-Received: by 2002:ac8:5f46:0:b0:43d:8952:f59e with SMTP id y6-20020ac85f46000000b0043d8952f59emr55123qta.38.1714999174912; Mon, 06 May 2024 05:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999174; cv=none; d=google.com; s=arc-20160816; b=hgO9zDDUNldpJJugIcctulQK3PPIEXvDR7B9s5xcDR3WT9JpEKInda5TVF3typxeYc OtNG5T5jloO0ETMtxYFZNA1hsK36T3YB3j5VeFFY61SBO/FmZMeYEX57tGY+iqHtJ+yr ztUxn/R8zHFEka157ZbwyNJPS+Bz1vpXRq2kut4f+G7oHgKdQZx7GaY2v2Y1xQy2rqjJ gN0DOOL85yKJz1Y7Xn+B+1oz+sd5pd6sSRT+Lrs+Auw7MdQy9f60F0leVhpzwT/tEVPc i8bhWaPsnevjHuEW5qdGnks0r6tGFSGrZwcbyUN5wxd3aaKIH4Vqkk/UD8zSzavK6GmZ kB5A== 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=vxHJc/1SpfLp2sqgCrwCIMC13iOcC35tqJ/KVJcg7HA=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=TW8v6NqIPsYdqm5DJFEPjsxLmCR6XprmxZ6I2sLO81cs4CpwBUvA6ZNnqbdfC3z4cY +vhOtzDnsFUUoAnwJUU3GP1p+HpptGk6xqXY2zrN3ZSEssNaivkmm4Fc0EfCAcWdd4U1 cnAbtu7sT33Usy2Ow9F47WmQdvzvkOvGyrsgDc7EvnaC2kDufJ1Q5HQ8tA1B9pq24mrN 3pRyWUoW3eU4rzaFbGA+i4G9/0zdjMQ/sjgE9pwJR8j8v9wytFLeaAlTxDoGqzt87M/B p/km7V6305OhewQSI8syq5UUQazgd2Vhj1ZrYmAxkGZZA6zTwq7jU7+aB9j1uEV6vYpT whgw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yyg5AJny; 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 w4-20020a05622a190400b0043aece8c6a2si9574675qtc.18.2024.05.06.05.39.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:34 -0700 (PDT) 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=yyg5AJny; 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 1s3xco-0003hO-LH; Mon, 06 May 2024 08:39:23 -0400 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 1s3xcI-00020D-4z for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:54 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xcF-00023T-Ku for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:49 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2e1fa824504so27400131fa.0 for ; Mon, 06 May 2024 05:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999125; x=1715603925; 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=vxHJc/1SpfLp2sqgCrwCIMC13iOcC35tqJ/KVJcg7HA=; b=yyg5AJny7xRj7kPEDDqstg1Ud7nzkoVP5YNIdJ8ktWJaNZqMvJTZPqM+cN3OIrQIZv TFAGPUBFc+lLfmu51DEh0rL9JuWZEMNVrE+J6ebmZeEjxBeoo+lk2R8krLMVgCHuEWf6 ap2EI5xEp+GIrOxn/hdL0T7EpmacVBD2BPulX82lsqTTcf4YzkRNIvb9koXCC4QZBaNW K5QIOKk9oRIgRgrxlsXDE911hNF2p5jrdd6rZN+b5rSYvALJqJ9sdEfcPxPWElgZYocY GBuLh2Q+GcSYMUIFTBffD/kiWFJk1THOUb+mG35tjxv3alptPH8tQnXiG5/PVKo3ZIfp V9LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999125; x=1715603925; 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=vxHJc/1SpfLp2sqgCrwCIMC13iOcC35tqJ/KVJcg7HA=; b=dOMA30NK5t6z4XVauOc883WzCcOuDzvMwpXt2m7k/9FwhgtmI+0fXGcDZwzPMPl0J+ /ChQUuIJXVfHWQWM8LAHR9SWbx0+yeMmYCN19/jDvlDNJXdAKr30ZJqRYRpSjRYS2w8j cJLgtozQGJxQI39xx0DHW1htartcQhT1yPL41DQv+/kWYkl5zJuosVhqGM8j0AerwST9 nstdMk70tfygnHmm5Cjlz+hImkt0jK5+kyJVAK8WBnxipR0sua5vYhYShMmVxY47E+PZ Pxe1QY1Ch1MHFwCxmtnb/BsioLzwkyO2fuWXTkvt8lHvBEfEgKHVJ0khCQeQUPyMRtYJ 5Rnw== X-Gm-Message-State: AOJu0Yxuez9+Zux9AqwJPKZuBzKMg9KwhwJ1xiCJKoJrijw+aOJNneer FCv5GgcZoVTIQCUSGtFCvsowQPv/CTG1u9XiYBw534pDWUQPu2h2i/EoAGAZbPHYEuWR/TPhNzK 1 X-Received: by 2002:a2e:9006:0:b0:2dc:b964:b15 with SMTP id h6-20020a2e9006000000b002dcb9640b15mr6152525ljg.25.1714999125390; Mon, 06 May 2024 05:38:45 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id m7-20020a05600c4f4700b0041b434e5869sm19638255wmq.43.2024.05.06.05.38.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 10/28] accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins Date: Mon, 6 May 2024 14:37:10 +0200 Message-ID: <20240506123728.65278-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=philmd@linaro.org; helo=mail-lj1-x233.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 qemu_plugin_vcpu_exit_hook() is specific to TCG plugins, so must be restricted to it in cpu_common_unrealizefn(), similarly to how qemu_plugin_create_vcpu_state() is restricted in the cpu_common_realizefn() counterpart. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240429213050.55177-2-philmd@linaro.org> --- hw/core/cpu-common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index a72d48d9e1..0f0a247f56 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -30,7 +30,9 @@ #include "hw/boards.h" #include "hw/qdev-properties.h" #include "trace.h" +#ifdef CONFIG_PLUGIN #include "qemu/plugin.h" +#endif CPUState *cpu_by_arch_id(int64_t id) { @@ -236,9 +238,11 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu = CPU(dev); /* Call the plugin hook before clearing the cpu is fully unrealized */ +#ifdef CONFIG_PLUGIN if (tcg_enabled()) { qemu_plugin_vcpu_exit_hook(cpu); } +#endif /* NOTE: latest generic point before the cpu is fully unrealized */ cpu_exec_unrealizefn(cpu); From patchwork Mon May 6 12:37:11 2024 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: 794998 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901314wra; Mon, 6 May 2024 05:39:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFL11eEIjh3fnnurTcHKC3duYJ96grebgm8MUTq9zMBBt6c7A0yRrxZYHVRbUm0QS8vWaIMYqHDvlq3xxiwMMe X-Google-Smtp-Source: AGHT+IGdQtdxmNOU+YggNcmA8r6YnqXADk6E7OJoqP4scjbmpQfLK7Rw08mippTkWS+brd9Cuz2p X-Received: by 2002:a05:620a:56c9:b0:792:92e4:df55 with SMTP id wh9-20020a05620a56c900b0079292e4df55mr4619419qkn.21.1714999155421; Mon, 06 May 2024 05:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999155; cv=none; d=google.com; s=arc-20160816; b=Vv7aOcC7336VzJrZCTQ6BAjlaHnAl6Tij+2odNjaBCb4g7y5YzZ6yVdR5E0VGp3BJ9 cUjv8u4w+D8+G2ZcOJp3Y4nEmgaUFv80PknqvxN78UZC6N9mT4WFUwXqMMfrMkgwxsDx LX/yFGUnNKMfkc3dWkwRUl35cC67MUx+V5AjKQWjs1X6Oq/pPdci9DlhhKkanjsEj9Ye a+JVdpeuOZ+ZVQOqyEvYfux/ZcgI3lr6i2Z6HjqK2GWa1Az95/bfXjNOmBhchrXSnRGl RyDfCBaYWBCxSe9OUQ9VmVk3vdw8b1TK+MB2fiwXL0g+HwNA3dP+AP1pfDwJ1Gfy1ojT Rg9Q== 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=MWoGQoSIt5HJcg/7P1ISVDqkVosvqIqVP9M622YHe5M=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=lE9UUd+jaWs/WR0EPQf4jf893VQnV9uHYR4pFI7xiBr3BmnM+nOsX51EtJxUCE2hx/ +ySP3TlbL4dwts5qUCVFBqsFIZ1Xnj9FizHlKWTA/WBIeHIXPF5i/jfypCGihBKp0lrw gWT8yHMHvMQSpJX6SSF05ZE4yVFwrQUw3NXsLA7Jj1hSS4zq676kR8c3d5LqLRRPgnLe s0STSpTcrTAJcblpqmbQ7lOR0YKn+hAeV0JKnaPvRf7ptEVRNA/grAD58phnwlpNLPNZ fVZ6GFgc9dWzGJaxXm/lsSLql3lPS18jfUSHGoh1svKJZm2aAE1kpr31m3iazkuHsqbZ MiXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=La5yRQyh; 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 z24-20020ae9c118000000b007925dc7384dsi8703568qki.721.2024.05.06.05.39.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:15 -0700 (PDT) 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=La5yRQyh; 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 1s3xcW-0002S4-Q7; Mon, 06 May 2024 08:39:04 -0400 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 1s3xcN-00029j-KG for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:56 -0400 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 1s3xcL-00024R-Vo for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:55 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b782405bbso12299285e9.1 for ; Mon, 06 May 2024 05:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999132; x=1715603932; 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=MWoGQoSIt5HJcg/7P1ISVDqkVosvqIqVP9M622YHe5M=; b=La5yRQyhNUHvqYbzCjBpMDsFjxSRZPmpWiajSsN81nP6qxvifdVoRGcbv6z/sdTVAY eGGc+O2eZSgY8jzMkifpRodc0nvVPZPcsMgw4Ec+v4HK0Gt8sijz9YcUQYaZv7f3oDNz 1qKPxkJXpAPL/6i2g7+kGJ2Ehr1nwuh78EZr4sYfb6tChbaEQTUCeg21Y+kZRDT3ccb5 36TrFx7ZIx9J2yz8HJQAtWfg9P15Wn5/0g+eqUim4ogysYjVwUwwict4l7SM9Bx84/AJ ltXrISwLwGXuEY7CFmsiQim0lNZqb9eSYyjAAQAH/9CMFiUA9yRJ7O4/Opa4QOv8905G 6IDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999132; x=1715603932; 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=MWoGQoSIt5HJcg/7P1ISVDqkVosvqIqVP9M622YHe5M=; b=Oalgnxa5Mbwb9qRsqWSD0EHQrPhAVonRiReLVsE3CrpGbLtKwTIQYL4HKBDlWVMgo4 bwLw0bK1dWPFODB8xt9JovZ1pG+V3Hac/MIa6HKpIfs9DKFeR7bGhsPHQXWPm5CNiopH uTE+CuCOyPESAZSSGg9i1yRs2ZobfNKJKqE6Vbc3N1sN6G1Z+TnQeHc5WDy4UktXh0wl jtMOzyQX0OFpCzJdgB5wimYf2vkIFuTZPgzaFEwSZjRtI3ovE/I8mSMdsadkwGpm10G+ nlnKemQdpowBZ5tRgVQ87f9WaQvL5sMWtDJgCQOiee2TnDUVT7EMOmIF0G3/ydcl4GMY WqUA== X-Gm-Message-State: AOJu0YwK4PtLWNWcW0aJPPdu0WtfD1sBnKdjSkMvkbK9lAQ5c6IOC3B/ X8y7DRG7be+88HwCbkZyPEujUpanOqDNtq8d9ecLP2XCQBB+CkLF+2GSb4YxuPGZ8CiEjEc06XD i X-Received: by 2002:a05:600c:46ce:b0:41b:851a:af43 with SMTP id q14-20020a05600c46ce00b0041b851aaf43mr7683963wmo.11.1714999131824; Mon, 06 May 2024 05:38:51 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id v6-20020a5d6106000000b0034d743eb8dfsm10598284wrt.29.2024.05.06.05.38.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 11/28] accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCG Date: Mon, 6 May 2024 14:37:11 +0200 Message-ID: <20240506123728.65278-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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=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 So far cpu_plugin_mem_cbs_enabled() is only called from TCG, so reduce it to accel/tcg/. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <5f59c754-44e5-4743-a2dd-87ef8e13eadf@linaro.org> --- accel/tcg/internal-common.h | 17 +++++++++++++++++ include/hw/core/cpu.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index ead53cb8a5..cbeff39e3e 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -24,4 +24,21 @@ static inline bool cpu_in_serial_context(CPUState *cs) return !tcg_cflags_has(cs, CF_PARALLEL) || cpu_in_exclusive_context(cs); } +/** + * cpu_plugin_mem_cbs_enabled() - are plugin memory callbacks enabled? + * @cs: CPUState pointer + * + * The memory callbacks are installed if a plugin has instrumented an + * instruction for memory. This can be useful to know if you want to + * force a slow path for a series of memory accesses. + */ +static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) +{ +#ifdef CONFIG_PLUGIN + return !!cpu->plugin_mem_cbs; +#else + return false; +#endif +} + #endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 173349b0bd..a001bafcf8 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1111,23 +1111,6 @@ void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint); void cpu_watchpoint_remove_all(CPUState *cpu, int mask); #endif -/** - * cpu_plugin_mem_cbs_enabled() - are plugin memory callbacks enabled? - * @cs: CPUState pointer - * - * The memory callbacks are installed if a plugin has instrumented an - * instruction for memory. This can be useful to know if you want to - * force a slow path for a series of memory accesses. - */ -static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) -{ -#ifdef CONFIG_PLUGIN - return !!cpu->plugin_mem_cbs; -#else - return false; -#endif -} - /** * cpu_get_address_space: * @cpu: CPU to get address space from From patchwork Mon May 6 12:37:12 2024 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: 795004 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901571wra; Mon, 6 May 2024 05:39:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVLN04IJ3Zxf36NRJOkOd6xxUsRuh44WgPT+JSSjx50EZqfvEAvJefZGLKV+57jvC/Xd/pW/Rnnc+GW47iUKoDk X-Google-Smtp-Source: AGHT+IGaoeSbQBR6sXWtPlOqqoPwpNEaGe63J+svlQNBW9hKbNtAPoGpPXZ1nl8Nu0A+x8wwAyiX X-Received: by 2002:a05:6808:2212:b0:3c8:63a6:eb4c with SMTP id bd18-20020a056808221200b003c863a6eb4cmr13782691oib.43.1714999188168; Mon, 06 May 2024 05:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999188; cv=none; d=google.com; s=arc-20160816; b=wDWyfU3zBNYfzD1Tz5hGFYa0V+dV6JUtfxRKn7vwkLhMZWNlQmTIHjHRmcPkOCNOZ3 Av8D669dubEuyhAdVJXnMiabw+r+XqjELTK6Ov3OlVBJFAbdthNELW4SSogh2RYTn3U0 LztbZtnqNH9GhvLaCAW2TNyQfHuHECJRxyMoFjVZN+0yWnGn1ru63KtJXixd8OLZANIk 9UHorBvT1ImksLliC7LGZgGdGqJur7x5Jjh3u2yCXtSBhlosL6fw+baD2Qa1aEMlno4f shDCof9Wed6b5T/VRXwdjmN7zPhMyiENVSLjRLLeA4p+vdKKvjirvd6cutAXnVK14Gu1 wv5Q== 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=2P2Lp6Z6ney+zSdOdvmSI8h/fve28/uqRuYWe+tRCYc=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=q8sBQZRKTU/y5E8V/YcpKl8Hsi1kV3Ks+/A0quCY9g0vmAyu1ALSjxvLfv/Z4OtQl1 St7soQBDDhXBqu9LtZUAjgSi4NxHCjOZbkHabc9xvNuPDPPKXOhcazVvZTbZmeNQ3GF9 QNeRdSiByAf3y8c6R9eFI9Iwv6jNjTw1Rnwp2RNUFLrT34TMn3uCM2QGf9lqkx3Q2uCq ATAosGdvFKt92iSWRcH1Uk5elzNTX56ri6t9PZMn+XIt46Zgd6AumK5VvieAGrAuZonu 98tBDNX5Z4FtExUdtQ3iD/ZomGeM6tGoL1bwtGJl2v21dD/ZTh1zA8/MG8g4g91hIIO/ W3mg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tXlWHPcH; 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 gv12-20020a056214262c00b006a0cb4e4c47si8830457qvb.590.2024.05.06.05.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:48 -0700 (PDT) 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=tXlWHPcH; 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 1s3xcw-0004Fm-3m; Mon, 06 May 2024 08:39:30 -0400 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 1s3xcW-0002QI-5s for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:04 -0400 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 1s3xcT-00025Y-AW for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:03 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-34d8d11a523so860204f8f.2 for ; Mon, 06 May 2024 05:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999138; x=1715603938; 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=2P2Lp6Z6ney+zSdOdvmSI8h/fve28/uqRuYWe+tRCYc=; b=tXlWHPcHhzVz4qJYEFJhFI0bYhRwNL1uCBON+XwQKj5VUy1EfGM2nDOoJdnqPeHfe6 2YZQH5wLHkI+wW5dIzmsIe0vhaSqp+YMkMBEafcHTw6S3r2OtvB6C1/f3Q79kJixk0BU w5xx+g92psGhJbMprGQkkJ5FL8r4VrKnI5UH7itQyLQrB0xQycXY6n3dWbPD7yallA2g SBjqkbjhf36LD6kYrxyuNHVL4CQLgi/6bgV3zwdF4BaBxhIglAO8/9b0loRc6CDW9wLc Y2pOoj3lVdPf+a6mR/m6bc0d4y9Seh2gVvcsSZTq8TIQ5Pk2sVWDpPBmzarVzBp3yjgm SR/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999138; x=1715603938; 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=2P2Lp6Z6ney+zSdOdvmSI8h/fve28/uqRuYWe+tRCYc=; b=jzMIkQkjUE9ugUZ2915aVlzX04jy1mQf5VnTYEj61QuSFmXkWhHNwlficx6BOmGl4o +SmEsUnVYKZLizOWuj1TYnTaO67jqJrdXCUvVXHqLdSH93yPapykCT/6k1/N+RVMUAsJ r2IX1DrOflBWupMkLdUIlF/KZ4aJFOhHH9d7kOfsuv72RilAo10/boREbCpGSK6mfniu naqiS70gp0kHZ0DYgAsV8UwQ6vxElJ8n9oBcBhcd4+XLE+wch01NcBfDXbcvb+GBa0Le IapM/G9HO+HaFrTsDLG28ZGcUx3LxZ3XNlmzk4JHj58RP8LDzaQxEdNLPtjA1XRW7Dmh bKzQ== X-Gm-Message-State: AOJu0YzlvjktS3yA4NDzZUeASNPi+YSq9sateuSF2POJBd4+FmDT0Aqj Bq4QP+JiyErAd5N0Rerg2FekKezBVMXZNTxoreAB40x+FlC6fr5gGt+zCGfMqwuTjkOov/Yeb3A 9 X-Received: by 2002:a5d:6a83:0:b0:34c:c4fe:63d with SMTP id s3-20020a5d6a83000000b0034cc4fe063dmr7072541wru.29.1714999138632; Mon, 06 May 2024 05:38:58 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id n15-20020adff08f000000b00343eac2acc4sm10630140wro.111.2024.05.06.05.38.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 12/28] accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetState Date: Mon, 6 May 2024 14:37:12 +0200 Message-ID: <20240506123728.65278-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 @plugin_mem_cbs is accessed by tcg generated code, move it to CPUNegativeOffsetState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240429213050.55177-4-philmd@linaro.org> --- accel/tcg/internal-common.h | 2 +- include/hw/core/cpu.h | 13 +++++++------ include/qemu/plugin.h | 2 +- accel/tcg/plugin-gen.c | 6 +++--- plugins/core.c | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index cbeff39e3e..cff43d221b 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -35,7 +35,7 @@ static inline bool cpu_in_serial_context(CPUState *cs) static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) { #ifdef CONFIG_PLUGIN - return !!cpu->plugin_mem_cbs; + return !!cpu->neg.plugin_mem_cbs; #else return false; #endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index a001bafcf8..6efd7353be 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -342,9 +342,16 @@ typedef union IcountDecr { * CPUNegativeOffsetState: Elements of CPUState most efficiently accessed * from CPUArchState, via small negative offsets. * @can_do_io: True if memory-mapped IO is allowed. + * @plugin_mem_cbs: active plugin memory callbacks */ typedef struct CPUNegativeOffsetState { CPUTLB tlb; +#ifdef CONFIG_PLUGIN + /* + * The callback pointer are accessed via TCG (see gen_empty_mem_helper). + */ + GArray *plugin_mem_cbs; +#endif IcountDecr icount_decr; bool can_do_io; } CPUNegativeOffsetState; @@ -416,7 +423,6 @@ struct qemu_work_item; * @kvm_fd: vCPU file descriptor for KVM. * @work_mutex: Lock to prevent multiple access to @work_list. * @work_list: List of pending asynchronous work. - * @plugin_mem_cbs: active plugin memory callbacks * @plugin_state: per-CPU plugin state * @ignore_memory_transaction_failures: Cached copy of the MachineState * flag of the same name: allows the board to suppress calling of the @@ -511,11 +517,6 @@ struct CPUState { QemuLockCnt in_ioctl_lock; #ifdef CONFIG_PLUGIN - /* - * The callback pointer stays in the main CPUState as it is - * accessed via TCG (see gen_empty_mem_helper). - */ - GArray *plugin_mem_cbs; CPUPluginState *plugin_state; #endif diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 18062528c1..b535bfd5de 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -180,7 +180,7 @@ void qemu_plugin_add_dyn_cb_arr(GArray *arr); static inline void qemu_plugin_disable_mem_helpers(CPUState *cpu) { - cpu->plugin_mem_cbs = NULL; + cpu->neg.plugin_mem_cbs = NULL; } /** diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 3db74ae9bf..49f5d1c2e4 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -55,7 +55,7 @@ static void gen_enable_mem_helper(struct qemu_plugin_tb *ptb, * Tracking memory accesses performed from helpers requires extra work. * If an instruction is emulated with helpers, we do two things: * (1) copy the CB descriptors, and keep track of it so that they can be - * freed later on, and (2) point CPUState.plugin_mem_cbs to the + * freed later on, and (2) point CPUState.neg.plugin_mem_cbs to the * descriptors, so that we can read them at run-time * (i.e. when the helper executes). * This run-time access is performed from qemu_plugin_vcpu_mem_cb. @@ -90,14 +90,14 @@ static void gen_enable_mem_helper(struct qemu_plugin_tb *ptb, qemu_plugin_add_dyn_cb_arr(arr); tcg_gen_st_ptr(tcg_constant_ptr((intptr_t)arr), tcg_env, - offsetof(CPUState, plugin_mem_cbs) - + offsetof(CPUState, neg.plugin_mem_cbs) - offsetof(ArchCPU, env)); } static void gen_disable_mem_helper(void) { tcg_gen_st_ptr(tcg_constant_ptr(0), tcg_env, - offsetof(CPUState, plugin_mem_cbs) - + offsetof(CPUState, neg.plugin_mem_cbs) - offsetof(ArchCPU, env)); } diff --git a/plugins/core.c b/plugins/core.c index 081323dafc..1e58a57bf1 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -533,7 +533,7 @@ void exec_inline_op(struct qemu_plugin_dyn_cb *cb, int cpu_index) void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, MemOpIdx oi, enum qemu_plugin_mem_rw rw) { - GArray *arr = cpu->plugin_mem_cbs; + GArray *arr = cpu->neg.plugin_mem_cbs; size_t i; if (arr == NULL) { From patchwork Mon May 6 12:37:13 2024 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: 795002 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901472wra; Mon, 6 May 2024 05:39:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUVmpSwgPIkjWtBVocCskCtGhbJ6MEaHXTSnBiu0246yiQSwujkeIp2JQ+sntuvv7sOHamOEc9i6WU8evPL0vYi X-Google-Smtp-Source: AGHT+IHHArP0J+pmMM0eKifp4U9j/2Bp2nT7woXB4iIUy3PiJDEDlYAHmOfgZ4hmNwg4NJ7IAEC4 X-Received: by 2002:a05:620a:8124:b0:792:91f9:739 with SMTP id os36-20020a05620a812400b0079291f90739mr4840311qkn.27.1714999174824; Mon, 06 May 2024 05:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999174; cv=none; d=google.com; s=arc-20160816; b=Bb7pY9wkfao3SRADXZ4opdK5R8fmnwCgMVd0mYYE2wnJwaP4OYbdpqe1FgEINTQ+On BXzPmlDPftS37767GitdRQFO/Ydu5sJ/OE2wgHBnfxS/WJx8vMbpniKJaiMkWSlXTNlC N5B35AAoY2IphOea+J+3wT3zrzHo+NSdwzQCOANQN+zy8xuunLybvzUK7+kOlPMrg5pY UkipvazjPo3ZrNKJrw/TxR3B5mvxpY3WM5blBMXztGx4/zQ6WI9XJNRnaNkXWpJDQOt2 n9D1u7ae6iLzYj2WBCn2058cCfdOoGK51+QlGQ8jGax3qsr5y0f8+la+lZZSKxGPI8z0 T0zw== 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=QDCtZ5R6jWRdBusTW5eWLGmV5MNQ1/vJ4icErDbd6hU=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=v+6vCgAEIzAMA7HTwOKQAZ199BkKRUWXlWsNbVGz8+cqkPM0k5tnSTXG8lggrHokRS Hkv1jXrHwcUzE0wy5bHdpNWATBwW0+G5bIvrInmZfInaHDDbD2ZjSLcMAuRqjI+o/wVU ovOZLAekya5RMjwdffWRPktklMHCsp3+ADR828WFrDsWo4IsEbSopgEs8ABVeXO/RNcn pTaZxwHFypIwcOwf0YmH0m1d5wjJRe4ZVZtEIKb8D21WdcN3DDqMUz/jCZrnx8tbcYdx wlAQhcSE6gXirpd3wm27i4ghePDYhrLFCu2rgpbsBjV5WC6zvFV1x79c7Ra8T8N0hR4t VCxg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uwlnMA9E; 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 dc54-20020a05620a523600b00790f5c79c4dsi8885901qkb.410.2024.05.06.05.39.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:34 -0700 (PDT) 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=uwlnMA9E; 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 1s3xcp-0003nN-QR; Mon, 06 May 2024 08:39:24 -0400 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 1s3xcd-000393-70 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:12 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xcZ-00026i-HL for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:09 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-34b64b7728cso1575803f8f.0 for ; Mon, 06 May 2024 05:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999145; x=1715603945; 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=QDCtZ5R6jWRdBusTW5eWLGmV5MNQ1/vJ4icErDbd6hU=; b=uwlnMA9Ecrm258wYw/yWuYGmP61sfj4BDkRMtW5uK5BnrqkxIcInzOlgNhxXZyAMyl cAvEplUrYA9hq778fqQADQkfj1bfmZ9hu5OStYKoGgUI05m5w69Ww6knZ9glJf6qvwAx GeD5Yl0mvlORRIEiUl23/GfjikBUtdNxHn7MYPG9//Lof/c2NoMQNkGxNMzDB7KI6KGi lrVbKGEz+fXejh07idWWrGZD9zskDCKm9wsQ3ZLLSYqnursLfv9zznsleXo7hzJBdBkj 5sPQXFkZ4A+ty70XFqH594ak9q3pqBHkVLozjXFpAGIRreHu4PKxVMb6THCA5VbfMldA 6QUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999145; x=1715603945; 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=QDCtZ5R6jWRdBusTW5eWLGmV5MNQ1/vJ4icErDbd6hU=; b=royKOlTKmyYtDPZpsLtzsrSJSIsK66aHbotMHwSZ3bXThsTmH1aKhliSUMjIj1dr9p XDK34wqVPyuWaDczrCyOtE7h6gbAXl0jLqLtoPgLITcfphddGHGy2F2P6KMJOTR7bTSU Fdh44/NXnYAgWOrmWpPqoH+z7GejUmICY5mg2G9WyVsbr1n0axWVmr/TP3rlP5z1x1iq dMCDq7LOC9HPVT4gd1AuhtBvleSVJ0SjQGrSQSzAGlIaZwY/GrOU53PlpdTfCy5uMjhu nqksC/pqq49tGJfLnd3/Q9oS22js79VFmMU4o/E1bue9adVVxEQOiDzC57K+NpLY4zRd YcOg== X-Gm-Message-State: AOJu0YxxJko0rtWy5CHRtMMerTJMR8hiIvCY+xKOn27cxqtz2JsPJzqD SlNRh2BrMmIV1WTmz4z5vno853u0A0Ek6BgcVEG4/2Tv5+ylDxZHc6j1eQGnTz1WmUYUsj8hnyF 3 X-Received: by 2002:a05:6000:11c9:b0:34d:a0b5:3c57 with SMTP id i9-20020a05600011c900b0034da0b53c57mr6060906wrx.23.1714999145528; Mon, 06 May 2024 05:39:05 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id h11-20020adfe98b000000b00343d1d09550sm10622257wrm.60.2024.05.06.05.39.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 13/28] user: Forward declare TaskState type definition Date: Mon, 6 May 2024 14:37:13 +0200 Message-ID: <20240506123728.65278-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 Forward declare TaskState in "qemu/typedefs.h" so we can use it in generic headers like "hw/cpu/core.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-9-philmd@linaro.org> --- bsd-user/qemu.h | 4 ++-- include/qemu/typedefs.h | 1 + linux-user/qemu.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 322177de16..1780f485d6 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -76,7 +76,7 @@ struct emulated_sigtable { /* * NOTE: we force a big alignment so that the stack stored after is aligned too */ -typedef struct TaskState { +struct TaskState { pid_t ts_tid; /* tid (or pid) of this task */ struct TaskState *next; @@ -114,7 +114,7 @@ typedef struct TaskState { /* This thread's sigaltstack, if it has one */ struct target_sigaltstack sigaltstack_used; -} __attribute__((aligned(16))) TaskState; +} __attribute__((aligned(16))); static inline TaskState *get_task_state(CPUState *cs) { diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 50c277cf0b..36f2825725 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -134,6 +134,7 @@ typedef struct SHPCDevice SHPCDevice; typedef struct SSIBus SSIBus; typedef struct TCGCPUOps TCGCPUOps; typedef struct TCGHelperInfo TCGHelperInfo; +typedef struct TaskState TaskState; typedef struct TranslationBlock TranslationBlock; typedef struct VirtIODevice VirtIODevice; typedef struct Visitor Visitor; diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 263f445ff1..7df4645c2b 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -95,7 +95,7 @@ struct emulated_sigtable { target_siginfo_t info; }; -typedef struct TaskState { +struct TaskState { pid_t ts_tid; /* tid (or pid) of this task */ #ifdef TARGET_ARM # ifdef TARGET_ABI32 @@ -158,7 +158,7 @@ typedef struct TaskState { /* Start time of task after system boot in clock ticks */ uint64_t start_boottime; -} TaskState; +}; static inline TaskState *get_task_state(CPUState *cs) { From patchwork Mon May 6 12:37:14 2024 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: 795019 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902774wra; Mon, 6 May 2024 05:42:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqKRoXjbdbp7IgZw65ub5Wn+cxdpTww/tXU5sphEvuJXzk1Q4dfXwo8sp70ieFoqsc1UQqWy0yk2bQtCr23ze3 X-Google-Smtp-Source: AGHT+IH4wEcvtPsYI8tUXbjs+eIk/OIomAI4jGXBiyuUUTI9/WKhoKXQfoIKMrCcMTtuIrjPW390 X-Received: by 2002:a05:6808:30a7:b0:3c7:5146:c4e5 with SMTP id bl39-20020a05680830a700b003c75146c4e5mr13496674oib.41.1714999378566; Mon, 06 May 2024 05:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999378; cv=none; d=google.com; s=arc-20160816; b=D1pOAm9rXoP/NfV9cRYVV2utUhLNDHMYUMS+Ee0qugm13D0RNeT8jUFDsdP7hx+NZT mPwmYr4RJKWr6sjE5GjcbRpdxAC5Lj4g4HZL0LP0BU/R96/Ht2CtIvzJN+EAMBr/Fb6v F1vakRhgNrZlj5uXPh0mdHM6XO4rAgyGFpY55ZQX2Wb/Yx1U6fHk5T7U3317dFMOlYtC efY3oozabkW+x1ssM9XIhG+42aM/diOnjnKHhXK4YU7vC57daVqmtXYmTbU15g/GCTy8 uPRtSnyABQjRIxED+4I0uv9AA9pMRygk7/0HXdgnCsFzk+90zuacWVjHBk0VPja+cbJr mEow== 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=QDNxZj+xmGVZ6dRFb3MDxJip4ebx+5/K+HgTl2Olyoo=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=RlpkZ4JY/4+43kGTZi9GtGwfCkkpyBP65ewB3ls7YC3GERKa0uMluTB4aNjxw8IvpC 9h9TWWlNpJ0E9Dofv3rFMqk0le4/CnkQS9D/GelsHpPomT1pY3DLzfKa/6trU9tOaU7b RG7zsEXbwK9LsJlXN4UFgi9FFsUdba5/LSqHgM+XCqh/tcfxYmy9cOQ0Rp1uafXRKclu 4Cno+xm7H/UQ9clvU1+fXmzR5cCiqIJPX45gnpEGFyToquM++TQx/OXLUZS1sy+ga+kc k5Xpd5YmVixdxVRA0tJCvZ6GjyB3mtOICB64H4TmHVQgEMxFvYP08CXrw66RONXMP7gY N4og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K7mO+6M/"; 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 t12-20020a05620a0b0c00b0079295710bf3si2678706qkg.757.2024.05.06.05.42.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:42:58 -0700 (PDT) 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="K7mO+6M/"; 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 1s3xcu-0003vY-Go; Mon, 06 May 2024 08:39:28 -0400 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 1s3xck-0003YF-II for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:18 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xcg-00027S-GD for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:16 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-51f45104ef0so1975408e87.3 for ; Mon, 06 May 2024 05:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999151; x=1715603951; 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=QDNxZj+xmGVZ6dRFb3MDxJip4ebx+5/K+HgTl2Olyoo=; b=K7mO+6M/yaF6Ti/eESVJUOftA+5vhsMYOGeDyvp3+NMEpYq0kkAlSA/FXg7u2EELhu ke8voxkK87EzauNy+WnRP/pROYR/RzljvwNe44newmk70AUcVMHTHX4128Sv21jGSPO2 7noGfMoPTVA+2XeEEyKOrQZKkzFV/2yPuQhXvcepokKoRHewpKhZdURakfPHtFJc+5ln DvcGtwjnBj+D3B+PbJmwtQ/vbAlvdnUItDoGghE7vnO8SJH2RmVMNjnS4WcU5u5kBRhn odslCjc1QSGeU9DvgA5/ePAxMh6gBfJ7rqcgMyMk8J5Db1lIYLPUCnsupXZ6jirxCjyM Udvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999151; x=1715603951; 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=QDNxZj+xmGVZ6dRFb3MDxJip4ebx+5/K+HgTl2Olyoo=; b=ZGBDng0mUAF/P42UG+jOWBzrlTJp8XbCW84zvhJH5b0y2FMUjj7ttkVQG44xb2tcem KhLGHTyt3x/F6dMT/qn32YQ2iE6n7Y4h0T1eH0nuGT7mKys1Fh7GMH2RLceueyp6vvv2 eJtN3wfKCy5HgVFF3OYqJvVSqsbnB4ZZaZ1F0qY4ymMv9aAaDeLp4PeccXR+K3Aaz7jU KQSwToyzDe3QAqEs2bnQK6ox7uh2hcEwoi96M3Cra1PJ8pOV5i0T+FQmxnCIcwYayVwv y9RSpwmu+ePKD/XPWqu1UrV1LMRdg2oPYUwcppj9ss318NYHLFzyKErKAoULkyuW4ney jdfg== X-Gm-Message-State: AOJu0YwIRnE+MDlEAuP9ZQJ7kBuBe8TtTA7tT1Akmk29ED2Z+99sSlUI citvRRaxTBWtFl/4WeJLtYMGCPYi+/3POr6+SYMdKB/c1xh3sdglTnmitu13K+bBurGCIMC4je0 5 X-Received: by 2002:ac2:5291:0:b0:51e:f1a6:ac39 with SMTP id q17-20020ac25291000000b0051ef1a6ac39mr6195254lfm.12.1714999151475; Mon, 06 May 2024 05:39:11 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id h20-20020a05600c351400b0041be4065adasm16097989wmq.22.2024.05.06.05.39.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 14/28] user: Declare get_task_state() once in 'accel/tcg/vcpu-state.h' Date: Mon, 6 May 2024 14:37:14 +0200 Message-ID: <20240506123728.65278-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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 While each user emulation implentation defines its own TaskState structure, both use the same get_task_state() declaration, in particular in common code (such gdbstub). Declare the method once in "accel/tcg/vcpu-state.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-10-philmd@linaro.org> --- accel/tcg/vcpu-state.h | 18 ++++++++++++++++++ bsd-user/qemu.h | 6 +----- linux-user/qemu.h | 6 +----- 3 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 accel/tcg/vcpu-state.h diff --git a/accel/tcg/vcpu-state.h b/accel/tcg/vcpu-state.h new file mode 100644 index 0000000000..e407d914df --- /dev/null +++ b/accel/tcg/vcpu-state.h @@ -0,0 +1,18 @@ +/* + * SPDX-FileContributor: Philippe Mathieu-Daudé + * SPDX-FileCopyrightText: 2023 Linaro Ltd. + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef ACCEL_TCG_VCPU_STATE_H +#define ACCEL_TCG_VCPU_STATE_H + +#include "hw/core/cpu.h" + +#ifdef CONFIG_USER_ONLY +static inline TaskState *get_task_state(const CPUState *cs) +{ + return cs->opaque; +} +#endif + +#endif diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 1780f485d6..9d2fc7148e 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -36,6 +36,7 @@ extern char **environ; #include "exec/gdbstub.h" #include "exec/page-protection.h" #include "qemu/clang-tsa.h" +#include "accel/tcg/vcpu-state.h" #include "qemu-os.h" /* @@ -116,11 +117,6 @@ struct TaskState { struct target_sigaltstack sigaltstack_used; } __attribute__((aligned(16))); -static inline TaskState *get_task_state(CPUState *cs) -{ - return cs->opaque; -} - void stop_all_tasks(void); extern const char *interp_prefix; extern const char *qemu_uname_release; diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 7df4645c2b..2e90a97175 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -8,6 +8,7 @@ #include "syscall_defs.h" #include "target_syscall.h" +#include "accel/tcg/vcpu-state.h" /* * This is the size of the host kernel's sigset_t, needed where we make @@ -160,11 +161,6 @@ struct TaskState { uint64_t start_boottime; }; -static inline TaskState *get_task_state(CPUState *cs) -{ - return cs->opaque; -} - abi_long do_brk(abi_ulong new_brk); int do_guest_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, int flags, mode_t mode, bool safe); From patchwork Mon May 6 12:37:15 2024 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: 795009 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901709wra; Mon, 6 May 2024 05:40:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX0mM7p4YNPCenRYctfUzbbW1N1190bBOgBtrqAw5rL0WXWG8jrveGSqhmiW5h0+8iWjuoGdpmLeqw/RA8j399M X-Google-Smtp-Source: AGHT+IFeAyZQ6um/mA4dqc3FeSdzRvfuod8pxQd0WBqlh6iL65TvMwP0FR4Zl9RPPKw8GycPlUUY X-Received: by 2002:a25:accd:0:b0:de4:70e2:16c with SMTP id x13-20020a25accd000000b00de470e2016cmr8957550ybd.14.1714999208922; Mon, 06 May 2024 05:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999208; cv=none; d=google.com; s=arc-20160816; b=lJRwiKIHHTNnHXQxBsAorkXNWnwdIZHCYWJW8Y8FEwWTLfswgmwZHO/kq4/6GSPwUh +7mm+kUQfNwtf2FiouPDUiKD4Y70Tlqi62KVXhtWBZEj53BMO1HseBO9/nxgJmDza7Ml +AjIWNTP+NHajRbSC7v2Apmejh8rDksG+/JLRTN5YMVlUsLpWE9uZPQzI3xKIgpiRq4K 3Gm5YFwrK4DUnhU8R1I8BAcUYA1eHE+I6eJejTd1g65kzBbb+fSc28npoR4pwOUXzn3l jN3e8l29ujUwqgNNOuPBRj8AATtrxl54Refe4pQPggxWobF6bCvDtMi5zHhbmviwqgnZ bF7Q== 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=s/Fp8DKElE44Fn+ap9z01bjvDp7koqMm6QbA7s6TWS0=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=B0pKWpNm0O2yH9hf4HYXqmJQM/x9wyDAxpNwYq4WFw/zfTkJlMGNZ2aWzExe0w+QrN rGgbpnmIsN1512SAZ36L3TSbtEgh2B+zAHsrU4J/EcRD7osr+rcn1rmu4kOFVV7jXXxL QoLZ5olFyBtpM721SbvHwF9Oz+KP2Qb8aQWSWwbZY4Y7Yq723d46kAmQEi8hR/Xz5l0A PgH/qKr4pvoNoqNPXMJv3egcobfqz++WJeziUrK37u7j/W9fgyLCkiA2FXVMYP0I56eH fvNlrLUvmGpfeGrSVnniXfT+RVn2RSfefmsTlM6ozbb3ttkSJchA2dEWxE8lIYgZ9NTJ DlTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fb4GpYfM; 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 i9-20020ac85e49000000b0043d415999e6si3025966qtx.419.2024.05.06.05.40.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:08 -0700 (PDT) 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=fb4GpYfM; 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 1s3xcx-0004X5-Ml; Mon, 06 May 2024 08:39:31 -0400 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 1s3xco-0003rS-Py for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:23 -0400 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 1s3xcl-00027y-NJ for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:21 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41b794510cdso15114335e9.2 for ; Mon, 06 May 2024 05:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999157; x=1715603957; 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=s/Fp8DKElE44Fn+ap9z01bjvDp7koqMm6QbA7s6TWS0=; b=fb4GpYfMg6cUPm0Bmlf46mTeWVPFZI9VgXhV9CMID8Rn6b8pl+ShGu8bnbGScH2gWT fDMmCwCGyeTnBVXbGxcu7mWIRjHMneLOJC3v+grY8vG1eVOzOR9lSBEVvdWEG0j9EizQ zwcXOkGn5iwxb+COBwSiJS3lnflJKxUKXjTiSplzWN2BldlzQj3qLUmsRS4Lda17TKU3 uWG0g5lhkkawt0Pl/oFT7v7z3alDcYI4y0cDa5Sz0hHd6lOZ6QhxX2scyrPL4FbXvwPS Tz7vLKYi4nAKUjf8Mjt7vbXnKHbv9IlPwArywk6v0c3PZvkS97BCUO7uG/64IqdtiG7Z x52w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999157; x=1715603957; 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=s/Fp8DKElE44Fn+ap9z01bjvDp7koqMm6QbA7s6TWS0=; b=i5PcfzY63byK2oLMAjkcDGgNJr/5KJRdQCUu4h0rKVDdbHRKZpD7VqSUJvBOMHPEmZ 1VqJDGGeMWxxfm/P/+yvhUgK8EdIS/RQPyat+F+qMBXFVT12Peq6Z3GoNgf9jv0WU2RY OUzNmfDKcLNCZUF1scPQODLG73hfrK4JHKiXvHPDLkOxjJSzggCJNifXL7E5kjZ6ZkQJ vGJXv6d4ozFggq45bsSPnF7sE6qdSrYKAxlxQZXcBlGz90la5IqRalQSUahVR+vBiWnk N012480KoklR4W6xpJEYRAvx29KWXCoGh1w7eyWqKduuIAgPZp+4e6m85E2unCw1h9qn p5mg== X-Gm-Message-State: AOJu0Yw7aYkzRKWyEZ6NyeJXBmWpJqKoRhyYfP1dtwQ7g2wR6z1nBtng NeII4pN1mWE/QWg5/+zwsDDEQTVHh9L6zk30TUZ0bmz5OL6uWftfeyU/33GrZxyo90jqMlUEyHQ Q X-Received: by 2002:a05:6000:d87:b0:34d:a1fb:8f73 with SMTP id dv7-20020a0560000d8700b0034da1fb8f73mr7057376wrb.4.1714999157442; Mon, 06 May 2024 05:39:17 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id n8-20020adffe08000000b0034df2d0bd71sm10588152wrr.12.2024.05.06.05.39.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 15/28] user: Use get_task_state() helper Date: Mon, 6 May 2024 14:37:15 +0200 Message-ID: <20240506123728.65278-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 Get the TaskState pointer calling get_task_state(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240428221450.26460-11-philmd@linaro.org> --- gdbstub/gdbstub.c | 3 ++- gdbstub/user-target.c | 4 ++-- linux-user/syscall.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 9c2b8b5d0a..b3574997ea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -32,6 +32,7 @@ #include "exec/gdbstub.h" #include "gdbstub/syscalls.h" #ifdef CONFIG_USER_ONLY +#include "accel/tcg/vcpu-state.h" #include "gdbstub/user.h" #else #include "hw/cpu/cluster.h" @@ -1661,7 +1662,7 @@ static void handle_query_supported(GArray *params, void *user_ctx) #if defined(CONFIG_USER_ONLY) #if defined(CONFIG_LINUX) - if (gdbserver_state.c_cpu->opaque) { + if (get_task_state(gdbserver_state.c_cpu)) { g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+"); } g_string_append(gdbserver_state.str_buf, ";QCatchSyscalls+"); diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index 6646684a4c..a9c6c64512 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -216,7 +216,7 @@ void gdb_handle_query_offsets(GArray *params, void *user_ctx) { TaskState *ts; - ts = gdbserver_state.c_cpu->opaque; + ts = get_task_state(gdbserver_state.c_cpu); g_string_printf(gdbserver_state.str_buf, "Text=" TARGET_ABI_FMT_lx ";Data=" TARGET_ABI_FMT_lx @@ -252,7 +252,7 @@ void gdb_handle_query_xfer_auxv(GArray *params, void *user_ctx) offset = get_param(params, 0)->val_ul; len = get_param(params, 1)->val_ul; - ts = gdbserver_state.c_cpu->opaque; + ts = get_task_state(gdbserver_state.c_cpu); saved_auxv = ts->info->saved_auxv; auxv_len = ts->info->auxv_len; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1b42e80f9a..b9b5a387b3 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6463,7 +6463,7 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, case PR_GET_TID_ADDRESS: { - TaskState *ts = env_cpu(env)->opaque; + TaskState *ts = get_task_state(env_cpu(env)); return put_user_ual(ts->child_tidptr, arg2); } @@ -8124,7 +8124,7 @@ static int open_self_maps_2(void *opaque, target_ulong guest_start, static int open_self_maps_1(CPUArchState *env, int fd, bool smaps) { struct open_self_maps_data d = { - .ts = env_cpu(env)->opaque, + .ts = get_task_state(env_cpu(env)), .host_maps = read_self_maps(), .fd = fd, .smaps = smaps From patchwork Mon May 6 12:37:16 2024 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: 795007 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901586wra; Mon, 6 May 2024 05:39:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDAJ1w5nlDb4pdd7lCiPrvIWHEUxNvGUKu1OOzgwy1Ng2nx7D46gyW1Ezl4bQ1mzQpQYujBMlCQl15iAY/uS+p X-Google-Smtp-Source: AGHT+IFGmgwKPaht/D55Szx/TJpDLhgnc7HZbFfJ5HjlZD3Vds1tgN6BXPzdTmOIwXgZ+xxPN6Vu X-Received: by 2002:a05:620a:29ca:b0:790:c91a:73ae with SMTP id s10-20020a05620a29ca00b00790c91a73aemr25620504qkp.2.1714999191376; Mon, 06 May 2024 05:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999191; cv=none; d=google.com; s=arc-20160816; b=q8GH8QmFJv5M/x0GAeQ1oKm7zhcnQRUwPUwVbUPNppkNGDH1ds8q7ruet54YQ91+Dv ys5spEMkgXxt0oNpEKvuR7WzNfjqlxlGK2OnVsMQVX4s6G8u8dTRWoWP0EyIVZeKjyHH aAPs8rXhsXIdubKVppNM4WalalqgNwkFkyv8NX8ABS5xIgs3bPtv98by5lySMSIzgejy a2vgqI9t204J2AWk70W73aZCSU5Uq0PuR/A+97rSutnefhqosRFsjPz4CQrpcSxEozMw jKWTh600ctDcSAYjXwXfhS3CILnssQMriSBHHyjbyEaUrm4pNdJIsOhbxcTMAGfsO07F 6eTg== 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=M2dIn65/w/ORbBuM0bD/NrI0A+aMa+5s4kd6JrVU3Ow=; fh=Ea1Ifb+aNA659h3B2Y0Cksei6Mwa0R7RBOGkfNjINlo=; b=W12qhB6PtXjxVtSHrQt8GiDrOkBO+bPlPw0mo+SslpuL2MgS3uJ+8r58B3G2liAVAW uUXrwm9zy13OsXH9KmNybRzDwGMNdrKkBmWTXrjexuxuriYBTFgl5kjPnfOEu+4LFJdd Lna8VTwsdsZXPqedmHJvt1AWKyVm965JSzdoAQMvftlVxggrBXRl0RkW7IcQ8bkZToG0 1KD15qKodBQyATIDtwRrBkgV8zrAuhtxfKW+YtO+9VDsR7Ipsai+0e1XlfzzZPFs1iha mh6aNJlbvybEd5sNOqV4ftWMCUY/yTLGWqsA2fSjeAVSYw0BG+SfLNwG+WJhWpJjL0Wm GRLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ne9/5zCF"; 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 pi39-20020a05620a37a700b0079295d7ff11si2676439qkn.321.2024.05.06.05.39.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:51 -0700 (PDT) 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="ne9/5zCF"; 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 1s3xcz-0004hi-6f; Mon, 06 May 2024 08:39:33 -0400 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 1s3xcv-0004Ak-54 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:29 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xcr-0002AP-Tq for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:28 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-41b869326daso12685915e9.0 for ; Mon, 06 May 2024 05:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999163; x=1715603963; 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=M2dIn65/w/ORbBuM0bD/NrI0A+aMa+5s4kd6JrVU3Ow=; b=ne9/5zCF4a6KBoTxso5oiw1IT0sa2um0InHsTdtLsJ4qRxmES+r1vLagCwbG8Hg30S 0U296T7XMfbIKbOt4zrBwc09wI0V0ZOsaDNMf2XJV3mY5H3biL0LIPaZ+DA52a4W3kh3 ENwdn98zXGwN7/1lBhkQeDcs9auHq8n4qDExo6iTaAwKQ/7CfYfQ7a4K7X+adfOe46f4 RIFAIn1KOWN9VlSPWnDX/oj2NZNPs2bvkDfLtvWTPMGNLmzxd7Ix//hjnAIANnf3UCwH BYp8N1VDYKvPPXHfZIwOxFsNkoLw44YXOEODQJArQuFQGkhnlzmqzLkZKqPlK16a/oIs r9qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999163; x=1715603963; 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=M2dIn65/w/ORbBuM0bD/NrI0A+aMa+5s4kd6JrVU3Ow=; b=RGwEfhHAldY4TPdlediV2FGzl+OdiLlyW4rgpLzK/3YdTNVcy2QDjD5Tv5kYYpJbC2 MZmX4hBe8vkFXRx0oe046eb85TcMJIpHWfFq7ejm4AZybZjpluyas9OYDNXd3fi4lhpq IEE7N4E4JLabqvstlPwVLB9mY+tVmkNJVgqJv1BSYPIIFojNlleaCI+WKKy47FdJ2vPu T5LYvz+QdzKwqCK4Rg38Kr2mHYDLDAGkMdsYtv0h87yw68Z1sleSZCFdEZzEO5JSyjI9 n4ebNHtr+XebNVQSzVzN6v/9bvf5QEQQzux41+11qnx1Lx+N2ltX0jUJgE9uwL391NUv nh4w== X-Gm-Message-State: AOJu0YxDtAZyv3+BLqbN40DAmEhVK8YcaCS1YY7BhUO1R0PJM1M0X7Wb wKfv51qfBT4wPRw5Yau59di21E0d3ShmBGoyzPHJdh7RxakMbRIc293VmS9K4+O3HMPkNyNTwrj a X-Received: by 2002:a05:6000:1963:b0:34a:d1d4:cb3c with SMTP id da3-20020a056000196300b0034ad1d4cb3cmr9155061wrb.39.1714999163635; Mon, 06 May 2024 05:39:23 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id t7-20020a5d6907000000b00349bd105089sm10559984wru.47.2024.05.06.05.39.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Juergen Gross , Vikram Garhwal , Stefano Stabellini , =?utf-8?q?Alex_Benn=C3=A9e?= , "Edgar E . Iglesias" , David Hildenbrand , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 16/28] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length() Date: Mon, 6 May 2024 14:37:16 +0200 Message-ID: <20240506123728.65278-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: Juergen Gross qemu_map_ram_ptr() and qemu_ram_ptr_length() share quite some code, so modify qemu_ram_ptr_length() a little bit and use it for qemu_map_ram_ptr(), too. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal Reviewed-by: Stefano Stabellini Reviewed-by: Alex Bennée Message-Id: <20240227223501.28475-4-vikram.garhwal@amd.com> Reviewed-by: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias Acked-by: David Hildenbrand Reviewed-by: Peter Xu Message-ID: <20240430164939.925307-2-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- system/physmem.c | 56 ++++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 44e477a1a5..8278e31c1a 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2189,43 +2189,17 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length) } #endif /* !_WIN32 */ -/* Return a host pointer to ram allocated with qemu_ram_alloc. - * This should not be used for general purpose DMA. Use address_space_map - * or address_space_rw instead. For local memory (e.g. video ram) that the - * device owns, use memory_region_get_ram_ptr. - * - * Called within RCU critical section. - */ -void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr) -{ - if (block == NULL) { - block = qemu_get_ram_block(addr); - addr -= block->offset; - } - - if (xen_enabled() && block->host == NULL) { - /* We need to check if the requested address is in the RAM - * because we don't want to map the entire memory in QEMU. - * In that case just map until the end of the page. - */ - if (block->offset == 0) { - return xen_map_cache(addr, 0, 0, false); - } - - block->host = xen_map_cache(block->offset, block->max_length, 1, false); - } - return ramblock_ptr(block, addr); -} - -/* Return a host pointer to guest's ram. Similar to qemu_map_ram_ptr - * but takes a size argument. +/* + * Return a host pointer to guest's ram. * * Called within RCU critical section. */ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, hwaddr *size, bool lock) { - if (*size == 0) { + hwaddr len = 0; + + if (size && *size == 0) { return NULL; } @@ -2233,7 +2207,10 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, block = qemu_get_ram_block(addr); addr -= block->offset; } - *size = MIN(*size, block->max_length - addr); + if (size) { + *size = MIN(*size, block->max_length - addr); + len = *size; + } if (xen_enabled() && block->host == NULL) { /* We need to check if the requested address is in the RAM @@ -2241,7 +2218,7 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, * In that case just map the requested area. */ if (block->offset == 0) { - return xen_map_cache(addr, *size, lock, lock); + return xen_map_cache(addr, len, lock, lock); } block->host = xen_map_cache(block->offset, block->max_length, 1, lock); @@ -2250,6 +2227,19 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, return ramblock_ptr(block, addr); } +/* + * Return a host pointer to ram allocated with qemu_ram_alloc. + * This should not be used for general purpose DMA. Use address_space_map + * or address_space_rw instead. For local memory (e.g. video ram) that the + * device owns, use memory_region_get_ram_ptr. + * + * Called within RCU critical section. + */ +void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr) +{ + return qemu_ram_ptr_length(ram_block, addr, NULL, false); +} + /* Return the offset of a hostpointer within a ramblock */ ram_addr_t qemu_ram_block_host_offset(RAMBlock *rb, void *host) { From patchwork Mon May 6 12:37:17 2024 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: 795005 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901574wra; Mon, 6 May 2024 05:39:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWx0y5k4pI2Rm3RdwiX38/Lz8G/P4kjq4h3HpHA0YeWT9j5zQHq39IKlYgcmmFwpuLdUetnsrnmQK/GDc/LNi4V X-Google-Smtp-Source: AGHT+IFv2D49bccFPaqX/gjXlw/ly6Df8wAAAz9ClIlV7j+l6j1vyZCOicoUqsYpZ9XRZo/Qkv6s X-Received: by 2002:ad4:5aea:0:b0:6a0:cbe9:d73f with SMTP id c10-20020ad45aea000000b006a0cbe9d73fmr11973851qvh.19.1714999188493; Mon, 06 May 2024 05:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999188; cv=none; d=google.com; s=arc-20160816; b=hY6GrJbrLthrvoToLf/FxyUIYh3rm+T/4XfZc13mJQ3+VnBequUQFJ4Yvu//+TeH5n CRsdCjjYmfjveJpodFRO5aJFLfWBIGZYjtHZ+F2UJqR9SUo0ePH0G5l9dnEGVvz//z4S epjUe8XMGxo3NN609kUWrPFhmfpCe+TNg7VINgU4hs+Vd0mQkwX/8TDoh6xkOHoUY3UM BUQN1UAcxounvUDb7iEYzj5IHtk9xDElLGMojnuMHyrUTNQKfjXmNUfTaMPwR4Cax+Ac lvQKfLTIRsdfZ9jziilrqhYcl36o6rtKlKsgsLLAIKBL6J+CnMWrXgJgxnBByE9Wk7dI L7kA== 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=vPkYetppSsjPcJRijyPbZW3TmA+wkAdtU1ccC5YsPog=; fh=r37zqqRgjl0vgMOE1d+sAKg5pRPdQEMjopPj8TtvHIU=; b=Tvn750yqGsSxMPep/kQMbkF/FSJ2modG6sMaSnkqXxbqy5XFNunr43/wp/re4WsTat OHWbyuQItZme6hEGT8fVYQCEzHfbBMXiaDmKRb9TPC5HlXUC0BjO6x6MyzuSnEMsRUID cL+KHAUG0nyHoF8V1mcVmorr42fhy9j1RGKAaHO6AZsnKeRlBPnJDhBfEOHW3pPK6Dvo qDI1oAhk1dow+PxZpyEcPQbIunuowODo/gjw3uea7MQ4eUeccwkHmNjeW6TyOcxBoA1L 3JhOTXfrtXD/rSETQx442P4Z0GdjHGzwX9ALtk3nGg0dHppq/fe2le+dWTel7Qtz3VLm iOmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hf0bccvL; 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 a8-20020a056214062800b006993d828d7fsi9089641qvx.259.2024.05.06.05.39.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:48 -0700 (PDT) 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=hf0bccvL; 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 1s3xd3-0005La-IN; Mon, 06 May 2024 08:39:37 -0400 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 1s3xd0-000535-OG for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:35 -0400 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 1s3xcy-0002BF-Lj for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:34 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41ba1ba5592so12617735e9.1 for ; Mon, 06 May 2024 05:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999171; x=1715603971; 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=vPkYetppSsjPcJRijyPbZW3TmA+wkAdtU1ccC5YsPog=; b=hf0bccvLPsJ3T279ELV5hRP8x7mJNaqgetWH4sWKJ3kiFIjq8zl5+LEZN6xiSL4OIm yqqg0CQ9dUDdzLOflj9mtJ2v+v8y/Nq0MEOJmH/I3gAWx0O1hG2LAQW2BGo03dp0Aq85 8KsGN2tN0XzaDCPkQQ984aoYx9bXIkeR973M41V7+WlzIUD6pmgfSTx4Rp2ziF7A+g8R BbY6B6r3D/vIjGvDV5W0a1ugO7Vdv9rdkhhpbtBRYssj3EQ3tvTeT8X0M7KtQvfYM+eV np+7equ/PqWRmdi4TCORQEV3J1QXYln/mR6XzS4OENmo5FOKEZg1Z0XQ6LgVj4HPetVu xntw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999171; x=1715603971; 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=vPkYetppSsjPcJRijyPbZW3TmA+wkAdtU1ccC5YsPog=; b=BPoHyhZRJB5IStndVvoia/+qVZOhQfXVexyqT33xSzLh08eEFa2EM1OOdVCyzQF0BY KthQKxJMkyNVJBX9i6sigDU907PhGy7Sm1QiZ/QJJwpCpAUGfbL439UvCOZCyto7yuK0 aO8Cqf5x+I0d/2KVRzKZcC88tKqSaHS6xF1KbE9Ma5i089xZ/79yzg1qRegSPNYJ1sTw zgWeBI8dThxX+raBxXiqmlf1NqFYkfg5jwQxJ/W3nr0AVbeWf8KwyB1KigUM4Lwz1FvL yvarajInVj6dgiNr3aCg9zXP+QavyhUXmA9f3wFE3RyYYYLC4zWapsXLswCsYOSUhJpJ /V4w== X-Gm-Message-State: AOJu0YzYgODdqrzYXptT2gxtPnAVPdakFky2drdwFPrrcoxp1plqb9hC bvOryzIqChZdM22Lf80LeXNQaNNxFuD7P2ErJZkHs4CcFkBfNcf90qEV8/I20E/WKieTRl4anyb k X-Received: by 2002:a05:600c:4f02:b0:41b:d973:24c1 with SMTP id l2-20020a05600c4f0200b0041bd97324c1mr9426655wmq.12.1714999170931; Mon, 06 May 2024 05:39:30 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id bg5-20020a05600c3c8500b0041bbec72670sm16031875wmb.39.2024.05.06.05.39.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Juergen Gross , Stefano Stabellini , "Edgar E . Iglesias" , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 17/28] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry Date: Mon, 6 May 2024 14:37:17 +0200 Message-ID: <20240506123728.65278-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 From: Juergen Gross Today xen_ram_addr_from_mapcache() will either abort() or return 0 in case it can't find a matching entry for a pointer value. Both cases are bad, so change that to return an invalid address instead. Signed-off-by: Juergen Gross Reviewed-by: Stefano Stabellini Message-Id: <20231005181629.4046-5-vikram.garhwal@amd.com> Signed-off-by: Edgar E. Iglesias Reviewed-by: Alex Bennée Reviewed-by: Edgar E. Iglesias Message-ID: <20240430164939.925307-3-edgar.iglesias@gmail.com> [PMD: Keep xen_ram_addr_from_mapcache_not_found trace event] Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 7f59080ba7..7771c6cb91 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -395,12 +395,8 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) } if (!found) { trace_xen_ram_addr_from_mapcache_not_found(ptr); - QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { - trace_xen_ram_addr_from_mapcache_found(reventry->paddr_index, - reventry->vaddr_req); - } - abort(); - return 0; + mapcache_unlock(); + return RAM_ADDR_INVALID; } entry = &mapcache->entry[paddr_index % mapcache->nr_buckets]; @@ -409,7 +405,7 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) } if (!entry) { trace_xen_ram_addr_from_mapcache_not_in_cache(ptr); - raddr = 0; + raddr = RAM_ADDR_INVALID; } else { raddr = (reventry->paddr_index << MCACHE_BUCKET_SHIFT) + ((unsigned long) ptr - (unsigned long) entry->vaddr_base); From patchwork Mon May 6 12:37:18 2024 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: 795008 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901707wra; Mon, 6 May 2024 05:40:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXrv4f982NeWsNqymscT7vP/i0V2Cvm6WUBnKpep9xESjkYwZ+Gq6uFsxeP7mnvybU7zUE0TS51kg6MA8WbXc0o X-Google-Smtp-Source: AGHT+IFaLDfdeRxFwrY8FSv9ZhOcHl1pUvyNqO0rqdIBM40KT/Hoi8lNFf+htyBWLJTWNZ9epNQC X-Received: by 2002:a05:622a:154:b0:43a:f441:75ab with SMTP id v20-20020a05622a015400b0043af44175abmr12542691qtw.22.1714999208730; Mon, 06 May 2024 05:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999208; cv=none; d=google.com; s=arc-20160816; b=BvvdqsMA9OrIFw2kLPEP8wnH2ZC6wOhoZdNENb8z8NZ3HD4zOBm/Iqjqfmxo944QRs qrgJ00ZwJITJnl2WNJAZ2aFz4b3tqUsAApEPhS6ttXz24CyYdIqyTK0MfU8gFQd4v9Xg e3AqhhzwR42pF+47FR1vJextdUfrOou9//tn2p3I0KWfsw4f3e+XCwML1/G0680JIOnm nZJ1bS/h2Z9W03FUE14VLHXIbRgL3nCxp6R/P+BBEOtBM4pH1VLcQIcVsPHxUivOsriX xmLeUO6/ws1n1G4qVgFbuRFf+lt7T8+ktK7UxpuI/om1hTbUn63fOJLLxiN9YuUbb34C vEfQ== 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=K5u2rheGkOka+/vzLNLtDhnD9hQYgNI374jkL3ZGkPc=; fh=XVUtrnJiHLUT3AfimIF4u8xDSdgEw+GOzMXzfP+PTMU=; b=w10EOW4r/Xulvm+4raMc6W3LH1MGEmwDebne9rNVM8xFVBMIJTnICdbR3q1OaBHRZV H5vkYTB2B2Cwbwn2xrWm88pL8tYYOi0cRtF2Dgn0/F4upYyT2AwzfWIVoqFR+nfO/GLh TF777E4QnnbZJbKp76r3eOtP4sNFVdLioc30uMHRt59ZVKvfKHfv2NpCB87uhk3p0cqD 36vUgldbZz67OllJWjDoRmdGumcJvjpzt7MNvRyswlsPQ0AJrMfvUAN9UIjsQoJiLBPm UQf7++glUGffL6EAM01H8TRsXE9x/aGAQJiyAAPOVGWXwQxPp/DfY2n2wgs/PfPJvUMb /ZQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FZ+BtUvJ; 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 z21-20020ac87f95000000b0043acfb0c292si9627780qtj.601.2024.05.06.05.40.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:08 -0700 (PDT) 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=FZ+BtUvJ; 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 1s3xdM-00086M-VN; Mon, 06 May 2024 08:39:57 -0400 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 1s3xdK-0007qD-IT for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:54 -0400 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 1s3xd5-0002Cr-8c for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:54 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41ba1ba55e8so11241215e9.1 for ; Mon, 06 May 2024 05:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999177; x=1715603977; 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=K5u2rheGkOka+/vzLNLtDhnD9hQYgNI374jkL3ZGkPc=; b=FZ+BtUvJPefmr+BMqwJ1EnSz3CGn0xq5QgeJhWeYSaWUGkWVY5cjYBIIxAun97ALYm hvKTKpNrZ6J2SWk7DkQtWKd84tT//bEloJDgIlj9mXlxgyybRxhDrVhGOBD7cV4CBLIv zMO70Kl6zJJXopDnwflMS2vvoGLP7tS9ZHfMTEQN86NLgatENIs4gs9W33FHXTi5gS8Y UJTjqL1DcposzVt9dFia8AmrmHznLkIFd9J2/TSF4pG32qneQNRalTyNPq6j68MKazFi ASvZTAd0QDrCXb/Yv+KRZ5qcDmz9INve7/cDU/waK9I4fEPQW/RIRZJOmjNQ8hH0++i+ CdoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999177; x=1715603977; 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=K5u2rheGkOka+/vzLNLtDhnD9hQYgNI374jkL3ZGkPc=; b=ei09O9qv9XK/k7jlfp48Bx6Bset609aq6fCkvjQ1Qh04EeacuwoBglL+4C2YX6d1Zz 6PH1RZnnoWjzP8wR8LKn2RtFTFGliiuitfVc/P/Xzvj4DtJJuFJqeVL+pG9r0keL2B0H XygcYqeiLB5zhTGZPa6vVis2Lfec3Sq/jZpTvx6oyS/YmV4vqY0hSbro15GJRlibvtK6 nQ/H6gGLKNytTo9RonFsCmG2wHDtxXXI0reBKxyxUawFDCKpaZm5PVaja+O2qb6GM1x7 g1NPre5Uy01MNeeu3J+vk73+Sf4XXFDI9uLTvQKGkIfUeySAvQ0KRCoJ4K40x9laU2OU m66Q== X-Gm-Message-State: AOJu0YxhVrESxIhu6KuzqXDk69q+Alzq5lrvd2e03jeO14jjljcQbJZp Yf7/KDv5TZsXWYNDyNdfb77HKxdeW5SRJPvzorqjyXkAIijluYgOKVLJuBGmqVYyP0rT+noYONH x X-Received: by 2002:a05:600c:4446:b0:41b:4de0:7bff with SMTP id v6-20020a05600c444600b0041b4de07bffmr7626181wmn.35.1714999177047; Mon, 06 May 2024 05:39:37 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id i16-20020a05600c355000b0041b61504565sm16142382wmq.28.2024.05.06.05.39.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Stefano Stabellini Subject: [PULL 18/28] xen: mapcache: Refactor lock functions for multi-instance Date: Mon, 6 May 2024 14:37:18 +0200 Message-ID: <20240506123728.65278-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-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 From: "Edgar E. Iglesias" Make the lock functions take MapCache * as argument. This is in preparation for supporting multiple caches. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefano Stabellini Message-ID: <20240430164939.925307-4-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 7771c6cb91..c27be6abee 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -74,14 +74,14 @@ typedef struct MapCache { static MapCache *mapcache; -static inline void mapcache_lock(void) +static inline void mapcache_lock(MapCache *mc) { - qemu_mutex_lock(&mapcache->lock); + qemu_mutex_lock(&mc->lock); } -static inline void mapcache_unlock(void) +static inline void mapcache_unlock(MapCache *mc) { - qemu_mutex_unlock(&mapcache->lock); + qemu_mutex_unlock(&mc->lock); } static inline int test_bits(int nr, int size, const unsigned long *addr) @@ -369,9 +369,9 @@ uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, { uint8_t *p; - mapcache_lock(); + mapcache_lock(mapcache); p = xen_map_cache_unlocked(phys_addr, size, lock, dma); - mapcache_unlock(); + mapcache_unlock(mapcache); return p; } @@ -384,7 +384,7 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) ram_addr_t raddr; int found = 0; - mapcache_lock(); + mapcache_lock(mapcache); QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { if (reventry->vaddr_req == ptr) { paddr_index = reventry->paddr_index; @@ -395,7 +395,7 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) } if (!found) { trace_xen_ram_addr_from_mapcache_not_found(ptr); - mapcache_unlock(); + mapcache_unlock(mapcache); return RAM_ADDR_INVALID; } @@ -410,7 +410,7 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) raddr = (reventry->paddr_index << MCACHE_BUCKET_SHIFT) + ((unsigned long) ptr - (unsigned long) entry->vaddr_base); } - mapcache_unlock(); + mapcache_unlock(mapcache); return raddr; } @@ -481,9 +481,9 @@ static void xen_invalidate_map_cache_entry_bh(void *opaque) { XenMapCacheData *data = opaque; - mapcache_lock(); + mapcache_lock(mapcache); xen_invalidate_map_cache_entry_unlocked(data->buffer); - mapcache_unlock(); + mapcache_unlock(mapcache); aio_co_wake(data->co); } @@ -499,9 +499,9 @@ void coroutine_mixed_fn xen_invalidate_map_cache_entry(uint8_t *buffer) xen_invalidate_map_cache_entry_bh, &data); qemu_coroutine_yield(); } else { - mapcache_lock(); + mapcache_lock(mapcache); xen_invalidate_map_cache_entry_unlocked(buffer); - mapcache_unlock(); + mapcache_unlock(mapcache); } } @@ -513,7 +513,7 @@ void xen_invalidate_map_cache(void) /* Flush pending AIO before destroying the mapcache */ bdrv_drain_all(); - mapcache_lock(); + mapcache_lock(mapcache); QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { if (!reventry->dma) { @@ -547,7 +547,7 @@ void xen_invalidate_map_cache(void) mapcache->last_entry = NULL; - mapcache_unlock(); + mapcache_unlock(mapcache); } static uint8_t *xen_replace_cache_entry_unlocked(hwaddr old_phys_addr, @@ -607,8 +607,8 @@ uint8_t *xen_replace_cache_entry(hwaddr old_phys_addr, { uint8_t *p; - mapcache_lock(); + mapcache_lock(mapcache); p = xen_replace_cache_entry_unlocked(old_phys_addr, new_phys_addr, size); - mapcache_unlock(); + mapcache_unlock(mapcache); return p; } From patchwork Mon May 6 12:37:19 2024 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: 795012 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901846wra; Mon, 6 May 2024 05:40:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVpIzG3jx7w1uqUc+OCTCu6jvSvjhoWzcoUAntjcffbTR0d8T6TuEPlxnMS7wy9PLRWMoTNv8Ko+pWtTkPR6TLy X-Google-Smtp-Source: AGHT+IFkh1lTomNfmNgeyR6qn66GmUGC9OKL9KPgMvskqRDMogSBkgO+Yb75C40Ss6UDNJshmgHP X-Received: by 2002:a25:d850:0:b0:dcd:97f4:9943 with SMTP id p77-20020a25d850000000b00dcd97f49943mr9108848ybg.19.1714999229828; Mon, 06 May 2024 05:40:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999229; cv=none; d=google.com; s=arc-20160816; b=AfaIKf2NNRzVdnNpqatPxLMO+M7UDK5SA+5hh7IAJX9V0f5cz1TxgzWyTu6quJXaiN K6p2oYOhhUP8g6VuNBFXiVniW13+KSvu7TWUuP3M9CeRuNVYCL+aamaq79HQpeEx66US QOg2F01hKUARrM7SSCbEmWRRJQNCWKtrfhCnnJ0hNLe1FneL3Xg0oGdRUrOJ0Iq6+LWP /KCsUSYPSNx/ft05RABfXgLmzpiOilNJ/7BpdICw9jPpLdoOmnnNgA4BVcCUKZPFYbGm 67ITvHBEwr9QWURo/ugY31EdIGxfo0k2q7Y1YJhcVuA5W2wURe04nWmUp7evL/a26vtm s5+A== 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=2FxlBjDJOEbHnMQ/UhA0SxKIT6u4WalO0XGgQNG39go=; fh=XVUtrnJiHLUT3AfimIF4u8xDSdgEw+GOzMXzfP+PTMU=; b=W+Ahxl26AmDXGWAKc69tojeDd7C/QJX1OW5wPmrj/4dnLyf6ohq+zBzRyMZdCkdjfn cXgzLobb4HXg360XMEG2zDerREn34264ZweiTwPFAsl7yHn9RKWtU/MbwlRj18c/EI9K cEqIj3SaxCzIMV8OTtdXQ4npJyyRVTj8TL5ivxea5hw9QeJse0bPPQ36LOTZngQzX+Ev XizK6nMlkU8rm5xKt/J4oEQHgQ6rP8b8plCluhqTnXlo6IP3SAz6odG0FrSe5l+jgMm0 qguhTnoVAM3BCZe944/ImZ7VaACovTKCVesJ7SOlK9dNbkqfmsithZkPPXIcgEHhdAGl WOaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fIuKLwAK; 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 g17-20020ac85811000000b0043ae5b10004si6187633qtg.154.2024.05.06.05.40.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:29 -0700 (PDT) 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=fIuKLwAK; 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 1s3xdQ-0000K4-QM; Mon, 06 May 2024 08:40:00 -0400 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 1s3xdO-0008O7-KY for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:58 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdA-0002En-Vt for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:58 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41dc9c83e57so23343225e9.0 for ; Mon, 06 May 2024 05:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999183; x=1715603983; 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=2FxlBjDJOEbHnMQ/UhA0SxKIT6u4WalO0XGgQNG39go=; b=fIuKLwAKU0c9zePIgoR/vAw5s4yRUeaG84yOtI7lHYSAo1qdrZfNbemgnrjD4ybGe/ +1l4lxxKP1ACCf0Px00xLOFM2HZHCnPRrc+LqIunaK0VP+Sl/KEQq2u2aTlzf6pQ8xcI a+Et/gGTLjAHgn7v83oUhKi8NyNg8IlZzxTdDjHmfZTsgxlrv+AOzr2QTFcfRoeoVHrb 5Dax7BeiYt+b9RE7Ss2mnidEZmVjIe142yLWQcHJpgswg0wsIyRdCYQXkSzOGm9Rraei NR1X1QMP1xuz4lJ1938ulrwk5lRupPjFyWGodPX5Vit7mTfcMMSC5VvE6olsQJ/AaUiA /MRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999183; x=1715603983; 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=2FxlBjDJOEbHnMQ/UhA0SxKIT6u4WalO0XGgQNG39go=; b=Rba3F6U6Jp1dF32+s19F6LHNjkErtIEjYHFYeOgM3M+I1S61gy7Gctmv+KB8y0d4IO O1o88DXwE8VaiD8aCKpMdPrapwxEaEE7TY7HYjmOwethzdHYVf27V4LPD1wJd3ytXLh0 +WI9VsZLdiYWoVuYiU5TvO7rsDmE5nNwV3WoKjEKs2Bvgpr/PGwlDykkNH7APdsS0Zxe QgMJDnftGbMj+5O8dTZAckKs7eGgApPcPX67Wwg7tJMneplVmS1w/jjO4kYaYefcGBho CSsorA+YGbJUdQ+mzyUVd2kRVANT/NTxFHoqqg19PrvXSz91EIvfgXegUEi29aNa3XMj 5SDA== X-Gm-Message-State: AOJu0YwgNOXkdzWm+mMFyO9MDcouZrlrESv1eOjL9BoNf8oGri70RK/N AEBJOFF+WZQOZ4xT9rtw4rpGHq4+5bR4uL4kZIwJJxWeLuUmkgnLuIhE2Pzu2skxlvC/GB1W/jE I X-Received: by 2002:a05:600c:3c9e:b0:418:3ea8:46c0 with SMTP id bg30-20020a05600c3c9e00b004183ea846c0mr11560331wmb.13.1714999183232; Mon, 06 May 2024 05:39:43 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id m9-20020a05600c4f4900b0041bf7da4200sm16063851wmq.33.2024.05.06.05.39.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Stefano Stabellini Subject: [PULL 19/28] xen: mapcache: Refactor xen_map_cache for multi-instance Date: Mon, 6 May 2024 14:37:19 +0200 Message-ID: <20240506123728.65278-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, 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: "Edgar E. Iglesias" Make xen_map_cache take a MapCache as argument. This is in prepaparation to support multiple map caches. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefano Stabellini Message-ID: <20240430164939.925307-5-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index c27be6abee..9e0a56b41b 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -240,7 +240,8 @@ static void xen_remap_bucket(MapCacheEntry *entry, g_free(err); } -static uint8_t *xen_map_cache_unlocked(hwaddr phys_addr, hwaddr size, +static uint8_t *xen_map_cache_unlocked(MapCache *mc, + hwaddr phys_addr, hwaddr size, uint8_t lock, bool dma) { MapCacheEntry *entry, *pentry = NULL, @@ -269,16 +270,16 @@ tryagain: test_bit_size = XC_PAGE_SIZE; } - if (mapcache->last_entry != NULL && - mapcache->last_entry->paddr_index == address_index && + if (mc->last_entry != NULL && + mc->last_entry->paddr_index == address_index && !lock && !size && test_bits(address_offset >> XC_PAGE_SHIFT, test_bit_size >> XC_PAGE_SHIFT, - mapcache->last_entry->valid_mapping)) { + mc->last_entry->valid_mapping)) { trace_xen_map_cache_return( - mapcache->last_entry->vaddr_base + address_offset + mc->last_entry->vaddr_base + address_offset ); - return mapcache->last_entry->vaddr_base + address_offset; + return mc->last_entry->vaddr_base + address_offset; } /* size is always a multiple of MCACHE_BUCKET_SIZE */ @@ -291,7 +292,7 @@ tryagain: cache_size = MCACHE_BUCKET_SIZE; } - entry = &mapcache->entry[address_index % mapcache->nr_buckets]; + entry = &mc->entry[address_index % mc->nr_buckets]; while (entry && (lock || entry->lock) && entry->vaddr_base && (entry->paddr_index != address_index || entry->size != cache_size || @@ -326,10 +327,10 @@ tryagain: if(!test_bits(address_offset >> XC_PAGE_SHIFT, test_bit_size >> XC_PAGE_SHIFT, entry->valid_mapping)) { - mapcache->last_entry = NULL; + mc->last_entry = NULL; #ifdef XEN_COMPAT_PHYSMAP - if (!translated && mapcache->phys_offset_to_gaddr) { - phys_addr = mapcache->phys_offset_to_gaddr(phys_addr, size); + if (!translated && mc->phys_offset_to_gaddr) { + phys_addr = mc->phys_offset_to_gaddr(phys_addr, size); translated = true; goto tryagain; } @@ -342,7 +343,7 @@ tryagain: return NULL; } - mapcache->last_entry = entry; + mc->last_entry = entry; if (lock) { MapCacheRev *reventry = g_new0(MapCacheRev, 1); entry->lock++; @@ -352,16 +353,16 @@ tryagain: abort(); } reventry->dma = dma; - reventry->vaddr_req = mapcache->last_entry->vaddr_base + address_offset; - reventry->paddr_index = mapcache->last_entry->paddr_index; + reventry->vaddr_req = mc->last_entry->vaddr_base + address_offset; + reventry->paddr_index = mc->last_entry->paddr_index; reventry->size = entry->size; - QTAILQ_INSERT_HEAD(&mapcache->locked_entries, reventry, next); + QTAILQ_INSERT_HEAD(&mc->locked_entries, reventry, next); } trace_xen_map_cache_return( - mapcache->last_entry->vaddr_base + address_offset + mc->last_entry->vaddr_base + address_offset ); - return mapcache->last_entry->vaddr_base + address_offset; + return mc->last_entry->vaddr_base + address_offset; } uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, @@ -370,7 +371,7 @@ uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, uint8_t *p; mapcache_lock(mapcache); - p = xen_map_cache_unlocked(phys_addr, size, lock, dma); + p = xen_map_cache_unlocked(mapcache, phys_addr, size, lock, dma); mapcache_unlock(mapcache); return p; } From patchwork Mon May 6 12:37:20 2024 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: 795010 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901756wra; Mon, 6 May 2024 05:40:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVbBOq3yVGPBECIZqs3GpDAgfqnkJvhHIripRZH24IEvY1NNChgyftVNTtQSyW3Q949i+DJaxLS9m0ZXuUSL9qW X-Google-Smtp-Source: AGHT+IFD7qwjrajrGAIT+8uwIsnv/EW2CYpkGPCAIqbfULhqNUVzurhlF/ID0M2Cc46dQk1wbqLP X-Received: by 2002:a05:6214:2488:b0:6a0:ae32:34c5 with SMTP id gi8-20020a056214248800b006a0ae3234c5mr11727437qvb.14.1714999216680; Mon, 06 May 2024 05:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999216; cv=none; d=google.com; s=arc-20160816; b=tg5iU4VYM1ZNDxJUbYfrm9MDCmHRiQ9s7FnOmcGyJTXGEyenAQ+7zUSbYyp/crTbUT FiSuArB5zJFiw3ygvTv50+rEeGRxU4HnCllVvcAYmQYJXD5VmFPb6qT+Lyplxi/dc/NT d8I0beF2dudxRP237AXVdBKWytF4n59YYCu+jNL0yPX/BFrdIKCQs3mPKH4i386lIzAa WXI+S4j4lp6l0FSCSc0Jsw4nfgroiG6xtYen/X/Dagvk/j9bqFaCc1uKXAwwuZU2YYRr gfZuLb0Qpzk9oBQFsd9wLTDCGI8BVwTSre8pXqel+uyVfuH8ZoHasb2TqvmJ68s9hU3J vnZQ== 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=1p0/bn0v9GB+8nuG2nruzO91sj0ZUfXKvZH/Fy9rq7U=; fh=t5ckFe1iifY1wq3g6za/3F2QK0Ucp01M/Pw5m9Xn0aU=; b=xlC7dtm/GpELv0LFNueKnxiq51jmOHWeuDmKtspoRgXhOKyrA26wYQJwLD9/XpbHzm WNh9hZ/QTcAdD6U/iRHLICRoN+qSFVeA34mDM8pBXQuneTjgyLMmZd96Q6xTjhb4U2dM 5h53r8PUdCFNjNzI11HTNUWowBt3Mts8vJd8YHCwPrSWXVvIJzEbQhJjACxeGMdbO5aB xDD0UZzttcfdQTjeWTJUGPvxS/UANDeqk4ub7NpE/unMaM1r8h1/JHuUjjEhaeD2fTOk R4MiKR8f4AMOCgmkaCby+0xZ8nAn3UFBRfyb/kdrLJX3hVdhdXVAT3EhYGDMnyMyEnq1 wcoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d4gLKbve; 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 gu4-20020a056214260400b0069b50350ad9si9222257qvb.190.2024.05.06.05.40.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:16 -0700 (PDT) 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=d4gLKbve; 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 1s3xdK-0007ql-Qv; Mon, 06 May 2024 08:39:54 -0400 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 1s3xdJ-0007bq-0l for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:53 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdH-0002FA-2u for qemu-devel@nongnu.org; Mon, 06 May 2024 08:39:52 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41ba0bb5837so12252795e9.3 for ; Mon, 06 May 2024 05:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999189; x=1715603989; 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=1p0/bn0v9GB+8nuG2nruzO91sj0ZUfXKvZH/Fy9rq7U=; b=d4gLKbveEe4X1q8Vid5upgyFd/8ozH1QK6AY1NkfSc6MCie8EOyF/sF+zbf7qTKnlS ffEC74IdSUf0h9aGuX1cc77QieOjyWI/izrZDn11GNDLgv8z1UN/t2aqt8Zg1FbBxJQl RxJ9FpT0j3CHaFnoiBMVVeGFckn8ZXw1FD4HU0E06zYHDsfN5gTMU98zIrKEv5qmispC qD0UzKgTNRszeX1kdTparvQrwdWX9hDji4FuVt5JIv67Rxmr27GGLmPDgR9QT0M7rPwf /4oxKU8UrfHLmneICg6SALj9dhWDIJ74Y0l6z+0/pog3srgMi6/GnBGblnVn0MsrLML8 xApw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999189; x=1715603989; 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=1p0/bn0v9GB+8nuG2nruzO91sj0ZUfXKvZH/Fy9rq7U=; b=fPT2wEkh+C70oJujn94Pv1anv0aQxGPdi9MdjxcGccA3OYGfjZO5VV6nzvUvLjn8r3 SOrSEdleY3ExbR34Y9LCOeflq/xar7b2nyYnd5dhEYN20d3rXBHfFPwJJLHVwmadXm84 5dnrgysIedVZv++iP38x5md4RbS/vF8nYkeQMtKwT+qvpugtwxqBroptMl1dFasWxCNZ x27cedD0mvR8WHjLfKHNKiHUfyJftZORtiI6dHpFhs8dZpuKRBWMXC/411ZtBAASZOcW r/WCmzgj9h33ynZ2NrCGfGpwGvja4notGGHjCrCTtCCLDkWe9SaU1LmJUKlSzhCUjCdY QnVw== X-Gm-Message-State: AOJu0Yy+XuBmOebDyHr4KXdYs7eRGNwI9xnvflPzFbTK5eUlhi4TyMzu 8eYOiOEaYROWMllPrf8TBPHkDG+5/1wcRcqTlWF8GBRku/zY3Dc5YSxWUavru+ORj4aJRy75lLV k X-Received: by 2002:a05:600c:5251:b0:418:e04b:ee63 with SMTP id fc17-20020a05600c525100b00418e04bee63mr6910750wmb.36.1714999189222; Mon, 06 May 2024 05:39:49 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id je8-20020a05600c1f8800b0041bf28aa11dsm15935813wmb.42.2024.05.06.05.39.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 20/28] xen: mapcache: Refactor xen_remap_bucket for multi-instance Date: Mon, 6 May 2024 14:37:20 +0200 Message-ID: <20240506123728.65278-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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: "Edgar E. Iglesias" Add MapCache argument to xen_remap_bucket in preparation to support multiple map caches. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240430164939.925307-6-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 9e0a56b41b..6bb3e0b362 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -139,7 +139,8 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque) mapcache->entry = g_malloc0(size); } -static void xen_remap_bucket(MapCacheEntry *entry, +static void xen_remap_bucket(MapCache *mc, + MapCacheEntry *entry, void *vaddr, hwaddr size, hwaddr address_index, @@ -313,14 +314,14 @@ tryagain: if (!entry) { entry = g_new0(MapCacheEntry, 1); pentry->next = entry; - xen_remap_bucket(entry, NULL, cache_size, address_index, dummy); + xen_remap_bucket(mc, entry, NULL, cache_size, address_index, dummy); } else if (!entry->lock) { if (!entry->vaddr_base || entry->paddr_index != address_index || entry->size != cache_size || !test_bits(address_offset >> XC_PAGE_SHIFT, test_bit_size >> XC_PAGE_SHIFT, entry->valid_mapping)) { - xen_remap_bucket(entry, NULL, cache_size, address_index, dummy); + xen_remap_bucket(mc, entry, NULL, cache_size, address_index, dummy); } } @@ -588,7 +589,7 @@ static uint8_t *xen_replace_cache_entry_unlocked(hwaddr old_phys_addr, trace_xen_replace_cache_entry_dummy(old_phys_addr, new_phys_addr); - xen_remap_bucket(entry, entry->vaddr_base, + xen_remap_bucket(mapcache, entry, entry->vaddr_base, cache_size, address_index, false); if (!test_bits(address_offset >> XC_PAGE_SHIFT, test_bit_size >> XC_PAGE_SHIFT, From patchwork Mon May 6 12:37:21 2024 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: 795015 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902273wra; Mon, 6 May 2024 05:41:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX7rx1oY9DcnAF/rf4ytGA5+peZ0diSyKmdwysTUtLO86fAb5rcnlzpbua8tSKzJebhCrJQHiGbnuUVDJqjw/bQ X-Google-Smtp-Source: AGHT+IGm8m9vDpIHAKGhO6+g3vNtbmpwKSjwGofYMHZ3T8svfF5bGL3tGJO8DXFJ5Lntkf1PhxhU X-Received: by 2002:a05:620a:14bc:b0:792:9313:a65e with SMTP id x28-20020a05620a14bc00b007929313a65emr4194067qkj.46.1714999296213; Mon, 06 May 2024 05:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999296; cv=none; d=google.com; s=arc-20160816; b=q5SlVogLeZJ3ehtUn/AYyRRv0LnL8jurW6/QLM886StKAKhWeXKbXjikBuy73snYtK amWw3DuCJVtiAJneIVpcJhP07MZIzFmf2BILeSf2tVQO4cuDC/hKP+P1onKy73fpVXOP dI9Ob5RnAJsirzK2azOEtTJvgdF51uIGTPmnKJ+ZJ2vfiejUY0NabQOvhRWlNgHXZuCB 9vJyHv9jjojT1KgF+x9/ILAprxso2iVRQ9izLDZeKBBRCeGQ3o3DkcVot/V8jytHj4dG iuhAajdJPPB2B2/DpLb+iOE1zi7ZpX6ieG84S+0g2mH5ukSIliotpvPAKPndCNwgGwbF ORkA== 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=H4urpjGwVcUdPIyFtNL9dEzEEHSDiRFQ9VHY+BzuV2Y=; fh=t5ckFe1iifY1wq3g6za/3F2QK0Ucp01M/Pw5m9Xn0aU=; b=Ql5fQIJLjkHzNMCWbiQWC1jyZev7YOuQ4ygpiQagsKNpQLf9dPVHpZ3IAwto5WrHON DdgnVwcF65MBsIniHsFhXI3XH0oA1wgKp689/eoJ/21uTVTLAOqTgi+kS1cJWRgMu9hs wTkUU9RGNxPtTuWOxmUiKb2a6G5sGlv3/ENWH95XeMxUa9Dm9MfMw7OBCaFahOES8kQF hW8ITvvAbbb518tnwXOtm48Am1v63WAcQa6awiXMe/O89MwflAhCZbIPSRF8sGkd781q XkHaG2cr6iA6kWFM0oqc3ifWiUHqxQ2H3uNEPhxdMp6hReLRQxMiymgafP9I70Dz0cWa zT4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IVKtoWjq; 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 m21-20020a05620a215500b007929190b8c5si3824951qkm.713.2024.05.06.05.41.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:41:36 -0700 (PDT) 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=IVKtoWjq; 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 1s3xdd-0001pw-8S; Mon, 06 May 2024 08:40:13 -0400 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 1s3xdb-0001cS-A8 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:11 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdN-0002GC-33 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:10 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-41ecffed96cso7453785e9.1 for ; Mon, 06 May 2024 05:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999195; x=1715603995; 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=H4urpjGwVcUdPIyFtNL9dEzEEHSDiRFQ9VHY+BzuV2Y=; b=IVKtoWjqKtVktFcdAandzSSu+DFdycOSpfmuhQezv2PFoph5VPsV2SQ04GgDNRjjTq JWqjlJn79nnWxuEK/qyUXtDUuN9B4wDtTZYbo8zjVXZdya5sbYTGy58WcJOR0+8N0ATy np5MikktY13SNQLSY/XbMr9tHPYycNFikzNZEFfNe21KPQlbdrmg8kPNH7o3wIi6Xojc acAYDtziyJEbrdQFZxy2V5B9CI/LvviWx7w60+0XyIqZ9UoLVzGz9PyZ+k17+z9/CEy4 JTZ28IhPgw7N+qpWm0yABKasGheat43gfKk96dYDN6ZG2758138XWdq2W4CDJIhypZUT DgMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999195; x=1715603995; 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=H4urpjGwVcUdPIyFtNL9dEzEEHSDiRFQ9VHY+BzuV2Y=; b=Bdua9xNPbyYIlMkf0AgRd3oNwO4SlCr7LmoKgx49SJ/IlXGWdFTDBNxYef0f8F4zgi JG3i2sFqCtm3cyspRe7VNR7p++cSP+JvNOIOQAFdPfiJag8knadNknrd8/m+ail14iam Qm1p6CUy12oG9wAAPS02KhfaUjDmNgku2f/gFKDGyo2nLrtoelo6CPdKvXCjI3IJW5Az 7gnnZ8N37UWIVG1qrMIpe0PqH7WwcBjZal0tec1NS+EIZWrNJ6RDWUNP8O10URqlAHof pwUe4Wnc8KYubM3/HMIr5GZKLFsGhBIV2+rmWisaZnXnY/+jLi8ASVEhPI9zb/GWnVgq D9dA== X-Gm-Message-State: AOJu0YwDGob71BkwlkPRndC4ujPm+xItM6NdvVNtRAAxXVEzXFK8HlvZ zqc5EWf1GDYsKgYoMQs79varLRMQBB4WrmeFCh+hngo+PmKv1MU0RCYVQc5sqVaBQ4DYNKdeLnk X X-Received: by 2002:adf:f0cd:0:b0:34d:7cdf:7fb3 with SMTP id x13-20020adff0cd000000b0034d7cdf7fb3mr7038544wro.62.1714999195378; Mon, 06 May 2024 05:39:55 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id b12-20020a5d4d8c000000b0034e65b8b43fsm8616106wru.8.2024.05.06.05.39.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:39:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 21/28] xen: mapcache: Break out xen_ram_addr_from_mapcache_single Date: Mon, 6 May 2024 14:37:21 +0200 Message-ID: <20240506123728.65278-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, 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: "Edgar E. Iglesias" Break out xen_ram_addr_from_mapcache_single(), a multi-cache aware version of xen_ram_addr_from_mapcache. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240430164939.925307-7-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 6bb3e0b362..1927334e9f 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -377,7 +377,7 @@ uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, return p; } -ram_addr_t xen_ram_addr_from_mapcache(void *ptr) +static ram_addr_t xen_ram_addr_from_mapcache_single(MapCache *mc, void *ptr) { MapCacheEntry *entry = NULL; MapCacheRev *reventry; @@ -386,8 +386,8 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) ram_addr_t raddr; int found = 0; - mapcache_lock(mapcache); - QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { + mapcache_lock(mc); + QTAILQ_FOREACH(reventry, &mc->locked_entries, next) { if (reventry->vaddr_req == ptr) { paddr_index = reventry->paddr_index; size = reventry->size; @@ -397,11 +397,11 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) } if (!found) { trace_xen_ram_addr_from_mapcache_not_found(ptr); - mapcache_unlock(mapcache); + mapcache_unlock(mc); return RAM_ADDR_INVALID; } - entry = &mapcache->entry[paddr_index % mapcache->nr_buckets]; + entry = &mc->entry[paddr_index % mc->nr_buckets]; while (entry && (entry->paddr_index != paddr_index || entry->size != size)) { entry = entry->next; } @@ -412,10 +412,15 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) raddr = (reventry->paddr_index << MCACHE_BUCKET_SHIFT) + ((unsigned long) ptr - (unsigned long) entry->vaddr_base); } - mapcache_unlock(mapcache); + mapcache_unlock(mc); return raddr; } +ram_addr_t xen_ram_addr_from_mapcache(void *ptr) +{ + return xen_ram_addr_from_mapcache_single(mapcache, ptr); +} + static void xen_invalidate_map_cache_entry_unlocked(uint8_t *buffer) { MapCacheEntry *entry = NULL, *pentry = NULL; From patchwork Mon May 6 12:37:22 2024 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: 795011 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901818wra; Mon, 6 May 2024 05:40:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbvflfSN5OyJ/ahipBc/K7C7KKHOudVfeyBdtVdyzD6EqG6Ow1abfCCnwFmJndP0zmo4LC43gMR10omkd+srCo X-Google-Smtp-Source: AGHT+IH2HJP+9LPABMY183g2ZsSKP1OZLjzBQUctUng9PPy8RkxDDTaYMkkodUuoUiG7QPAMPPXE X-Received: by 2002:a05:690c:fc9:b0:618:7f3c:cbaf with SMTP id dg9-20020a05690c0fc900b006187f3ccbafmr11546445ywb.42.1714999225814; Mon, 06 May 2024 05:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999225; cv=none; d=google.com; s=arc-20160816; b=moZdQXjZXZD2V1iVeGtjvT4onph+rR3R3qsXdVgCZ95VabreNvifUUsTVT2bW+LNg6 Ed+/0eizRVoXeT2/vob9HNSMA8du4qvj4iEHu6ppN8SXV4oJl2icxDtPsjVgQj2qEICU Nl4rEvLoQzCLH2CdKi/4gokXg8CXeuqPU6t8pT8kNhHRymbsQ2SyBabgJHLuuAbQvLus xK3OqWz6ngJnzcAHKhkELYQhkUEwqReN+QqCctYaPXCf4mrbTUY4MD0Qo8w+rQyZA64t WkNsNp6uok4gggulqm8kT54dSvr/ViVrSwXqhexdINbNHvRnv3LrR/Ti7EkaZXfP0z9j JLBA== 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=H6DhMzJBpLSItZebFXH5mHvd8v4e+bkGKskA9q4u7KM=; fh=SkWdp2kknXplGAOIo8SBckv7QkEuIFm0jG0TmJ6oU7c=; b=FwN/kEfnB+Tr0PGD4wIAe48n9OxFSfzc9LAEr6FCEFIDS/3TDeEpA8rKABnNGJRae8 MOipupsMSpFdpglrpk2cHX0FF8VuqyCY2UmUp0epeUFctjQ5MdjAQEFMI6friYnShmtP rAVO/s242sD9fzgJqquuKZYs0D+CV3JCOhUAtK2d/JX7MMkqH6D+AuwCRQ6F3resdLnh 3nE+DaI6bKa+38nKMdpaVxyEMGvg3hMJIiLU8N7/t8u9M+3drYN8Cv8m8j7Oz4C5yScg Aa1VNniIyn0VmQDng5gkaKuiTmL0928S6yQhodZ6beKrbSzOTmgvl9sABuIGs/vvO4hu wV3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xOrNbAgI; 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 dh15-20020a05622a4e0f00b0043affa6212fsi8407656qtb.801.2024.05.06.05.40.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:25 -0700 (PDT) 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=xOrNbAgI; 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 1s3xdY-0001Go-8L; Mon, 06 May 2024 08:40:08 -0400 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 1s3xdV-00011R-LK for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:05 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdT-0002Gq-7e for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:05 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-34d8d11a523so860616f8f.2 for ; Mon, 06 May 2024 05:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999201; x=1715604001; 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=H6DhMzJBpLSItZebFXH5mHvd8v4e+bkGKskA9q4u7KM=; b=xOrNbAgIWzT3YyEstzCiU+px8SG9o1AS4nlz5R9bxq+asHZqpbmF9UOO6h29fiA8wf A4zPejCCccrYdlSP0Z95ZTnNAXC5bC36WkhgxFw5yTS50F96VMcue0dgYgUsKzXbxuvu DGyoFtFIj3yl4GWI/pByAcSP4GEpLLwM/pAwKARgVzbdG8GcxGUwlv4Yh48IrA2wzBR0 o84YJnT6Bp6qLEnfidnmgLhEYsulj15MuvW1w5ICVKTNKw1RHqjFvCLxY2PvONe3Fwl+ duacTuMQsMb+HAlYSivDgN90pOZr+WBtkp4Bfd/2zeqxiScP3Ee5hdpsUcwKAqEZbRMe Sdzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999201; x=1715604001; 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=H6DhMzJBpLSItZebFXH5mHvd8v4e+bkGKskA9q4u7KM=; b=qWKzMbIFEQuRrvFzAxubggipvqbTUmT1hnOj5780GVYgpenkdDF7Rof5CVYEAAy2hq Uk6KkevzK89Kr1qHq2MKovNn+YHVdsZaP6dQTcYp2rQ0+Wqo7qMkVWLSjp6Rqh/McZB3 Xh/IF3vF+ktrN1q7FHyM+dDaZxTMJPPhP6d9pnNEbtWQI209R8jtW3XWoAK0upJ7Ityo c0eICv+CHzluTzfHQbhYiNI0MYMFiakPrCLpWjRWqGOzjQzL6hsfolP0Sq89xFWiOtLb WbC/CL0CKQWmwEfvFm2/BK7D7eKGB5axmdDbVLeP6eqvmPm7rLVwaH93tIhWn5RH33DC UccQ== X-Gm-Message-State: AOJu0YwL8iKSv/f0fXG/LugE1aofUQ6ELKJ+TNJUDHYOxeW/xfSJiCpn 9RGCTu2IxBBEW1aHmiNtba7WI1XLX+MU85q2ioIwRk8Spcf+LsQAA/A0TlopOUQ+cqhH8i9DmbZ 4 X-Received: by 2002:adf:f305:0:b0:34d:8190:72f4 with SMTP id i5-20020adff305000000b0034d819072f4mr6325091wro.1.1714999201314; Mon, 06 May 2024 05:40:01 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id z8-20020a5d6548000000b0034dbb122af4sm10586926wrv.113.2024.05.06.05.40.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PULL 22/28] xen: mapcache: Refactor xen_replace_cache_entry_unlocked Date: Mon, 6 May 2024 14:37:22 +0200 Message-ID: <20240506123728.65278-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: "Edgar E. Iglesias" Add MapCache argument to xen_replace_cache_entry_unlocked in preparation for supporting multiple map caches. No functional change. Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240430164939.925307-8-edgar.iglesias@gmail.com> [PMD: Remove last global mapcache pointer, reported by sstabellini] Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 1927334e9f..96c422981e 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -557,7 +557,8 @@ void xen_invalidate_map_cache(void) mapcache_unlock(mapcache); } -static uint8_t *xen_replace_cache_entry_unlocked(hwaddr old_phys_addr, +static uint8_t *xen_replace_cache_entry_unlocked(MapCache *mc, + hwaddr old_phys_addr, hwaddr new_phys_addr, hwaddr size) { @@ -579,7 +580,7 @@ static uint8_t *xen_replace_cache_entry_unlocked(hwaddr old_phys_addr, cache_size += MCACHE_BUCKET_SIZE - (cache_size % MCACHE_BUCKET_SIZE); } - entry = &mapcache->entry[address_index % mapcache->nr_buckets]; + entry = &mc->entry[address_index % mc->nr_buckets]; while (entry && !(entry->paddr_index == address_index && entry->size == cache_size)) { entry = entry->next; @@ -594,7 +595,7 @@ static uint8_t *xen_replace_cache_entry_unlocked(hwaddr old_phys_addr, trace_xen_replace_cache_entry_dummy(old_phys_addr, new_phys_addr); - xen_remap_bucket(mapcache, entry, entry->vaddr_base, + xen_remap_bucket(mc, entry, entry->vaddr_base, cache_size, address_index, false); if (!test_bits(address_offset >> XC_PAGE_SHIFT, test_bit_size >> XC_PAGE_SHIFT, @@ -615,7 +616,8 @@ uint8_t *xen_replace_cache_entry(hwaddr old_phys_addr, uint8_t *p; mapcache_lock(mapcache); - p = xen_replace_cache_entry_unlocked(old_phys_addr, new_phys_addr, size); + p = xen_replace_cache_entry_unlocked(mapcache, old_phys_addr, + new_phys_addr, size); mapcache_unlock(mapcache); return p; } From patchwork Mon May 6 12:37:23 2024 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: 795013 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902004wra; Mon, 6 May 2024 05:40:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUBM99YCCJIarAWYuSzG2qnEM4z+bC4L6HHCMTNfJK/3Ffksv8/1O/f7tz/J8GUtbNvi5ca7x97LCd6RA5qK98/ X-Google-Smtp-Source: AGHT+IGN3ORHJ/FKgJS6Q9wqkM1FWXWX0OksmLnbMahMnWRv8TWIgfVJ4MTLvNRuhbVuWtwtPS1w X-Received: by 2002:a05:6808:152a:b0:3c8:64bd:1f06 with SMTP id u42-20020a056808152a00b003c864bd1f06mr14115649oiw.22.1714999252934; Mon, 06 May 2024 05:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999252; cv=none; d=google.com; s=arc-20160816; b=JRpVQgqDIKlORganpOWGOu6V037neX7C5Xs+JIFNyDjJY5eDZmSpaFDuS6ZbB3dgcU TUcFK6G/MWpdn5Sos8YAqCTEb8Ejo+s4rlgsqFtbmTs54poN4J03tQ7O7IZN/eb8zxtb z58R8lX61PhtuyXfKSGgjPOWxtv+h9FURqrLwmWEIzitXKJD0oMeIivk47SKqsj924hV udNyU1G05XDvIMmYjuX2jqb6HFWEGvDkzHTIj4NonB9PKdGdbiaUEBwWDY6eY8evJuFp jMX5O7RbUe/8bbTXPMCKZZJ4Z2OQ8p51+uuo9bgX/vnd3psjPAL2//a1oXdEA492LFN8 lqIA== 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=Ri6vQTLDDsyaTfFoI8+TokF2rNRkB8/RJlz+zNYMusQ=; fh=t5ckFe1iifY1wq3g6za/3F2QK0Ucp01M/Pw5m9Xn0aU=; b=lqKvgRzFmJbU6bEIeyX4R11CZpGEF8KH0YkLVuwnqvRlxPeO+O14gtphnbYuZXjBrx VyFJXRwubEEwUhXv3a92rKpcaCUdjRfLDXS30zUsMkg4p1OuU9BfHhNALAqH08ctomhZ lTJXZJmEHiSy241larxueHsKIOBa93l1VIeI649hIP7VzvGC/0zv2366M1ooWBEDMQzx YP8I5VbHDYehuvkBC9drAhVr4Hgu80xphx1bB8LMn2tRgV4jXTD076wlgcc4KiHkImmX JI7Hf1Z19x/mmwmDGwc/acWD5hS7juN9UhZijcTMiEd4w7/Gmtm2JP/UkRMIwIeNcRwj h5zg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KpiB54GC; 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 fq8-20020a056214258800b006a0d21750e5si9234616qvb.310.2024.05.06.05.40.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:52 -0700 (PDT) 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=KpiB54GC; 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 1s3xdi-0002Ob-Bc; Mon, 06 May 2024 08:40:19 -0400 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 1s3xdf-00027g-JQ for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:15 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdZ-0002IW-FW for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:15 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-34db6a299b8so1194869f8f.3 for ; Mon, 06 May 2024 05:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999207; x=1715604007; 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=Ri6vQTLDDsyaTfFoI8+TokF2rNRkB8/RJlz+zNYMusQ=; b=KpiB54GC5hJhVs68H1UYudugF/+wT9O5J2zkZdmKD31b0xPCyf0sZWMI3rAwBZNbEg KKJsDzcbci45sB/Bq6OKWk+r3dXS1caTXRam1zDxP02zX3SfSfta7jHS3Cz/Tsc/l079 EfgETt67gUNjZvLE8eSYL0pqr1W8brGA4rn7WC7qbSOVhDhZ69EovSwVCO76TZlZ1DMX 8Rrrt3AXxFN+ge+KhoQuonbl2AQsE5BWXluvJ8vSPcw/b3/jFsC0CzfQtkONuTbqCKwx VkYFzL3YluTvNnvKoFZo46CR1DWRnqK5syxX34dU4sDKAHUivQdFtEt7saoylHFpt8cV AdXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999207; x=1715604007; 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=Ri6vQTLDDsyaTfFoI8+TokF2rNRkB8/RJlz+zNYMusQ=; b=sXksf4f2G+K5QthJYMf1Zkh9sQdqYnYmCWRZGYYMgWviY6wfxBoOJkBufZFffD5nNI i5dHC0/FfrkXvl1xoepweQK/Vbytg30eXvIVYtQ50jZgn874kf6cXAfHDODo5EyJIbzu JfDeRKZ1hxBVRr9TApNLlL9hSEzzQH5+A+ZKrsi5QDFvidi4uiJUL//Bpc7+QJiC5jf9 fhN8tYKl/jWjNmNnzF0vDFgNqha5v3OVYbxjVWLKCDYGzD5M8+QSdtl1omFxmLoCZB0h 71o2LjljTyI+OEFOBrVLpJUq0QxxdBa1VwZ9HVOLx7qVocEKHnobesRL0Kwbv9ahrcRL uPQQ== X-Gm-Message-State: AOJu0YziL1e8Xe2fM4IY2+N/imuZ6yj12HapNZvG+ClNR7Fm9TEwzZKU lBQ7ER3g+fSmH1Ut9t/kAhsAqplUHEATSdA9bzKi72nvKMZRlcK1g/bdCykPq4SD5hejuwAiOfY e X-Received: by 2002:a5d:4409:0:b0:34d:384:2dd4 with SMTP id z9-20020a5d4409000000b0034d03842dd4mr6242519wrq.60.1714999207264; Mon, 06 May 2024 05:40:07 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id j30-20020a5d6e5e000000b0034db5f648a8sm10669808wrz.77.2024.05.06.05.40.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 23/28] xen: mapcache: Refactor xen_invalidate_map_cache_entry_unlocked Date: Mon, 6 May 2024 14:37:23 +0200 Message-ID: <20240506123728.65278-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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, T_SPF_TEMPERROR=0.01 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: "Edgar E. Iglesias" Add MapCache argument to xen_invalidate_map_cache_entry_unlocked. This is in preparation for supporting multiple map caches. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240430164939.925307-9-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 96c422981e..3e6a1a0a93 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -421,7 +421,8 @@ ram_addr_t xen_ram_addr_from_mapcache(void *ptr) return xen_ram_addr_from_mapcache_single(mapcache, ptr); } -static void xen_invalidate_map_cache_entry_unlocked(uint8_t *buffer) +static void xen_invalidate_map_cache_entry_unlocked(MapCache *mc, + uint8_t *buffer) { MapCacheEntry *entry = NULL, *pentry = NULL; MapCacheRev *reventry; @@ -429,7 +430,7 @@ static void xen_invalidate_map_cache_entry_unlocked(uint8_t *buffer) hwaddr size; int found = 0; - QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { + QTAILQ_FOREACH(reventry, &mc->locked_entries, next) { if (reventry->vaddr_req == buffer) { paddr_index = reventry->paddr_index; size = reventry->size; @@ -439,7 +440,7 @@ static void xen_invalidate_map_cache_entry_unlocked(uint8_t *buffer) } if (!found) { trace_xen_invalidate_map_cache_entry_unlocked_not_found(buffer); - QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { + QTAILQ_FOREACH(reventry, &mc->locked_entries, next) { trace_xen_invalidate_map_cache_entry_unlocked_found( reventry->paddr_index, reventry->vaddr_req @@ -447,15 +448,15 @@ static void xen_invalidate_map_cache_entry_unlocked(uint8_t *buffer) } return; } - QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next); + QTAILQ_REMOVE(&mc->locked_entries, reventry, next); g_free(reventry); - if (mapcache->last_entry != NULL && - mapcache->last_entry->paddr_index == paddr_index) { - mapcache->last_entry = NULL; + if (mc->last_entry != NULL && + mc->last_entry->paddr_index == paddr_index) { + mc->last_entry = NULL; } - entry = &mapcache->entry[paddr_index % mapcache->nr_buckets]; + entry = &mc->entry[paddr_index % mc->nr_buckets]; while (entry && (entry->paddr_index != paddr_index || entry->size != size)) { pentry = entry; entry = entry->next; @@ -489,7 +490,7 @@ static void xen_invalidate_map_cache_entry_bh(void *opaque) XenMapCacheData *data = opaque; mapcache_lock(mapcache); - xen_invalidate_map_cache_entry_unlocked(data->buffer); + xen_invalidate_map_cache_entry_unlocked(mapcache, data->buffer); mapcache_unlock(mapcache); aio_co_wake(data->co); @@ -507,7 +508,7 @@ void coroutine_mixed_fn xen_invalidate_map_cache_entry(uint8_t *buffer) qemu_coroutine_yield(); } else { mapcache_lock(mapcache); - xen_invalidate_map_cache_entry_unlocked(buffer); + xen_invalidate_map_cache_entry_unlocked(mapcache, buffer); mapcache_unlock(mapcache); } } From patchwork Mon May 6 12:37:24 2024 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: 795014 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902041wra; Mon, 6 May 2024 05:40:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUeIlmggnO/n3jo3NsMjWZxiobKsFJfH0qQBozJtISkrAN8UcsuHmx0jwqoFnj5kp6UY8e7EkiZIT8vm7ca7Xou X-Google-Smtp-Source: AGHT+IFpQQ/s+QTs63ugCXjhosB9OiPti2DKfzP6r+/d9OhbElqQdtAtZugyB/BBe0mPbsQnldp0 X-Received: by 2002:a0d:e6d5:0:b0:618:1034:f4ef with SMTP id p204-20020a0de6d5000000b006181034f4efmr9198449ywe.16.1714999258715; Mon, 06 May 2024 05:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999258; cv=none; d=google.com; s=arc-20160816; b=XyjbS1v31EJme/mXIRzRZtQl017HO/IfEoCJFq07CYcrEEO+qz5W5zlhE5x+a1fYaN moQ/KJePAPfU5wF6pnuJXEvQV+Diu3GG9R4Oi72YmVDiqxIdZZjse437XOkgFO6GCt3a VBnDPrEi/wFNOPGyzN4NtQZ9sKOuvUYJT1sDtvAXb9V/BmdN/Azkxb0lATm1JUohUbpx xtUwA4AQyXr/CkNoOLHqCMdqubtWiS2Lt+aK7bVbNT75dT0zMqAzNMWeCdwcgAEIBLBz LJMJWy30G0GLhRjZwSf31lxtGhS3SCLmLCLn5SrV8zbi4L64Rf7Neth2w0gPaCTOz1mq OADw== 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=JAoBz8aoMGUtkfGWAKV8DQjUNcnX+pc6qT9VuQpXWc0=; fh=t5ckFe1iifY1wq3g6za/3F2QK0Ucp01M/Pw5m9Xn0aU=; b=wCJX5feZlNEciaQW2Zrz3iAqqW2iHbA3pMCWXPfLi0RHCViASyLVz6+kUeOwPcVDm2 9hvH+QRGcOpAf9q8c/9Hl/6K61bGZBS03edyqz1qzRL4YWfKbu7P803SARSB0l2fwQXx sexss67It0js826YRRq0bc/4VTmL9iod8gixtGJgNqL4vIrk3cWeBs3PC7XArdFcse/g N+9zP8AQ65Q1C+9WBb8MciVTPFlbY6LtmmbRK9WgQRoxCT+xnn7pQf/1MjBrHgP17zGm Z7grmceNYtlGk7y73o+k9fZ+Kz1GbE+PeIi+z5kdArBPaMGXEJ3bgLLov32sNa7KsYgI pZmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uigCCNJY; 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 s6-20020a05622a178600b0043980b93f21si9179467qtk.634.2024.05.06.05.40.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:40:58 -0700 (PDT) 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=uigCCNJY; 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 1s3xdk-0002X3-FY; Mon, 06 May 2024 08:40:20 -0400 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 1s3xdh-0002I0-0f for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:17 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdf-0002Rk-3C for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:16 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-34d99ec52e1so1165529f8f.3 for ; Mon, 06 May 2024 05:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999213; x=1715604013; 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=JAoBz8aoMGUtkfGWAKV8DQjUNcnX+pc6qT9VuQpXWc0=; b=uigCCNJYID6Wu/qX+qzNWl+O/WIpAJbet0JjbVfoKne1YF7QBofhc3qffq+3goKSxm 39wK3kgj7G8bJK9sD7/utKUprhBhfK1xWR1zzEgvnHDLeWcyPej+WPEEZwHlxdGzDmhb o6hDeMaJJiksdR6lPvOqobkY7JLQvUKwduJuaGD5UIaoEjbLUERBwjbNoxHxj5wj2nQS 5yNaP9SNshh+LliqOc6eYNp/ZiPcYeOnJQlUNZcZimycvzrLlRpfb/7/TIl0wY9t2JpH LwbRYupcD5NHCh52LPBg4SKWdJ5tQj475N+DU+d2cD1RYrw+e0/S4mqTRyNVVcRkXR4u 7Gkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999213; x=1715604013; 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=JAoBz8aoMGUtkfGWAKV8DQjUNcnX+pc6qT9VuQpXWc0=; b=csR07Uqt0GbGlJks1r9rUZEG6h4YnepRhxyxUAJUWWIJgqYAa5lTokizRsdYWSbdrI OXNd/0XRIo3FqyvH/tOC15+LfoqoAu5sgxZnADS1Wj5wsrHN0rla/pp7AKsubhQCi6Ln XoxbsQ9yK57/RRzj/m9p5BsRVVZergJKgu8vJrR51UNexGxgcJFITOz2pREH3UkUPZfh oJpuTOeunR7A2SvbyK9KVJIR67O3qwsYxNFoTftB4gtoJX2VY/2Te5Nxvjj4UvUHJudm ihyTYLej011fFBe4sxIO500OzPBNMzGtW6mhsVoxd98ucxbhbIQeBuW4vWNCgJjU9DDb fLJw== X-Gm-Message-State: AOJu0YxWCqZ6n512wriAnBReL5kAlJ+2kOqzAPtSb8Pc7Z8WS95yg62J I5Qxn7cKms/icUjIyw/9FXzTpNC3d/+BBW6rGH3gp1IA/EOAesyZF9chl6leEWnv+tcNoNcydHD y X-Received: by 2002:a5d:5511:0:b0:34d:74cb:c0be with SMTP id b17-20020a5d5511000000b0034d74cbc0bemr6789600wrv.35.1714999213228; Mon, 06 May 2024 05:40:13 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id d18-20020adfef92000000b0034c71090653sm10579327wro.57.2024.05.06.05.40.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 24/28] xen: mapcache: Break out xen_invalidate_map_cache_single() Date: Mon, 6 May 2024 14:37:24 +0200 Message-ID: <20240506123728.65278-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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: "Edgar E. Iglesias" Break out xen_invalidate_map_cache_single(). No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240430164939.925307-10-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 3e6a1a0a93..c8a0f4fbc2 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -513,17 +513,14 @@ void coroutine_mixed_fn xen_invalidate_map_cache_entry(uint8_t *buffer) } } -void xen_invalidate_map_cache(void) +static void xen_invalidate_map_cache_single(MapCache *mc) { unsigned long i; MapCacheRev *reventry; - /* Flush pending AIO before destroying the mapcache */ - bdrv_drain_all(); + mapcache_lock(mc); - mapcache_lock(mapcache); - - QTAILQ_FOREACH(reventry, &mapcache->locked_entries, next) { + QTAILQ_FOREACH(reventry, &mc->locked_entries, next) { if (!reventry->dma) { continue; } @@ -531,8 +528,8 @@ void xen_invalidate_map_cache(void) reventry->vaddr_req); } - for (i = 0; i < mapcache->nr_buckets; i++) { - MapCacheEntry *entry = &mapcache->entry[i]; + for (i = 0; i < mc->nr_buckets; i++) { + MapCacheEntry *entry = &mc->entry[i]; if (entry->vaddr_base == NULL) { continue; @@ -553,9 +550,17 @@ void xen_invalidate_map_cache(void) entry->valid_mapping = NULL; } - mapcache->last_entry = NULL; + mc->last_entry = NULL; - mapcache_unlock(mapcache); + mapcache_unlock(mc); +} + +void xen_invalidate_map_cache(void) +{ + /* Flush pending AIO before destroying the mapcache */ + bdrv_drain_all(); + + xen_invalidate_map_cache_single(mapcache); } static uint8_t *xen_replace_cache_entry_unlocked(MapCache *mc, From patchwork Mon May 6 12:37:25 2024 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: 795018 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902481wra; Mon, 6 May 2024 05:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpP8Vbjs984JqM3vectW5y3+inC1kwTTyegThqLcZIp3jtxkcP21aoerjU9sDyXAmhpMlsWmGPvOLVt0nPbbLR X-Google-Smtp-Source: AGHT+IHM9wFostfbRoPsU/zO76ijabqFs0xk4qCVEeKIZYOcYj2q2ZA2V8UCG9C1rN9SsQxkV/8s X-Received: by 2002:a05:6871:1cd:b0:23f:9c2e:8ca2 with SMTP id q13-20020a05687101cd00b0023f9c2e8ca2mr3080587oad.55.1714999333864; Mon, 06 May 2024 05:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999333; cv=none; d=google.com; s=arc-20160816; b=L9Tyg91kl24LIZpNs5OJQKLvGgXblrr9U6TrlxL9QqQa86jahb2HtL3bfEoW/s2k8s IylhKn9uTTBKH4OVe8URH5s6kT7CmeBeGYECdNjUPX60cjXAPO3TgtWPH9E8cVOMyND7 Z0SFESsxgn3b5Ph08hblFb7qK+EKS8/Yxl3xx2Qe826EXaQTE7NaqCIdqqdfChQ4Ta4W nE/skWuEjCRM5lA9Wel2gCHfYc2Z7wo/G9Pg9dG+J2LbcTi8n9UpqAenYmwBssfhyeeR yIxQH2EkCVnzJccfOdCMTIKYhM5wbnoOxI4edenjiuH//zfrK0sJeu1pgclUyE20DTn0 +MRw== 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=uJEndL+RDFNTj+y6nM23b2p4J1hp6d4o1ioofR186sw=; fh=t5ckFe1iifY1wq3g6za/3F2QK0Ucp01M/Pw5m9Xn0aU=; b=y7N6XmrZhh3ya6fP5Ex+QvqFiADaOzqrJbysuEVPH/gaz8Sts+L8C8mxeorVw3wujF +AoUtUuUJH+cIGUBpglR+AJVJBsrGQYS1drx0us0+8NcqjUni0fHzIr1FdG8ez/ljVbL MltxU3qpEM2kxiWufgr3upqiVZLgUunK2IqNmg8JDXzpNhGPY6bbvteOB8umQM9QDDrW +Ervm1hQa4rOUiM6/Aqm7Ck4FN+h8I328xMcHr/MxA6ououz4jlhToPbKPKt/eRygbXK vois1j/g8dPORsTCyZ5+qNcGkBIJNnkrnNHERa6m/yUCAolmBFgeGyoBDGVmjPe0X48t Pivw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NMWPXn6g; 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 t19-20020a05620a0b1300b00790f5c422ccsi8912011qkg.673.2024.05.06.05.42.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:42:13 -0700 (PDT) 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=NMWPXn6g; 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 1s3xeU-0003vP-7m; Mon, 06 May 2024 08:41:10 -0400 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 1s3xe0-0003e3-Lq for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:50 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdl-0002VW-3b for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:36 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41ba1ba55ffso10137955e9.1 for ; Mon, 06 May 2024 05:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999219; x=1715604019; 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=uJEndL+RDFNTj+y6nM23b2p4J1hp6d4o1ioofR186sw=; b=NMWPXn6gg9SulVb95ge6RffX0FEJO7kCrXhpUZGc4WajoFgMEa/hT+Uh5F6xaXIk+W 6Y4KDrt0DoNN0JodHh0e4sBVA3Bq4jeYVERsx5R6P+huWXcoxKyqc3zTIqGNe+UZggqU dj4LJ3rb3N6kl2lB27WUpDTqj4qmpK6nrsrfk9LYiFNxR7rLUCNZvELDN6rk8XUQTlwi bTwEOP2c33N+0s6xOS+8nv0BC5Tl19zANhRdlu5ak8fEKlVMMRai41wlARHIRHH7Bsnk 90ZlgtL5dZ8PgcZm3+IeOLvapdxkqMwzy+O2+PEkJLQumCTtVvPEDNSzsPXz0UF2tSvi Yvqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999219; x=1715604019; 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=uJEndL+RDFNTj+y6nM23b2p4J1hp6d4o1ioofR186sw=; b=JfY2yhyA1X3G9c5eP8W7Ow+0EyszO2HQhOlgNs5RJwiexSJDhM9IAfJ8PJASHcoRNH WPDInEp3YeH511cg44nA0cgZXzzxTT0hl+EPYGSZVap3niXTARqScVvVyOlusDxrPMZJ HpnX60bE7R4RGlnM6OkTEn98PkAN/S3JdpZCy5wCIrL5wEOJSQX2FhUpeXiQSmjq5yxd 01joDK0G/eCEUy3Bq7jhnLLxq8BecbUGWGHbWyuvLzY1NVmJCrK8Ej5bu9Hxhg0FXOYk hvPcBJlHnhgd0jMCbHdYoCNz/woR39+CYoLwuvohzRXSB+gL5RNtV+DC8uvO7UYIABO3 3YCw== X-Gm-Message-State: AOJu0YyhY6PQ95yXSmG1pxVEOkllcldUnpE5yKmHuwR0w6zVC0WUD/sP NsrP/GHifXm6CdNWILNe+4abIZdCyMAu7YS8WcjfYHSlrcFT65LNQf9uKLknXPogydyj8VqQD+u 6 X-Received: by 2002:a05:600c:3b1b:b0:418:f5a:580b with SMTP id m27-20020a05600c3b1b00b004180f5a580bmr11738521wms.18.1714999219311; Mon, 06 May 2024 05:40:19 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id t12-20020a05600c198c00b0041becb7ff05sm15710181wmq.26.2024.05.06.05.40.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PULL 25/28] xen: mapcache: Break out xen_map_cache_init_single() Date: Mon, 6 May 2024 14:37:25 +0200 Message-ID: <20240506123728.65278-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, 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: "Edgar E. Iglesias" Break out xen_map_cache_init_single() in preparation for adding multiple map caches. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Message-ID: <20240430164939.925307-11-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen-mapcache.c | 57 ++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index c8a0f4fbc2..6fb2db2612 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -93,23 +93,44 @@ static inline int test_bits(int nr, int size, const unsigned long *addr) return 0; } -void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque) +static MapCache *xen_map_cache_init_single(phys_offset_to_gaddr_t f, + void *opaque, + unsigned long max_size) { unsigned long size; + MapCache *mc; + + mc = g_new0(MapCache, 1); + + mc->phys_offset_to_gaddr = f; + mc->opaque = opaque; + qemu_mutex_init(&mc->lock); + + QTAILQ_INIT(&mc->locked_entries); + + mc->max_mcache_size = max_size; + + mc->nr_buckets = + (((mc->max_mcache_size >> XC_PAGE_SHIFT) + + (1UL << (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)) - 1) >> + (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)); + + size = mc->nr_buckets * sizeof(MapCacheEntry); + size = (size + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1); + trace_xen_map_cache_init(mc->nr_buckets, size); + mc->entry = g_malloc0(size); + return mc; +} + +void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque) +{ struct rlimit rlimit_as; - - mapcache = g_new0(MapCache, 1); - - mapcache->phys_offset_to_gaddr = f; - mapcache->opaque = opaque; - qemu_mutex_init(&mapcache->lock); - - QTAILQ_INIT(&mapcache->locked_entries); + unsigned long max_mcache_size; if (geteuid() == 0) { rlimit_as.rlim_cur = RLIM_INFINITY; rlimit_as.rlim_max = RLIM_INFINITY; - mapcache->max_mcache_size = MCACHE_MAX_SIZE; + max_mcache_size = MCACHE_MAX_SIZE; } else { getrlimit(RLIMIT_AS, &rlimit_as); rlimit_as.rlim_cur = rlimit_as.rlim_max; @@ -119,24 +140,14 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque) " memory is not infinity"); } if (rlimit_as.rlim_max < MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE) { - mapcache->max_mcache_size = rlimit_as.rlim_max - - NON_MCACHE_MEMORY_SIZE; + max_mcache_size = rlimit_as.rlim_max - NON_MCACHE_MEMORY_SIZE; } else { - mapcache->max_mcache_size = MCACHE_MAX_SIZE; + max_mcache_size = MCACHE_MAX_SIZE; } } + mapcache = xen_map_cache_init_single(f, opaque, max_mcache_size); setrlimit(RLIMIT_AS, &rlimit_as); - - mapcache->nr_buckets = - (((mapcache->max_mcache_size >> XC_PAGE_SHIFT) + - (1UL << (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)) - 1) >> - (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)); - - size = mapcache->nr_buckets * sizeof (MapCacheEntry); - size = (size + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1); - trace_xen_map_cache_init(mapcache->nr_buckets, size); - mapcache->entry = g_malloc0(size); } static void xen_remap_bucket(MapCache *mc, From patchwork Mon May 6 12:37:26 2024 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: 795016 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902339wra; Mon, 6 May 2024 05:41:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWAykAj+3deWGzxOYxJZTMNwQjWeCzrRz/Gr0m2BNZc3YZ/KWrVODE8jn5y/86Fzb2NpZ5wm1oqhom0A+5YXViU X-Google-Smtp-Source: AGHT+IF5c97+OrBcr4xkWwl22C0skWMdhxITB7iftrEO+d190ZhAGd+TplVC0UQ3RDxoLgstEOoS X-Received: by 2002:a05:6102:5f6d:b0:47e:f109:ea33 with SMTP id ix13-20020a0561025f6d00b0047ef109ea33mr12121941vsb.19.1714999306289; Mon, 06 May 2024 05:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999306; cv=none; d=google.com; s=arc-20160816; b=QoB65AAnGLdVvzeCmL6v/dgvBrffCRee4xndAndg1xvrxgTr44MNyswfuRQJ+98ZsE hUpPmFjvCCp66+F2ZjtMUEeKQZSLhBgibP/ZV9+xrOiIOL7Kw23Ec8NRZbHUQL2His9M yAEebTHvDMyTJjY15OxMTy8+R6fXbabectQnD88DoPeYBX/uXJ/tUCPHChCHRyZkva7A xg/dmlQOiFMq4geb1kWc5YH0/1NpUozswy0Co9tZNLRGyhFl9cI0Ky6wI2xWff/gb0Oi MlFPqi9AGgdSKGTqlmjHoxXEfWXz05zqRqJskEDRg4aKRaOhehUPcRylRBcjnj0qHvDT j+7A== 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=WTcAtz5StyXLlO/6Yq7APKphEf7fSpnGIrEv/+Ejp0A=; fh=KkKZDEwWarL8Z0amXIf/kyzx36Zuz+mvDnFNQPETJ7o=; b=jiq1EvoXI6m6HIMzl5vVnBCP9MXhgjhhoRqJEUukknopgIzjxkKj+bD0uxPzoQrcSE 4PSxyRZERLWDzqUyw7p7g86ZOn/F/syFhra044xA6FaR/jRTjMru9hECNgWWp6oN+doo Z5OXvIETb8HCUMBn0b1E6YaGIBzoEvkDFz94T7442ZIcQbKo6OxAOgwgYLWtVYMsrPIl VMQ+56v38wJOkP+wr5vPKD5Z/ircpZBsDZU4gRxhz/2ViO3K3HEeOBVC3kzTLbsGBfYd FJ2FekLbFpRdbk/rVYHdKu8DT+JnMbZX38HVi1TtYaLEpSvjAADYBbVIw6e8C3wyECTm ZTVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zcXuc+d4; 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 r17-20020a67ef91000000b0047d91d62e42si1471651vsp.108.2024.05.06.05.41.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:41:45 -0700 (PDT) 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=zcXuc+d4; 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 1s3xeo-0004N8-2d; Mon, 06 May 2024 08:41:27 -0400 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 1s3xdz-0003dN-6k for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:47 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xds-0002Xd-54 for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:34 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-34e0d8b737eso2432816f8f.1 for ; Mon, 06 May 2024 05:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999226; x=1715604026; 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=WTcAtz5StyXLlO/6Yq7APKphEf7fSpnGIrEv/+Ejp0A=; b=zcXuc+d44REnIMs7+ZijoVPHYqQQxUkkiimrrYQ/dy/MzEO6tQl2Ar2q89qJxauvzC EJsH9sV77Zd9vMDRMjqQJ2z8RaQ14IJM9NG4uP0txUOI9XF7ZNCsv2UBLGtv+GtTfvQG CD5Spi6sKlSJx+2sZWregBrKIhct48mLUnq4F/9yA5GNCsKl+RdFBllzwkW+F4JCjfW5 uYkmt3nqPsWribNJ8IeaQEG3YXGiBfOtgDifmXnqq53g7Z1afE4XUbztDNZ3+jfL8AMq d+QyNLjRckT29qOGsBQBNxejkfQ1lQCfUXgm5sl1NdWHdNfQy9190PV0WaFrCksu4i5p u8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999226; x=1715604026; 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=WTcAtz5StyXLlO/6Yq7APKphEf7fSpnGIrEv/+Ejp0A=; b=jWN8OwnMF1i8l3T9+plgpC0a/splqhYFwVZI7xpD7KR51CAdgURIqN+8EgaunhqL0A jjxazze8ZIdLZ0qbjlZ3A8mANNtM62skiIp/VwbKoX55pQkOlCpjmzkaM8G4eEbEHauP M8KL9V7tnyDFtojxqLM2EVWvk/m79O8kZ4GBtqV24aZyEbEzY2gcj/BssNdbPfYgn14h P5Jroaw8EahlDjb2axRjrlDJEDQjVoLSOM8zLmLOAmuDtZb/fPTUte106VifpaiYctYt mn4DaiwLBfLE6RRse4TQxAn6GEfifPDb9PDB6YaJG9B3GRaSqRBI/q7/j8zSNczPXaez g12g== X-Gm-Message-State: AOJu0YwjoSr5BHNQrydCgVPnE14EJkAAba+BtGHJPDojzSgJkFpH6Whs zamWdEMdPJ7v34KtJvlBAbdGMXIe/GRzwZ9bjC8cuGLo6TtBC1ZKTRv/CJPBN94XlL8fVEET6MM 5 X-Received: by 2002:a05:6000:188:b0:34d:c4c7:7ca with SMTP id p8-20020a056000018800b0034dc4c707camr11471080wrx.20.1714999226077; Mon, 06 May 2024 05:40:26 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id g4-20020a5d5404000000b0034ca136f0e9sm10608838wrv.88.2024.05.06.05.40.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Peter Xu , David Hildenbrand Subject: [PULL 26/28] softmmu: Pass RAM MemoryRegion and is_write in xen_map_cache() Date: Mon, 6 May 2024 14:37:26 +0200 Message-ID: <20240506123728.65278-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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: "Edgar E. Iglesias" Propagate MR and is_write to xen_map_cache(). This is in preparation for adding support for grant mappings. No functional change. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: Philippe Mathieu-Daudé Acked-by: Peter Xu Reviewed-by: David Hildenbrand Message-ID: <20240430164939.925307-14-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/xen-mapcache.h | 11 +++++++---- hw/xen/xen-mapcache.c | 10 ++++++---- system/physmem.c | 31 +++++++++++++++++++++++-------- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/include/sysemu/xen-mapcache.h b/include/sysemu/xen-mapcache.h index 10c2e3082a..1ec9e66752 100644 --- a/include/sysemu/xen-mapcache.h +++ b/include/sysemu/xen-mapcache.h @@ -18,8 +18,9 @@ typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset, void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque); -uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, - uint8_t lock, bool dma); +uint8_t *xen_map_cache(MemoryRegion *mr, hwaddr phys_addr, hwaddr size, + uint8_t lock, bool dma, + bool is_write); ram_addr_t xen_ram_addr_from_mapcache(void *ptr); void xen_invalidate_map_cache_entry(uint8_t *buffer); void xen_invalidate_map_cache(void); @@ -33,10 +34,12 @@ static inline void xen_map_cache_init(phys_offset_to_gaddr_t f, { } -static inline uint8_t *xen_map_cache(hwaddr phys_addr, +static inline uint8_t *xen_map_cache(MemoryRegion *mr, + hwaddr phys_addr, hwaddr size, uint8_t lock, - bool dma) + bool dma, + bool is_write) { abort(); } diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 6fb2db2612..fa6813b1ad 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -254,7 +254,7 @@ static void xen_remap_bucket(MapCache *mc, static uint8_t *xen_map_cache_unlocked(MapCache *mc, hwaddr phys_addr, hwaddr size, - uint8_t lock, bool dma) + uint8_t lock, bool dma, bool is_write) { MapCacheEntry *entry, *pentry = NULL, *free_entry = NULL, *free_pentry = NULL; @@ -377,13 +377,15 @@ tryagain: return mc->last_entry->vaddr_base + address_offset; } -uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, - uint8_t lock, bool dma) +uint8_t *xen_map_cache(MemoryRegion *mr, + hwaddr phys_addr, hwaddr size, + uint8_t lock, bool dma, + bool is_write) { uint8_t *p; mapcache_lock(mapcache); - p = xen_map_cache_unlocked(mapcache, phys_addr, size, lock, dma); + p = xen_map_cache_unlocked(mapcache, phys_addr, size, lock, dma, is_write); mapcache_unlock(mapcache); return p; } diff --git a/system/physmem.c b/system/physmem.c index 8278e31c1a..79d46054c5 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2191,11 +2191,22 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length) /* * Return a host pointer to guest's ram. + * For Xen, foreign mappings get created if they don't already exist. + * + * @block: block for the RAM to lookup (optional and may be NULL). + * @addr: address within the memory region. + * @size: pointer to requested size (optional and may be NULL). + * size may get modified and return a value smaller than + * what was requested. + * @lock: wether to lock the mapping in xen-mapcache until invalidated. + * @is_write: hint wether to map RW or RO in the xen-mapcache. + * (optional and may always be set to true). * * Called within RCU critical section. */ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, - hwaddr *size, bool lock) + hwaddr *size, bool lock, + bool is_write) { hwaddr len = 0; @@ -2218,10 +2229,13 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, * In that case just map the requested area. */ if (block->offset == 0) { - return xen_map_cache(addr, len, lock, lock); + return xen_map_cache(block->mr, addr, len, lock, lock, + is_write); } - block->host = xen_map_cache(block->offset, block->max_length, 1, lock); + block->host = xen_map_cache(block->mr, block->offset, + block->max_length, 1, + lock, is_write); } return ramblock_ptr(block, addr); @@ -2237,7 +2251,7 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, */ void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr) { - return qemu_ram_ptr_length(ram_block, addr, NULL, false); + return qemu_ram_ptr_length(ram_block, addr, NULL, false, true); } /* Return the offset of a hostpointer within a ramblock */ @@ -2747,7 +2761,7 @@ static MemTxResult flatview_write_continue_step(MemTxAttrs attrs, } else { /* RAM case */ uint8_t *ram_ptr = qemu_ram_ptr_length(mr->ram_block, mr_addr, l, - false); + false, true); memmove(ram_ptr, buf, *l); invalidate_and_set_dirty(mr, mr_addr, *l); @@ -2840,7 +2854,7 @@ static MemTxResult flatview_read_continue_step(MemTxAttrs attrs, uint8_t *buf, } else { /* RAM case */ uint8_t *ram_ptr = qemu_ram_ptr_length(mr->ram_block, mr_addr, l, - false); + false, false); memcpy(buf, ram_ptr, *l); @@ -3234,7 +3248,7 @@ void *address_space_map(AddressSpace *as, *plen = flatview_extend_translation(fv, addr, len, mr, xlat, l, is_write, attrs); fuzz_dma_read_cb(addr, *plen, mr); - return qemu_ram_ptr_length(mr->ram_block, xlat, plen, true); + return qemu_ram_ptr_length(mr->ram_block, xlat, plen, true, is_write); } /* Unmaps a memory region previously mapped by address_space_map(). @@ -3330,7 +3344,8 @@ int64_t address_space_cache_init(MemoryRegionCache *cache, l = flatview_extend_translation(cache->fv, addr, len, mr, cache->xlat, l, is_write, MEMTXATTRS_UNSPECIFIED); - cache->ptr = qemu_ram_ptr_length(mr->ram_block, cache->xlat, &l, true); + cache->ptr = qemu_ram_ptr_length(mr->ram_block, cache->xlat, &l, true, + is_write); } else { cache->ptr = NULL; } From patchwork Mon May 6 12:37:27 2024 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: 795017 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902479wra; Mon, 6 May 2024 05:42:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9aeIRsHHqcoyVlkoj5jy1OqJRDqtd1yTGnPpcjGi6y77xmSlsPx5loaV7ly6OK9b0NnuxEgsC6yPA8bfM+MBh X-Google-Smtp-Source: AGHT+IHmUDXkNQRmekn8ekUb3sz6z1RQFKI0WODaLl/7rnUiNEUiODUQRGtVxKsC3JEQNdlCEE5e X-Received: by 2002:a05:6870:2486:b0:23d:4997:7692 with SMTP id s6-20020a056870248600b0023d49977692mr12514778oaq.1.1714999333639; Mon, 06 May 2024 05:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999333; cv=none; d=google.com; s=arc-20160816; b=H6azgkt4beTAI9kbJa9GUMfH1fwLqYNFStGL3oL0wn7JVLlmYzTz7fkXxxgKDnW9Oa fjJP1pMh33bXNUG0y4+GbjHuBZuCtAxsNpb8EXaKVRspbb0FqjsrHheaFyk0J/OQ6WZk VQwUZqcKuYDHCYY6fTlRrm6fwV7/k7dHfpvr7yc0m0SuRklDTy1tRhDMwzPOD2VP96yI b9NdUH+AI930I+fULgCMWub7ywf6LWlvTxJo3gZtdBu+3zdmKEbv47l1Bxt1km9oQEUJ jqn+Fr0K91cGi+dSad8OKxBKSWsVcXlY3CZhJclJVdRysmWYTExJiklb0Szeik9ayAaa eD4A== 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=xkL5eliVD3ZZyqFaQzJbXHxlNyzeRrAKJ2SMZi0kzO4=; fh=4ovD7dUI8WiTRQjcrxAK+/5SqHUg2zRqngKBH9zwHcg=; b=YX4wOwjx7n4RD9n8iIPjcsoMkm5i7G6joaHi0QAtdj9KbT+D3HF+6lY9r5YnsxOiDg RLxjRo5gA/8BKrQjIYutmhVXoYNwCBvop8zwFMqa9ji8g61eivVtQXsH4a03LTvnPq0l UWzt9yWRiD1m2at0y6hOoUnaTyTanxdIRpAH4EGlotEV9WSe+WPX9ACG2fIfyh/pZBSd FH6Jh9n0gZqjIAHpnFxRBsGVA59ad58DdYj0jYpO11b9Dp5lNbThqNm0vim5GPSzw5tR sgQXV4n7p4O78L8WLPiBHBBVJgDqO95EUxSD4T0USl4DHMWcZ7e5OUDSlFRuCgfKCJRc MSTg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ovsYD8s3; 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 ea3-20020a05620a488300b0078d5f08d591si10300874qkb.340.2024.05.06.05.42.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:42:13 -0700 (PDT) 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=ovsYD8s3; 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 1s3xew-0004WB-CY; Mon, 06 May 2024 08:41:34 -0400 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 1s3xe0-0003e2-KO for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:50 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xdy-0002YD-St for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:36 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2e2a4c20870so24071431fa.3 for ; Mon, 06 May 2024 05:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999232; x=1715604032; 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=xkL5eliVD3ZZyqFaQzJbXHxlNyzeRrAKJ2SMZi0kzO4=; b=ovsYD8s3naKOvQQJqIeDrdxWzaSWix53h+sqY/IfbEIKdejNEv1PgyB7LEehaZwa5q dIZjptyuufVad0ZxoSkah2tG2jEE3uj6K4fwMG4NUY4ADSoC7JxsRCClt9QwbBfQPinn rKxWgbAMTIZNdfVlgP5bYWx9+rorb8nNbHJV+eoGtSJOuqKYdHGu6qRCZWEn2s5C5fS6 RBRz8U6RfEhgqAVDW3Z/U12KQc2BDWtnk2e2N+YdPAWX7mo35D+fXE+dZaUI6Qyd8+Au m5cKHvpEWZDfMwNJD2xHxeygFQSwkE5hdXannBC5SjG3hU5jRjwOwAubnxvo6YLRg7g/ 6xOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999232; x=1715604032; 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=xkL5eliVD3ZZyqFaQzJbXHxlNyzeRrAKJ2SMZi0kzO4=; b=SfoD/I/V+jDIkkzWI+VpGmyiWURFzD2gm3hZoMwVZVbwsqRBQrkY3HP5WgT7fJrDAT MjJoLyIp/yXGG5EzaKzJVpX/ZaCFptD3tvar0KOHt8eHTQvUaWNov6wgEfPzhuyoVCw1 imIzisvfu8iqYQP/WNcly7r2VZBjQtRIG1p20IehL6+VPCPWYdVW1wi9IxhLzqWrsvEI 5ahx5X5LCcMMrpNu3HES5DxMf174PglENxPTYMcXBrQkRtB5ki6KgCIB6vfxBPM7HDZl BRFFWDLIv0MAh22XAqyvL0pamBQCe4JEPmrWz1YHhFzyf43QhW2Chgk2cxNHILh1Xkc/ Buqw== X-Gm-Message-State: AOJu0Yz//bEpiX+RtPevT6CZWSUoWNXFD41n9JDgZGGi5x2gtqv/N62z biq2VNcvmlsPp/VwMeC+qOUBxa/ClBSa5/oR215fvvZxVO63MAyC0RmvuVs3ijI4NYzIVrF5cS8 m X-Received: by 2002:a2e:a58d:0:b0:2e0:1349:1eb0 with SMTP id m13-20020a2ea58d000000b002e013491eb0mr7318261ljp.43.1714999232200; Mon, 06 May 2024 05:40:32 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id v17-20020a05600c471100b0041abdaf8c6asm19693892wmo.13.2024.05.06.05.40.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aleksandar Rikalo , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 27/28] MAINTAINERS: Update Aleksandar Rikalo email Date: Mon, 6 May 2024 14:37:27 +0200 Message-ID: <20240506123728.65278-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.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: Aleksandar Rikalo Syrmia LLC has been acquired recently and the syrmia.com domain will disappear soon, so updating my email in the MAINTAINERS file. Signed-off-by: Aleksandar Rikalo Message-ID: <20240209062147.62453-1-aleksandar.rikalo@syrmia.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 595808fc96..63ada48bb4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -285,7 +285,7 @@ MIPS TCG CPUs M: Philippe Mathieu-Daudé R: Aurelien Jarno R: Jiaxun Yang -R: Aleksandar Rikalo +R: Aleksandar Rikalo S: Odd Fixes F: target/mips/ F: disas/*mips.c @@ -1335,7 +1335,7 @@ F: include/hw/mips/ Jazz M: Hervé Poussineau -R: Aleksandar Rikalo +R: Aleksandar Rikalo S: Maintained F: hw/mips/jazz.c F: hw/display/g364fb.c @@ -1357,7 +1357,7 @@ F: tests/avocado/linux_ssh_mips_malta.py F: tests/avocado/machine_mips_malta.py Mipssim -R: Aleksandar Rikalo +R: Aleksandar Rikalo S: Orphan F: hw/mips/mipssim.c F: hw/net/mipsnet.c @@ -1385,7 +1385,7 @@ F: tests/avocado/machine_mips_loongson3v.py Boston M: Paul Burton -R: Aleksandar Rikalo +R: Aleksandar Rikalo S: Odd Fixes F: hw/core/loader-fit.c F: hw/mips/boston.c @@ -3762,7 +3762,7 @@ M: Philippe Mathieu-Daudé R: Aurelien Jarno R: Huacai Chen R: Jiaxun Yang -R: Aleksandar Rikalo +R: Aleksandar Rikalo S: Odd Fixes F: tcg/mips/ From patchwork Mon May 6 12:37:28 2024 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: 795020 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp902825wra; Mon, 6 May 2024 05:43:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8gu2DKXKflvU1/1bG2oAAbVZCrR3vYWBKoLhWrkcOio4r7uWjWhA8AugmDcvPrmLZCR6wmFMkOYCPIqtx3Zo/ X-Google-Smtp-Source: AGHT+IEFsCV01zg0SSZ7C70oiIiOyg8aMN6iWVAxC9vSTFvLnBiTBWaxbp/mUN25XYL+CgPVqgnZ X-Received: by 2002:a05:6902:603:b0:dcc:2f09:4742 with SMTP id d3-20020a056902060300b00dcc2f094742mr8767771ybt.51.1714999385716; Mon, 06 May 2024 05:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999385; cv=none; d=google.com; s=arc-20160816; b=bym3GSCJo2mLe8fWmO1mM7usJnby/PEniYDuqpfD6ZmF2v3i7i4nehowcinEjtL1d9 tnQeTvl4oK96MqUllWw89mysjXvJ8Nv9E+LeyQcutOMSm5wD+gqvJPVgygKql++s5t0y YgRbVdmmcLd3AdYkVX8balvwU7J0W8pSZsCRvHaU6vrl8KLQVi+oEiqcDnnQjbbpNGpx W5y72pgX2fOLgUD+3TUnQrgqCPMyLZWGquljKEqrufhl6EFk4dvD+30Rd1NT6iMfxyno 8AMdMDXc/IFjqJuQD7+Mb4wU2+Ffgns7GVCPp1pGVdbNEwW9v/vFwHKy6rkicRKZWTo5 hsIw== 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=g0IuTaR/rYPSDHaMLMAN6l0+lNFCpJZOF1M4qKW9REw=; fh=TSezUn2FzGGWcIqwb0TuFmNKhNrD0LIXO/uYgsZ4xcw=; b=LnXB2Zeq3PJ+I4gg9fGS0E15zkjg2PcIHdf1azTxDOoDad0LRPgQB+YYrgit1xQQ6/ ud+K+zoW4sJBJOJMIstmJDu5LSuv4jGlsoExN6N6ycpd4eank+CjEeKcEMry93M8VY/h +loFZaSqvLGkO8YBaccqiI7ZeCx/6Gvz0UO896KXPoZhRvTdrFCFIoZDsbIl59nS0atD M/LyrKZkJ4nMa4wNARqjtfjpuT96+4hFAuv369cd3s5HbfH2KJcA22275R6wWc6QszTg KkaTkuNZbgBjltqFV/pLg6ZPsbcpc/sqKjwy7hMTxOgXB9e1siGSHA0I3N47K1XC00mK H5lQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dmgSOB5k; 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 c8-20020ac85a88000000b0043abd5b90d5si9396473qtc.104.2024.05.06.05.43.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:43:05 -0700 (PDT) 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=dmgSOB5k; 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 1s3xef-00049L-2p; Mon, 06 May 2024 08:41:18 -0400 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 1s3xeC-0003iI-Nx for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:53 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xe8-0002ZX-LO for qemu-devel@nongnu.org; Mon, 06 May 2024 08:40:48 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2e242b1dfd6so21495251fa.0 for ; Mon, 06 May 2024 05:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999239; x=1715604039; 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=g0IuTaR/rYPSDHaMLMAN6l0+lNFCpJZOF1M4qKW9REw=; b=dmgSOB5kYn/53JNrBSp7WSF9MDAMHJcaipEADqQrHj0YEcllNGEuGb2ss0TqLy6TWM yVk+lg4x26GJyxp88MxgoO8Fjd18XvwqZcUCC9yN21JmpHX0Y/2VuExJ8iuzJQjgeubP 2ZdbEfruDk3BmvmNI0kfhM8cIbW9shAqKGa/mFkOc2Hv03b2K1GLSEwQKCsCz++SRa9P USSPlGytcN64Xh6/KyR9kD8BWCnLEdS6OlYqisPTt69WuriiPt8V4rYNIgPSK2/qWnqO 0Upkfd6WqRrfhT5t/L/XP2557/tpltZaletqyoSz/NwQaJ8as8+bB9EBz3BRyvFV9K8U fQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999239; x=1715604039; 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=g0IuTaR/rYPSDHaMLMAN6l0+lNFCpJZOF1M4qKW9REw=; b=M/3RteKKXUEZvYTKQQP9YoUxMmPirIX5GpfE+w6WZU9efszY3zmrttl9/0jhSzWAcN JLSlF6xJJh0o6fjopwAiRPUvYK+KXB5JEv+iO/4Fx0uy2GUaEqDf+rMjiDRW9ZRdwmL7 f7kYDSJLi8Z8iNm+zSZcDqHFPD0E/7OLL4nkYUduNmPAt+Yz5SlXhIy1U6Pn0K0bDHaD wo+auSxQY4KkHh7+QrqyRq3Uj98mlSEmiSHsqVciBu/d71jnMqqJqTWGFWrp9eght+lr zuUlUPpSN3GSbpeVnsq/mbNn9wGzDZHwvLSRBinOZR65V12KYBVdclBJxnNuDwOaWUvi R1+w== X-Gm-Message-State: AOJu0YwptYVjDk2JndE7CVgIYEyendnDDwPEdzLe446tiNnuM/mSaFdY HGRLKqszUNCUmOqaPRmT8r5Vt36+rnDri5W8asuE8FOxHOjA+KmBkgM7qy6zi3mokdGHQojyMBv a X-Received: by 2002:a2e:9d19:0:b0:2da:d986:e387 with SMTP id t25-20020a2e9d19000000b002dad986e387mr6514067lji.50.1714999238791; Mon, 06 May 2024 05:40:38 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id g7-20020a05600c4ec700b0041902ebc87esm15959719wmq.35.2024.05.06.05.40.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:40:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Bin Meng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 28/28] MAINTAINERS: Update my email address Date: Mon, 6 May 2024 14:37:28 +0200 Message-ID: <20240506123728.65278-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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: Bin Meng The old Wind River email address (bin.meng@windriver.com) is no longer available due to an internal infrastructure change within the company. While a new email address (bin.meng.cn@windriver.com) has been assigned to me, I am unable to find a way to send this patch directly from the new address. Presumably, the basic authentication with client submission (SMTP AUTH) [1] has been disabled by the company's IT. Switch to use my personal email address instead. Signed-off-by: Bin Meng Signed-off-by: Bin Meng [1] https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365 Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240505072312.2776074-1-bmeng.cn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 63ada48bb4..84391777db 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -320,7 +320,7 @@ F: tests/tcg/ppc*/* RISC-V TCG CPUs M: Palmer Dabbelt M: Alistair Francis -M: Bin Meng +M: Bin Meng R: Weiwei Li R: Daniel Henrique Barboza R: Liu Zhiwei @@ -1603,7 +1603,7 @@ F: include/hw/riscv/opentitan.h F: include/hw/*/ibex_*.h Microchip PolarFire SoC Icicle Kit -M: Bin Meng +M: Bin Meng L: qemu-riscv@nongnu.org S: Supported F: docs/system/riscv/microchip-icicle-kit.rst @@ -1630,7 +1630,7 @@ F: include/hw/char/shakti_uart.h SiFive Machines M: Alistair Francis -M: Bin Meng +M: Bin Meng M: Palmer Dabbelt L: qemu-riscv@nongnu.org S: Supported @@ -2126,7 +2126,7 @@ F: hw/ssi/xilinx_* SD (Secure Card) M: Philippe Mathieu-Daudé -M: Bin Meng +M: Bin Meng L: qemu-block@nongnu.org S: Odd Fixes F: include/hw/sd/sd*