From patchwork Mon Apr 28 12:59:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885473 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5164034wrs; Mon, 28 Apr 2025 06:00:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWjbKlc23AuXLvCJcPzQ8MNDg4yysYT6Nv2j8B/5PpULBZQ5f5kiZNNzwY1cdDQqVTqMV6VsA==@linaro.org X-Google-Smtp-Source: AGHT+IFVwJO2sVIAq03xe3FVo3//oVWP2OXcW4zhN6UD9kbmw2Ju8rQUOTT2/EF0eT95RUQjHP+l X-Received: by 2002:a05:620a:178b:b0:7c5:57b2:2cb7 with SMTP id af79cd13be357-7c9668cdc19mr1594694485a.56.1745845219593; Mon, 28 Apr 2025 06:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845219; cv=none; d=google.com; s=arc-20240605; b=jzn2Kz26mGziVk9UYJMGud+98ylhEgNxWqa1l972cDN8GnsRMzfYxXIxibced5VS03 wzMT7hmWZcJ0Mv74oEO5C4CBngkTaFgaEnVYxreL8PHgUYVvzVKsNPQZ5Mup7at3ZQXs f7Z7cFkHrOQoHvhfHHlSEUf2jPfJzlm5BKVzFE4XLxOKANFlwtDqeaPcTRFm9Yjhmi9G zCHgmFmcabiiGKezC28I/RKMdyL+qf5YQEEw10CHnrDXT+0xSFtCmlnKZbqbbElhBIoc RCADjPvLtJBgDwhjEE6t8MFRYfuokCWGTZeX2whwHaqClIS7xd+5h32BDUoKx5KkStc7 vzbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jhcZnu+Y1TIeUDuUOI6qKcuAJbQrXxQgcrFBlI5eh30=; fh=CRxZ/er3+VXA5mJQYxYBLkuBdEcLSBKdQEqlxuayHY4=; b=Fbgc6wZmVPocDUA81ujf2ExrSxHJRTm0zuioXqN8e6Bz+ON2UE1lY2XVj28OBvE1OO OqAi4th/pNXeUhGMjXBaRxuP8xPS/Ht1QxbS4qJ1OexsP/d7sQnkU9XUrV/nvsE6rBlc a6bKIaD25b2fqW6CcMOY2t47rlVa1ocUwersGN/D2GsIIEF5CFf6bD7f3wWhjq84u0yb R0quri+cAoWQhW5HFm8jy4hrnd/o3G1a9ea+o1d6/qSm/GzMRsp1OFvtFMAV+u4wMq2J g17dIG3AR7RCZ6ESyrKvNnGQwmeItVVakX6vqexH/5E2yrqbytctj06KTB+kHTuQ4M/s t6cA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ChkFS2oG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c958d87295si1006180285a.224.2025.04.28.06.00.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:00:19 -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=ChkFS2oG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5O-0008Gy-Ml; Mon, 28 Apr 2025 08:59:51 -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 1u9O50-0007sk-Ha for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:27 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O4x-00036L-3X for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:25 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5eb92df4fcbso9078194a12.0 for ; Mon, 28 Apr 2025 05:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845161; x=1746449961; 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=jhcZnu+Y1TIeUDuUOI6qKcuAJbQrXxQgcrFBlI5eh30=; b=ChkFS2oGlIUdvk3dcuGuoLxujrulNR87jXBJ74zIt859im84W+HZeTGepoQ1y9jO2r GmGShvg1ZQAxCcBm2bya0zHScW4f4ph6h4yqDxTIDvN/i87UnROuoLzm/PJN41oDBn48 fGVqAy4XbJpU2ath7spafBAPlWdaMhK+baBgz30kQORlEFjuxX3CVfP6OH8eWg42+YrL hG3zQn8y5Ltx61z8SFnEU3hvRX6qwiAZyKAL2WT8cbyexaDH8tCtBMOME1xubZiyOaJ1 OZRcaQDEdenGzby7LpiLDDx9U2f9rYHCV2i871WSVF1wSOx1NFjlQ7d6C8j/X8jdxNtY GmBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845161; x=1746449961; 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=jhcZnu+Y1TIeUDuUOI6qKcuAJbQrXxQgcrFBlI5eh30=; b=iaPP79/TczlrpWJomwwavMAX9cfHTtCRWzSwCeirLcusWu5LVpyz/KJQm0hGoJX5lQ O5yd+0y+FUlxMHPqJXNWcCptsQOVJkElwj/O5RG4UMPPnqVmdP6ljn9X11wCh4TFzYBi +4yTtBRLiHXr+KOJEta8QejihZQDbALbPw6ZQY5MnfMB1WuFQZlVqkhMgoxyUdzgxcF4 gZ0pFYC29TPZMm29p5pFYLI+UtVQHBsOhQ5uGjhk5O+icV5rcT8t/0qbVG14RzShh5qP sg27OeZPZoEwO+w/M4T8KsxTx21R15q2CnlY9g0qeEN8+SmRvQZKcSzt45bs2fktrGdA KJIw== X-Gm-Message-State: AOJu0Yz0w8TfRxgYmGcNQh0rRrSMWUEdysPiIQTiP5bvzp0YTlE2VUtU z25Wmk+wdMBYrF5I48wBQRE/8MFFvA9h9Jkpt7EBP7UOI0eMb+m4QWOeqnQ3JbY= X-Gm-Gg: ASbGnctfUDz4NIZyKz/VhRveV3yb4yZF+II2MSem+k3t8q8ghjGvSM2pnskzHAPNQg9 BkgMIiSRLdHezJ4atPqGf/dUXcuD5BZVfdAwh3rzgzG6j1+mWg3P+eIKWVMzr77a+jWLTpUebEu alWtEuuTzMGQHN00WoNbWvCBVYq2U1jJSwfNyLRHcXziS1e6K/S1egIY2G2JZdM4iUG4ihpRSXC aPJwrIaeRg7aDmiHTpCLA/AJSwPt+p7pQ3iHHAr8Ge3b2oSMrBwpYytILMS50bkQhOWoTbPrP2V 1Fzac91a7aTtjdL+PedC1JcjokjgRgF1YIblNXrrj8/7wD4czwWc8g== X-Received: by 2002:a17:907:9405:b0:ace:6bfb:4a12 with SMTP id a640c23a62f3a-ace848c2190mr861793366b.7.1745845160665; Mon, 28 Apr 2025 05:59:20 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ace6e41bc62sm618677666b.25.2025.04.28.05.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 592E05F93C; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour Subject: [PATCH 1/9] tests/docker: expose $HOME/.cache as docker volume Date: Mon, 28 Apr 2025 13:59:10 +0100 Message-Id: <20250428125918.449346-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 If you want to run functional tests we should share .cache so we don't force containers to continually re-download images. Signed-off-by: Alex Bennée --- tests/docker/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index fa1cbb6726..56a8d9f8ff 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -224,6 +224,7 @@ docker-run: docker-qemu-src $(if $(NOUSER),, \ -e CCACHE_DIR=/var/tmp/ccache \ -v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \ + -v $(HOME)/.cache:$(HOME)/.cache \ ) \ -v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \ $(IMAGE) \ From patchwork Mon Apr 28 12:59:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885472 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5163758wrs; Mon, 28 Apr 2025 06:00:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVof6+W1vfOQ8UibAnWuZEcGO5W102/chrE2ii+u99X8J1COVk3zzvexYRQWooy0c92lQLA4w==@linaro.org X-Google-Smtp-Source: AGHT+IEpPuK+Jc8uYIf2OfMt+DydBMzQ/WEqF2vliDa0aeVwi91x5OfwIcY+JnyK28NV0ZKjIBhy X-Received: by 2002:ac8:580c:0:b0:47b:3a5:927c with SMTP id d75a77b69052e-4801c9812eemr178095661cf.15.1745845204485; Mon, 28 Apr 2025 06:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845204; cv=none; d=google.com; s=arc-20240605; b=NOkT/iwHbJ/+qHcEY0g6Kz/u14vJwF5z90ZRsXd46Q6RgzGwyoNrQ1oQfdBQOQGiJV 4YlJqqBkDvE+UuuaRU+82ht+9QXNiFy9WtFKu/JASD+iQKkphC2yQIhM3voN0rJYpeOE 4NhHfomfH1vdYTyQ2WUzHB/EwlO47jz7DtlGWSWGDfUmVoLDJNzzA1gWnKjqMfB356qr /kSyjsP7kGssvbpI/EwGnRi5/xpsVk0cpKD7Q7XFwe6CyjPKP3LLo6RIajbaWABZaac3 gFxE24bKEfUE1+IpLYOxbg72QN+USJAY4Y7ZbrvcrDcA8lV0lTph/3y/SOpXeIwilhXB Jhrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mN1ikYfL3yXWBXqalxA+FshRUzVIN2Sj2/UZDoT8lTI=; fh=CRxZ/er3+VXA5mJQYxYBLkuBdEcLSBKdQEqlxuayHY4=; b=JSR1FxyDFfGtNEaNd1GzbX4yO56oNrvhOdTCEEG10H9heDl+KykhCbEgZbXwARZIOf /QnoMO7X04rP/AyRAhcmQsU5QJWC7/uBnp/MdKv4eoh287Taa3ZXA3ivJVzboPTU87bZ /w2jixjkSwbwsqyde1FY4nkvw7TzzZX+eF9Qknb1mA6NNP7hZBfKx/6LxPGb1l/seTI9 nt6hIuCjmxR8Q9NPsOhs8Swf96k0WP6diQdGh0jwU+LEfVv63IbUYo/PTKocslzV1G0o F5J1K78mIXj2VfAU/lB+jbBOiyiUT4k0enQ3+bYnPjaiNWGi/wkzkHMgFMXpyyxk9J6p pidA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tylNmCFm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-47ea26a3baesi100781551cf.585.2025.04.28.06.00.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:00:04 -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=tylNmCFm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O57-0007zd-8s; Mon, 28 Apr 2025 08:59: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 1u9O50-0007sn-I0 for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:27 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O4x-00036G-3N for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:26 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5e8be1bdb7bso7490379a12.0 for ; Mon, 28 Apr 2025 05:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845160; x=1746449960; 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=mN1ikYfL3yXWBXqalxA+FshRUzVIN2Sj2/UZDoT8lTI=; b=tylNmCFmLogDYmogUz3BZm0NuAHfz9m3o6OA1e9wLCf6OosM1rMxH+botm5cUNTmYW TuE7l8dziAvUAuSPCO9I36AFxFmCgW6LboQahPZQM9Wc/HtBgbpP+/YrY60gE9h/XEon GxvXrbzacaf/O9owkUQjH0CLJTQ49+Ea76z/dN0Dr+1CmK/rzwDCVD37MGpmhRX435YN 5QaLvGc/vCfaExGtZQHFuZjGEWhcOtuLkDheZHog9cqnLInHMWxSO4ftTa3/nVv5RjYK bUIZS01Q+c+MBjRqtHqVX1cV0/5sMaZ19mufwCXZwqpp1yulmECVreS5P+/mYCkwyvBJ 0+Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845160; x=1746449960; 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=mN1ikYfL3yXWBXqalxA+FshRUzVIN2Sj2/UZDoT8lTI=; b=sWuWiURYEBxD0HbZrDPO4uuU4Aq2+5S6RklRNR4bl3iVySEJ3KgtCLv2SdQlwko7iG LqQc/VZ/gtO+wnxul/sWfZJaWzSWJdvzIYjHkT263Jbv5ockKw6OxLLVkEktLsHuwfBK 5DbA6f+o7rd15nsmr7YOiN5kCDNe4hyAaYMK8BVsJ2UzD2LfHRQlZyPWL0HoW0YSULil 56FceXyfg+E+DKe7ZPloWHdVxJzMcuxaoYjjwrEJTgb1tokNe0Tu1rBFWJo9QpOV99LJ k82weNS1mCxYcg3WnDLXJ9zJ8gsRwAzoBxQ0x/XtMKnrdtndB8CpViqTnGjxIeL9oTHY +eag== X-Gm-Message-State: AOJu0YxyNCqReIdbsBE+Vb/YYwv8Ps1gSwartJ65XiE5wilU2PyUuLII L04SJJbyFMnzuZ/5HRVJeAV25VahyoMnLNUHFSkGkZikSuMbNiwgczmdxccDTvk= X-Gm-Gg: ASbGncuguXiiAVSTbjRw3OSfPAtwndnhtu1DLS4yP0nRM24SvoB2YerH73eYNybONGl kvokdRAHOKSeGMcb5QVBqsO76yD2MIOePK1FWfvPfSh/eSPtZr+FVncF2yk+A4M860pUdj1COax /9TrEsUihc25S9hkX5kZ4qOH+c1dq5tn2hrwj47gaSUvc3wsNWIlz23dI3wYtJBZwsCnJjcjLZ+ sa5H32XlwvDM6gDcPLM2XJU2ykUgIEkneUN9S0Ff/3eb6Qny5TT5H1CdJOkbFHBrDLqmOyIO9Yl wQa2EFgWM0zkI8+05fYT0yL4Mr0cVfgW2bmHTYF7Dcs= X-Received: by 2002:a05:6402:35cf:b0:5ed:61c8:adcf with SMTP id 4fb4d7f45d1cf-5f72297d620mr9563628a12.15.1745845160298; Mon, 28 Apr 2025 05:59:20 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f808b23ad5sm781881a12.66.2025.04.28.05.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6FC5E5F9D6; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour Subject: [PATCH 2/9] gitlab: disable debug info on CI builds Date: Mon, 28 Apr 2025 13:59:11 +0100 Message-Id: <20250428125918.449346-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Our default build enables debug info which adds hugely to the size of the builds as well as the size of cached objects. Disable debug info across the board to save space and reduce pressure on the CI system. We still have a number of builds which explicitly enable debug and related extra asserts like --enable-debug-tcg. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- .gitlab-ci.d/buildtest-template.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml index d4f145fdb5..d9e69c3237 100644 --- a/.gitlab-ci.d/buildtest-template.yml +++ b/.gitlab-ci.d/buildtest-template.yml @@ -24,6 +24,7 @@ - ccache --zero-stats - section_start configure "Running configure" - ../configure --enable-werror --disable-docs --enable-fdt=system + --disable-debug-info ${TARGETS:+--target-list="$TARGETS"} $CONFIGURE_ARGS || { cat config.log meson-logs/meson-log.txt && exit 1; } From patchwork Mon Apr 28 12:59:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885471 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5163727wrs; Mon, 28 Apr 2025 06:00:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV1spMg68AHPu9KL6F6EIRKhGM05l9wCjYZQg6Bw1q0GMhBsdSRap4lOqp0CYFEqva4J10LOQ==@linaro.org X-Google-Smtp-Source: AGHT+IHLVQN5Uq+/GOIuTL4ErCtsDwxS6Ji6JSOIbjYNaqynsXeI4eY/86m6iX0Mspx7Nt9JZhGv X-Received: by 2002:a05:6214:d8e:b0:6e1:a4ed:4b0c with SMTP id 6a1803df08f44-6f4cbcd4276mr194750166d6.26.1745845201949; Mon, 28 Apr 2025 06:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845201; cv=none; d=google.com; s=arc-20240605; b=Z1dujKtfkti5+YMKeMrvtyEm1FpaN78zndnsDIJJOW1ergrb1OGAba6bawNEEWA4rv +fxN0DrPMk0rAsQ0yqFJHx/RutrqkbQEaBoWvam9cECnjhGGBo/RdvORRGQUxwhQ3OrR sbZcUiZj9iFNvLHe5K2GJFjR5Bu4UffOkhwxZ0ZrPZ7yG5GCAN0/+27avBQkoJ9x0L8e yPIRUnaIQldUfNhq01quzp3uycxKIViYnw9YJ/r2/ZGOAWJ6XaUiNzWa7V/BVln9xFvt LXiIhUtYk1gx9EPdRPeWzlpupPfxT/ZeIjgpaU+epYHjKm19H/NfDKyvZswL94AWg4gU ekVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Qc7SHqkPGeFwD7OQUk3puk/Z8FG2BzOSogWjxrnjPA8=; fh=WQdx5IuKOW47fPFin68RJHgHrvEuRrLEbIlw7SaShRo=; b=RUJawBHNzgJG7UEg4Q85mrJvabc+f9zW+9x8YbikR7yRRhVvXPGqZC5VCXNZu1fYaa 1+45a72nvU49ccB6TZC1X3KjH3o8CcCenYpoNqeMHCMKRDz4wcVmkn8VGYU8FrAgFlR9 OtXGUt2KMd7tkVqhs9u5c37k6K99esqM/WlwL+5uHD6TDmE7o3L50eSFu2VDt7ia5PJF BDhapLUt0JxHfGlsFsonZX/qqtz+V6dEMNl86QvMRzxYO6JuHyAXt4V3aRRAya7R9TXW PM5r1cxN9UIMpje9R0/u7XsbzmIzfsFV+EhWAj1uHbRHCqLfjsLo9cMhy+8n1h8cksGv puyg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d+g609W2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6f4c76423fasi86410726d6.169.2025.04.28.06.00.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:00:01 -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=d+g609W2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5O-0008DP-I7; Mon, 28 Apr 2025 08:59: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 1u9O52-0007tf-C9 for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:30 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O4x-00036m-Rn for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:27 -0400 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5e5deb6482cso10136939a12.1 for ; Mon, 28 Apr 2025 05:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845162; x=1746449962; 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=Qc7SHqkPGeFwD7OQUk3puk/Z8FG2BzOSogWjxrnjPA8=; b=d+g609W23dZf8fHRhusj8Fq3akM6BdgiY+PQ9nONOXDBWULwvLDmZpFAXx8tHD50yB LoeGkH7Vcxd9Fn8IQMm0ZtwcaWOsmBkIwz6ar4G++lmEwT7HCbF6Yl9PlR2fqavD9VwF KIAWRVYi5jQaqVs+V5ndIcd4sMsXfQGb9pLYw8sYc4wwu4Ja8LJYqK4MnmRLJ+Fla+sU M/+JQGuXB0HazwsmVeRmz88hkk3y9XxmR51ylPEovGHtkyl3JhPitV+J+O6Rer/zAHbs Kf2IJJ+tTBAmuuFVVZfjv3tJ0PF/uwzsX0sF/+JY4gklFLm3zbxmJ2hE1eYsO2Xv4rlQ WmNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845162; x=1746449962; 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=Qc7SHqkPGeFwD7OQUk3puk/Z8FG2BzOSogWjxrnjPA8=; b=lwqCdmHBclPxxwH+5Tjl+5LJ84F7/5wIQXvEi2koxUAMBFIf1wC/NgparJYO3oGPN8 lTt5qQaGb3SntnUNQsGFRtNsk1Bb6gkV2/bkapfQlkXaCZfFTTjwZbJblLC4dT5vjZob CKf8K4Gc1kVQNGT2ES0XyPSIV/9XIP0PeiHeJLvUP7LMPiZX6qgYDJit/L9DDEpw0auG 4G6uUVQQ5BD/J0eUxuuqJx8bmbNY3y/Nm8wMZfy4tK1XXvxsW2+JbCs4WGaX/Dldbj+m uENTSvPO9barH4o9CJdilvQiAG3m6tNuFd7O3M0qCRFsIQTeNZfEMSs1zKMUnPiUwxM4 QiUw== X-Gm-Message-State: AOJu0YzjZVYFuVR+g1vDM7GIMnrmlwkW0pIenR+Af95SHIWejDxD5hlG oBYQSxUdYTczrrNQZKyBudhibswE6WOt8NtVZy3UcL1KCg6hbq0RP21wBxbE2z4= X-Gm-Gg: ASbGnctHB6EjrBXgBdduEP60tgdTG2TwfKK1vofL0pO2EIOywsyXsO27vtjlcrbfRWo kj/4upQOHaAW37BwyNY6g6L10OzOmJ0VruMTz+Ht+EXn4+RfO8dNbHNzPyd0Rl9Ao0Oszb1Vv/f MKoYRPaPYM/H7oqV7MMKhTPNZySRqmtRJBvJZ9y9Fv6lr7Zrf4Rfh/RH0zOOFiZb0qKsTnVY2ga SmGlRJXLuo/6xVLhoZ7QuR2un/TK/drj8oDeVpx/vCUdZWiJ2HW8CQAk7ukF2mbzKn3pTT+z8i7 q8ei9YPtVJR97dtx/Ti8rgnoRbe00Zz9hrv9Qfz8JWQ= X-Received: by 2002:a17:907:3da0:b0:acb:a7cc:4102 with SMTP id a640c23a62f3a-ace5a124bfbmr1411844266b.4.1745845162079; Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ace6e5959basm617760466b.82.2025.04.28.05.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:19 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8662C5FAE8; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour , Julian Armistead , Jim MacArthur Subject: [PATCH 3/9] tests/tcg: make aarch64 boot.S handle different starting modes Date: Mon, 28 Apr 2025 13:59:12 +0100 Message-Id: <20250428125918.449346-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Currently the boot.S code assumes everything starts at EL1. This will break things like the memory test which will barf on unaligned memory access when run at a higher level. Adapt the boot code to do some basic verification of the starting mode and the minimal configuration to move to the lower exception levels. With this we can run the memory test with: -M virt,secure=on -M virt,secure=on,virtualization=on -M virt,virtualisation=on If a test needs to be at a particular EL it can use the semihosting command line to indicate the level we should execute in. Cc: Julian Armistead Cc: Jim MacArthur Signed-off-by: Alex Bennée Reviewed-by: Manos Pitsidianakis --- v2 - allow tests to control the final EL we end up at --- tests/tcg/aarch64/Makefile.softmmu-target | 3 +- tests/tcg/aarch64/system/boot.S | 127 +++++++++++++++++++++- 2 files changed, 128 insertions(+), 2 deletions(-) diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target index 9c52475b7a..f7a7d2b800 100644 --- a/tests/tcg/aarch64/Makefile.softmmu-target +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -68,7 +68,8 @@ run-plugin-semiconsole-with-%: semiconsole # vtimer test needs EL2 QEMU_EL2_MACHINE=-machine virt,virtualization=on,gic-version=2 -cpu cortex-a57 -smp 4 -run-vtimer: QEMU_OPTS=$(QEMU_EL2_MACHINE) $(QEMU_BASE_ARGS) -kernel +QEMU_EL2_BASE_ARGS=-semihosting-config enable=on,target=native,chardev=output,arg="2" +run-vtimer: QEMU_OPTS=$(QEMU_EL2_MACHINE) $(QEMU_EL2_BASE_ARGS) -kernel # Simple Record/Replay Test .PHONY: memory-record diff --git a/tests/tcg/aarch64/system/boot.S b/tests/tcg/aarch64/system/boot.S index a5df9c173d..19b18bdeec 100644 --- a/tests/tcg/aarch64/system/boot.S +++ b/tests/tcg/aarch64/system/boot.S @@ -16,6 +16,7 @@ #define semihosting_call hlt 0xf000 #define SYS_WRITEC 0x03 /* character to debug channel */ #define SYS_WRITE0 0x04 /* string to debug channel */ +#define SYS_GET_CMDLINE 0x15 /* get command line */ #define SYS_EXIT 0x18 .align 12 @@ -81,10 +82,129 @@ lower_a32_serror: .error: .string "Terminated by exception.\n" + .align 8 +.get_cmd: + .quad cmdline + .quad 128 + .text .align 4 .global __start __start: + /* + * The test can set the semihosting command line to the target + * EL needed for the test. Keep that in w11. + */ + mov x0, SYS_GET_CMDLINE + adr x1, .get_cmd + semihosting_call + adrp x10, cmdline + add x10, x10, :lo12:cmdline + ldrb w11, [x10] + cbz w11, 1f + sub w11, w11, #'0' +1: + + /* Determine current Exception Level */ + mrs x0, CurrentEL + lsr x0, x0, #2 /* CurrentEL[3:2] contains the current EL */ + + /* Branch based on current EL */ + cmp x0, #3 + b.eq setup_el3 + cmp x0, #2 + b.eq setup_el2 + cmp x0, #1 + b.eq at_testel /* Already at EL1, skip transition */ + /* Should not be at EL0 - error out */ + b curr_sp0_sync + +setup_el3: + /* Ensure we trap if we get anything wrong */ + adr x0, vector_table + msr vbar_el3, x0 + + /* Does the test want to be at EL3? */ + cmp w11, #3 + beq at_testel + + /* Configure EL3 to for lower states (EL2 or EL1) */ + mrs x0, scr_el3 + orr x0, x0, #(1 << 10) /* RW = 1: EL2/EL1 execution state is AArch64 */ + orr x0, x0, #(1 << 0) /* NS = 1: Non-secure state */ + msr scr_el3, x0 + + /* + * We need to check if EL2 is actually enabled via ID_AA64PFR0_EL1, + * otherwise we should just jump straight to EL1. + */ + mrs x0, id_aa64pfr0_el1 + ubfx x0, x0, #8, #4 /* Extract EL2 field (bits 11:8) */ + cbz x0, el2_not_present /* If field is 0 no EL2 */ + + + /* Prepare SPSR for exception return to EL2 */ + mov x0, #0x3c9 /* DAIF bits and EL2h mode (9) */ + msr spsr_el3, x0 + + /* Set EL2 entry point */ + adr x0, setup_el2 + msr elr_el3, x0 + + /* Return to EL2 */ + eret + nop + +el2_not_present: + /* Initialize SCTLR_EL1 with reset value */ + msr sctlr_el1, xzr + + /* Set EL1 entry point */ + adr x0, at_testel + msr elr_el3, x0 + + /* Prepare SPSR for exception return to EL1h with interrupts masked */ + mov x0, #0x3c5 /* DAIF bits and EL1h mode (5) */ + msr spsr_el3, x0 + + isb /* Synchronization barrier */ + eret /* Jump to EL1 */ + +setup_el2: + /* Ensure we trap if we get anything wrong */ + adr x0, vector_table + msr vbar_el2, x0 + + /* Does the test want to be at EL2? */ + cmp w11, #2 + beq at_testel + + /* Configure EL2 to allow transition to EL1 */ + mrs x0, hcr_el2 + orr x0, x0, #(1 << 31) /* RW = 1: EL1 execution state is AArch64 */ + msr hcr_el2, x0 + + /* Initialize SCTLR_EL1 with reset value */ + msr sctlr_el1, xzr + + /* Set EL1 entry point */ + adr x0, at_testel + msr elr_el2, x0 + + /* Prepare SPSR for exception return to EL1 */ + mov x0, #(0x5 << 0) /* EL1h (SPx), with interrupts disabled */ + msr spsr_el2, x0 + + /* Return to EL1 */ + eret + + nop + + /* + * At the target EL for the test, usually EL1. Note we still + * set everything up as if we were at EL1. + */ +at_testel: /* Installs a table of exception vectors to catch and handle all exceptions by terminating the process with a diagnostic. */ adr x0, vector_table @@ -100,7 +220,7 @@ __start: * maps RAM to the first Gb. The stage2 tables have two 2mb * translation block entries covering a series of adjacent * 4k pages. - */ + */ /* Stage 1 entry: indexed by IA[38:30] */ adr x1, . /* phys address */ @@ -233,6 +353,11 @@ __sys_outc: ret .data + + .align 8 +cmdline: + .space 128, 0 + .align 12 /* Translation table From patchwork Mon Apr 28 12:59:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885474 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5164724wrs; Mon, 28 Apr 2025 06:01:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUyBTiCKnUPULR0oFwV86/OrGbmfHPJiJB8oZIOMwzxrn52CX64gr7DiXUPRukInTJDWDkkag==@linaro.org X-Google-Smtp-Source: AGHT+IFpNF+xRM+R3NZPWx1Wfy9zEqLN4tFb0XxJxblN87wt/pswRf2ncseHjd3ni948S/j0cHH8 X-Received: by 2002:a05:6214:2486:b0:6e8:f8ef:d659 with SMTP id 6a1803df08f44-6f4cb9d30e7mr199088146d6.10.1745845292491; Mon, 28 Apr 2025 06:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845292; cv=none; d=google.com; s=arc-20240605; b=OCWnDrdiKFz8yoj2ANoPJuGuaTlIIOAsW7Q7MZZg/nA7jLyfOx162uKzbmBDv2bX+U tOAhfgM2ra9W4fhgX4v57KlOzg5tbIVxX7eeK43rs0O7fLSz9RFePp5lyXnhzQCwCwIG Z68BYXKz8aUU38z1TAXo0rYcfGNMKQnAmlgHfCOB6Wf6gzu/ZtqHTXve6U+aB1P5M0Ms Eh4fc16PaaNWpX9onbs5PhnGoeu2epBKl8w4y/G62PcNCSutksP3pC0nRqI6/eJtjnaq lK6KJp+NhXpqm27a+ElVw1Ib1oA23OncZahPm/eEX0rZdvdE2CD+z4XkL0ZxVgknqTOZ ZGWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OpcnbbS7NZaVAROUGSORdG952tVH4km68aGL3qTrH6E=; fh=CRxZ/er3+VXA5mJQYxYBLkuBdEcLSBKdQEqlxuayHY4=; b=d1Ybyx36pDFQ0/OBlZlBU4OqHetaBNkAO+tEox1Hgz0qH9f9CLaribSLiiHeOZjCRq 9+puz4NCP/gL6WNlp2dBSEEKMpTB9+DK/NcF+YRV4eWbeRCZJYGuQgwu2vzZ1MMkRV0l p6wmSfvPkRULKulN8QAiekwGLX5/ZnpD5Evpo6qJhp126+jmT6EdZjmmqsHCGVIVvKxY bhjLvtET77SR+IBwhjtBFud0TDwuOZ857lYs2cxxxvEmk0cKdeAYPH5OpcEvIGljejtv 726IOybD9lcNoOo8gKJUYHfRPyAHTJ74dbN1tPEUqQnDFykIj4ftyTYw4C7vZOi9pGi/ fl2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b08SX4nx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-47e9f2ca778si105795721cf.94.2025.04.28.06.01.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:01:32 -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=b08SX4nx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O59-00080w-6q; Mon, 28 Apr 2025 08:59:35 -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 1u9O52-0007tc-AX for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:30 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O4y-00036q-28 for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:27 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-ac2aeada833so927775566b.0 for ; Mon, 28 Apr 2025 05:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845162; x=1746449962; 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=OpcnbbS7NZaVAROUGSORdG952tVH4km68aGL3qTrH6E=; b=b08SX4nxgTdy0psISi+SAexoeWfKko/2u93q4wCGJqfMJXUERMF4PYZ60pH5LhjrC+ gybFPF9H3BVGQwp3Qo08g4u1d0SBdHx7u0okknKLNwkzRy+sb/0pCsJUjNmPgQL8hxVY KDzKcSXeLSaNWO5o2I0gxH3TXOJn+RRkJIvHhA5zkpkMj38Bc3JZzQG9aPs+hNaxVoNt TWfOknUKs7/aDVR/DI2R9pZKlpQGbzrILUk8o+CGdbvNxpM0pmdJrv0NJpqVn50cILlr /N9QlrwYGAKVU6qpD9TrM2cIx7POFCvvE3UhMh7FVsa5eWlUCu7HgT3h6OQ5irSoTJ8P a75w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845162; x=1746449962; 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=OpcnbbS7NZaVAROUGSORdG952tVH4km68aGL3qTrH6E=; b=i9EoQfIPKDvqcpZWdmDY3FxBRdxRiArLJ4h4Ih/JHS7TIspg0oRzepArAkRm76edq0 auYPRq9+BSl4J4cI1lZSNvggXbnLB3YKCKNAW1rua+6awajW96jXMfX/IXMDJZTnVDP2 dJ5HCgsJ/FRcAeQNvhQrkyQiahtdtidyY7qFEib2EmKWXLS5UNwqJlKRbDj+Xyl6P++3 WoysLN27YTb8T6Lp6RgSAkFG/ze/CcVqpvU9zW1DY7w+Wd6mE1bjHmHFh7u/7+qNODzX ffDbzIYexF87LowxB5F1wE0dwAQDvswgMnn4YnyvgruW2sewWV0T9W2wsSvaDgBAylkW 5HOg== X-Gm-Message-State: AOJu0YzVLXbiEaxvizpNcdiL19OJj9JJJgEim93mH6NSDg8vODNSt41Z skkYqqZgwFCHIu2+DZcxe6PHly8C3ec2/ZpxBNpy7edjY1uaSIxvo6Y37wYQtU0= X-Gm-Gg: ASbGncvHodIvLfi2cPGXxYIlXrUkxk+6rAgOeL/PSbB2E8ifFkxdejn5syOwriN8wG4 BpUT3LxJEFsc0UmiBPXL1eWBMv4adOpaia32OCxsGuxUyOi1TAT5cidDKuVgwvjQiwx5pepX7ue rU8AIIC+ox4/U3dsarnC4uRxjNze6Yee9helq6mLxBNp6nAFLKby7sFASXDkL9ICB7+DO5nr+qQ 7HP/AK+esECLxD4XE4Y0OjCA4Whorr2QZ/iDYRT9jrELzdx/tBhBbth3BzkR0gGmsQBlxT1bjZ6 JUrsxnz1vmvlmTv4b6GQ3ybfmhnMUI52fdpFVBVsGec= X-Received: by 2002:a17:907:9804:b0:aca:d276:fa5 with SMTP id a640c23a62f3a-ace73167e83mr1087497466b.0.1745845162449; Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ace6ed70611sm627048766b.143.2025.04.28.05.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:20 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9B2F45FAEC; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour Subject: [PATCH 4/9] contrib/plugins: add a scaling factor to the ips arg Date: Mon, 28 Apr 2025 13:59:13 +0100 Message-Id: <20250428125918.449346-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 It's easy to get lost in zeros while setting the numbers of instructions per second. Add a scaling suffix to make things simpler. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- contrib/plugins/ips.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index e5297dbb01..1952e0866d 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -20,6 +20,8 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + /* how many times do we update time per sec */ #define NUM_TIME_UPDATE_PER_SEC 10 #define NSEC_IN_ONE_SEC (1000 * 1000 * 1000) @@ -129,6 +131,18 @@ static void plugin_exit(qemu_plugin_id_t id, void *udata) qemu_plugin_scoreboard_free(vcpus); } +typedef struct { + const char* suffix; + unsigned long multipler; +} scale_entry; + +/* a bit like units.h but not binary */ +static scale_entry scales[] = { + { "khz", 1000 }, + { "mhz", 1000 * 1000 }, + { "ghz", 1000 * 1000 * 1000 }, +}; + QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) @@ -137,12 +151,19 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, char *opt = argv[i]; g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); if (g_strcmp0(tokens[0], "ips") == 0) { - max_insn_per_second = g_ascii_strtoull(tokens[1], NULL, 10); + char *endptr = NULL; + max_insn_per_second = g_ascii_strtoull(tokens[1], &endptr, 10); if (!max_insn_per_second && errno) { fprintf(stderr, "%s: couldn't parse %s (%s)\n", __func__, tokens[1], g_strerror(errno)); return -1; } + for (int j = 0; j < ARRAY_SIZE(scales); j++) { + if (g_str_has_suffix(endptr, scales[j].suffix)) { + max_insn_per_second *= scales[j].multipler; + break; + } + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; From patchwork Mon Apr 28 12:59:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885475 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5165015wrs; Mon, 28 Apr 2025 06:01:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUWlOROShd9b8XfpF/EAriVJipKTDA+q6MEt0QWVR7xyLKGwlcxbiAQnfLQMzwP9YXp0TLgVQ==@linaro.org X-Google-Smtp-Source: AGHT+IFnKp1vO6NulLfn6G7MmJxn7Jvq3gmApZTXwLiT0qrsyKOFyYTnLsS4PX7d33msW8VnfekR X-Received: by 2002:a05:620a:390c:b0:7c5:79c6:645d with SMTP id af79cd13be357-7c9606ac6e6mr1664074285a.11.1745845317037; Mon, 28 Apr 2025 06:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845317; cv=none; d=google.com; s=arc-20240605; b=Y6QWuTu52MFsiHZrWzDZnGQ+WlI6UF0SkylwQMUemcb3UiMWdTZphKZ/ecHbC2LT+u mw+ZDDzD8DG7F6FS7R8Qi6QV4wMUsRtKwzk2xMoMsDyWrn9BrnuYEh9A5rZBr68W75LN XN2YmzhPol15ghe2x2L+mQoUa6+J4cojQyrRWmA9JPl84Bl8ddiPsM8eIYRQR8Kvm9K1 09zQrDemtgO44MVSS0taWZMWlBZfxekNiqTmoad09yg9JpmPp8RX7APekeCJhrO2XP69 Xd5jpLJhVpbN6h23hEY86mdK95rYndyoiRqFbv85gkx8b+VGOkYNnZf4KpR10agiGPQ5 7wPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=djoQOHWyk0AtirIrodM8UGPqfENNxGNaKjJ0HgISDiU=; fh=CRxZ/er3+VXA5mJQYxYBLkuBdEcLSBKdQEqlxuayHY4=; b=gDg9A2r3p+KdBoz0j6ujWc47A9i5slem3yTQkcgbIA5VYo5kCPYnJN/959WX4Yqz2y THNIXf7oiU9cpHgBLSZz4DHSZQWac42cAli/tEmoTKf0ORkf1NLFanl/+qHv2TasTDyS opimWGFF3/e/g0hnUmPC4CAOt1q7Jm1DGnwGr2LENY0E010TeQuesdBdDE+yEegSszC3 rIN1FzDdx5suztA1IJKLlaSz/RnkU0YXgWw5uRGVjNyAeTB041XhVqLGHtFTLbHMLQwf A2VG74KC3GjHyPRVkKIonRPYH7oHkyLf5M5iZyX0QhhCNjfWJc4UIBWkH3AZ5yvClIY/ G4AA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ir1c84ex; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c958ee1ae7si986991485a.640.2025.04.28.06.01.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:01:57 -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=Ir1c84ex; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5H-0008Ag-Tz; Mon, 28 Apr 2025 08:59:44 -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 1u9O54-0007uP-V3 for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:31 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O50-00037W-1T for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:29 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-ac6e8cf9132so920334966b.2 for ; Mon, 28 Apr 2025 05:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845164; x=1746449964; 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=djoQOHWyk0AtirIrodM8UGPqfENNxGNaKjJ0HgISDiU=; b=Ir1c84exYpMhLrW/0q8LgRysAfnCZ3aHUINXrsTQf6kEqHsriqufU7UzZcuZVm7+Mt uF2PWdVyCGcsEBBnluTbDdjYAzxrT2s4ZMBos4YhOstNuijw8WL0syTgnmbE0tizU9H+ Ym0sCuqneUPAcaFOoFLO/CboAQFtrQpjeetbOkozDkwtPSSCvK7DZadgYHSLNGfpbz49 PYhnH6txI0F6bLR6+GE2iIAuq67D0bZSHStQreRMiNmDr/s1BcGtDiHjtIs7Zg13YBI1 3anDf0bNtIR5KaxxoKlPs5gXzlJ1u1HM/MjSr1+uk/kHXdptm4Oo2c0J7QOptVTeO5K0 e9Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845164; x=1746449964; 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=djoQOHWyk0AtirIrodM8UGPqfENNxGNaKjJ0HgISDiU=; b=B3hAl396CBy+2+7cIAKYupD3dZNLnd3WLnMBesh9JSeQlUBdd3AYXw8nJLcPvOxEOo DThgxQzs8PnmPaXQ3yRTRFl4H41h3qMdF4cfQxAAiF9fRquV7qLW7S6fQQATeI2Pip71 8mHKO/fkWKl+IXKygDxkEcaJJaHz6mTEyXtOqcJTriwhlcWLgqyCbjnSRuE5XVwHtTcy dbs83BATXgg/Vn2a3Dd6Hrd9JZGisrDzU0e5IfkQGDyM0jLm4IpnQLr8FY5aJsxAzUX5 CUMRw2ITksuk67APDx1gbWYrAezKVaIbBw923CFWFGPON6zQB5QqDAMrOfVdf3VZ7XR5 ThDw== X-Gm-Message-State: AOJu0Yx9xHRf2C3aTgLI+fWCdCffFoPh8MKJXa2wf54ozf1s39T/swQg LNMWycVBKFdA7QMkaLoo3ine1yE0oc7PAWVXp3vbqTrNCv97WbseFXO4+sMtmEc= X-Gm-Gg: ASbGncvjeisPQZbfSBP1pVwXfdZPrg/RIiVNGcGc5pAjL6ceTAhMRR+rB8fBzTXDFku Bb30J1MB23cEMbziMbd1S64sc5wYGAVo9aZrSCKkz8vcWGHcuVX+7ozg+nAD+srBQmz+bTNEB88 89Qlu3vw6b3aWrUk0U4fJjVWYhpcSN4yHk8D5+7FaWI8SK7iMqWzkwyIFIfUP6yGLYB79A8mdIh jANFuBRqONu0lBnGx3RbYm6/99vXCCD13fwAaFG9+ZDBD1ZCWbUCykHHFCGSbSFo37mmEkHKPHv xpZm5Cvh7r1XgOq3q2nEPzTGE39pDYET4ZH2Ar1p7WU= X-Received: by 2002:a17:907:3f9b:b0:ace:672d:c7c9 with SMTP id a640c23a62f3a-ace73a6bed7mr1109878466b.26.1745845164287; Mon, 28 Apr 2025 05:59:24 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ace6e4e70bbsm632156866b.63.2025.04.28.05.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B1C2C5FAED; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour Subject: [PATCH 5/9] contrib/plugins: allow setting of instructions per quantum Date: Mon, 28 Apr 2025 13:59:14 +0100 Message-Id: <20250428125918.449346-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 default is we update time every 1/10th of a second or so. However for some cases we might want to update time more frequently. Allow this to be set via the command line through the ipq argument. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- docs/about/emulation.rst | 4 ++++ contrib/plugins/ips.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index a72591ee4d..b607183d13 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -811,6 +811,10 @@ This plugin can limit the number of Instructions Per Second that are executed:: * - ips=N - Maximum number of instructions per cpu that can be executed in one second. The plugin will sleep when the given number of instructions is reached. + * - ipq=N + - Instructions per quantum. How many instructions before we re-calculate time. + The lower the number the more accurate time will be, but the less efficient the plugin. + Defaults to ips/10 Other emulation features ------------------------ diff --git a/contrib/plugins/ips.c b/contrib/plugins/ips.c index 1952e0866d..d83124d71c 100644 --- a/contrib/plugins/ips.c +++ b/contrib/plugins/ips.c @@ -147,6 +147,8 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { + bool ipq_set = false; + for (int i = 0; i < argc; i++) { char *opt = argv[i]; g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); @@ -164,6 +166,9 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, break; } } + } else if (g_strcmp0(tokens[0], "ipq") == 0) { + max_insn_per_quantum = g_ascii_strtoull(tokens[1], NULL, 10); + ipq_set = true; } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; @@ -171,7 +176,10 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, } vcpus = qemu_plugin_scoreboard_new(sizeof(vCPUTime)); - max_insn_per_quantum = max_insn_per_second / NUM_TIME_UPDATE_PER_SEC; + + if (!ipq_set) { + max_insn_per_quantum = max_insn_per_second / NUM_TIME_UPDATE_PER_SEC; + } if (max_insn_per_quantum == 0) { fprintf(stderr, "minimum of %d instructions per second needed\n", From patchwork Mon Apr 28 12:59:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885479 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5168324wrs; Mon, 28 Apr 2025 06:06:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU39wY3skn0/I72AhDKBdc92rZpvG/SY5xf3GodSQgSzqur9CceEEBDbDAtcr6h8ZtHQyeHgw==@linaro.org X-Google-Smtp-Source: AGHT+IGIf6Kn5yTtX+FnLuOnMoXOH8MiC62U2j6ezbUEMxwEqozj3HaEHjGt2meFGLMYBrBJ6RN2 X-Received: by 2002:a05:6402:26d2:b0:5e5:bcd6:4ad8 with SMTP id 4fb4d7f45d1cf-5f7395ef836mr6465530a12.9.1745845586516; Mon, 28 Apr 2025 06:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845586; cv=none; d=google.com; s=arc-20240605; b=lrEgrle1QXCNZX15bQdZkNxfCh2aBDHxxVMeta4LOEieZwEeil+Co5V1xSZv8oJ8MP /IaaR/t00MELy/8EK7HtLNpmA3ZrrA52+UIxG4XitTuOXucGZtxebNiyRK9EOGE0lbRk LWZWsA3jSJ11RUgAnh8Gup7GrRtpMSagWA6IHY6iTYq9IGEABZyvGr+GHtLVqDZzOUTp YotXlQycninosAn2roQ8JYphYHuT8UTWF/E/SHicRm6qbbfxqVldU646pbYf5GMCR0L/ J0xKUhlhiAPBLyr5Ish5md1TO+4VQnR2lTwAUV7NuYp+1ARFlDSByLi3bNizOIkOFbBm qjIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U57KKXtG3p2E4GxRki+kejQJQkJUB7hPOj4McHyafgQ=; fh=CRxZ/er3+VXA5mJQYxYBLkuBdEcLSBKdQEqlxuayHY4=; b=GzuL9SIVA51RkSeOoyGjXeklCbuRBele8dVzViTrLfiolitno1B0qK31cEJo8QoCcy JB7o8xs1nW33FROia8kZKB7ekCWuoRHCnFcdE1TQrQMpK2ihj96MjTgQQO+Qoj2I6pJr eM07D7zq994M5TIAXeUyrB+kAbp/7HzP+xVlRzR8HouaH5HcCUK2Pa7oOWgTFciON2/8 FyqGq+WePTobRBPo+/81hCHP/4HoDtOLf4x7QARH/gd4UvMLShjwcYvhvjS61r6mS6O2 MoB6s9DkbXG8Z/oK25b6VHcx7MY4Q3GZglpQYh2U4A8wtmQKVpcC3vOE9loMBs/pwQVY e1mA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NASWo8/G"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5f703734193si5080694a12.538.2025.04.28.06.06.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:06:26 -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="NASWo8/G"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5i-0000Yo-3N; Mon, 28 Apr 2025 09:00: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 1u9O54-0007uO-Uq for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:31 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O4y-00036y-K5 for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:28 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-ac2c663a3daso935283866b.2 for ; Mon, 28 Apr 2025 05:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845163; x=1746449963; 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=U57KKXtG3p2E4GxRki+kejQJQkJUB7hPOj4McHyafgQ=; b=NASWo8/GBCe4GuKte1m6OOvxqxl2e73kO2fqArfE9jZ+LIzUoC7B+erYSOVJgpPUF9 TzUao1LaWaITWZ4jjFHsF514WabiQ4Iq2KlvCa4m7vvUDcjZLrlwZTvaDWQ9LetIVwMp NadHDV6LztwnuPczSQpW1mCUjVPs+Ka+hnKmQkyyCXHgbIqSWFUbU2tvIDSp8qNFG1Ai mGwafPg2n6usoY9myUSRZJPPao1qYZ9zeYEiRTGNBO0NzFDgJGVn3+/N1R/tttUwUWtb zdllZI3DSBNJz8rcDHcdZORu14DPkTc3Sm/RinsW2vWZxk19Bd747LgI06bL78rMY+Sa 53bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845163; x=1746449963; 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=U57KKXtG3p2E4GxRki+kejQJQkJUB7hPOj4McHyafgQ=; b=VNLjw2HLWuU7CeoX46E2nQENrQSa2SWOwrKfUTn9HViOTf0rt9oXKbK3+PAevnGyZt jDD2RSXDYUDJWKnrFTJrazCgMbdfxydadv33c0J57WKQ59y5t1AqH0KAjc935ThGrnj9 47rOlL8xknoYOTKO+JZzU1vWJNKCIXKuoNacrxJCDWv9PLZ8qDDDMMOAwwnEncmX7NFj /9ymnOfYtpvOK+k+NX26jY6yd1mcHXiVAr4Q5SDlPMnIjK4rzaigvFsJh9uRMZNBOo09 li1Acm9tnqiBmOyJsoyVFroQQQ3NbI5QzMU2gBZWACQTfSG7V6U76XPlEsIgFTTAfh3G OvNw== X-Gm-Message-State: AOJu0Yw3xPK7rZvXuZvzMnJBdm5F8i8/CXVSFzuP3uN43N9YRcm8vGDG 6JrIgNHshOE7QNvHEefomIxinZonhikMI7WxBhMoApdB61NyJZrKrQ8kmd/4Xzo= X-Gm-Gg: ASbGncvp3hLSU9W2+ik2qLkqowal9XVuIZGmoDuXilNjuh0Maiy8GEhMZLNzGLsRvb2 Flo8BcEnBaC/9olxpbtihWSGLQFrGR7rZsDjPsOrpRUVev2jvOW1Dw3abP/FXshfN9tzPkeFSrL T1rWhUVyvfofJziTy569wJ9nf5T2ugYJHlNaH24oS0JlACaizE855Yo8F39TEsKWDBuThCQ7bCQ FRKmnZBdf/FayMNfDScP2tppMvwPOGjV9kmF1HmQwI1n+F/TdgAFsMMPcT3QGOgnPPrwKPtY6vg Wr+FvvfWl1NDWhd22BJGdpokY5VF/d7hYNYuP2UlDPg= X-Received: by 2002:a17:907:97c9:b0:acb:b267:436b with SMTP id a640c23a62f3a-ace84938eeemr803926066b.25.1745845162835; Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f7011055f0sm5809746a12.15.2025.04.28.05.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C6DB65FAEE; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour Subject: [PATCH 6/9] MAINTAINERS: add myself to virtio-gpu for Odd Fixes Date: Mon, 28 Apr 2025 13:59:15 +0100 Message-Id: <20250428125918.449346-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Seeing as I've taken a few patches to here now I might as well put myself forward to maintain virtio-gpu. I've marked it as Odd Fixes as it's not my core focus. If someone with more GPU experience comes forward we can always update again. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 661a47db5a..f67c8edcf6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2636,7 +2636,8 @@ F: hw/display/ramfb*.c F: include/hw/display/ramfb.h virtio-gpu -S: Orphan +M: Alex Bennée +M: Odd Fixes F: hw/display/virtio-gpu* F: hw/display/virtio-vga.* F: include/hw/virtio/virtio-gpu.h From patchwork Mon Apr 28 12:59:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885477 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5167990wrs; Mon, 28 Apr 2025 06:05:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVukYBh5mf5EbfKgg4vYNso05cfiBAjqaw49dIheny593EDjgEkuKAgiKoDHn1QUaoDa0juiw==@linaro.org X-Google-Smtp-Source: AGHT+IEuPykGD/qdvSkXVUHV2vN+4fs2LxwBZyumf9UJ0IwwOlG3W9WNVTUK3IIuibG2gs6pnSRB X-Received: by 2002:a17:907:7f91:b0:ac7:9828:ea41 with SMTP id a640c23a62f3a-ace84aabbedmr872858966b.41.1745845556772; Mon, 28 Apr 2025 06:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845556; cv=none; d=google.com; s=arc-20240605; b=SSvxQ2T94rIoPb/W3WCCbOZdjF18/oadnF/xeZyBb4eNeyYKN5DDX5CGrlKbV10BBY lhcafpZqJAgMEptM3A0vdXYWMrHlig4QjbOitEHGx4Zn0pcCrlQzO3AuUpJ1vUTP7uEk QCH7Z2g2JBalD773GE2oGRXZvD9oPy067mQZdStGkxaZsA76IFIOaygZt+mYVXMxk97x y9R6jGsb7xywuVIDxA/DoYL/1azLOK57nK18Je+8x/knyrG5Q16jDvo3itzMR5VbXUmi dnZCbsNPxlwSkLErbKnLgIi91SEra9wMI1w8PRS6Pzk+S6yWRhSR59GT6D76W2RBei6k fwnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=prKtOm6WcF+MO/JIEf9B+KJu4Pq11tFhYp9uWEc/J/U=; fh=MbSZeyuHz1YMF37U3Zh5uEBxqt8d1r6Azei5dqApup4=; b=g4sXCEotLfTlKJkTciix+CGDQGCoNGc0qnmKOe7afChZP0KpFNGCnlYyOpHBoTH9PX r0T/dkVfQBX+Zn1Oz56reXQEuBc/JUdQP0RPy43SSJygSJ+KFq5UoGQuexLiDbPEUCRp lRYmtnXAy9gEUF+MjWdcMvU2NGzMvaa7XxuI6yeNTM6J9Ae8BAD+EBP+OUZZij07bcuG 4NOSqesBx8Wb5s5+/sQh8VBTF9OC9xpZgxJVVosvQ0BpWwXuZmvotHcphP2DATs6gb+H FqOg3S7E6Tyga0HBalCr5yJULaLTBwBiHYUOsuQk21MfZpppavFKqESzV7Pfw+sx+AJs BnWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JYR4ScJ4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a640c23a62f3a-ace6e4f881fsi471004266b.195.2025.04.28.06.05.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:05:55 -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=JYR4ScJ4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5o-0000pe-8d; Mon, 28 Apr 2025 09:00:16 -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 1u9O55-0007ue-5A for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:31 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O50-00037g-SM for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:30 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5f4d0da2d2cso9075131a12.3 for ; Mon, 28 Apr 2025 05:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845165; x=1746449965; 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=prKtOm6WcF+MO/JIEf9B+KJu4Pq11tFhYp9uWEc/J/U=; b=JYR4ScJ4o0Eaf/t8uzCG9Iv8kQv+vZEbIG5Q91rPJfl+q56UmMBSY7pHixpO6eKTX9 rWOvvTX4wuiqSUtKCa6lEd+kGiQ/QbpsFhVeERrOFYwmesHq20kUwL3qez8pJmrL6VF+ nuyCv3lSEn0+UOGnoDiJR9dwPLl6wHBD/hNouQqXH4B+bLsgb2JSBKmPgUiGICHmLBfi EhgKPvQdRQCsk4owsZ3rRbg/tPug1Go7qa9lB6knhwdZolgLI2CorK+kpZN//5pABLLB OrpB/ewmAipEqORdg+RmfZHT2WtHXywpdZ8anjjilgeGjf8y5nWW9qByJpFtghBX42Jg j6+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845165; x=1746449965; 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=prKtOm6WcF+MO/JIEf9B+KJu4Pq11tFhYp9uWEc/J/U=; b=vNJGRr8zMCDyHZW/lMB+rynxvkx5jTGvPv4sx2NbZfZIXMiYsBSw68d6LFQ+SyheIw W+BYj4g9zF4M1zHhOOeSEuPP9DazkWGHdZPGYfphzeY9NtvOVkS+P59E9r68diD7REIy 9Qe0uuE7EgVf2OkXWRcLLqaSSUJBqo2HrZx+rVNw+iEsxcMLzObgoA2TfxuKam2t6fSS z0e3uxRgZSBmYHL3TVkGWvLiBsIs1yvcTAYk4kwGwXv6/JUpTdAD4PBBw6hn1ZuR6Oo9 pSAVdkK4wM1Z4sFIJBOwECwzuaECo5Sok42uMxquDZcdKwWc4s/+eW4mYs0mZVyoC6ja ABIQ== X-Gm-Message-State: AOJu0YyWj+f9ahKdKFPca+PC5RHzBYXeLPl4LqFJrVILhYgPEap9JsEj mBs/iVMOIyf6shTienxOgzIZND7h3L+vbbzy1GMaNDDLU893NbEwgq4rWpr3Ixk= X-Gm-Gg: ASbGnctvQeo5DZPwa7ieZg1wemMCS/qI66jlSn2lpitxIG9lLFUnZoq1qEua7ZPcnqT udiyoRkMFlzc9u2RyWlIa2UZzkyro/Dac704fMM0OrU9xszNpWpVviRy0v2lhPZ7PBL/irLaBdZ +SRf+oM+tAQhMbNCSP8/Bbci3YdJK/I0rJbL8hw7I2dkZUXvVDErLswuGEnQSPe+dSbX+Qt/Pjz ZhbgeNh4IRrvUcJ5kSQOftOpQTurAEcZ14Ojcp2v0y83901rdJJT9W+LIjRDGn7GSNL9u+L2C0T 7ZzBpJTnVfHUGEu5qP2pTCj8PBHJVXSg7miIqXaTQ3w= X-Received: by 2002:a05:6402:278e:b0:5f2:f29c:b98c with SMTP id 4fb4d7f45d1cf-5f73984e3eemr7678441a12.32.1745845164918; Mon, 28 Apr 2025 05:59:24 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f7011fc361sm5820327a12.16.2025.04.28.05.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DF9935FAEF; Mon, 28 Apr 2025 13:59:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour , Manos Pitsidianakis , qemu-stable@nongnu.org Subject: [PATCH 7/9] hw/display: re-arrange memory region tracking Date: Mon, 28 Apr 2025 13:59:16 +0100 Message-Id: <20250428125918.449346-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x531.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 QOM objects can be embedded in other QOM objects and managed as part of their lifetime but this isn't the case for virtio_gpu_virgl_hostmem_region. However before we can split it out we need some other way of associating the wider data structure with the memory region. Fortunately MemoryRegion has an opaque pointer. This is passed down to MemoryRegionOps for device type regions but is unused in the memory_region_init_ram_ptr() case. Use the opaque to carry the reference and allow the final MemoryRegion object to be reaped when its reference count is cleared. Signed-off-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20250410122643.1747913-2-manos.pitsidianakis@linaro.org> Cc: qemu-stable@nongnu.org --- include/system/memory.h | 1 + hw/display/virtio-gpu-virgl.c | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/include/system/memory.h b/include/system/memory.h index fbbf4cf911..b3cef1acb5 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -783,6 +783,7 @@ struct MemoryRegion { DeviceState *dev; const MemoryRegionOps *ops; + /* opaque data, used by backends like @ops */ void *opaque; MemoryRegion *container; int mapped_via_alias; /* Mapped via an alias, container might be NULL */ diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index 145a0b3879..71a7500de9 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -52,17 +52,11 @@ virgl_get_egl_display(G_GNUC_UNUSED void *cookie) #if VIRGL_VERSION_MAJOR >= 1 struct virtio_gpu_virgl_hostmem_region { - MemoryRegion mr; + MemoryRegion *mr; struct VirtIOGPU *g; bool finish_unmapping; }; -static struct virtio_gpu_virgl_hostmem_region * -to_hostmem_region(MemoryRegion *mr) -{ - return container_of(mr, struct virtio_gpu_virgl_hostmem_region, mr); -} - static void virtio_gpu_virgl_resume_cmdq_bh(void *opaque) { VirtIOGPU *g = opaque; @@ -73,14 +67,12 @@ static void virtio_gpu_virgl_resume_cmdq_bh(void *opaque) static void virtio_gpu_virgl_hostmem_region_free(void *obj) { MemoryRegion *mr = MEMORY_REGION(obj); - struct virtio_gpu_virgl_hostmem_region *vmr; + struct virtio_gpu_virgl_hostmem_region *vmr = mr->opaque; VirtIOGPUBase *b; VirtIOGPUGL *gl; - vmr = to_hostmem_region(mr); - vmr->finish_unmapping = true; - b = VIRTIO_GPU_BASE(vmr->g); + vmr->finish_unmapping = true; b->renderer_blocked--; /* @@ -118,8 +110,8 @@ virtio_gpu_virgl_map_resource_blob(VirtIOGPU *g, vmr = g_new0(struct virtio_gpu_virgl_hostmem_region, 1); vmr->g = g; + mr = g_new0(MemoryRegion, 1); - mr = &vmr->mr; memory_region_init_ram_ptr(mr, OBJECT(mr), "blob", size, data); memory_region_add_subregion(&b->hostmem, offset, mr); memory_region_set_enabled(mr, true); @@ -131,7 +123,9 @@ virtio_gpu_virgl_map_resource_blob(VirtIOGPU *g, * command processing until MR is fully unreferenced and freed. */ OBJECT(mr)->free = virtio_gpu_virgl_hostmem_region_free; + mr->opaque = vmr; + vmr->mr = mr; res->mr = mr; return 0; @@ -142,16 +136,15 @@ virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g, struct virtio_gpu_virgl_resource *res, bool *cmd_suspended) { - struct virtio_gpu_virgl_hostmem_region *vmr; VirtIOGPUBase *b = VIRTIO_GPU_BASE(g); MemoryRegion *mr = res->mr; + struct virtio_gpu_virgl_hostmem_region *vmr; int ret; if (!mr) { return 0; } - - vmr = to_hostmem_region(res->mr); + vmr = mr->opaque; /* * Perform async unmapping in 3 steps: From patchwork Mon Apr 28 12:59:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885478 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5168313wrs; Mon, 28 Apr 2025 06:06:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/p/sNz4XR+Sg7nbTsmvDudlLIceIaYI3gtaLjASLopxbLYpwNgzpVbJUisVkO7VF8U9j7PQ==@linaro.org X-Google-Smtp-Source: AGHT+IGK9gMWnb+9frXW+Qlg2+lFSUt1smu5GNaNq8Xfy89VgMMhJMjKCmjIb6/uOS1b8+YiZ8P9 X-Received: by 2002:a17:907:c0e:b0:acb:ac30:61f2 with SMTP id a640c23a62f3a-ace73a45d9emr1108240966b.18.1745845584617; Mon, 28 Apr 2025 06:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845584; cv=none; d=google.com; s=arc-20240605; b=drrPEq2UeX35JQLY7uSY/BFTtUSsrem2gXiU0UFyJp5NToEwBJTYEUvZUmIwFZCxYn VuTlKcP1/t2h9MqxmTHZ+ERGTe8BX2xQ35bfDNTEwo8tYf8wDULLdwqEHJfI+lUJFn+S yxH6Ff1F34DVWgR8XdWIOZZppMmn69LYoe5SzMdyJfSajf66gR1r8qbYu+kAT+6+k7Cf kul1uBE8v5PWBQzNmt+d3x37YrLc4aePkw/s4nAf+xtRy2ilW8yMxJYhG2KqQsWioi7p FbUhbUrhQhTll8ZvASiRr8Ed8UmXAKI3ylHm/faMCOptmSKIA0vGtCNUsDkmjbpcz1Ot 8SRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vC8n191P5j8mUKL+6H7GfxpWwzkXlFDtmwixiEivZfA=; fh=MbSZeyuHz1YMF37U3Zh5uEBxqt8d1r6Azei5dqApup4=; b=ehJY26jm1YGkyKRykyTuvSo8jUAsbKu8u82qv5C0t9uhcGTAoNjBH6RoAncHtwTKAb /3kbj2wpKr+8zrEG8I/aY2UZGwWoTDnX0gCAZJNxQauS36y1NB4OvA5Dy0xkJsMEqGuJ VC2t8oqEHQC4IEVprdKbr5N4y0L8v5z9/I3seuKNSyBSASvmngygvXgMvNHvx84Bj5j8 uMrf0zA2MQHlGe3TlzjaliICbws3jIkEp7m3lp76Euh3Au/nI5LYbkSf3ovTfY/Q3YGa XY2Qz56QeVYAviakai/8+jS1fIk9Kcqf4jo6HldWQwmPsqhaytxiF5huIFua2sfHtL38 23ZA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LtbM9zZA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a640c23a62f3a-ace6e432e1asi505835166b.61.2025.04.28.06.06.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:06:24 -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=LtbM9zZA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5Z-0000Cc-E0; Mon, 28 Apr 2025 09:00:05 -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 1u9O56-0007yB-Ho for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:32 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O52-00038S-0f for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:32 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-acb39c45b4eso752545766b.1 for ; Mon, 28 Apr 2025 05:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845166; x=1746449966; 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=vC8n191P5j8mUKL+6H7GfxpWwzkXlFDtmwixiEivZfA=; b=LtbM9zZAjmrx8EPgUFzb4dwTkeIhqbUPaHQ8zrSMnBMSP9Ti1EBkrlViXT4GEk3Bd0 RtVT3VZHOOD7iyHbZ3/tiIKFjuj+1vdWpC+gnHactdN+hAr/rR3xCa5y5m5r6nBeyQJw zYwDZNA7ENipR08B+UJfNFKv61ITw0t/nYGheA3quvhrTy5uk6EsQcfXfpcxnWd/hdym +L8xonNM7mKLRwCBN9YWYH2ZY+pTPu9X5f5QCUNZACzIPMtzcYNm0c4IbA50wyK4+YUY wN9W3RhHDIsJXtmfCiX33HOAQ461RgZTvK3slBCmmTDvzSuQomnXwqiVt6k1tKsNZGT3 v2RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845166; x=1746449966; 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=vC8n191P5j8mUKL+6H7GfxpWwzkXlFDtmwixiEivZfA=; b=I5nQPThjYVFX7Q6/gxKUb2l5Zjh5JwE37CV2YhX+lqXbeC2Zl+HSuLaMaSZ6lDsKpl qTFnh7jWUXourDOFyw1tQ9Hb0IksvWXfmCw2X6CvtIykYAXKX6jmqtoE95h+i8ShzRN7 GkeysOtHftvSMJZsNZpylLLIYO6mUlZ560tdI9dYUH2LM2TL/x+u4V56niS7RoeqFDb5 Uf5Jq4w7OgLDDwfBev1IuNulYtBnYuQyDehi4Vt9Aey+jgZsLIeQngQQL5hVf69p3En7 TjAu/xPNi8BbNgEAlQtn4v1tJ2McFm7ySGeHA9Ptjgn+6wKbCu9yQa+roXEeIfXtYQEC NxHg== X-Gm-Message-State: AOJu0YwbFGVL44PRcgpomCTyYJrT5VHprdvz+zJkkLY/5efd+20bGLYj GGkh9BaTJ6RKIO4kNS0lV55B1kOtxBFrsQEGnO6K0Sl9IuWeAOXtTCsvEI2q5RE= X-Gm-Gg: ASbGnctMx/d8kJ/JoUJEhUZIx4hch1PBKX3bypaK44jco45JduAmeCltU/ZgrVuuibO +ir5j8jnx4TJR72u4cbdx3bi6leeCkIwGa1YR+mhY6oYrPRIONAvHzPZqg1gzWg++EgSjqqKS7w mMeYUb1B3meaJXyfGIhi/zvADppvAflolPPx1m6bd/rJ1UgG3ft3yi/RakdLHHbPgJlSkR4i2mm xhLRLHmknRZaWelFmagh9VSqZWaoaYb7cW2mRma8EOy9hKj9sNYn8yK80Pt2dmyLsnL9q5ePk6C 4E0X+w1bjAPYszQ6sLwOpgY5UmZjsudGyGV1ONiFdueyqOxotogcAw== X-Received: by 2002:a17:907:2d94:b0:ace:6703:3cd5 with SMTP id a640c23a62f3a-ace73a45cd7mr1155454166b.19.1745845166242; Mon, 28 Apr 2025 05:59:26 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ace6e41b7f9sm623625266b.6.2025.04.28.05.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 032375FAF0; Mon, 28 Apr 2025 13:59:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour , Manos Pitsidianakis , qemu-stable@nongnu.org Subject: [PATCH 8/9] virtio-gpu: fix hang under TCG when unmapping blob Date: Mon, 28 Apr 2025 13:59:17 +0100 Message-Id: <20250428125918.449346-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Manos Pitsidianakis This commit fixes an indefinite hang when using VIRTIO GPU blob objects under TCG in certain conditions. The VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB VIRTIO command creates a MemoryRegion and attaches it to an offset on a PCI BAR of the VirtIOGPUdevice. The VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB command unmaps it. Because virglrenderer commands are not thread-safe they are only called on the main context and QEMU performs the cleanup in three steps to prevent a use-after-free scenario where the guest can access the region after it’s unmapped: 1. From the main context, the region’s field finish_unmapping is false by default, so it sets a variable cmd_suspended, increases the renderer_blocked variable, deletes the blob subregion, and unparents the blob subregion causing its reference count to decrement. 2. From an RCU context, the MemoryView gets freed, the FlatView gets recalculated, the free callback of the blob region virtio_gpu_virgl_hostmem_region_free is called which sets the region’s field finish_unmapping to true, allowing the main thread context to finish replying to the command 3. From the main context, the command is processed again, but this time finish_unmapping is true, so virgl_renderer_resource_unmap can be called and a response is sent to the guest. It happens so that under TCG, if the guest has no timers configured (and thus no interrupt will cause the CPU to exit), the RCU thread does not have enough time to grab the locks and recalculate the FlatView. That’s not a big problem in practice since most guests will assume a response will happen later in time and go on to do different things, potentially triggering interrupts and allowing the RCU context to run. If the guest waits for the unmap command to complete though, it blocks indefinitely. Attaching to the QEMU monitor and force quitting the guest allows the cleanup to continue. There's no reason why the FlatView recalculation can't occur right away when we delete the blob subregion, however. It does not, because when we create the subregion we set the object as its own parent: memory_region_init_ram_ptr(mr, OBJECT(mr), "blob", size, data); The extra reference is what prevents freeing the memory region object in the memory transaction of deleting the subregion. This commit changes the owner object to the device, which removes the extra owner reference in the memory region and causes the MR to be freed right away in the main context. Acked-by: Michael S. Tsirkin Signed-off-by: Manos Pitsidianakis Reviewed-by: Alex Bennée Tested-by: Alex Bennée Message-Id: <20250410122643.1747913-3-manos.pitsidianakis@linaro.org> Cc: qemu-stable@nongnu.org --- hw/display/virtio-gpu-virgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index 71a7500de9..8fbe4e70cc 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -112,7 +112,7 @@ virtio_gpu_virgl_map_resource_blob(VirtIOGPU *g, vmr->g = g; mr = g_new0(MemoryRegion, 1); - memory_region_init_ram_ptr(mr, OBJECT(mr), "blob", size, data); + memory_region_init_ram_ptr(mr, OBJECT(g), "blob", size, data); memory_region_add_subregion(&b->hostmem, offset, mr); memory_region_set_enabled(mr, true); From patchwork Mon Apr 28 12:59:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 885476 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp5167984wrs; Mon, 28 Apr 2025 06:05:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXTH+z+niqdLAhsQwUZFtGjdtGhXpB212sS8CQVfBkjpoKvEb9FsStcT5MCP1ICFFGWW4DVnQ==@linaro.org X-Google-Smtp-Source: AGHT+IHO9PGfA3/oroJei0OngAVfW56T3kpP3FSDnwp/AxIVpjl0eFcqyrfQG32phxyBRVDwnwyx X-Received: by 2002:a17:907:98b:b0:acb:6c92:cbce with SMTP id a640c23a62f3a-ace8493f8f4mr743301266b.32.1745845556775; Mon, 28 Apr 2025 06:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745845556; cv=none; d=google.com; s=arc-20240605; b=K70FgS3m2FxpzTjk2lzI1N4QOX8ljrn8BmXAlVOTAx3398GwCw+C8MzS+Vu8lX4L38 y29oGAN7cjjqXyzXR3DwkdOnsrXFG5Pa5ZJOzvj4OhJpEX8a7u0kzFGkjSpr777nQd6q jT68CyoYyhQaKP/VxyE6khoBQPoPcTBd2t/4WJrXwPK1NAgQ6OahqHKDcCUXnh0Z74dt rTt8hmG5ofYRKGpWIap9iRlycU83fCWY7EJlfR7Mjv+j5U5JocjPUBjjXm4iwAtAdwum 47z4r9aXgUDa1AwwvBO3moelBY127TM4MWuJ//oJMQexAQwxZ/OwLWhaEgoO5MhQqKg4 gFKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZKjH7CjiJYzujGe3Nf/k6lUsudRskeBEN8uYYCNZGto=; fh=MbSZeyuHz1YMF37U3Zh5uEBxqt8d1r6Azei5dqApup4=; b=TMeNyHGlxLZEPsZDyCPGw+as+h1n50sQaumsTkNvUa6GqTINuXPDwa8yfI6TnS/YdM pJVxCphZAYoUXkKMpAwuGXR7ZNCiSAReDCNcMLGj4O29/SZ0sUrnGyb4TSxB1PQj/SfE C6SAx5lmj/yfSHQ+jZ7MqP4xN3pB+wgWDbkaIr2uv6Q5B/fSfm37IAtQOglukYqeQdii S3LHjpNnVJcwAZL//6EoNDrqbiZn//HI+TNdzynq6B8/mUw/j8wspGt+Do/HYGFlMwM1 a44WwAHV3lc/GYQpS4I6sljBODU0A9Y2nlm5R3t9c0k7sCDdfihZDp0XvCTCXK7fJvJ6 d+cg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cl+Cayrq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a640c23a62f3a-ace6e41d439si477051266b.38.2025.04.28.06.05.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Apr 2025 06:05:55 -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=cl+Cayrq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9O5n-0000o4-HX; Mon, 28 Apr 2025 09:00:15 -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 1u9O55-0007w3-CM for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:32 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9O51-000383-PF for qemu-devel@nongnu.org; Mon, 28 Apr 2025 08:59:30 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5f4d0da2d2cso9075162a12.3 for ; Mon, 28 Apr 2025 05:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745845166; x=1746449966; 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=ZKjH7CjiJYzujGe3Nf/k6lUsudRskeBEN8uYYCNZGto=; b=cl+CayrqVe7kYwRjwjmXUfAHlGUdAlVCrQtCN5cfz96GFuZBUonHRfSuv/uLLthijW /SR6yproRGQq5LheSyDYJfXEqmENLDWv4rNJ8gtxLdLtAks8H4Xf82Zq9C+7XyNqAl2t BsPuuNJJPwxx31DSRW/s5AMKhwxfJ8Ow/qqwFCkALETvDod0W2LO2+6m5cT/zTphAuo7 YGXMQiPtIr/C1u7ezfjXcDp+k1g1puBEihbKCO0dIZa3G/+FhEmbP+v/qy/ch1+t2v1y hyUbokhXcju6qB+wrFu39CCw06C4UI3MFwbUCh8BbLTFfE9shk5wd77O9V09PrEMHRy8 +dkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745845166; x=1746449966; 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=ZKjH7CjiJYzujGe3Nf/k6lUsudRskeBEN8uYYCNZGto=; b=tmzjz4FwodlToJyyvIT1eYB9M3Za9gh8KXwY5OAzh6G0b90CijU6gsUn6ctVrpl3PK CFh8aYZBcDxAdra8JpFcXdolSQKO4M4i7pK6m36FIr7p2dU6Ayxjpqo4T9EjVHz3dlRE 1BywSyqLKd4pWKB0GtQfm6FMHzLoFIIflsQLELlbqR+F66yxjQFLG0Ppdt1R2HMPZsKF G4jtAk6dRID+4vsIBMIGA1J2L3B705jCi3wd96/T2Enn5p0KRfZxjHXduELr3gxhCKFr 7wI0U3UsaebCdjpL231teG2YBuIMzTZvV9m8OEFzI6KXBhXs9J6niKqJCX6xp0OAn/P8 0qyw== X-Gm-Message-State: AOJu0YyKpV1z6kbh33oWZaFlNd+UHjQLmeSKWWU2tOUgW+EXXyzAwVIA zUkpVwXrQTDjUYNpHsYHsdYMyJsayWDWC78RCWYbe8dFJmBYQBvQgOFmeKMshL0= X-Gm-Gg: ASbGnctgIqtGd/3xeRFioDcdwJ8cvavOW1OGLck8n2qx1cFDAwKPno2j8pA0uLYDus7 q9CksAeSgjPmkNreuOlqdph/UYB1YaBbHR+LRxzXO55GrCF8Vc3Ng0kqF8UHVzdWXudF1wdytp1 ytsuZZ2ishMZ8Y9jBN3xNiJ4EV5pKbrzxZ4Tkb21gA4CcFbZ3hYzkn59zO7OFw4Mx1jnWSitM6/ iIx3O643ge0BP5wjZRlnwkEWJG6ZBEGP54FMFKRKoYwYAcL6T1xt8zWCG8a0WiO5All/NsxM4cE H7iT7fEeHEXmqtOzwGZ5NOU6WYwXXIhbgw7LXd7baG8= X-Received: by 2002:a05:6402:2345:b0:5dc:c9ce:b022 with SMTP id 4fb4d7f45d1cf-5f7395efc3cmr6818100a12.9.1745845165661; Mon, 28 Apr 2025 05:59:25 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f7f83ef5f1sm979766a12.21.2025.04.28.05.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Apr 2025 05:59:22 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 18C605FAF1; Mon, 28 Apr 2025 13:59:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Alexandre Iooss , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , Pierrick Bouvier , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , Peter Maydell , Mahmoud Mandour , Manos Pitsidianakis , qemu-stable@nongnu.org Subject: [PATCH 9/9] virtio-gpu: refactor async blob unmapping Date: Mon, 28 Apr 2025 13:59:18 +0100 Message-Id: <20250428125918.449346-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250428125918.449346-1-alex.bennee@linaro.org> References: <20250428125918.449346-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Manos Pitsidianakis Change the 3 part async cleanup of a blob memory mapping to check if the unmapping has finished already after deleting the subregion; this condition allows us to skip suspending the command and responding to the guest right away. Signed-off-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20250410122643.1747913-4-manos.pitsidianakis@linaro.org> Cc: qemu-stable@nongnu.org --- hw/display/virtio-gpu-virgl.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index 8fbe4e70cc..32a32879f7 100644 --- a/hw/display/virtio-gpu-virgl.c +++ b/hw/display/virtio-gpu-virgl.c @@ -155,7 +155,32 @@ virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g, * asynchronously by virtio_gpu_virgl_hostmem_region_free(). * 3. Finish the unmapping with final virgl_renderer_resource_unmap(). */ + + /* 1. Check if we should start unmapping now */ + if (!vmr->finish_unmapping) { + /* begin async unmapping. render will be unblocked once MR is freed */ + b->renderer_blocked++; + + memory_region_set_enabled(mr, false); + memory_region_del_subregion(&b->hostmem, mr); + object_unparent(OBJECT(mr)); + /* + * The unmapping might have already finished at this point if no one + * else held a reference to the MR; if yes, we can skip suspending the + * command and unmap the resource right away. + */ + *cmd_suspended = !vmr->finish_unmapping; + } + + /* + * 2. if virtio_gpu_virgl_hostmem_region_free hasn't been executed yet, we + * have marked the command to be re-processed later by setting + * cmd_suspended to true. The freeing callback will be called from RCU + * context later. + */ + if (vmr->finish_unmapping) { + /* 3. MemoryRegion has been freed, so finish unmapping */ res->mr = NULL; g_free(vmr); @@ -166,16 +191,6 @@ virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g, __func__, strerror(-ret)); return ret; } - } else { - *cmd_suspended = true; - - /* render will be unblocked once MR is freed */ - b->renderer_blocked++; - - /* memory region owns self res->mr object and frees it by itself */ - memory_region_set_enabled(mr, false); - memory_region_del_subregion(&b->hostmem, mr); - object_unparent(OBJECT(mr)); } return 0;