From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630714; cv=none; d=zohomail.com; s=zohoarc; b=LBNOo6Drrll8yQtcQct/PFhEfqSGAvrjFTR1H76v8g9z+Wb0rHS+XY12CHqucHBO/mYRuisAXM9zGZuXAhVTWE7u+ZP/qRLaB148QX+QMqueEpcYcmvBpD8A0vwaM897Sb9xUAAHsk5mVE8NUNqfbsxiu/+Lk1bt3rEa884qB/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630714; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=9t7sxXRLpO6MKTnicE2Ws/es6K6rtSZrGzRNv62qnpw=; b=KChHEaOQLMIkH9YloNPypB+JHiqHjlwIHahf6iWFIdb/Pvg58ulxWfN0XAObcL5+Y8GYf5wJuBrxMpOKXxIXiFEwhZw0oBy/0K6V+YPgwiX/xEPDAWmbE8EhZeGLnOs+yNxfd6Tj2e3izthJr7F2mVIngbDv+9T595jbRJqpEPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630714623324.70783077644705; Fri, 1 May 2026 03:18:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIktt-0003u7-Nh; Fri, 01 May 2026 06:15:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktr-0003si-NV for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:11 -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 1wIktq-0008E2-5p for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:11 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488b8bc6bc9so11353765e9.3 for ; Fri, 01 May 2026 03:15:09 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630509; x=1778235309; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9t7sxXRLpO6MKTnicE2Ws/es6K6rtSZrGzRNv62qnpw=; b=MluybssXDIArCkN8jgRhPYPoPiiJutvgjNrCo2v7OS1k5D3Cc4BacOOsBz/OpqGAo2 B7UMDlYKhsZSDoJArrlkTCUtSHG6cXOMyBQ2I+1QvsezlOZRvQ+VjBgzk3OfwUrOyYSb 3/976mApRFFn7E+h0n7Xa7g5g4tFwmwnEOcxKB7w/YwxdoSrJCpOXFBKPQCD9uWlR+rB NLLPu/vi3Si9Gtzznx3pHVfZOX94jyAgK2vkSdx9t55VS7M+fkA+mjMY2VoeAXRDumiM H727HnHMWF1w3cVLC9Pe3lGdiN7TV/J0VftC4TIUsv2ikra/28mi27P/HF4Qo71cUT6/ fpvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630509; x=1778235309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9t7sxXRLpO6MKTnicE2Ws/es6K6rtSZrGzRNv62qnpw=; b=SH8K3A6bbxaCHKBWg3n6gIlk1mlIVjnz+s32YrIPjsc39L1vCBagMLT0rbYqaNJ/Rk KQruk6cDCZ2IyUa5P01fVS97T+8qOpBOuLmfnsuWPLCqLb080kYbWNICuOj06oabW0UP ILJMsESDSoWiNQ4zRfDHhI64hStx3JB4w2IUOsm/fwiTR9DTu8aFouqk/0+wjer4sfTM 9DSL26j4II7gkMkXbWK0zltnFx68mbsw6JZ6lzbK19jsC99i1bGrIxugwABNrVdIquYH AtH4igeCZpowsLB22Re4MgDjh72rz031llELptFKxRB31howceEpZ5YKPogQDYW48LHZ IN0g== X-Gm-Message-State: AOJu0YzZy/AEqhk6sti0gOsNa40DajgYmsBoPNWerRd3/cKYKf7EgRs3 wLh6iF259528HU8iirsXNo4/Bjt1PHH27Kgv+yRoJ/Dj6JaO/M4yluKYYI23wIK6WO4Q4P4qxV4 TJy5W X-Gm-Gg: AeBDietdyuWzsW74zgzUb1UZnc+91rf6/rv6ghO/sMJ+k37M+nsXkdU2csdx8SKxOfz WIrxTLe0R8uYh+ZIVQKtWbS4WmKncgmEGqIy/RHMK/kXHOPmvslSGXGcihGHriJfomtafv4dAPT vOL4v3YhzrSWXRhhl6TmJRKcyDWM8KE9indNrmDaAZ1jXz1I72gQZzJ4NXIH71qNK4uxcRsWBA2 FBsKEo9/AyyfyCDHJNKBvu0XBQxZJUv3FCWID/0p/4heprIg5zkehO8VsZpT3gyS8e0CjzEg/Ds psS6du5inatxHXmyJtomu73aMiI5SU7/IxA69EDT0OgvD1+pvBgIlUttexnS0REKMvwMdLZasMV UXSm6pXXChgQADz8ixHvDtrfvNV4bRNgi9P+AIr247jmNp37VvOEw9xKPcajzcr0KWtfmJOaTqD fsUjIhqK6BlogF+SP7vmhpKqkRHfKf3ENDVPzsGRqx2j3F0fYO5MaIJ1nZlB/QFjlu4jOsC+Ssn aQB3fn8R9tEvTW62LDmX/ZWIk3WkMKWZF+Ot9z9RnYQu+sE0Ms6 X-Received: by 2002:a05:600c:888e:b0:487:12c:e7e1 with SMTP id 5b1f17b1804b1-48a84446ed9mr78678975e9.11.1777630508798; Fri, 01 May 2026 03:15:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/28] hw/arm/fsl-imx8mp: Do not create redundant unimplemented devices Date: Fri, 1 May 2026 11:14:38 +0100 Message-ID: <20260501101505.3485916-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630715712158500 Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow The GPT devices are implemented. No need to create redundant unimplemented devices. Fixes: f8b26121762c ("hw/arm/fsl-imx8mp: Implement general purpose timers") cc: Gaurav Sharma Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell Message-id: 20260308203516.160103-2-shentey@gmail.com Signed-off-by: Peter Maydell --- hw/arm/fsl-imx8mp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c index b36df82971..33749d7fe1 100644 --- a/hw/arm/fsl-imx8mp.c +++ b/hw/arm/fsl-imx8mp.c @@ -687,6 +687,7 @@ static void fsl_imx8mp_realize(DeviceState *dev, Error = **errp) case FSL_IMX8MP_GIC_DIST: case FSL_IMX8MP_GIC_REDIST: case FSL_IMX8MP_GPIO1 ... FSL_IMX8MP_GPIO5: + case FSL_IMX8MP_GPT1 ... FSL_IMX8MP_GPT6: case FSL_IMX8MP_ECSPI1 ... FSL_IMX8MP_ECSPI3: case FSL_IMX8MP_ENET1: case FSL_IMX8MP_I2C1 ... FSL_IMX8MP_I2C6: --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630552; cv=none; d=zohomail.com; s=zohoarc; b=Gu97nB2urgHhpOJHAKb4hUOuWaYFnZSw2RJtryztfsBDuAtpRbWPQSUIrN9ja+wMtsgTncajh5c+ADAsHlYHmvVEgclwVsS/TEyLjVJAUwp19LOSYdei9VBG8/onhBr9B1YoD/MIkpOv4IBNdENUtys3vG8x2USfgKLYLmDsWZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630552; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=KeBNe4wyqrjV7VPSNCuKtnzVllsWaRV++aujRpEZVKs=; b=MAqVJoVZV56sNNSrogdoMlASQF8orrvLEuAHCngqTZoc08DAMofPJ+kAqkvLxohLxoYaBPHppDLL0GRgZ3ZOYNSGOZhNeQF7QFxYrfdB9KErJY6jhK0CtD5gabamE0pxkfgUybchK0EdxeAaIS6X8fvfGV1Ov8iyFS1vTrgygW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630552357739.6053077390953; Fri, 1 May 2026 03:15:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIktv-0003uU-1w; Fri, 01 May 2026 06:15:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktt-0003ty-0M for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:13 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIktr-0008FX-9A for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:12 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-488a88aeec9so18444295e9.2 for ; Fri, 01 May 2026 03:15:10 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630510; x=1778235310; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KeBNe4wyqrjV7VPSNCuKtnzVllsWaRV++aujRpEZVKs=; b=ccIKruR5n9VWjoLLyTa4rHLQUXRQCKHtcxxWTKpaah8BMrDbMhHLTyZSqH1deHcuvf i/b/cVIeQmuogkv/qRELPfq55cA0mMJTZU9p2V2XAtquq7/TRpphD9j2Wc4xVZFa2eN9 KSQO0K81803X6j3nMHqOVnOZXD0fS/yAg/KQecsfMkXzTGIMoAVegZbai5RAHhi//yzJ gEb5Or8NmT+2s3hSE8LAlBZOakqmE0UdgjVKiUyqacjWkBVO1arxakH+Py+izvTPPmXL rAr/hvjZjXmIAHbpo+7qGTu1zx0HUtQ7o2Sy3rNdSJHK94PISXLNIx8nc3H35jG9KY/8 NY0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630510; x=1778235310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KeBNe4wyqrjV7VPSNCuKtnzVllsWaRV++aujRpEZVKs=; b=jDRFcC9oj0nLM2QxHIjCp/fE0Y+HYjLVcpENqiWCDqtI6Z+O8oJs4jWm2kGjyn9KoO 2n7KVAdb0NTK2mLghtMBJqx/kHV/8dI1/7MZsJlsE9jOJ7naA7s/fY354KTpn9debd2x 3mp0X6wKBC7OhqYYzIrJ6h9ww/NbcD3pfDf2AB1Z4HHu9ZLrpkXoNQv72GlJC1p6zoEK sC0LGU/3NoneQnNh3h7BrvhE22sweAS2P0sxyCOPmng9Nf889x9Fp0R5oWKGOVkkKa5m Xp5S4lqMAaAHe31vIi7GHTOQeoFPqEUzL1m8RtCAn0E5TEH9B8b0sEMlzzIQgPu1SpDN u0DQ== X-Gm-Message-State: AOJu0YwE8mea/M9QWLe/voAPgSlITzAFncQ1VRXsVnOMzI/QaaeaskW2 a3/C2d91ZPjd72KZudvPVJYk2hlZpj8fXWwFzgMWepEwfBkbghpzNiF04kaUbd/qVYysL7tqD4g ncvn6 X-Gm-Gg: AeBDiestKXKwk5TBG9ukOeL9718CmYJ+r7p6L8wmo7b5XH3Ho7ytmMHOmKMIiYAW7gC acXfKmgoUIQUtQ3l3Q51AfLj1fyfs7itR+UES5ZOESXhQSGAtrht2ruVkgdYqyfH6o2cGwv7LOU RGypl34g1eK9a3CHZUxuQe73POoOU39MWioVIxHpS/5IBzHJBje0GXsmgBIb7e6SQ/53cupn6wH DvX/NAElm+SeYhQcApT0TStwXRCJKaimoOYKXhb7FnNfEin1hZbm9as+ckKW74z+KsfqkLUeeKD biJtrGEiZFxj7BNNOBrkoJzxN4DepJ3CwEC502n2W55O4N5ZAvdUaF6Cff83Lhhu8JrbuMixf6L Dwo+oDBcRzgvcb4kJcCqkyFFHNjxK5YxgrDIuGZCoM+zYDocbysdzzfud+ci7Vv9g7RU7Q/mtjH Xkumg22Ia/lGgN2NPkBmKP5zqXhNgcU8CgVPoXk0L1RuaLpOzFe3dQo3J1iuW7JmHe5pe0NIyfy HkRM4/hJQp++Swx4rzNAxohqyMH+iSHBGxeq/3aYQ== X-Received: by 2002:a05:600c:8b70:b0:483:2c98:4368 with SMTP id 5b1f17b1804b1-48a8eb88365mr34690405e9.18.1777630509734; Fri, 01 May 2026 03:15:09 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/28] hw/arm/fsl-imx8mp: Fix parent of ocram memory region Date: Fri, 1 May 2026 11:14:39 +0100 Message-ID: <20260501101505.3485916-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630554934154100 Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow Rather than having a NULL parent, let the containing SoC object be the parent. This cleans up the QOM composition tree a bit. Fixes: 1aaf3478684f ("hw/arm/fsl-imx8mp: Add on-chip RAM") cc: Gaurav Sharma Signed-off-by: Bernhard Beschow Reviewed-by: Markus Armbruster Message-id: 20260308203516.160103-3-shentey@gmail.com Signed-off-by: Peter Maydell --- hw/arm/fsl-imx8mp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c index 33749d7fe1..7c03ed3c34 100644 --- a/hw/arm/fsl-imx8mp.c +++ b/hw/arm/fsl-imx8mp.c @@ -670,7 +670,7 @@ static void fsl_imx8mp_realize(DeviceState *dev, Error = **errp) fsl_imx8mp_memmap[FSL_IMX8MP_PCIE_PHY1].addr); =20 /* On-Chip RAM */ - if (!memory_region_init_ram(&s->ocram, NULL, "imx8mp.ocram", + if (!memory_region_init_ram(&s->ocram, OBJECT(dev), "imx8mp.ocram", fsl_imx8mp_memmap[FSL_IMX8MP_OCRAM].size, errp)) { return; --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630577; cv=none; d=zohomail.com; s=zohoarc; b=TKunQCrO0NyWhrcX5DuCr1kvHbkRVr9u96PuOm/3PqsgcM1tEIJ3y4n9VfpnnigEW6RkGZQI5lw4BFTyzlaV5sSKz6cqhA4hRh/uEaw5bTEnIJ/6oqhjInGFj0emq5ZxGARWXKuVQkW4YmlZkQmISitgRCPvRBZiWCX09hcGXwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630577; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=jvzQsyH9P5JY6kgKUh6A4LpYKgME6BJ8LWqJR3cPdb8=; b=RuTZ8BcsSH8v+uDb3FSBpPPt4dJRbo2hSohNuV9edXcHi2g/H2LoR8GNku9B6Knv+53kddfPKnRY7NZJS0fgQflEy9dALpYaUZRg2DvojqgtWb3rUVz7KuvofB1Pz22aABgr9rvpgALCky4eQN1gCyHLX0jetk8boq95okNRm9E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630577667250.15344379794362; Fri, 1 May 2026 03:16:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIktw-0003ux-ET; Fri, 01 May 2026 06:15:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktu-0003uP-LA for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:14 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIkts-0008Gu-Rd for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:14 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so23183655e9.0 for ; Fri, 01 May 2026 03:15:12 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630511; x=1778235311; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jvzQsyH9P5JY6kgKUh6A4LpYKgME6BJ8LWqJR3cPdb8=; b=xejwSFayji9UcxSpkowj7symuXRb8Iyk/5nmc3bKye6l2YmiQwKvtkW+0r2vHdGVxE 1mtxY5BtYfleEuoXN/3cqmdeSK17PUbAsakhBhOMb9Ta++76iExc6uCA3GGoifnr0j01 +V8cY4U9CxeTDMILxpk1Ep1HNkse7qS+CJ30nH+J5xESay81WBMvpHU/iu1556lMB7lq ad0i5BsXIRQ7e2I1mB8V6ME89aWdxGV62Q9YVNxuyVT2hNKJRgF67xWCjyLa5hluDR2A rh5srxIJKHznLvwxji+hAOM5YTluRTIXR6mZhEMUb5TXb99t9jZ+Ar8VJK8slltinjSa hSOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630511; x=1778235311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jvzQsyH9P5JY6kgKUh6A4LpYKgME6BJ8LWqJR3cPdb8=; b=HynQ2vaZRBQvKy8s2CVHLaE7eKoqW3K602WGTPIc9XjjfeZb7n+P71/C1Be58MK88N tK3JW38/vkcKsW54+PDVB5i9LZ6GxNU4u7SD8V5XXOLcoyMy681EDF8uqvMfIKoMPHBs jI4JRC66lHyDKg/jZasf/cZyP1UrFESNcyjcY3fVYSB73uUHo9xvQNdWzTKyk1xFCajf w0MHmBhAdONc0y7yKu8Wl2fVF/L3y28F8zpAMYfEq/HweguJPVn+gIbcPRqV69KodeiZ uo7eirL4RLRWmJyFtqmvQ5FXyqNd0AMF85crZ894tx8CfIdIp5uD2gICeloVVlfI9sGS x5Bg== X-Gm-Message-State: AOJu0YzON5H+uZzHIorQTNkBvJKqv/sph5J4RVpi5jkQVBAHGtlSc19+ BfXBa3AuaoAwRuukMQsBN4ssVZoqEYHJqV+moO60+U0jTOxN1ZLWz+BYHmkat/CYemSGL7jpG/T ecFrM X-Gm-Gg: AeBDietIc9hE/nd6cR8Ezx7Wr9yEcLHIrHuvM3ALyvVScyFY7KroDUtQhFXYrY+1ih6 PbddjBdqVqtKtZ7dKojKJuKNYAO3Ngs6ulihkB2wBKgtkfkcu2WwOPFqmYQXHj4GI+hwpKLsOYY iSS44Cjrn+e8VqYcFWrtZXhz2A49HTNTMIpsl9PV7fNZmt8do1ctCGt0QakVY+5M6DAIRGdU1YG TpFP8tjcv/dFmJ5t+lHEu7R9Fyx821EluLok6rBCoMWzvuZAWTRK1fz1sCMy742P8XM2yoUD/ug ZiMK8Z6gB+C6nL8rEC7TqVuDpwEQGtTkwf0U/KLtSHyIdr29MpB0PECqOzJyLW4XYdjiEKnQQuw rn6767dlVzLEyU5zLXKMsYb6TVbiFlv6/b31h2ugZpizTIMXW0r8OfgkX/q2P/dUvwBAHQwq/vJ oiGTpjM6NbSmEEi4n0QEcXIsXa4Rs6CW+epRf+P3AVSHezRA3HmiZzM+dZZ41mpx7LX2gqd9McE AzC+ThrApFUeJQIl19GMzAHB//NFXKdmQO7yoDCWg== X-Received: by 2002:a05:600c:c108:b0:485:40db:d40c with SMTP id 5b1f17b1804b1-48a8eb61ddfmr26694415e9.3.1777630510661; Fri, 01 May 2026 03:15:10 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/28] Revert "sysbus: add irq_routing_notifier" Date: Fri, 1 May 2026 11:14:40 +0100 Message-ID: <20260501101505.3485916-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630579294158501 From: Bernhard Beschow The callback has been introduced in commit 715ca691daca ("sysbus: add irq_routing_notifier") for use in VFIO platform. Meanwhile, VFIO platform has been removed via commit 762c85543948 ("vfio: Remove 'vfio- platform'") which was its only user. Remove this unused code. This reverts commit 715ca691daca081108b33306faa6fa102f0df8d8. cc: C=C3=A9dric Le Goater Signed-off-by: Bernhard Beschow Reviewed-by: C=C3=A9dric Le Goater Message-id: 20260308203516.160103-6-shentey@gmail.com Signed-off-by: Peter Maydell --- hw/core/sysbus.c | 6 ------ include/hw/core/sysbus.h | 1 - 2 files changed, 7 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 3adf2f2faf..3e1160ee92 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -104,13 +104,7 @@ qemu_irq sysbus_get_connected_irq(const SysBusDevice *= dev, int n) =20 void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq) { - SysBusDeviceClass *sbd =3D SYS_BUS_DEVICE_GET_CLASS(dev); - qdev_connect_gpio_out_named(DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ, n, ir= q); - - if (sbd->connect_irq_notifier) { - sbd->connect_irq_notifier(dev, irq); - } } =20 /* Check whether an MMIO region exists */ diff --git a/include/hw/core/sysbus.h b/include/hw/core/sysbus.h index c0d18d9e00..f3c4259d29 100644 --- a/include/hw/core/sysbus.h +++ b/include/hw/core/sysbus.h @@ -50,7 +50,6 @@ struct SysBusDeviceClass { * omitted then. (This is not considered a fatal error.) */ char *(*explicit_ofw_unit_address)(const SysBusDevice *dev); - void (*connect_irq_notifier)(SysBusDevice *dev, qemu_irq irq); }; =20 struct SysBusDevice { --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630552; cv=none; d=zohomail.com; s=zohoarc; b=bV06naQ14/SBwBv5DoC4J2GKZzFahd03eDFpDmUO/zZgVj0s018FOmeTPkVtOPT3vTRP41aVfyma4Gxzy/PgAMMeYJqmyN4sU8fJJbQ0u9gSTjGNSKMYyeMXtMaB2bCUtLQ2Bnz9RF6/IptGYbxwgpfrsYxeY8NrA4toF3e3Qdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630552; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=CDst0IXYQnDF21W1Eul66jWjgyL41RzGLPKADSYQjbA=; b=MynMD5Quv16L+8xrJ9ay3VN7V2RJ4rjvIIsTSC6mfljATL23W3RjraIGOkfe9tua5QzDv+7xxmfhWWwEa5DBbZ+oqlJORhXgQ5ac+NmJ09yvj5NTsXANh619NS0savH4PAbUn0fVXFjXgV3HekwtS3aWooAQ/dqukrnarSW7144= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630552951951.8088225620501; Fri, 1 May 2026 03:15:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIku0-0003wS-Qq; Fri, 01 May 2026 06:15:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktu-0003uR-Uf for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:14 -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 1wIktt-0008HU-8w for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:14 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4891f625344so19352075e9.0 for ; Fri, 01 May 2026 03:15:12 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630511; x=1778235311; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CDst0IXYQnDF21W1Eul66jWjgyL41RzGLPKADSYQjbA=; b=KqjscGX6z7rirV7FFFNL3MDBqdW4LBG7ohr1ngSEt38A9rWUsRw9vEfHGppfI/Hc2E 845APHs36ZQphdReOV+VeTf4be41mpjADQ65T5TizUQkJ+F1k991mfTSKy1m0MTqyYvt clioL8YTa7OY/wyWOSBfsvQz1PQw1Lo5JYaH0TjNz0mOmxY4NgtRw+/21crjYAk4nKzD 7WKYIcBjfuc5m8d//ZFTpoJLyIhR2Geuah567Gpy20nItijN9XPDsQV+PlzhPVsKhSWZ Mk+20cWLpvRUCDULoynr5btm8oQIBh+VnxPj+g6Mdbi6mIFMEUrZVL1IOyQ8a7Oc5Wo4 Z2Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630511; x=1778235311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=CDst0IXYQnDF21W1Eul66jWjgyL41RzGLPKADSYQjbA=; b=DfK4NuMNEleSvF3fLa5pLaH8Wvei3C3pjyb8xnkSnHKBLqIFtxiNjF3lJSiYKZR6+G LIUvCcB0qKkI2cv9VA4e8WdJSDDG4QVcxJY59MVguk5m10DVbxcw9ONnEeiuw1wqAfvU 1XOGWLCxpyWqa5vVKxuVZTPK5srQ5IZAJUGxogjFt4bM+EhRmhsKwYCeWNT95HUetOUa SJgKsN0Abm5jSc8EtSgz9pDk3LQkhcpw6MhIddwVTSF0hOWaJdYLSNif8fbPMuJdHWUG 78lu1X4VPMuAYDbpi1Makez2IMaJJwv351sgiV31krTjlGpHzK9gr/s33xXZUZ0AVN8A ci/Q== X-Gm-Message-State: AOJu0YxwQteejgrmlKor9cg3x/vSXhhd/en9AFK4N8J5HmXaVfbylXPZ q1pSTTaoK9BF7P84PlFTF+pqnn/cdiM/WhIEnQHRFgh0jOaNyCUIsjEbwPSaEQREqCQ4pJZbK+J P+sVr X-Gm-Gg: AeBDiesKz4cGUWJckOQXrw3EUD7ZQYlcCMQ+F9xl00h5WgEAJ7kI8v1Fe/S8SWbhu5/ a0BGd1TDpPhiCgHqUHNySmr70X8kATiPixI4iw1/+9EPQ1xV6mV5oXQ/S5F0clbeaD238skM0SV d7nt45jZxeUES560Bw5GW0XZYYTYLP8mvuXzbvph5cUzMh9iRD7tv8YcTqek2N7lwpywk2sDrQA 2UqCroESpqoNuVMhForlG8d6r8SOb9L/HQIzLnS4e3dssDLXh/rJtvN9d05hexKSJBsajG0gT6z fOgbz+YUKLx2xNj5K7giTEEm/RiDzHljrDoR5T9j6V6ZSKUF+noYzSmpJAnecelfexJWvk38V8r GAqePkwUo6LBvRxniRIn0fmsnKmcTc7O5H5k4t/XFx44yEUNA5Ngm1NPvK15Iru0DBSk4bSxI5t PjwCukKk96sVqwgn48YY9Erlt7ucdwvTborSixMaUFub+e1XP581hMfkkv1krgcYDRxCnTB2/+R OCf2Um1G455df8XK3wFVi2PV3ifD0korQMAIHw5dQ== X-Received: by 2002:a05:600c:6291:b0:48a:79d8:a8d6 with SMTP id 5b1f17b1804b1-48a85e75173mr98983315e9.7.1777630511543; Fri, 01 May 2026 03:15:11 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/28] linux-user/arm: Restrict regpairs_aligned Date: Fri, 1 May 2026 11:14:41 +0100 Message-ID: <20260501101505.3485916-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630555362158500 From: Richard Henderson The function regpairs_aligned is for extracting a 64-bit quantity from a pair of 32-bit registers and does not apply to AArch64. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260409035015.132370-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- linux-user/user-internals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 24d35998f0..e65373b204 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -136,7 +136,7 @@ void print_termios2(void *arg); #endif =20 /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers= */ -#ifdef TARGET_ARM +#if defined(TARGET_ARM) && !defined(TARGET_AARCH64) static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { return cpu_env->eabi; --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630582; cv=none; d=zohomail.com; s=zohoarc; b=SEo1tAe4hd9iki4cj7IzViSxtnLcu13qrVh2ucPehl650NJchQ1gQ64x1BuJuH0L5NkxOJ/+paHiWa/wmiT+6sSvyiqtPEsA7UU3rnoJ+dHApqeSgU5hDOJCDwnf96MTD134g9KvkFMJT8Em40eO9NQcQFnXBh0bReJIGfZOrkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630582; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=J0oxSzs5Xj1EPDKnDrGEtP3tZDOMa7Ke42A06bFU/R4=; b=M2LOasEkzm8APBbMCVLruzeCZoN9+QHArmmmG2TbrThMugO2BDFzS+k6vgFF8qd+DNYKhBSh7LOoyV3fMZe8TwTXHO51x5ZMcBMt/LUhuDuiin+BG54Pd3k/2QyGet0OvuhZcUlzO4EjY/KlnMRELQkU7EB4IpG3PuRS/Z4XsjE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177763058251068.33737430553992; Fri, 1 May 2026 03:16:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIku6-0003ya-Mp; Fri, 01 May 2026 06:15:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktw-0003uq-49 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:16 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIktu-0008Hy-3W for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:15 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4891c0620bcso13607015e9.1 for ; Fri, 01 May 2026 03:15:13 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630512; x=1778235312; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=J0oxSzs5Xj1EPDKnDrGEtP3tZDOMa7Ke42A06bFU/R4=; b=aGaq9gckjXkiNBMeoGrbJZ4gqvf3Jb23J1dyk50zxabl+6nG52q3KPAj/lteGxL6Gs gpx39xQwvjCuKqN9soY1JFEqwyG7ObIGuDJZzPh+L83mH1h1j+SG/7LbOrhzjY2bAvB5 MZrTyt+hxjsktxroVFns2e0GsZgo8snTZ6fcCivy/U/Wb1wDqSRUIuKynL9zqRBsNCfT 69cex9sNWTTqlXRUQ06/uggiAoP6qLe1rNQsn9iRo5xsD/WXks4yWV0ZD6HWrvfAGrJH Y5gIlbmHV6rUUbJzBJkybbU+mZDHHOs2TjSZ2Hk3rtEXI+3UBbB+S8EMb0eiQmDmt63E N0BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630512; x=1778235312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=J0oxSzs5Xj1EPDKnDrGEtP3tZDOMa7Ke42A06bFU/R4=; b=BQ3eKtDsh+euLYRWXTixwC+EmTTI/fR5H76GUyAbA+7KnRsVHyLggcVEceM2BHf2SE v7ahaY+Lcv4Q/MTxtrokin4FN7x6o3YroLLvegFp7KboJDDSp/5uK0utfIo5dtL3vcOv dy/daWqor40tC6tMuoOiMs1OEcXwxyI6M5/ulB9MOiGKb+NgGVZv3iR918r2wyHXhwzq 8ZfYMdcfF1nYBidRgx5BCnZpY8AHji0C/B2gcUSJ6dPUULgY2dreAU1lCjsh5S5qQTsd JYsaqcNTAEVPMLzD3t5rKmsRrBaa3qicisAjagS2K2j2wdjfX0Jg3BqmhAcDEZQLwckN mo9w== X-Gm-Message-State: AOJu0Yy92Htdi29f3A8vVmfU1mdmgLz2y52ol982nGxVMUlqlAJNzGJ/ q4XeShD3/fsnBebTCqBUI6+rI1sIOAa0LnhZKWQ3cU52OZ+xc3s07myi1abgvUBeuhM0HAHuJ3q qidzk X-Gm-Gg: AeBDiesrB2NOwjOhmo734VeiAUDVFTmFNuiqUnBoUf6Ld2+9tpTJakMjMBd164iqj1r F5Sw0N4Hb04rVuT2mwbTwnwRZ7x1TPXNoUAMyI1F/MBmxlCC/1Q3hOtF0eSDozt+GoiFQZuIBtX eKgLz12/JsZLzwbdvqbRDURu93/vzbSU/i2A7V4Yvs8se6dsS+hPK0qbd4c3gwPX+mQWHcrBPuQ Ddi5vubdg6hXcI6NVQ7NOt1lZcYub52Hi3G7AFGSXB+BfhssYXc1ZVm9U5K2vF9T6NDPft8Ajb0 tTiOdvsMD3vgk7oHKfVc6407Voj60lNjbLkUK8y3eqaWo5AEE3Rxm7dcKWuOxDr6GBMa+Q03xWf GD3u3GAjfrYKOzMpSQ7gxbrYTpwdGpV28wgYWiJ44rxEHM9DPmzcdAIOHiMDaty57bNQ1efY7l6 SMHruRTbJ/wPjF4sP1VkbKahBEyOn8KsacUD1WRnFb2rPvRYwuyf6E9hSkk0Os+OkXemaHQZbKh o4wX435VL6gyTlJer6ABH9ln19LpYLNInSjZywT54xKI1ACKg1L X-Received: by 2002:a05:600c:e41a:b0:489:1ae1:4eb9 with SMTP id 5b1f17b1804b1-48a84532408mr79466475e9.28.1777630512468; Fri, 01 May 2026 03:15:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/28] qemu-options: Improve description for -smb option Date: Fri, 1 May 2026 11:14:42 +0100 Message-ID: <20260501101505.3485916-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630584849154100 From: Pali Roh=C3=A1r Add #PRE and #NOFNR flags to LMHOSTS example line. Include information about LMHOSTS path on Windows 3.x. Windows NT 3.1 requires #NOFNR flag for successful hostname resolving as described in MS article Q103765 because qemu/smbd does not respond to netbios name verification queries. #PRE is suggested in that article too and decrease delay on Windows 3.x for the first connection. Signed-off-by: Pali Roh=C3=A1r [PMM: Expand documentation to note what these flags do, and clarify Windows LMHOSTS paths for different Windows versions, based on discussion in patch review, fix existing grammar nit] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- qemu-options.hx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index e780bc2ac0..98e39a1ad4 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3415,7 +3415,7 @@ SRST =20 ``smb=3Ddir[,smbserver=3Daddr]`` When using the user mode network stack, activate a built-in SMB - server so that Windows OSes can access to the host files in + server so that Windows OSes can access the host files in ``dir`` transparently. The IP address of the SMB server can be set to addr. By default the 4th IP in the guest network is used, i.e. x.x.x.4. @@ -3424,11 +3424,20 @@ SRST =20 :: =20 - 10.0.2.4 smbserver + 10.0.2.4 smbserver #PRE #NOFNR =20 - must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows - 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows - NT/2000). + must be added in the ``LMHOSTS`` file. In this line, ``#PRE`` + requests pre-caching of the mapping, which speeds up the initial + connection on some Windows versions. ``#NOFNR`` is necessary for + Windows NT 3.1 to tell it not to send QEMU NBNS query packets that + QEMU does not handle, and is harmlessly ignored on other versions. + + The ``LMHOSTS`` file may be in different locations depending on + the Windows version: + + - ``C:\WINDOWS\LMHOSTS`` for Windows 3x/9x/Me + - ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` for Windows NT/2000 + - ``C:\WINDOWS\SYSTEM32\DRIVERS\ETC\LMHOSTS`` for Windows XP and = newer =20 Then ``dir`` can be accessed in ``\\smbserver\qemu``. =20 --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630631; cv=none; d=zohomail.com; s=zohoarc; b=ZKIh7t7PUk1PvXrqfzHrzcAaDjE3Jklnn40a0RpuPHRUz9gdr4RjW8zxO7QIo0oAL/OAAKqeRd3hZcLkPVU+AiGisSRkGLuRDlBpUPxUObyV3DsRWYtPdbPW4szhRbxabPoHEyLNua1BuhaPCkKtOzAZ3zvMi7ymHItYe/fND08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630631; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Xl4HhnyBXMIn8KYzROgjNlZ37AqhnUlhFOr63vQnvhM=; b=le4fUb/E22UjGaKvbrZa0n74vde3SckQPRPwlvJjUGMjsy/jZk83L6l3Xwt1pQns6DJuYD/LhddWJDdZDkKv2rsm6r8tjxaeT+Lkufx6qpM9cAdXbbVUDJnkJXu0ed0KqRi0eWcQiHDjMST+9QcM753tX++LtcojDwJoaZrDnN0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630631628353.6381678553661; Fri, 1 May 2026 03:17:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuA-00040C-Ln; Fri, 01 May 2026 06:15:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktw-0003w4-Kt for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:16 -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 1wIktu-0008IZ-V1 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:16 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488af9fdaa7so10168065e9.1 for ; Fri, 01 May 2026 03:15:14 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630513; x=1778235313; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Xl4HhnyBXMIn8KYzROgjNlZ37AqhnUlhFOr63vQnvhM=; b=ex2WuxsvGWEbFkEDizvuTZgCD6wi6L/RzWE/PAeNwMIPTBO6vOxMigy0xASy6R8uh2 +CrfGGO4lddKZTZI4hpitTa+YclG0wfSW43BdKmlKIfqdi9IOM/LS7k6huGwt1f4qayE mp/Gh9v8TizcLc2ixlzaQ4wK7B9wwLbBYhmAZr94u75V5s6RJ6s1xalYZ3c4oAjyNYWg PEqTriZNxg4QBPHCdkonxUFtOF00+P1xxS7Y+1sTNrcrqNh5zM8FAJZeiphO6+BaCkpA QzV+d0LShcZVeLMJamAc8rpjpNEn7eaWZ0XoQniF7oPKQXTJSKm/ydQsI2P327XBJYKv E72Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630513; x=1778235313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Xl4HhnyBXMIn8KYzROgjNlZ37AqhnUlhFOr63vQnvhM=; b=SO+iUbYBZkV3JNxMJL12spsMm4e7uScQdZHNEnptu3FdhgmA3lZixbUA34y4tvlcu6 tc3T727rqIh4c4W+zBm9RcmTXAIW768RFN3rDwNVfFTNhXApFf09gbYy4fFS4Y16OdQf XSDjzTviNzWGJs2rYGjNU7URKOps/ielTGciYnYJLyvPcNLX7hywTh2/rVAeHEWWT5nJ dzrmQx47AbZIGSqqvlN5wRNx7UG2GNpmgKgRD3+7zyoNxjwM8/C4Ar3YiP3nfto9eYr1 xnzdesFdHqNwfH262ynj9s4YFWBYLONUALiHWgws9Ex8LUO7HTAm92hknntueBrF3Sk2 Py2A== X-Gm-Message-State: AOJu0YxE/86h7aYyKJu89pLP91c+GscwnPLBBknqe6fmMWyf3XSJgqL7 oSkbk4I0F1ljN6+e4Gi/uK4nI85ORUFsQIcF+PcTbAdKUEjuMSA3xqx7642t5RPxKRbxTlMskAc TDoCy X-Gm-Gg: AeBDievS0rRl55SyzOygV9n8FAZFy/MRDqjSXcV1BbO4v+q0NBqmIjrmIDFV0ldZ7WD wvbHtx/oR1Ynj0GVU1zPBB+SaVtX9jW5vIdpRmuLoTbGU2gNhK120b3OM4HuydJ5arSH6ViVRKM z7ZDvoaPTI0Uw31+eU8FeZdOe5DeM61SXREl6yz172wY8YpeNtvUELbaR9h024RH67/vJSQ/k9I d6oy9t0hBFp+S0HS2hPLBMTfLqz5B2b9w1uUcpHOCmju6KBwZS54tnyUSfX+gW5hv09V6LZzvcc UUQlw4MpALjorvzwiRCHohObghOQEcrAFldBDCrPMgLUtSg7OLhsiEhUTxXNt6atIZty/ESmo/H ewEcpR9Qc/qqV9jBW+G+fa+2xmyUF6QIUeR9yLAcgH+49UmAzi7xMemqdJQMcL4qsEQBVNG+f4W SYiV2vNGzZmdjuD8QKVM9JT2TFoyTVn1e9hy4rQI6ck9q/phqpV3ZevBDwVt76n4CvN0GIEM/G/ NovRH0yMSM8ni+Pg4L4fMA14Ra7XRiSxSLkT+N0LQ== X-Received: by 2002:a05:600c:1f8e:b0:488:a824:fe04 with SMTP id 5b1f17b1804b1-48a8447f466mr101081045e9.26.1777630513445; Fri, 01 May 2026 03:15:13 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/28] target/arm/cpu-features.c: New fields in AA64MMFR4 Date: Fri, 1 May 2026 11:14:43 +0100 Message-ID: <20260501101505.3485916-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630633512154100 Content-Type: text/plain; charset="utf-8" From: Jim MacArthur Added RMEGDI for FEAT_RME_GDI and other new fields. Reviewed-by: Richard Henderson Signed-off-by: Jim MacArthur Message-id: 20260421-jmac-feat_rme_gdi-v3-1-ecd20c77eae1@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu-features.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h index 6e5212ff6c..88fe3ed287 100644 --- a/target/arm/cpu-features.h +++ b/target/arm/cpu-features.h @@ -346,8 +346,16 @@ FIELD(ID_AA64MMFR3, SDERR, 52, 4) FIELD(ID_AA64MMFR3, ADERR, 56, 4) FIELD(ID_AA64MMFR3, SPEC_FPACC, 60, 4) =20 +FIELD(ID_AA64MMFR4, POPS, 0, 4) +FIELD(ID_AA64MMFR4, EIESB, 4, 4) FIELD(ID_AA64MMFR4, ASID2, 8, 4) +FIELD(ID_AA64MMFR4, HACDBS, 12, 4) +FIELD(ID_AA64MMFR4, FGWTE3, 16, 4) +FIELD(ID_AA64MMFR4, NV_FRAC, 20, 4) FIELD(ID_AA64MMFR4, E2H0, 24, 4) +FIELD(ID_AA64MMFR4, RMEGDI, 28, 4) +FIELD(ID_AA64MMFR4, E3DSE, 36, 4) +FIELD(ID_AA64MMFR4, SRMASK, 44, 4) =20 FIELD(ID_AA64DFR0, DEBUGVER, 0, 4) FIELD(ID_AA64DFR0, TRACEVER, 4, 4) --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630553; cv=none; d=zohomail.com; s=zohoarc; b=Dp23YYW8r69xehqNVPgPOiqI4d4Mi4OuuqS99k4ZP/0or9Eh0b+uoykNMi12Ui2ideIFLjqU7xoeKWsCnaCBrLzv5TYcn1d+vsJ/2sEcAm2u/3QqatDCwQmtSeqftXxBd79nF/+SGB1LHbd9xL6mY7ujnBgOQ8pb34rSK1jFgWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630553; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=1SqFziae8xxmF2dq3qr29rHFjOIsHc7vyCdhmtS47b0=; b=GZrT+M8KwuQyyX6Ltj80Lj/FpZNaguxGV2m9sLzM94Xhd/IX7aBQ4AbsoR6HdWyHjthoJhuTm0iiiHlmjMD22hFMhyaK1sUetNLVFTzYEyBz4X2c7mchMAi8YJZpOkioi4+cQ4H5IO7f4Orz25LUrMWHF2S0iSiIOX9Tv45nv4s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630553493934.6338246999304; Fri, 1 May 2026 03:15:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuG-00041G-MC; Fri, 01 May 2026 06:15:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIktz-0003wP-Du for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:20 -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 1wIktw-0008Kc-VI for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:18 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4891cd41959so15950445e9.3 for ; Fri, 01 May 2026 03:15:16 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630515; x=1778235315; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1SqFziae8xxmF2dq3qr29rHFjOIsHc7vyCdhmtS47b0=; b=mqbWFg0fzkAJ2v07KxM1MdPhmvkeAI+zoPxUMCYR7Ev9quDKzMa1o9JL/rLwPSW3bT QTtBjN1wsrNiWwj5DoDYuacR2pLNuX7YgaFsEjLRiLBNYNl/D/lnwQx4qPIU+DKY5YvB h/XB4WqK8HLyM9iHc7z9ApbvAl+xzu50WcYhqpVLJBAS+lkdhLBnaBlH0kpSk+TjVwY8 G8wgS7BsXGsoroi5uIK66JfN4+eqzVyrQE2ibnYS0IkzT4IxkTbjNs7opg2WMwz+b7Yk ExLUu7ahKPsdE9atBU/Pv6HlZm8pvE47ke/+k8NMyQrtCiVcmtpHQsAQVpqnLraF/sRe Nvvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630515; x=1778235315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1SqFziae8xxmF2dq3qr29rHFjOIsHc7vyCdhmtS47b0=; b=JMBSSsMRD+1NzwCHhqaT2iYe1xBCmuV7fyI/iaDsJpn/RWYAPMaOq3x5DInr0VRr0e qqe2764Z7pzSFQ0z9MCd9x80QaD45lDE4LJ4hQFodTMYnbOnngA9W11+HhFw1vXuFZEp qzHh5oRNmDOcohtFI39mwPXcDQIwuwxrMfUZI2ArxTSTkdw9Ubkv2teiB/ANdCallqK1 aJ0lRNAnBDvHln5LUVcI+CvTrv+K8XD8FiM0DCNgvlIGWpJBzEO4+6hnROcqYgTDo0SB Ck62K/90QMNo64xX/UfVA/6VJgui1DnfC7+PKfwMeYCieO8cgqsfZy4zRgM0pherDSO+ /5Pg== X-Gm-Message-State: AOJu0YxS9kDTYx26HDAdeILjbSDmSU5+s51j6v1dvZdKuoSDkVgA01NT iiarRADITus8jOa0WbXewur2w14BZ/rnH+z7H52DWYbR/73qg9HeHyQz+sSJnydoVHTQs0pHQ0P wjFIL X-Gm-Gg: AeBDieuV8E/fudq0QXccJRaiwIZ92OHuVAB8vX9jWFwHXxhiYeiFfMXk2hstSJa7p7f i6VN9wLfpRj3lXCgFlpXXOEDOLs1WHJpMEP18G0pgDyKIPHtJ30bZTDF8oKXGeqUiDizYZcJeOQ ozGnKUrCAZ2+ase89ebir+BWky5W6ghCUKVtknUmg1ozFXU0QKDQOeQddvFqpN9vxU/95inqX8S fTqeJ9Qyjcr4K7bJYbxOMtWF1RxMuU4/4UcdwrJ8D6hDGi3jmQ44dNeD2EfWmiKsCpNqea08j6j 2+NgqugDAHD7gDhBW6RIkCEpdnCAAXY/hcqhyfUUYv8Bi5jClYKWf0oM8vfobBkPNE6zn0EHVV0 ZnDy+D8emIwmAuf3L6wXXYd2Cyv49xCKrvD3ynf35ZvJsTRDWyoxM7P6hs9ikYI28wqk3dgmLrz jxNIjenS/cGWC8k7P2Tgbtdk0O19macW26/9MpV3SiGWFEgXu/0QsgXK0uBnmN5esDsILJMQSD2 3HHMRfBX0DCVjHGkbB07Mf4u4vUDmG5nb/83kWQCw== X-Received: by 2002:a05:600c:a416:b0:48a:568f:ae6b with SMTP id 5b1f17b1804b1-48a83d6ec59mr92232585e9.7.1777630515499; Fri, 01 May 2026 03:15:15 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/28] target/arm/cpu.h: New GPCCR fields Date: Fri, 1 May 2026 11:14:44 +0100 Message-ID: <20260501101505.3485916-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630556420154100 Content-Type: text/plain; charset="utf-8" From: Jim MacArthur Add SA, NSP, NA6, NA7 for GDI and GPCBW for good measure. Reviewed-by: Richard Henderson Signed-off-by: Jim MacArthur Message-id: 20260421-jmac-feat_rme_gdi-v3-2-ecd20c77eae1@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index be14a47c35..5e4f12f1e7 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2091,6 +2091,11 @@ FIELD(GPCCR, TBGPCD, 18, 1) FIELD(GPCCR, NSO, 19, 1) FIELD(GPCCR, L0GPTSZ, 20, 4) FIELD(GPCCR, APPSAA, 24, 1) +FIELD(GPCCR, SA, 25, 1) +FIELD(GPCCR, NSP, 26, 1) +FIELD(GPCCR, NA6, 27, 1) +FIELD(GPCCR, NA7, 28, 1) +FIELD(GPCCR, GPCBW, 29, 1) =20 FIELD(MFAR, FPA, 12, 40) FIELD(MFAR, NSE, 62, 1) --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630632; cv=none; d=zohomail.com; s=zohoarc; b=Rh8AIA468CNwvt/LdQIA19eST6xnzd3AaXLLUn8EoceVz2vXEx2xi2CrcyKmkxfY+zh1TPQ0NzH970l1osWqqbNst4pnDNrBmbMQ+6BEwL1dEkhZQlpLTLqxtE0/lgepQ3kWqfOYpktCK9F25GKT59ZaqHJ21mq+DwOtHRA34sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630632; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=dwdpNuQzmGhSaNwgQnbl3GNGGmyJ/o/emE+Fj3bUbk0=; b=gRyy30J+o91YrsQeZ5DTUkGp4kyNGZ6ZHnRsxoxpxPzsEEOFWws2GGrkrSQZH9VWgiizOvpDmXzBa+Ce3Gg9OxoLrfc0uxIyQ+bAjITe/On7SXMNpl7lHeBqxb4MTcQE05T23j579XqAfWvoVSAFJ3WFpIQiH/qwQTB61HKgKJw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630632334430.11059805947457; Fri, 1 May 2026 03:17:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuI-00042Z-9Z; Fri, 01 May 2026 06:15:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIku1-0003x8-13 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:21 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIktz-0008L6-4T for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:20 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so29038645e9.2 for ; Fri, 01 May 2026 03:15:17 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630517; x=1778235317; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dwdpNuQzmGhSaNwgQnbl3GNGGmyJ/o/emE+Fj3bUbk0=; b=c1oLbFQC9wb0vkDx+pLZdklwhS9yFRGJMvewPfH116RwSlnASE0p8CP+D3dyYZI45K aTyzyTMYpfe+Ikx8/sTVwJ7LKmDk56GXUNCyaktVKfvKz06xzM2DRKMkSWlnA2a5//M2 /f3dUtXbYdiX6WGWIv5ijLXf8dKqrAhBnO9JGOVBNIB1WCzj6rfXnFwyYdMF1KfI8Udo jnGJjERppwXPXurvtaaR/4y4mL1sBaaCeOEni6jjdoiBFCDkODD3PjarRzT5+vVu9mKL stVt681ok631iIF2ZPRf9SRBBMCfiJ87uRNzq0XjYQpBSVS73z3lskqHu39OHOeDy2lz rq9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630517; x=1778235317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dwdpNuQzmGhSaNwgQnbl3GNGGmyJ/o/emE+Fj3bUbk0=; b=G9lX5zEgkl+HvS0cCecIdx6ztE19g8W3J6odYYcs/mlvfOskhK03pvhPI9M4I4ULOd riYADBO0NVYK4ktK77gWNaRZ02VOLAbzlbFjBbtgNh+SuUDwro2AHDK5Nrj+vbtO/FSA nemh1s7WEd6vGGnUCgqAglQkqyi5UugLfjZxo9WXW2pHOYjlplOQBIF3LTRNBc4gxMd3 XzyavM5EuxMtueTfhFf/gAzFhHBANOTLxyPQmz4ErZZ5k8WUVPdRc9BT+EMOte5gU/8K P2lI9+5VTdrrPDcCQpF8tZSNDrTR7uHXAnO9l+pZRPCLEiFwqWM0R4YLTCOZmgBrqap1 HNfw== X-Gm-Message-State: AOJu0YwzHjKAolFjRq5nAAZy3G6o9YjcBO3Rs/jWvojiEKS10oZeAS0f cKkJf3EIFM96NfWwK87bdtdqLBJcuHJIghNAEOylxx2KWK4b0qvFd0N2b+if2V/2TKRxwiFpokI FjI6f X-Gm-Gg: AeBDieuPMZIwBHTbl1YHlqfrF+cVwq8ohvjJP5Z7ukHeFCMULbT2aPAxPPuoZ97bxES c/5fyYWziGIUGlBO80tsezBggV+fZUAntd+HV+pnbQ2zAnTz8IDqLLIVlcQWupnCCxKOq1LyxKQ u0qSH9L/N1XsLSVCIRl3bhFXTCzELHEwiBXghy7w8/UvRK+yUcKZniQOOLqGbONyss3WSaOrJp9 twnLVa9UPC+cVPvXBM9u5p7OAtvscrphyBmRrbPz/LcSTxBUxhRI3KDPtDyhG5AWQVvhd0BOWfU UjfDTzKjkkXBTPGqkdVVQxGBOEe5p8qZfmJ2zysyygKLBhxYKMuiZ5EuDXE9wNF4WwnltLi3aVw vEO5WKlZ4pbzqgpMYnH2d2jXY1fsinGhwPhUOUqsO5T6S3AxGMKKbdHc9UEWx9BSVSbUOZKVepZ 54YbA3Rz7gK5/BmIxvEPooVpyvqUzK3YymLD9S7uo0pp1s0JRk0fMss/WSssw+1+98XoFHtI3+1 UztI7u0znUr2zsVMLZQggLo6cBU+QnOcqHur3w4QQ== X-Received: by 2002:a05:600c:3e10:b0:488:a2ac:a34c with SMTP id 5b1f17b1804b1-48a844533d6mr108261655e9.12.1777630516902; Fri, 01 May 2026 03:15:16 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/28] target/arm/ptw.c: Add GDI spaces to the granule protection case Date: Fri, 1 May 2026 11:14:45 +0100 Message-ID: <20260501101505.3485916-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630633515154100 Content-Type: text/plain; charset="utf-8" From: Jim MacArthur System Agent, Non-secure Protected and two other GPI field encodings. These are explicitly denied access for any processing element when the relevant GPCCR bit is set, and reserved values when the relevant GPCCR bit is zero. Reviewed-by: Richard Henderson Signed-off-by: Jim MacArthur Message-id: 20260421-jmac-feat_rme_gdi-v3-3-ecd20c77eae1@linaro.org Signed-off-by: Peter Maydell --- target/arm/ptw.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 7b993bb5b3..316e201cfe 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -510,6 +510,26 @@ bool arm_granule_protection_check(ARMGranuleProtection= Config config, break; case 0b1111: /* all access */ return true; + case 0b0100: /* system agent only */ + if (FIELD_EX64(gpccr, GPCCR, SA) =3D=3D 0) { + goto fault_walk; + } + break; + case 0b0101: /* non-secure protected */ + if (FIELD_EX64(gpccr, GPCCR, NSP) =3D=3D 0) { + goto fault_walk; + } + break; + case 0b0110: /* reserved if NA6=3D=3D0, otherwise no access */ + if (FIELD_EX64(gpccr, GPCCR, NA6) =3D=3D 0) { + goto fault_walk; + } + break; + case 0b0111: /* reserved if NA7=3D=3D0, otherwise no access */ + if (FIELD_EX64(gpccr, GPCCR, NA7) =3D=3D 0) { + goto fault_walk; + } + break; case 0b1000: /* secure */ if (!config.support_sel2) { goto fault_walk; --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630681; cv=none; d=zohomail.com; s=zohoarc; b=X2fjzudNaHEWPJQ04M+HjH+fZtEUCi+jf5Psi0XjKM4uLLfSeA60peK3R+ClsYZP4m/zFM+dI9BoDgyySQK0UzUMZTaOjaRgnbJ1xlsmd3/puEYADWz4IaevRuKwJCl5BtSnJAP4ER9Yd2sOWlTX1Zp7kX9AE4Vgk7ja6OM8vV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630681; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=6fBvCYcxXcljcsjaxVxVKcZBMcAOoEdboxdW8oit2uM=; b=GDC4xvcwB4obh2+ct7uybzdwt38+GoLuS4+B4pLfPPHL5IcUOXhb2mKg7PETWNdsP+6HAQvnNYvJdUBNuAyB0hh4+UN7otesPFW9UY9nHkaSOcBm6Zz5ije7JMLdASacLB8RQTEdX86PBAFaTazEAyKxHq3P2iOHEZNa6Gxban0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630681715715.0469319482902; Fri, 1 May 2026 03:18:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIku8-0003zZ-Gy; Fri, 01 May 2026 06:15:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIku2-0003xb-DR for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:22 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIku0-0008N4-Op for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:22 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-488ba840146so14645175e9.1 for ; Fri, 01 May 2026 03:15:19 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630519; x=1778235319; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6fBvCYcxXcljcsjaxVxVKcZBMcAOoEdboxdW8oit2uM=; b=MUDrtg1+95ljBY6ywq3Fdq3nH9NvkmHxDVjktEVbJkrB6qF/U9KubaeiXic6T/PO3p ku4i0Zn8MqbNsIDRh4YS4FR2dkZm7U2CKKmyFaCw/XApO//Zc8ypLook4kxHwFIKOKg6 36yTchtNCseUzJ5p8MpwdcwJ4QV+UcfBrhmkxQkGJtty+yOmWw1SbMsPT9hPZYfJyE3t LlgHPmGdW79iEi/NB1hFDJ+Whpunj8EfyuxKhQo08ei0mJru3IRradqdqc3ARF6zvF/b 6indGVhEVJELeyKQNUGK2nTADNEezTTmBfhPXajAyfwxDVEEwpEq4/JXc1Kq+eYzYY3E 0JTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630519; x=1778235319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=6fBvCYcxXcljcsjaxVxVKcZBMcAOoEdboxdW8oit2uM=; b=BQZPkccv6FGQLakrUBAjWgy3R2M176nW1R/0epKdaQo8mb2EVVqnDf6BHpijykR1i+ CJ9AccLoONVWkkT+gR4N4Z8INWN47RHhieO3iNVPQId2MpBgCDWNlhSGniMEDHM81Kh3 kQMI/CPc6ltHhgB/yekoo5PtF3ZNj8uDOce2qi7MWr6wgFlvlhA7rkTuKDZ68Gqpax8g pSwKperXVAXxf7mw35izQ1OpSSRrTYt3oevDqEFbEh0XxRR1fP5WncEplL1Gyiv14o3M QwgZAQNDmNkXSk28rwUEI0IwO+t2+bc2DL/ttqT5Q2+tBvmbkveZeoITRfa/odRFQ61F NNHQ== X-Gm-Message-State: AOJu0YxydkkzDNTLjLKJThPJfTRpuKzjY8y6iK/uRBQ21Sqz8ZajV+Ig U9nCQypeT69mB45rzgobOSWWisK4yUDkgwCeRBcNZ0cShzKxkduAq1TouJhxC7oCWJMSumedy2h F5O9H X-Gm-Gg: AeBDies6nM/q86J6lsL1qabhdg+qMJ24Tew4LJOaP9lmZ40SZcLARdSbiJWxk+XA9ey ewOaNenpqluNKUy1F9lx3grIQtQ5m3cOrFkX5py2JxBUiE1YsrFPUxeLd9sDpJQKYAgzpRhRip3 ZVvD2FOeZY9aG6DNQBYEKNxJsRqepEhsgAdW5epirQnlDmbNCU52Aj2acPCMnwWMFe4QboUVg7G gsiutoEkyNE34ZFni8pBzdGrHywUzYGpbysQoxVwsoavKEewCDvIL5u2ITPl9P+AAsrzP3ujA/A 7Hw5D5FNfGYH9pCayCo+wcGyQjg9zORTjhiQ2TB6v6sm5qpi6O6NWFtoXeBtQEAzE0j5hlw3rh7 4ANKfk5QlA4qw5vjDSOJpHlY0aWgT82X+wMGhVGZEmtkh5PmZuHw143zufWewBRwuaQ6zT4teS3 LWqmcgk2FrONo0T2kthxPoyk6Vvs96l+hrNLubyEGri3IEaggEuAp56uClPx9ovpuP0ju9oxEa0 p+xtGDx7J0kt2bD9Q/TTUA2f0JtjMk2Vzp2uKdfDw== X-Received: by 2002:a05:600c:4e05:b0:489:201c:dc46 with SMTP id 5b1f17b1804b1-48a83e72f12mr106264835e9.12.1777630518664; Fri, 01 May 2026 03:15:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/28] tests/tcg/aarch64/system/rme_gdi.c: Very basic test of GDI Date: Fri, 1 May 2026 11:14:46 +0100 Message-ID: <20260501101505.3485916-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630683644158500 Content-Type: text/plain; charset="utf-8" From: Jim MacArthur Simply tests GDI's prerequisites; that if GDI is enabled then so are FEAT_RME and FEAT_RME_GPC2. Signed-off-by: Jim MacArthur Reviewed-by: Richard Henderson Message-id: 20260421-jmac-feat_rme_gdi-v3-4-ecd20c77eae1@linaro.org Signed-off-by: Peter Maydell --- tests/tcg/aarch64/system/rme_gdi.c | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/tcg/aarch64/system/rme_gdi.c diff --git a/tests/tcg/aarch64/system/rme_gdi.c b/tests/tcg/aarch64/system/= rme_gdi.c new file mode 100644 index 0000000000..e869943a13 --- /dev/null +++ b/tests/tcg/aarch64/system/rme_gdi.c @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * + * FEAT_RME_GDI Feature presence and enabled bits test + * + * Copyright (c) 2026 Linaro Ltd + * + */ + +#include +#include + +#define ID_AA64PFR0_EL1 "S3_0_C0_C4_0" +#define ID_AA64MMFR4_EL1 "S3_0_C0_C7_4" + +int main() +{ + uint64_t mmfr4; + uint64_t pfr0; + int rme_status; + int rmegdi_status; + + asm("mrs %[pfr0], " ID_AA64PFR0_EL1 "\n\t" + : [pfr0] "=3Dr" (pfr0)); + + /* rme_status is 1 for RME, 2 for RME + GPC2, 3 for RME+GPC3 */ + rme_status =3D (pfr0 >> 52) & 0xF; + + asm("mrs %[mmfr4], " ID_AA64MMFR4_EL1 "\n\t" + : [mmfr4] "=3Dr" (mmfr4)); + + rmegdi_status =3D ((mmfr4 >> 28) & 0xF); + + if (rmegdi_status < 1) { + ml_printf("SKIP: GDI not implemented\n"); + return 0; + } + + /* Check FEAT_RME and FEAT_RME_GPC2 also present */ + if (rme_status < 2) { + ml_printf("FAIL: GDI is %d, but RME is %d; RME should be >=3D 2\n", + rmegdi_status, rme_status); + return 1; + } + return 0; +} --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630648; cv=none; d=zohomail.com; s=zohoarc; b=ihvQtXkWi1ufV6hJ2otdjpsWVNdJZH55NiDGeHqqg5KNbNrbFNiD2MZnfYsqrhJMyUzs5q+SY66ARbRYMJ3YloGNEeR3T6Z62AdfmRfyyAeJzFMXA8akDf1TLM/ZnZTHhSitF1WqyICdsrJKBhgfi81JOOF8O9JtLVoKm7L72fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630648; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=eMf0Nfv81bsOU7sGD8NbZmFV5EZggvO8uux0sh3Ikqk=; b=GwoyoxJF8BesEIWM/8IGTiRSgPuZqnEyVB1TwYwJqOHRAVxs2PC7McITGRN1IiWGp3L3BM/ZJmTOUqeSQiPzU6zu5pK7s81zGz/SyeEWaf7+J9G/JYolXD3t6UQQYy4xuGkgbUwJ0bsEXLDXuBV129JPWQmiMlMCt94bhh38Q10= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630648205218.54053875227623; Fri, 1 May 2026 03:17:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuO-00045r-0d; Fri, 01 May 2026 06:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIku5-0003yl-Lm for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:26 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIku3-0008Rx-Rw for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:25 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4852a9c6309so14802785e9.0 for ; Fri, 01 May 2026 03:15:23 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630522; x=1778235322; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eMf0Nfv81bsOU7sGD8NbZmFV5EZggvO8uux0sh3Ikqk=; b=jVwRWowCq5OYpMDnD/P2WQzAJA85nSu6v9wuk6XhDkISa7tcQZbQayR1Befa7XzR8y 3XsGMdJN4kjQB1pOrjTyeyKPxLKOle0IuwhGJaxo8uGfCRGVqsfn++EvkU9VeYCPBheA pc3VVi72d1qDiTHSW8x3bUF8BjofMPk7d1RJgGjAmvcWBdxrs1zFst0C3qPkNVvtORMd ZWqRr3FIqYajuraq8YHJ/hZM0b0FGXEnwIxELUsNKcPleEsiOoU/uSyW69eTXF1OyNNA 3Ck2BFL2ou4EhpVj0cb34cnc7AvZj/i+AR2U7yKaoPQYzyCqrBk4fiMZJ8Nt9wDpBwj9 6ddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630522; x=1778235322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=eMf0Nfv81bsOU7sGD8NbZmFV5EZggvO8uux0sh3Ikqk=; b=DHgz2KXui//GKjBWYW1mY2850I1Fa1eorPDgq/1a28sNWOgdMjnbHCVS+rZVuSKEMt Vhy60a391TpP8QR5NX503RRiEPl/zw92/pmarBfeez0gx0gaiNbAbg/wuLaCPcFqZwdf ULzobVyO1Bduy6hRb1bqPK24wS+PWgepvr0x5etOJWfSBneNIovePwd6nrDg1Du+o60X 6Ry5gLKLy+NPaBDKelIv+hyM2m6bB0ZQ1Wly6a2jg4SoX+qbohxi+w12ccMWLMoWNURu ANRUklNaspoFYuY4tNvCq8s/kkXli3T5PGGVpzvZBZxyG//DO09DuTNxvg+q3Jfkyum+ 13IA== X-Gm-Message-State: AOJu0Yx8wTTLBrG59HmVYaiV8AUh2k2nYFCDc4njZOSOeGcKBd20V9Zj qN8yfS+Kmfe5WFgV6K01YqtKoE6jVWQZH0OCwDN6293yoqiC8kAZbaXnVYzH/JVkRJSgYUMKflM ata8Z X-Gm-Gg: AeBDietWXk54JiIkm4cEuIiSxrmTLCtlBPstir0kyAU/Ok257F04jE64Qi0FVCSEf67 EF7K+7tc5dSM7SvoA9rPGFmwXNtmeSfVR35j+XI2SU8YHG54u6jXLNkPL26QyoR1N7K94CIEEVF VnjoFKpTy+8T01DZqIxGKtgVQCfYMkkpnIp88px8+E7bW+3E4ud0/+5AMLjYUYh9F5qPRKvNnZC SDkBLsPtZc5pHTlrDGwmtIF0jWhZpdAur55Tz4sWYaIEnHIlt+BIosERblqmLHAxys9xL1AyoOg EK2SFfr549bI3v1Ody5qPCxB9287xKqo7LiIhJj0cV9EueekfBngsZ/AI7Jok035H8PtrnqgFwI sYVJY8BLMbDhBt0Y9GM20hsgXRFTF+9HSjbk8F0N83rQtKL7fddSjcC6yZLlletXKYcN2+ljPjb P0rdCOh3kP1kr6XcYeaDbv6NrP8dzZsgpNS0YyHRk37e+7/iplxstix58t9iinEfeG29Hkw+X1J iHpyH3spfi6ArymCRcx3EYccx3g6K2189GlmpAeEbcsiB0FU6P3 X-Received: by 2002:a05:600c:3d97:b0:48a:53ea:1408 with SMTP id 5b1f17b1804b1-48a83d78a6cmr93951595e9.8.1777630521964; Fri, 01 May 2026 03:15:21 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/28] docs/devel/decodetree: Fix formatting in "field examples" table Date: Fri, 1 May 2026 11:14:47 +0100 Message-ID: <20260501101505.3485916-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630649520158500 The rST syntax for a table uses ASCII art to draw the cell boundaries; then inside each cell the text is treated as a body element, so it is rendered the same way as text at the top level of a document. The "field examples" table was assuming a "literal document" format for its cell bodies; this meant that the single line cells were being rendered in plain text, not a fixed width font, and the multi line cells were rendered as definition-lists because of their "second and subsequent lines are indented" layout. Fix this by consistently using inline-code markup for the left column and literal blocks for the right column. (We want to be consistent within each column because a literal block renders differently to inline-code, with a green background.) Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Peter Maydell --- docs/devel/decodetree.rst | 44 ++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/docs/devel/decodetree.rst b/docs/devel/decodetree.rst index 98ad33a487..33cd6fe583 100644 --- a/docs/devel/decodetree.rst +++ b/docs/devel/decodetree.rst @@ -64,23 +64,33 @@ A field with no ``fields`` and no ``!function`` is in e= rror. =20 Field examples: =20 -+---------------------------+---------------------------------------------+ -| Input | Generated code | -+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ -| %disp 0:s16 | sextract(i, 0, 16) | -+---------------------------+---------------------------------------------+ -| %imm9 16:6 10:3 | extract(i, 16, 6) << 3 | extract(i, 10, 3) | -+---------------------------+---------------------------------------------+ -| %disp12 0:s1 1:1 2:10 | sextract(i, 0, 1) << 11 | | -| | extract(i, 1, 1) << 10 | | -| | extract(i, 2, 10) | -+---------------------------+---------------------------------------------+ -| %shimm8 5:s8 13:1 | expand_shimm8(sextract(i, 5, 8) << 1 | | -| !function=3Dexpand_shimm8 | extract(i, 13, 1)) = | -+---------------------------+---------------------------------------------+ -| %sz_imm 10:2 sz:3 | expand_sz_imm(extract(i, 10, 2) << 3 | | -| !function=3Dexpand_sz_imm | extract(a->sz, 0, 3)) = | -+---------------------------+---------------------------------------------+ ++-----------------------------+-------------------------------------------= ---+ +| Input | Generated code = | ++=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D+ +| ``%disp 0:s16`` | :: = | +| | = | +| | sextract(i, 0, 16) = | ++-----------------------------+-------------------------------------------= ---+ +| ``%imm9 16:6 10:3`` | :: = | +| | = | +| | extract(i, 16, 6) << 3 | extract(i, 10, = 3) | ++-----------------------------+-------------------------------------------= ---+ +| ``%disp12 0:s1 1:1 2:10`` | :: = | +| | = | +| | sextract(i, 0, 1) << 11 | = | +| | extract(i, 1, 1) << 10 | = | +| | extract(i, 2, 10) = | ++-----------------------------+-------------------------------------------= ---+ +| ``%shimm8 5:s8 13:1 | :: = | +| !function=3Dexpand_shimm8`` | = | +| | expand_shimm8(sextract(i, 5, 8) << 1 | = | +| | extract(i, 13, 1)) = | ++-----------------------------+-------------------------------------------= ---+ +| ``%sz_imm 10:2 sz:3 | :: = | +| !function=3Dexpand_sz_imm`` | = | +| | expand_sz_imm(extract(i, 10, 2) << 3 | = | +| | extract(a->sz, 0, 3)) = | ++-----------------------------+-------------------------------------------= ---+ =20 Argument Sets =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630588; cv=none; d=zohomail.com; s=zohoarc; b=OQLeN/ZsN3JDN609vQzVQrAlqXTRoEl9YLNdCDrcAgQ64ASig2wSxKxNWnga9beihjt0K5F3ygu/TryCCGFd/s/+YiJ7qjuhGbiIYiCjKkqqFUE9xHtr7ltAyR1f+kFhEYSoviXFNoOs0sFy1aGIFsJW5IMkGTtI9rcz8OLeyFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630588; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=uHU9h2+WU5EN+SU5sswOD5/FpuOCYQGm063E2pBhKIc=; b=fbNNY0+8GjF7M8tRvLE15i8QfsQ0RCqi/BnjDB6l+XyVZkq9/VZGTgdnrTwDVsThOGA1l/LKAxiTTc6cNn8owRpf85YT7k7UQOyqFYu+cDCN9AU5URrqLptYixcL46VgcpaoXS0e/ubZOFItuQZiAGyEqHTLrYi1CsoaHmkc7i4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630588156784.9377101139617; Fri, 1 May 2026 03:16:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuE-00040m-Mh; Fri, 01 May 2026 06:15:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIku6-0003yy-OS for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:28 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIku4-0008Tk-JY for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:25 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so23185085e9.0 for ; Fri, 01 May 2026 03:15:23 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630523; x=1778235323; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uHU9h2+WU5EN+SU5sswOD5/FpuOCYQGm063E2pBhKIc=; b=BKXbraPhsN7nJ81XDwL7u/KrPD+82YqYaE5BjCWFow5swVrkExiC7vMXW7oxXswAE8 Z1+Yj2RiydSz2JEkQrHWcZDB5QUUtStZc3VPKWMvYnXKRIAPpj5VVm+v/5JmjUF9xhAZ deyJB+G3nwIYvABYESk1/PwbAiOBu7SPfq0nigwuoQMVF9KuTupBLEZ0PXKTwhiWe4h7 DKjXSkqe0kpvvFu266TWgAzPcdQOq5nsPnoINcdJoIWFOoUIADdeKVQ3WWv1j1EsxE2Z 5BdgLmaRtyVnoZAZYKeyNvWvFTptoBsTKI+y8Xes4lhPUUCUl264FCMDzLkcR0bccQe4 5ijg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630523; x=1778235323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=uHU9h2+WU5EN+SU5sswOD5/FpuOCYQGm063E2pBhKIc=; b=QIeAL7qKFqEmwp+PC2QRtEDDWU1q8IPDaiSDhHTxGQba54nItFSuuwB+nMErx4GNyN G9mKvF49RovEyNTwVUzgqirxYayvyopijTKryacWa18rDegfcd1abeTrsYyhamQTmrp+ XChVBgmdw1X/5b+O9WHskdmmVwqpCHc7siqDjujyHo8Nxm5UYTXCCyZHEsk24Rbr6Xp+ 8sVSWpo7sTabZL+cPczFUD4pTzRZldIVtvC2ZNkI93QrRAlpqWplSroGlD2xf4tkWKFn BZPgg/w/gxJdwPMxdNkS4epKHQ+8pf/wvGmoImCVWdvZzKD0jxvnIrg66xhQaGRyYAxK uZig== X-Gm-Message-State: AOJu0Yz/9qy5zTnTf9dQ8kTeaAG3C0HnI+W9l6G4VOrSTzQjTuCxDDwT PWzdSjEF+p8zZ9h08yGDkZOlrWmqYy+55UFwm+mQ3LW6MtKazVzsMsvts2pHmbNpw0ELz/fx4qz ZJ8A5 X-Gm-Gg: AeBDievEDi2vyBYPbmw22SvRTCFzHsnImsohMkhXSOt2LlfEIZr/MzY5C5XiEfslmgs 6yC2kba6211ZON2FO3Kzk+uXogLXJgAPgYr4240Eqt1BeBs/woFnxwSIT2uOiiRc6GFVnCgTSnY nXIgIOn0oNQ0YXeLMWcHlgNYtCU+pcj9C/gbIus6eOzN3xSFkqi2HvjPA2dgY4NkOnItfhnKnb0 Bt88RU14WybWivTPACi8V9vhLyJPkpQIPsRqh+VGRcBtgIzun+yPhJnsSB8yZVrkbWmdnbIwsQn XvTFxn5jAMVSRhuQ0xO1sfWns9sKk7UsDGxRAd4pmq4rbBXg7Ba3XC7ria7bDwkW/XXGX3QJzV6 QG1j8Qyr/bMTTckNb2oykiR4VJQnj8EIokLIh0D0Ww6skiqt6Bmy3ayGF5VFKp0UlNKVH1CwHNa r4i6K8z+r6NA7cL0v3hpOvGtNIl2qFfU2immX/wFHwd/sn71CA6tdBmCmOYzKEVXEl+omkcrfFE aaXFeI5jZd73vW2ucKFZ4bw6koRtV4QVRa1c2tfMQ== X-Received: by 2002:a05:600c:a40a:b0:48a:53cb:85f4 with SMTP id 5b1f17b1804b1-48a8eb9a7a1mr28177265e9.24.1777630522889; Fri, 01 May 2026 03:15:22 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/28] hw/net/allwinner-sun8i-emac: Flush queued packets when rx is enabled Date: Fri, 1 May 2026 11:14:48 +0100 Message-ID: <20260501101505.3485916-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630590927154100 From: =E5=AE=8B=E6=96=87=E6=AD=A6 The RX_CTL_0 register includes the RX_EN receive-enable bit, which allwinner_sun8i_emac_can_receive() checks. That means that if the guest sets it we need to call qemu_flush_queued_packets() as we might now be able to handle them. This fixes a bug where networking didn't work in u-boot on the orangepi-pc machine. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3459 Signed-off-by: =E5=AE=8B=E6=96=87=E6=AD=A6 Message-id: 20260430040753.3337-1-iyzsong@envs.net Reviewed-by: Peter Maydell [PMM: expanded commit message, removed unneeded RX_EN test] Signed-off-by: Peter Maydell --- hw/net/allwinner-sun8i-emac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/net/allwinner-sun8i-emac.c b/hw/net/allwinner-sun8i-emac.c index 9b7c67ae8e..8ddaa6101f 100644 --- a/hw/net/allwinner-sun8i-emac.c +++ b/hw/net/allwinner-sun8i-emac.c @@ -727,6 +727,9 @@ static void allwinner_sun8i_emac_write(void *opaque, hw= addr offset, break; case REG_RX_CTL_0: /* Receive Control 0 */ s->rx_ctl0 =3D value; + if (allwinner_sun8i_emac_can_receive(nc)) { + qemu_flush_queued_packets(nc); + } break; case REG_RX_CTL_1: /* Receive Control 1 */ s->rx_ctl1 =3D value | RX_CTL1_RX_MD; --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630653; cv=none; d=zohomail.com; s=zohoarc; b=YcWaxPcLwAUfi4fGtnSTmCPRiytK8drY33PlZEvlqZ7ZI0FVo218pJd60YSUwbWBojfrOVlg+C9oqQSAjjmzZp0ug+WT9R7Yx0Ssso8lYoH3q1nOG3AztmEav/wT6FlrW9sndU2d2t1yN4SWIawtBCXgn25ezq3cv9YkJOCXbNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630653; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=W4UfCZGlGsslHj81NT0nPwBtEGpVU9AOA4AqrFJUctM=; b=XFtCWUBs25U76s4wB8DpHpY/jd1OKJzRkfjgXCOIYuB5UApX567o6YZmh/mHKy5TW7L4BUtgLBsZQWcqNX2U4PDZsouAvGaORD+nsU0yrxp3FqAVWLay+qz/LkBXeLqspJIkUlFzoTF34EwSQJiINxSaGfdiYYuS5eISulaBWZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630653635630.3678062124737; Fri, 1 May 2026 03:17:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuI-00042b-F0; Fri, 01 May 2026 06:15:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIku8-0003zy-MB for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:30 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIku6-0008Va-Fh for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:28 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-48a563e4ef7so17328365e9.0 for ; Fri, 01 May 2026 03:15:25 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630524; x=1778235324; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=W4UfCZGlGsslHj81NT0nPwBtEGpVU9AOA4AqrFJUctM=; b=kSGYF29dTlUUlIGIWV1Dc1uxnfmlgprqQfDrg86K3lXBg/BnVGTAeXgTHBq2ImghAj A7SvhQsGyymeauaj2nJsoHtVAZhZpwHzw8fWe3LmTM8Q7ti/YBvjD2G9bd6nnpo0WZjz cBnlic79wwy2giS3a30te6wJZ0nboxpv5lMYYr54Z1x64izZJWWxd0JLPaAO5Er5FUA4 CT1V09URIzYhda/eO4Tg+bQ68AcbkdC5FX1f3CFuoh5yTSe8L0feVJ/kuIOhTIslZUK+ yjHsnCl6soxzzW23kQON5U9vIYNqwvX65LIjEtkp/lIH+qUs+ppUBwssrWwEFdOdqvAF dpMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630524; x=1778235324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=W4UfCZGlGsslHj81NT0nPwBtEGpVU9AOA4AqrFJUctM=; b=h7Eok1kSKZTltF/JLenGtBcghHCQxhVDLIitB8tvpaRyJiu76vPSEZ4QkGtid1XmyR 2VWaftnypKlOlf6eKabVs7Bxc0WNBdIh7dKyjkOD2Eze4OBfqe1rCwGhUrSYcOb6h4lH a6+xMyH6RV7+ho+T6+SHUHxlBIDd7g8z13UU6kTHcpVXuYWL9a27fYuxhpEyCqfqVqQn 58p6NXDVbOjT0TiYJ9F3avXQUV1Q+f41PsGtMRSzEgjetjBebXZwo0TPMeWsp880/5ZZ toQt26k1wmkVa1ny0skiqZQe3QFPelTGNtPaFIkhz3Wp3/fJ612gr21q1ndy9Guiu2h4 VRHw== X-Gm-Message-State: AOJu0Yw/XuIjCf1qc/Z2zpS3DslriN9LDQgPHmzg2ILIjqloC33Tdpdr Rp4E+e9YBJgcylUizMC43+ohLG/iatrXHZlKlAyy2w3rPUrxsv4IB2CjMJAscsxB7fPnG5XdMy0 B3PFG X-Gm-Gg: AeBDievlDEgUwcV3Iw/8CRa+F422/inmo8hZYrTo2mlniEPg7h8OPAjLe0o5k9mskU2 1e48rKbQMiUexV1aPYsWbJXBh5TdJ7ej2ugDUZC/nmwkFomBKsAlNQia+V/eBu+AOqmzeoKpWOR 2J0eGdWq5rUdh3rR7x32Cup8CCPBDsM6ikOlZQxM+aMpB6kGBoKwk3yiG3HL1h7B58P22c5Z69j zm38TjmDYP18y44B34H99oLi78NLgGEWfTQJfILKKrehbiFi1CMBKRVqVMO/q5MRVPcsJRqcPUa MYjJ2cVrjCnmFkeyos6D3dJjlQhzlN2ZgnC9YP+zvmmfNP39hepA/3yKz/Cck0FLx7WtnTZbPDx XV3hg2C3UNH+X5VDtRSNXEY/ttrkC3FzvhMy/dtwSI6VeFLbwTo7i0Dqqb/svya0mtBW1z2/uCU Po/BZ8vATjMulcWybiCDaX6EnDbherFiuzPUtf3l18pLUfVRkwrPeZJo0PRanyLONNlNlXrLeKa 52Ke7O7bZLMsQgPVUNlcBtgY/SRkSZkiWY1V4UZVg== X-Received: by 2002:a05:600c:a401:b0:488:c80c:c236 with SMTP id 5b1f17b1804b1-48a83f6e3a3mr76497935e9.5.1777630523855; Fri, 01 May 2026 03:15:23 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/28] hw/intc/arm_gicv3: Fix NS write to ICC_AP1Rn_EL1 when prebits < 7 Date: Fri, 1 May 2026 11:14:49 +0100 Message-ID: <20260501101505.3485916-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630655548158500 Content-Type: text/plain; charset="utf-8" From: liugan1 The existing code uses a blanket `regno < 2` check to make ICC_AP1R0_EL1 and ICC_AP1R1_EL1 writes from Non-secure code WI (Write Ignore) when EL3 is present. This is intended to prevent NS code from claiming active interrupts in the Secure priority range, which could block Secure interrupt delivery. However, that check assumes prebits=3D7 (4 APR registers), where the NS priority range (128..255) maps entirely to AP1R2/AP1R3. Since commit 39f29e599355 ("hw/intc/arm_gicv3: Use correct number of priority bits for the CPU", first in 7.1), all QEMU AArch64 CPUs are initialised with gic_pribits=3D5 (one APR register), so NS priorities map to AP1R0 bits [16:31]. Blanket WI of the entire AP1R0 register prevents NS code from clearing its own NS active priority bits. Machines using hw_compat_7_0 (e.g. virt-7.0) still force pribits=3D8 via force-8-bit-prio and are therefore unaffected. A concrete consequence observed in virtualisation scenarios: when a guest VM acknowledges an SPI interrupt but does not perform EOI, is force-killed and restarted, the new guest's attempt to clear the residual active state by writing ICC_AP1R0_EL1=3D0 is silently ignored. The running priority (RPR) remains stuck at the old interrupt's priority, preventing all equal-or-lower priority interrupts (including timer interrupts) from being delivered, and hanging the guest. Fix this by computing the exact Secure/NS boundary within the APR bank based on prebits. For registers entirely in the Secure range, keep the WI behaviour. For the register that straddles the boundary, preserve only the Secure bits while allowing NS bits to be modified. For registers entirely in the NS range, allow full write access. The new logic produces identical behaviour to the old code when prebits=3D7, preserving existing behaviour for machines that use force-8-bit-prio. Fixes: 39f29e599355 ("hw/intc/arm_gicv3: Use correct number of priority bit= s for the CPU") Cc: qemu-stable@nongnu.org Signed-off-by: liugan1 Message-id: 20260428083119.1400110-1-gs_liugan@163.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_cpuif.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index fcb3922fa0..921d1fdfde 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -1869,9 +1869,40 @@ static void icc_ap_write(CPUARMState *env, const ARM= CPRegInfo *ri, * at a priority outside the Non-secure range (128..255), since this * would otherwise allow malicious NS code to block delivery of S inte= rrupts * by writing a bad value to these registers. + * + * The NS priority range (128..255) maps to APR bits starting at + * aprbit =3D 0x80 >> (8 - prebits). Depending on prebits, this bounda= ry + * may fall within AP1R0 or AP1R1, so we cannot simply WI the entire + * register. Instead we calculate which bits within each register + * correspond to the Secure range and preserve those, while allowing + * NS code to modify only the NS range bits. + * + * prebits=3D4: num_aprs=3D1, NS starts at AP1R0[8] + * prebits=3D5: num_aprs=3D1, NS starts at AP1R0[16] + * prebits=3D6: num_aprs=3D2, NS starts at AP1R1[0] + * prebits=3D7: num_aprs=3D4, NS starts at AP1R2[0] */ - if (grp =3D=3D GICV3_G1NS && regno < 2 && arm_feature(env, ARM_FEATURE= _EL3)) { - return; + if (grp =3D=3D GICV3_G1NS && arm_feature(env, ARM_FEATURE_EL3)) { + int ns_start_bit =3D 0x80 >> (8 - cs->prebits); + int ns_start_regno =3D ns_start_bit / 32; + int ns_start_regbit =3D ns_start_bit % 32; + + if (regno < ns_start_regno) { + /* This entire register is in the Secure range: WI */ + return; + } else if (regno =3D=3D ns_start_regno && ns_start_regbit > 0) { + /* + * This register is split: low bits are Secure, high bits are = NS. + * Preserve the Secure bits (below ns_start_regbit) from the + * current value, and take the NS bits (at and above + * ns_start_regbit) from the written value. + */ + uint32_t secure_mask =3D MAKE_64BIT_MASK(0, ns_start_regbit); + + value =3D (cs->icc_apr[grp][regno] & secure_mask) | + (value & ~secure_mask); + } + /* else: regno > ns_start_regno, entire register is NS: allow writ= e */ } =20 if (cs->nmi_support) { --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630716; cv=none; d=zohomail.com; s=zohoarc; b=BKdOhsQtr7qSbCLlkGPhs4LZvzY3dPe7eaIMX3vrTUsWmrImesfqHMJdUUlkYXp+KbjVlC7kwVPlSpDj3uxd1Tlh6g3Snu+u7rvu16WZUjBY4Mlt5xL1lRWLI870C3kPI+L1p78a7bIDt6CX2saecZ5c+66F586dsS725smB7xM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630716; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=2YjxkgDmODhzB8F97AzDnOR+tGT6XYFOQgHnOUXmosQ=; b=oHZ2czZJhsVPcm1jtVOTMBJZhEd3IHSqefA5F34c7qAmlkoiZpvWdZ3VMvmxOtPIZAlDxsDNOS9UxO7sNeU2xzikz/G//gb6Bmt7sv9elXLu/+OAXYmdN2pWWXNVVHV8fzV83QoK87bRb9GkRQGc6yTE8q600K2ZwxcWWfRyGwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630716638996.746152871423; Fri, 1 May 2026 03:18:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuI-00042d-Ud; Fri, 01 May 2026 06:15:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuA-000403-9b for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:30 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIku8-0000AB-Dh for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:29 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so26211545e9.0 for ; Fri, 01 May 2026 03:15:27 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630526; x=1778235326; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2YjxkgDmODhzB8F97AzDnOR+tGT6XYFOQgHnOUXmosQ=; b=oRXoGm9gk7R71IyQxNkHRQyGzFLOiB2vp5S6Ba3YLdZIh4Pe9X9T8jTjrkOWvj5vmS ps9FAYw5mONzDIsGcWE8nr2YqpT+ubJIFc3aG2jgGdGi5H4LOnvTXwKX1d9Oh1h5ICzx WpFuzt6rC0AT6/E6lepCyWnffvQYinCcYbrPA69CordLQ4GZ1jQvaIKGe7flDDGORRQl klTDx+9/pKlHkR7KwlASUiOKk5wP8/fVEVFbYpmxO1iFJLOOnTQo9sDKpr2T2BCBPx60 3Jzy1ldJYHhLV79KPf2t/6qgnBHUHQE1A9hNrRypCtmaDJegTqeXZNv1U9kNGGYX8qjQ 5avA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630526; x=1778235326; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2YjxkgDmODhzB8F97AzDnOR+tGT6XYFOQgHnOUXmosQ=; b=aDv1rorr6OiB5jocuHs2KgYtWdWFHz1xYSY9ydhbsCIAs1lR2w2b/SkeVQXnCVBsuF 3ZyxO5s/1u/PHcp492LdZYbWhL0TMv1XuVt6HxXOsya4pcEqvsF0PEQ590fCOhFM4PwT Qw4QZreoV5yvg8guB49rHLtknp/uuUU+lWtghwfBceqa2O+bNdibA4ZcJRWQ1K3PrjUJ KkZEibH75VL7wTYmwV/R3lwDTp9UVhOzwuupaG53zdrCrHfuzTIRQEqRrTFu4YJqcuHr nty5GTJ5FkZcuex89Kr37tAd5VetDdxLSCstxbBpFD+tizEZB2Yk31R+JF0zcOXvo/9e vadg== X-Gm-Message-State: AOJu0YwgPJ0enM35tDP8Ni4AtoAYhzJb+J6k8sBlekrubA/ddMGlJV31 a67CuG6VMlg1VsNb2ECC7XixZwZ8Kg1wXsOmwVxdjjqwrPJI49VK85EcMY/MdLW02jBtZv60EMT mn3oi X-Gm-Gg: AeBDieuJSAUvPA5HFCUNUpjhyPuuEIZo77GjAHyOxU9AaeOHrTj0IE1wcG0CdK7IDi6 I7pGYMoKEnRZU8uQWYrczUDT4z4W0vCh5zRedEmHtvs8VLaE9JMRuqE/aCb199KtlbAQAbUFU31 L+cg2Z4Dv2L9+KMSpcKa2XXB03B9PKIYMIUouNPT3Z9HuD8O9X59u1Rrwbreu86Pe9C4mMldqIa Z5f8PCg1thEIUAiOjmRBDZY+YhgljmLCvLDsZtOPuN8+jtptrvaIvwde+R10Pr6rtjmnjkN1DFm BNqGHdU9cZGNpOSbh/BC9PPv72RL7U0HN4+nxZynMvPqijPNg4r58yC70KJIyraFqmPR7ssMchR lAvkd0GVu1jTSjNmbgzvhdtGnEoUAOCIEJYq1quxdSzC29XgQuuGnhGO/LUzqMdic9MetjwOBCp uecWzCjL6dULIcbh+dR+PGJULSaNLWR7WBhPxWUrGIAVfi17KcZMUCaxr26RzwRf9FOm0891Jdy UE9SRYC5TruEBpHUFxgficQEYR7yXz9YfrjScpCe2uUlhqxruFg X-Received: by 2002:a05:600c:1d1a:b0:485:30d4:6b9e with SMTP id 5b1f17b1804b1-48a84458d16mr114107105e9.21.1777630526469; Fri, 01 May 2026 03:15:26 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/28] target/arm/kvm: Cache host CPU probe failure Date: Fri, 1 May 2026 11:14:50 +0100 Message-ID: <20260501101505.3485916-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630718823154100 Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki kvm_arm_set_cpu_features_from_host() does not properly handle host CPU probe failure with caching. The current algorithm can be summarized as follows: If dtb_compatible is not cached: If kvm_arm_create_scratch_host_vcpu() fails: Report failure Cache dtb_compatible If getting register values fails: Report failure Report success This algorithm has the following problems: - If kvm_arm_create_scratch_host_vcpu() fails, probing may be repeated. - If getting register values fails, later invocations incorrectly report success. Make two changes to fix them: - Cache dtb_compatible whenever a probe is attempted. - Record probe failure by assigning QEMU_KVM_ARM_TARGET_NONE to arm_host_cpu_features.target. Suggested-by: Peter Maydell Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Message-id: 20260428-features-v1-1-1841b39da7e6@rsg.ci.i.u-tokyo.ac.jp Signed-off-by: Peter Maydell --- target/arm/kvm.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index d4a68874b8..7d194ea112 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -273,7 +273,7 @@ static uint32_t kvm_arm_sve_get_vls(int fd) return vls[0] & MAKE_64BIT_MASK(0, ARM_MAX_VQ); } =20 -static bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) +static void kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) { /* Identify the feature bits corresponding to the host CPU, and * fill out the ARMHostCPUClass fields accordingly. To do this @@ -287,6 +287,13 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFe= atures *ahcf) uint64_t features =3D 0; int err; =20 + ahcf->target =3D QEMU_KVM_ARM_TARGET_NONE; + ahcf->dtb_compatible =3D "arm,armv8"; + + if (!kvm_enabled()) { + return; + } + /* * target =3D -1 informs kvm_arm_create_scratch_host_vcpu() * to use the preferred target @@ -326,11 +333,9 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFe= atures *ahcf) } =20 if (!kvm_arm_create_scratch_host_vcpu(fdarray, &init)) { - return false; + return; } =20 - ahcf->target =3D init.target; - ahcf->dtb_compatible =3D "arm,armv8"; int fd =3D fdarray[2]; =20 err =3D get_host_cpu_reg(fd, ahcf, ID_AA64PFR0_EL1_IDX); @@ -454,7 +459,7 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFea= tures *ahcf) kvm_arm_destroy_scratch_host_vcpu(fdarray); =20 if (err < 0) { - return false; + return; } =20 /* @@ -471,9 +476,8 @@ static bool kvm_arm_get_host_cpu_features(ARMHostCPUFea= tures *ahcf) features |=3D 1ULL << ARM_FEATURE_EL2; } =20 + ahcf->target =3D init.target; ahcf->features =3D features; - - return true; } =20 void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) @@ -481,18 +485,20 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) CPUARMState *env =3D &cpu->env; =20 if (!arm_host_cpu_features.dtb_compatible) { - if (!kvm_enabled() || - !kvm_arm_get_host_cpu_features(&arm_host_cpu_features)) { - /* We can't report this error yet, so flag that we need to - * in arm_cpu_realizefn(). - */ - cpu->kvm_target =3D QEMU_KVM_ARM_TARGET_NONE; - cpu->host_cpu_probe_failed =3D true; - return; - } + kvm_arm_get_host_cpu_features(&arm_host_cpu_features); } =20 cpu->kvm_target =3D arm_host_cpu_features.target; + + if (cpu->kvm_target =3D=3D QEMU_KVM_ARM_TARGET_NONE) { + /* + * We can't report this error yet, so flag that we need to + * in arm_cpu_realizefn(). + */ + cpu->host_cpu_probe_failed =3D true; + return; + } + cpu->dtb_compatible =3D arm_host_cpu_features.dtb_compatible; cpu->isar =3D arm_host_cpu_features.isar; cpu->sve_vq.supported =3D arm_host_cpu_features.sve_vq_supported; --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630682; cv=none; d=zohomail.com; s=zohoarc; b=NlxsesNW3YAONo/gTQ4RA2tj+96IJ+sg6EDphF8iQ6pdFkzScdqtkhJO9fOwLNhsiGU3ih4NyC9jkSOEf90UJhaaFe4VWxHVa/Ulos9fRkJPiDLHuPeSCNY0xikZ7Fhx0krntN1pENbEHdS/rg1Pwg8oXna3wueJROwrGxIJH0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630682; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=VHYQ3sEbHhf9JiOzweo2r0DAPn1IB5i37+wIDFmfga4=; b=kBYHld7SNqqqlgwRehwK5vfmtgWuVbDgY5vvOh1ckhGRsZuur3LPmjuaiMH/0yPpKiIbE+mZibbRQphIKNdkhIsBfEqlsgrJbrfrMcSq3Awwcr89hmwApU2wgxqmQWnm616Oxg5ulquOoGdvkYBRvPx3UPQj3pshAZOKRccBM3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17776306827921009.8319652629493; Fri, 1 May 2026 03:18:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuJ-00043O-Tg; Fri, 01 May 2026 06:15:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuD-00040n-93 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:34 -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 1wIku9-0000B9-LZ for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:33 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so26211845e9.0 for ; Fri, 01 May 2026 03:15:28 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630527; x=1778235327; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VHYQ3sEbHhf9JiOzweo2r0DAPn1IB5i37+wIDFmfga4=; b=kF5XHJtf9eeCUKqRKp8wtqzBfgRkbk31Qmb/koTVCMF83YzNqK4jqvIlAyxt6rrpKE dC0znY7lYQ6n4x+repolLJ9r6Vwc3KxmYt+GqHnjB+jtM2tDqZVIpugmmwgojn+MbkQs XRu+PYukF55GRDnJ6ZxR2TmP9Np1VNqTD4RgtuR6OGrPJqxxkPmbFQvtORKNSc++hhpA 5z1DI6vDNe+Ykv7rqY7x5fIYVMUNFYJeuIeUMmUVknej5S5YAj2lHwW3nJwJhzx8IlXA W8NxLKbJ6g0l/3D6eniDxYoiMugfDc2Oi6+wQDmq/amjeK5Ofaub/9WLW9EcGeKn72JF 4nfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630527; x=1778235327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=VHYQ3sEbHhf9JiOzweo2r0DAPn1IB5i37+wIDFmfga4=; b=AplfQqd9D9ZKy/Tm3DWfUFVmIA9i9ahZkLfXrssCdg6bo4e7/hGHv6N3ET3hkyPOnn pxQQ/6QuUHZPlD/ja2md8P+8U2MwMcg6b+7vtPCQIpHGhYZvgmD52em1ffqAyd7f3i9g W9E6kp6fE0iimecxj1FedFdZ0qL9kb3ZG07QYuZLfG5MCbVX4JwbCw3WUb0Igz9E7Cxo j/RZup9HnZ0Sz1TkKlkiopdWM2FYnmPXDRGJyKyQ6IxQHMqICgjyI6kj2WNL6cj3oK6v RrjT287Ajo3dS87AyaabfgCyUi3J0Cf/mAEmQvZoog902VVnZfEEpzoa6BrFU7mAYY6O dT3Q== X-Gm-Message-State: AOJu0Yzqx/yFDbgyTtExw5/SuBxU/F7sAVYT6/j2c+PMHSWZDSL/JZLo MUlb3KkJrqlTjDgtoyzeFs3Q7ZCP5tjaHsXWB0RHlC3QcxefLx3D1OH3YH0YsIox3XwU1DJBEOF xpX2X X-Gm-Gg: AeBDiev49e0y/4sGetVhWx4iY20MudL7Ks6maKdKv9Hdoh9DkgPDIVhwRen6XyZbXXF UdeCo7KY8MZyvucczhxw0Kf945zNF6QHq9D1IUjn/ZcGrrkdArGX9TwpDzQIbTo3CHCL3XGXV3W xmYLTtsJR7D4BdhYASDlOAlBQJhALXy1NI9ldxbShdIJfK0KjelQxhzdEaQEW/jVK8N3Ob2o2Mb CSjloD+7g+g58TzjX9M5WgK2u4UGSbRaIel1rXj/M/o6ufvXWm14syg2dTWWq97eH9WJEtUSz5d A5jQazQa2DuwiESC4npKhBprQ3WNotl+aHH4lO5P5WaMGdyDA2tqt7lrLKqLKfjolpCCCtv8X5G 1pBnVk05sH9ojP97ALiTHH9SjjsjWb87WNE5UYN+rWNgwxcEPwcCOxeF3WI+s0n8oO6ZR5hYXFV G2v3yX/H6aSML9yO770mC/Ny1LXlw+tsi4rmCckr9YkcbkVWyamr56X+yLec080l6MH9qeCV81K s1jbtxrLfJLG2qKWDnbAd7qd2QqVh7quZWfX0+rL3XqMf7sO6Hq X-Received: by 2002:a05:600c:4e16:b0:489:1f3e:5f6f with SMTP id 5b1f17b1804b1-48a83e73c23mr114823855e9.12.1777630527359; Fri, 01 May 2026 03:15:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/28] hw/intc: Add hvf vGIC interrupt controller support Date: Fri, 1 May 2026 11:14:51 +0100 Message-ID: <20260501101505.3485916-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630683712158500 From: Mohamed Mediouni This opens up the door to nested virtualisation support. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Message-id: 20260429190532.26538-2-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_hvf.c | 749 +++++++++++++++++++++++++++++ hw/intc/meson.build | 1 + include/hw/intc/arm_gicv3_common.h | 1 + 3 files changed, 751 insertions(+) create mode 100644 hw/intc/arm_gicv3_hvf.c diff --git a/hw/intc/arm_gicv3_hvf.c b/hw/intc/arm_gicv3_hvf.c new file mode 100644 index 0000000000..22f19d274d --- /dev/null +++ b/hw/intc/arm_gicv3_hvf.c @@ -0,0 +1,749 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * ARM Generic Interrupt Controller using HVF platform support + * + * Copyright (c) 2025 Mohamed Mediouni + * Based on vGICv3 KVM code by Pavel Fedin + * + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/intc/arm_gicv3_common.h" +#include "qemu/error-report.h" +#include "qemu/module.h" +#include "system/runstate.h" +#include "system/hvf.h" +#include "system/hvf_int.h" +#include "hvf_arm.h" +#include "gicv3_internal.h" +#include "vgic_common.h" +#include "qom/object.h" +#include "target/arm/cpregs.h" +#include + +/* + * For the GIC, override the check outright, as availability is checked + * elsewhere + */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" + +struct HVFARMGICv3Class { + ARMGICv3CommonClass parent_class; + DeviceRealize parent_realize; + ResettablePhases parent_phases; +}; + +typedef struct HVFARMGICv3Class HVFARMGICv3Class; + +/* This is reusing the GICv3State typedef from ARM_GICV3_ITS_COMMON */ +DECLARE_OBJ_CHECKERS(GICv3State, HVFARMGICv3Class, + HVF_GICV3, TYPE_HVF_GICV3); + +/* + * Loop through each distributor IRQ related register; since bits + * corresponding to SPIs and PPIs are RAZ/WI when affinity routing + * is enabled, we skip those. + */ +#define for_each_dist_irq_reg(_irq, _max, _field_width) \ + for (_irq =3D GIC_INTERNAL; _irq < _max; _irq +=3D (32 / _field_width)) + +/* + * Wrap calls to the vGIC APIs to assert_hvf_ok() + * as a macro to keep the code clean. + */ +#define hv_gic_get_distributor_reg(offset, reg) \ + assert_hvf_ok(hv_gic_get_distributor_reg(offset, reg)) + +#define hv_gic_set_distributor_reg(offset, reg) \ + assert_hvf_ok(hv_gic_set_distributor_reg(offset, reg)) + +#define hv_gic_get_redistributor_reg(vcpu, reg, value) \ + assert_hvf_ok(hv_gic_get_redistributor_reg(vcpu, reg, value)) + +#define hv_gic_set_redistributor_reg(vcpu, reg, value) \ + assert_hvf_ok(hv_gic_set_redistributor_reg(vcpu, reg, value)) + +#define hv_gic_get_icc_reg(vcpu, reg, value) \ + assert_hvf_ok(hv_gic_get_icc_reg(vcpu, reg, value)) + +#define hv_gic_set_icc_reg(vcpu, reg, value) \ + assert_hvf_ok(hv_gic_set_icc_reg(vcpu, reg, value)) + +#define hv_gic_get_ich_reg(vcpu, reg, value) \ + assert_hvf_ok(hv_gic_get_ich_reg(vcpu, reg, value)) + +#define hv_gic_set_ich_reg(vcpu, reg, value) \ + assert_hvf_ok(hv_gic_set_ich_reg(vcpu, reg, value)) + +static void hvf_dist_get_priority(GICv3State *s, + hv_gic_distributor_reg_t offset, + uint8_t *bmp) +{ + uint64_t reg; + uint32_t *field; + int irq; + field =3D (uint32_t *)(bmp); + + for_each_dist_irq_reg(irq, s->num_irq, 8) { + hv_gic_get_distributor_reg(offset, ®); + *field =3D reg; + offset +=3D 4; + field++; + } +} + +static void hvf_dist_put_priority(GICv3State *s, + hv_gic_distributor_reg_t offset, + uint8_t *bmp) +{ + uint32_t reg, *field; + int irq; + field =3D (uint32_t *)(bmp); + + for_each_dist_irq_reg(irq, s->num_irq, 8) { + reg =3D *field; + hv_gic_set_distributor_reg(offset, reg); + offset +=3D 4; + field++; + } +} + +static void hvf_dist_get_edge_trigger(GICv3State *s, + hv_gic_distributor_reg_t offset, + uint32_t *bmp) +{ + uint64_t reg; + int irq; + + for_each_dist_irq_reg(irq, s->num_irq, 2) { + hv_gic_get_distributor_reg(offset, ®); + reg =3D half_unshuffle32(reg >> 1); + if (irq % 32 !=3D 0) { + reg =3D (reg << 16); + } + *gic_bmp_ptr32(bmp, irq) |=3D reg; + offset +=3D 4; + } +} + +static void hvf_dist_put_edge_trigger(GICv3State *s, + hv_gic_distributor_reg_t offset, + uint32_t *bmp) +{ + uint32_t reg; + int irq; + + for_each_dist_irq_reg(irq, s->num_irq, 2) { + reg =3D *gic_bmp_ptr32(bmp, irq); + if (irq % 32 !=3D 0) { + reg =3D (reg & 0xffff0000) >> 16; + } else { + reg =3D reg & 0xffff; + } + reg =3D half_shuffle32(reg) << 1; + hv_gic_set_distributor_reg(offset, reg); + offset +=3D 4; + } +} + +/* Read a bitmap register group from the kernel VGIC. */ +static void hvf_dist_getbmp(GICv3State *s, hv_gic_distributor_reg_t offset, + uint32_t *bmp) +{ + uint64_t reg; + int irq; + + for_each_dist_irq_reg(irq, s->num_irq, 1) { + hv_gic_get_distributor_reg(offset, ®); + *gic_bmp_ptr32(bmp, irq) =3D reg; + offset +=3D 4; + } +} + +static void hvf_dist_putbmp(GICv3State *s, hv_gic_distributor_reg_t offset, + hv_gic_distributor_reg_t clroffset, uint32_t *= bmp) +{ + uint32_t reg; + int irq; + + for_each_dist_irq_reg(irq, s->num_irq, 1) { + /* + * If this bitmap is a set/clear register pair, first write to the + * clear-reg to clear all bits before using the set-reg to write + * the 1 bits. + */ + if (clroffset !=3D 0) { + reg =3D 0; + hv_gic_set_distributor_reg(clroffset, reg); + clroffset +=3D 4; + } + reg =3D *gic_bmp_ptr32(bmp, irq); + hv_gic_set_distributor_reg(offset, reg); + offset +=3D 4; + } +} + +static void hvf_gicv3_check(GICv3State *s) +{ + uint64_t reg; + uint32_t num_irq; + + /* Sanity checking s->num_irq */ + hv_gic_get_distributor_reg(HV_GIC_DISTRIBUTOR_REG_GICD_TYPER, ®); + num_irq =3D ((reg & 0x1f) + 1) * 32; + + if (num_irq < s->num_irq) { + error_report("Model requests %u IRQs, but HVF supports max %u", + s->num_irq, num_irq); + abort(); + } +} + +static void hvf_gicv3_put_cpu_el2(CPUState *cpu_state, run_on_cpu_data arg) +{ + int num_pri_bits; + + /* Redistributor state */ + GICv3CPUState *c =3D arg.host_ptr; + hv_vcpu_t vcpu =3D c->cpu->accel->fd; + + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_VMCR_EL2, c->ich_vmcr_el2); + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_HCR_EL2, c->ich_hcr_el2); + + for (int i =3D 0; i < GICV3_LR_MAX; i++) { + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_LR0_EL2, c->ich_lr_el2[i]); + } + + num_pri_bits =3D c->vpribits; + + switch (num_pri_bits) { + case 7: + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2 + 3, + c->ich_apr[GICV3_G0][3]); + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2 + 2, + c->ich_apr[GICV3_G0][2]); + /* fall through */ + case 6: + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2 + 1, + c->ich_apr[GICV3_G0][1]); + /* fall through */ + default: + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2, + c->ich_apr[GICV3_G0][0]); + } + + switch (num_pri_bits) { + case 7: + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2 + 3, + c->ich_apr[GICV3_G1NS][3]); + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2 + 2, + c->ich_apr[GICV3_G1NS][2]); + /* fall through */ + case 6: + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2 + 1, + c->ich_apr[GICV3_G1NS][1]); + /* fall through */ + default: + hv_gic_set_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2, + c->ich_apr[GICV3_G1NS][0]); + } +} + +static void hvf_gicv3_put_cpu(CPUState *cpu_state, run_on_cpu_data arg) +{ + uint32_t reg; + uint64_t reg64; + int i, num_pri_bits; + + /* Redistributor state */ + GICv3CPUState *c =3D arg.host_ptr; + hv_vcpu_t vcpu =3D c->cpu->accel->fd; + + reg =3D c->gicr_waker; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_IGROU= PR0, reg); + + reg =3D c->gicr_igroupr0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_IGROU= PR0, reg); + + reg =3D ~0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ICENA= BLER0, reg); + reg =3D c->gicr_ienabler0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ISENA= BLER0, reg); + + /* Restore config before pending so we treat level/edge correctly */ + reg =3D half_shuffle32(c->edge_trigger >> 16) << 1; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ICFGR= 1, reg); + + reg =3D ~0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ICPEN= DR0, reg); + reg =3D c->gicr_ipendr0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ISPEN= DR0, reg); + + reg =3D ~0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ICACT= IVER0, reg); + reg =3D c->gicr_iactiver0; + hv_gic_set_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ISACT= IVER0, reg); + + for (i =3D 0; i < GIC_INTERNAL; i +=3D 4) { + reg =3D c->gicr_ipriorityr[i] | + (c->gicr_ipriorityr[i + 1] << 8) | + (c->gicr_ipriorityr[i + 2] << 16) | + (c->gicr_ipriorityr[i + 3] << 24); + hv_gic_set_redistributor_reg(vcpu, + HV_GIC_REDISTRIBUTOR_REG_GICR_IPRIORITYR0 + i, reg); + } + + /* CPU interface state */ + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_SRE_EL1, c->icc_sre_el1); + + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_CTLR_EL1, + c->icc_ctlr_el1[GICV3_NS]); + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_IGRPEN0_EL1, + c->icc_igrpen[GICV3_G0]); + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_IGRPEN1_EL1, + c->icc_igrpen[GICV3_G1NS]); + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_PMR_EL1, c->icc_pmr_el1); + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_BPR0_EL1, c->icc_bpr[GICV3_G0]= ); + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_BPR1_EL1, c->icc_bpr[GICV3_G1N= S]); + + num_pri_bits =3D ((c->icc_ctlr_el1[GICV3_NS] & + ICC_CTLR_EL1_PRIBITS_MASK) >> + ICC_CTLR_EL1_PRIBITS_SHIFT) + 1; + + switch (num_pri_bits) { + case 7: + reg64 =3D c->icc_apr[GICV3_G0][3]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1 + 3, reg64); + reg64 =3D c->icc_apr[GICV3_G0][2]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1 + 2, reg64); + /* fall through */ + case 6: + reg64 =3D c->icc_apr[GICV3_G0][1]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1 + 1, reg64); + /* fall through */ + default: + reg64 =3D c->icc_apr[GICV3_G0][0]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1, reg64); + } + + switch (num_pri_bits) { + case 7: + reg64 =3D c->icc_apr[GICV3_G1NS][3]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1 + 3, reg64); + reg64 =3D c->icc_apr[GICV3_G1NS][2]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1 + 2, reg64); + /* fall through */ + case 6: + reg64 =3D c->icc_apr[GICV3_G1NS][1]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1 + 1, reg64); + /* fall through */ + default: + reg64 =3D c->icc_apr[GICV3_G1NS][0]; + hv_gic_set_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1, reg64); + } + + /* Registers beyond this point are with nested virt only */ + if (c->gic->maint_irq) { + hvf_gicv3_put_cpu_el2(cpu_state, arg); + } +} + +static void hvf_gicv3_put(GICv3State *s) +{ + uint32_t reg; + int ncpu, i; + + hvf_gicv3_check(s); + + reg =3D s->gicd_ctlr; + hv_gic_set_distributor_reg(HV_GIC_DISTRIBUTOR_REG_GICD_CTLR, reg); + + /* per-CPU state */ + + for (ncpu =3D 0; ncpu < s->num_cpu; ncpu++) { + run_on_cpu_data data; + data.host_ptr =3D &s->cpu[ncpu]; + run_on_cpu(s->cpu[ncpu].cpu, hvf_gicv3_put_cpu, data); + } + + /* s->enable bitmap -> GICD_ISENABLERn */ + hvf_dist_putbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_ISENABLER0, + HV_GIC_DISTRIBUTOR_REG_GICD_ICENABLER0, s->enabled); + + /* s->group bitmap -> GICD_IGROUPRn */ + hvf_dist_putbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_IGROUPR0, + 0, s->group); + + /* + * Restore targets before pending to ensure the pending state is set on + * the appropriate CPU interfaces in the kernel + */ + + /* s->gicd_irouter[irq] -> GICD_IROUTERn */ + for (i =3D GIC_INTERNAL; i < s->num_irq; i++) { + uint32_t offset =3D HV_GIC_DISTRIBUTOR_REG_GICD_IROUTER32 + (8 * i) + - (8 * GIC_INTERNAL); + hv_gic_set_distributor_reg(offset, s->gicd_irouter[i]); + } + + /* + * s->trigger bitmap -> GICD_ICFGRn + * (restore configuration registers before pending IRQs so we treat + * level/edge correctly) + */ + hvf_dist_put_edge_trigger(s, HV_GIC_DISTRIBUTOR_REG_GICD_ICFGR0, s->ed= ge_trigger); + + /* s->pending bitmap -> GICD_ISPENDRn */ + hvf_dist_putbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_ISPENDR0, + HV_GIC_DISTRIBUTOR_REG_GICD_ICPENDR0, s->pending); + + /* s->active bitmap -> GICD_ISACTIVERn */ + hvf_dist_putbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_ISACTIVER0, + HV_GIC_DISTRIBUTOR_REG_GICD_ICACTIVER0, s->active); + + /* s->gicd_ipriority[] -> GICD_IPRIORITYRn */ + hvf_dist_put_priority(s, HV_GIC_DISTRIBUTOR_REG_GICD_IPRIORITYR0, s->g= icd_ipriority); +} + +static void hvf_gicv3_get_cpu_el2(CPUState *cpu_state, run_on_cpu_data arg) +{ + int num_pri_bits; + + /* Redistributor state */ + GICv3CPUState *c =3D arg.host_ptr; + hv_vcpu_t vcpu =3D c->cpu->accel->fd; + + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_VMCR_EL2, &c->ich_vmcr_el2); + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_HCR_EL2, &c->ich_hcr_el2); + + for (int i =3D 0; i < GICV3_LR_MAX; i++) { + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_LR0_EL2, &c->ich_lr_el2[i]= ); + } + + num_pri_bits =3D c->vpribits; + + switch (num_pri_bits) { + case 7: + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2 + 3, + &c->ich_apr[GICV3_G0][3]); + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2 + 2, + &c->ich_apr[GICV3_G0][2]); + /* fall through */ + case 6: + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2 + 1, + &c->ich_apr[GICV3_G0][1]); + /* fall through */ + default: + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP0R0_EL2, + &c->ich_apr[GICV3_G0][0]); + } + + switch (num_pri_bits) { + case 7: + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2 + 3, + &c->ich_apr[GICV3_G1NS][3]); + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2 + 2, + &c->ich_apr[GICV3_G1NS][2]); + /* fall through */ + case 6: + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2 + 1, + &c->ich_apr[GICV3_G1NS][1]); + /* fall through */ + default: + hv_gic_get_ich_reg(vcpu, HV_GIC_ICH_REG_AP1R0_EL2, + &c->ich_apr[GICV3_G1NS][0]); + } +} + +static void hvf_gicv3_get_cpu(CPUState *cpu_state, run_on_cpu_data arg) +{ + uint64_t reg; + int i, num_pri_bits; + + /* Redistributor state */ + GICv3CPUState *c =3D arg.host_ptr; + hv_vcpu_t vcpu =3D c->cpu->accel->fd; + + hv_gic_get_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_IGROU= PR0, + ®); + c->gicr_igroupr0 =3D reg; + hv_gic_get_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ISENA= BLER0, + ®); + c->gicr_ienabler0 =3D reg; + hv_gic_get_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ICFGR= 1, + ®); + c->edge_trigger =3D half_unshuffle32(reg >> 1) << 16; + hv_gic_get_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ISPEN= DR0, + ®); + c->gicr_ipendr0 =3D reg; + hv_gic_get_redistributor_reg(vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_ISACT= IVER0, + ®); + c->gicr_iactiver0 =3D reg; + + for (i =3D 0; i < GIC_INTERNAL; i +=3D 4) { + hv_gic_get_redistributor_reg( + vcpu, HV_GIC_REDISTRIBUTOR_REG_GICR_IPRIORITYR0 + i, ®); + c->gicr_ipriorityr[i] =3D extract32(reg, 0, 8); + c->gicr_ipriorityr[i + 1] =3D extract32(reg, 8, 8); + c->gicr_ipriorityr[i + 2] =3D extract32(reg, 16, 8); + c->gicr_ipriorityr[i + 3] =3D extract32(reg, 24, 8); + } + + /* CPU interface */ + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_SRE_EL1, &c->icc_sre_el1); + + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_CTLR_EL1, + &c->icc_ctlr_el1[GICV3_NS]); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_IGRPEN0_EL1, + &c->icc_igrpen[GICV3_G0]); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_IGRPEN1_EL1, + &c->icc_igrpen[GICV3_G1NS]); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_PMR_EL1, &c->icc_pmr_el1); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_BPR0_EL1, &c->icc_bpr[GICV3_G0= ]); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_BPR1_EL1, &c->icc_bpr[GICV3_G1= NS]); + num_pri_bits =3D ((c->icc_ctlr_el1[GICV3_NS] & ICC_CTLR_EL1_PRIBITS_MA= SK) >> + ICC_CTLR_EL1_PRIBITS_SHIFT) + + 1; + + switch (num_pri_bits) { + case 7: + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1 + 3, + &c->icc_apr[GICV3_G0][3]); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1 + 2, + &c->icc_apr[GICV3_G0][2]); + /* fall through */ + case 6: + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1 + 1, + &c->icc_apr[GICV3_G0][1]); + /* fall through */ + default: + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP0R0_EL1, + &c->icc_apr[GICV3_G0][0]); + } + + switch (num_pri_bits) { + case 7: + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1 + 3, + &c->icc_apr[GICV3_G1NS][3]); + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1 + 2, + &c->icc_apr[GICV3_G1NS][2]); + /* fall through */ + case 6: + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1 + 1, + &c->icc_apr[GICV3_G1NS][1]); + /* fall through */ + default: + hv_gic_get_icc_reg(vcpu, HV_GIC_ICC_REG_AP1R0_EL1, + &c->icc_apr[GICV3_G1NS][0]); + } + + /* Registers beyond this point are with nested virt only */ + if (c->gic->maint_irq) { + hvf_gicv3_get_cpu_el2(cpu_state, arg); + } +} + +static void hvf_gicv3_get(GICv3State *s) +{ + uint64_t reg; + int ncpu, i; + + hvf_gicv3_check(s); + + hv_gic_get_distributor_reg(HV_GIC_DISTRIBUTOR_REG_GICD_CTLR, ®); + s->gicd_ctlr =3D reg; + + /* Redistributor state (one per CPU) */ + + for (ncpu =3D 0; ncpu < s->num_cpu; ncpu++) { + run_on_cpu_data data; + data.host_ptr =3D &s->cpu[ncpu]; + run_on_cpu(s->cpu[ncpu].cpu, hvf_gicv3_get_cpu, data); + } + + /* GICD_IGROUPRn -> s->group bitmap */ + hvf_dist_getbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_IGROUPR0, s->group); + + /* GICD_ISENABLERn -> s->enabled bitmap */ + hvf_dist_getbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_ISENABLER0, s->enabled); + + /* GICD_ISPENDRn -> s->pending bitmap */ + hvf_dist_getbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_ISPENDR0, s->pending); + + /* GICD_ISACTIVERn -> s->active bitmap */ + hvf_dist_getbmp(s, HV_GIC_DISTRIBUTOR_REG_GICD_ISACTIVER0, s->active); + + /* GICD_ICFGRn -> s->trigger bitmap */ + hvf_dist_get_edge_trigger(s, HV_GIC_DISTRIBUTOR_REG_GICD_ICFGR0, + s->edge_trigger); + + /* GICD_IPRIORITYRn -> s->gicd_ipriority[] */ + hvf_dist_get_priority(s, HV_GIC_DISTRIBUTOR_REG_GICD_IPRIORITYR0, + s->gicd_ipriority); + + /* GICD_IROUTERn -> s->gicd_irouter[irq] */ + for (i =3D GIC_INTERNAL; i < s->num_irq; i++) { + uint32_t offset =3D HV_GIC_DISTRIBUTOR_REG_GICD_IROUTER32 + + (8 * i) - (8 * GIC_INTERNAL); + hv_gic_get_distributor_reg(offset, &s->gicd_irouter[i]); + } +} + +static void hvf_gicv3_set_irq(void *opaque, int irq, int level) +{ + GICv3State *s =3D opaque; + if (irq > s->num_irq) { + return; + } + hv_gic_set_spi(GIC_INTERNAL + irq, !!level); +} + +static void hvf_gicv3_icc_reset(CPUARMState *env, const ARMCPRegInfo *ri) +{ + GICv3CPUState *c; + + c =3D env->gicv3state; + c->icc_pmr_el1 =3D 0; + /* + * Architecturally the reset value of the ICC_BPR registers + * is UNKNOWN. We set them all to 0 here; when the kernel + * uses these values to program the ICH_VMCR_EL2 fields that + * determine the guest-visible ICC_BPR register values, the + * hardware's "writing a value less than the minimum sets + * the field to the minimum value" behaviour will result in + * them effectively resetting to the correct minimum value + * for the host GIC. + */ + c->icc_bpr[GICV3_G0] =3D 0; + c->icc_bpr[GICV3_G1] =3D 0; + c->icc_bpr[GICV3_G1NS] =3D 0; + + c->icc_sre_el1 =3D 0x7; + memset(c->icc_apr, 0, sizeof(c->icc_apr)); + memset(c->icc_igrpen, 0, sizeof(c->icc_igrpen)); +} + +static void hvf_gicv3_reset_hold(Object *obj, ResetType type) +{ + GICv3State *s =3D ARM_GICV3_COMMON(obj); + HVFARMGICv3Class *kgc =3D HVF_GICV3_GET_CLASS(s); + + if (kgc->parent_phases.hold) { + kgc->parent_phases.hold(obj, type); + } + + hvf_gicv3_put(s); +} + + +/* + * CPU interface registers of GIC needs to be reset on CPU reset. + * For the calling arm_gicv3_icc_reset() on CPU reset, we register + * below ARMCPRegInfo. As we reset the whole cpu interface under single + * register reset, we define only one register of CPU interface instead + * of defining all the registers. + */ +static const ARMCPRegInfo gicv3_cpuif_reginfo[] =3D { + { .name =3D "ICC_CTLR_EL1", .state =3D ARM_CP_STATE_BOTH, + .opc0 =3D 3, .opc1 =3D 0, .crn =3D 12, .crm =3D 12, .opc2 =3D 4, + /* + * If ARM_CP_NOP is used, resetfn is not called, + * So ARM_CP_NO_RAW is appropriate type. + */ + .type =3D ARM_CP_NO_RAW, + .access =3D PL1_RW, + .readfn =3D arm_cp_read_zero, + .writefn =3D arm_cp_write_ignore, + /* + * We hang the whole cpu interface reset routine off here + * rather than parcelling it out into one little function + * per register + */ + .resetfn =3D hvf_gicv3_icc_reset, + }, +}; + +static void hvf_gicv3_realize(DeviceState *dev, Error **errp) +{ + ERRP_GUARD(); + GICv3State *s =3D HVF_GICV3(dev); + HVFARMGICv3Class *kgc =3D HVF_GICV3_GET_CLASS(s); + int i; + + kgc->parent_realize(dev, errp); + if (*errp) { + return; + } + + if (s->revision !=3D 3) { + error_setg(errp, "unsupported GIC revision %d for platform GIC", + s->revision); + } + + if (s->security_extn) { + error_setg(errp, "the platform vGICv3 does not implement the " + "security extensions"); + return; + } + + if (s->nmi_support) { + error_setg(errp, "NMI is not supported with the platform GIC"); + return; + } + + if (s->nb_redist_regions > 1) { + error_setg(errp, "Multiple VGICv3 redistributor regions are not " + "supported by HVF"); + error_append_hint(errp, "A maximum of %d VCPUs can be used", + s->redist_region_count[0]); + return; + } + + gicv3_init_irqs_and_mmio(s, hvf_gicv3_set_irq, NULL); + + for (i =3D 0; i < s->num_cpu; i++) { + ARMCPU *cpu =3D ARM_CPU(qemu_get_cpu(i)); + + define_arm_cp_regs(cpu, gicv3_cpuif_reginfo); + } + + if (s->maint_irq && s->maint_irq !=3D HV_GIC_INT_MAINTENANCE) { + error_setg(errp, "vGIC maintenance IRQ mismatch with the hardcoded= one in HVF."); + return; + } +} + +static void hvf_gicv3_class_init(ObjectClass *klass, const void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); + ARMGICv3CommonClass *agcc =3D ARM_GICV3_COMMON_CLASS(klass); + HVFARMGICv3Class *kgc =3D HVF_GICV3_CLASS(klass); + + agcc->pre_save =3D hvf_gicv3_get; + agcc->post_load =3D hvf_gicv3_put; + + device_class_set_parent_realize(dc, hvf_gicv3_realize, + &kgc->parent_realize); + resettable_class_set_parent_phases(rc, NULL, hvf_gicv3_reset_hold, NUL= L, + &kgc->parent_phases); +} + +static const TypeInfo hvf_arm_gicv3_info =3D { + .name =3D TYPE_HVF_GICV3, + .parent =3D TYPE_ARM_GICV3_COMMON, + .instance_size =3D sizeof(GICv3State), + .class_init =3D hvf_gicv3_class_init, + .class_size =3D sizeof(HVFARMGICv3Class), +}; + +static void hvf_gicv3_register_types(void) +{ + type_register_static(&hvf_arm_gicv3_info); +} + +type_init(hvf_gicv3_register_types) + +#pragma clang diagnostic pop diff --git a/hw/intc/meson.build b/hw/intc/meson.build index 96742df090..b7baf8a0f6 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -42,6 +42,7 @@ arm_common_ss.add(when: 'CONFIG_ARM_GIC', if_true: files(= 'arm_gicv3_cpuif_common arm_common_ss.add(when: 'CONFIG_ARM_GICV3', if_true: files('arm_gicv3_cpui= f.c')) specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c'= )) specific_ss.add(when: ['CONFIG_WHPX', 'TARGET_AARCH64'], if_true: files('a= rm_gicv3_whpx.c')) +specific_ss.add(when: ['CONFIG_HVF', 'CONFIG_ARM_GICV3'], if_true: files('= arm_gicv3_hvf.c')) specific_ss.add(when: ['CONFIG_ARM_GIC_KVM', 'TARGET_AARCH64'], if_true: f= iles('arm_gicv3_kvm.c', 'arm_gicv3_its_kvm.c')) arm_common_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_nvic.c')) specific_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_irqmp.c')) diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3= _common.h index c55cf18120..9adcab0a0c 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -315,6 +315,7 @@ DECLARE_OBJ_CHECKERS(GICv3State, ARMGICv3CommonClass, =20 /* Types for GICv3 kernel-irqchip */ #define TYPE_WHPX_GICV3 "whpx-arm-gicv3" +#define TYPE_HVF_GICV3 "hvf-arm-gicv3" =20 struct ARMGICv3CommonClass { /*< private >*/ --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630587; cv=none; d=zohomail.com; s=zohoarc; b=FotbVVQjj6N9KG0mLuMlG+haR5J1JbcRqvlDeX/iIbMYFC8Dys+6La6G2sZYh0W+claLO0fHNGQQz0k8amclmyHd1o9D/AKdNjYIg52XNu2QVI/lZlLZdb0AhtbvTW1e4gXdyzW5pfiNv8PGZvWa2vlHW1haKh8rzDVkZ41NKmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630587; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=SAMGDXIEcobd83dl2s0gFfogcIChGUbSxz86yoSNez8=; b=g0iteh2LLr7tFNCaqgci/jitlNf7QB1Zg7UmBQXJP8CJcsrB1asw6hUDgxcQxYxvrEYCmaRYXAjh/DMi3J7GaNGHnQrLoth+fCRv1rs0YRPOhs2dPbSYSgH7PXz4Ktr9lVUMvHCktsiyLrAIatNWgR4hNOYl+YVyi8pWKNjwknc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630587854627.4461459134652; Fri, 1 May 2026 03:16:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuM-00045P-KR; Fri, 01 May 2026 06:15:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuC-00040l-LG for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:34 -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 1wIku9-0000Ba-M2 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:31 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-488ad135063so15070685e9.0 for ; Fri, 01 May 2026 03:15:29 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630528; x=1778235328; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SAMGDXIEcobd83dl2s0gFfogcIChGUbSxz86yoSNez8=; b=CTj1fa0do6+PP+/iqyyT2+v7tcd0DiVkEEaDzyYrcoSEZ2oX7loUu9oqQaFfh/Vp+i raGFIHz17Pi1Tt3nhOe0JjKcRkmhh2h7vwElWATPSSCeCS67FZ7bECYVIEzolzraHDd+ RZPDGipTo9KsNJHpTRIOe5FNVFwAHHzU3Hy9C5EI79AWCtttXcQ8bFqMVrSqFAPGYJYn aYZocIWqqXWbADBlfp6eNvVDpFdzNU2FCwBOIjE9Rbb/FZn0ioI875zgSwvP2Rga1v41 eb4d2HR0wYN3RnCOEyXkqtEWF9x7RBV4yzUN/iOXFN5aUsmiDViW6FUYiyXpg//Yjmo3 1yyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630528; x=1778235328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SAMGDXIEcobd83dl2s0gFfogcIChGUbSxz86yoSNez8=; b=mVdemR97n0TePp2OBRd2vnHewj9k2J5Svfatt9TfjqUu5YVUKKdQbtCtpOlRSgfu0c WdabsFGHeSrwCtYq7JUPIoOaX+7fznLur3tOBSYOfaFYn+RSVyRQnQuxrogpLkIKkKVp ouwA7Adw/uygJRwdzRWw0qtaa1Do19hShCi1pzMasgu20uu1attImi6T3iI9M1/0WmDK fopqAuc1ykuVK5l6CtNoQz9b8DjDiOPaE+aKBz4hCNH5HpRlZo6wxtzZmx4DhVSmvPut yGhR/11yz7wRfard7nue0R28atGkfb0o7mbztiZDOL92y+6Davonhg9O7XgBXK3SWnd0 tkRg== X-Gm-Message-State: AOJu0Yy68hBdQXgekHQK2DR4RsUNn9UDCTKpLOUbwkdk2h323NV3eFRR cKqbVUMGdbwI5aVdGrozXn/8TyOgHlsGc16HnFYsNOiGLAmfcZuaJNNS6K2VGHmB8LbgW5qgdxJ eg8En X-Gm-Gg: AeBDietz2qidf7GinvNb6EbLr1XZe4NEr+xYa7wNeHk7PeA8O3vN3Sn+/gVGJZcBQ/T NuXNTTkMg3VVmZnBW7PtNH2HNZGaX5Tg9QColZIEnf4W2HtMr72N22NqJbom0s7LGe/XnfV9r0R dpPoBPjqAmX7uxEaesIcaJd4S8dVur1npQubuVRxSRCjcaVVQHNlT+7EZBVp/giRb6nGdRBhcwl xfCWfpSBSLt3jsan82PgDE8leOYwkQxoJX3VSXMBvAsG4djXftu3KEkHN/1atZX+qRyfadGEltF 9erLj/hnq2489/mZWLjzhJoghQmC+lqrraE4TPuKyKdumc+dfh6sB/gPRckkelcS4vRmKoZX75c aRMid6HIhQp4xqhJ1E5U3OJYEe5xby2wJELzuDpSxdjm0sCNOGWQqLRRRH+QGNnvQZQU/TvFYhe ZenklU6uMaRQiS1hTtQKN4TnzQarJ8ilvEmqjx9sJPIGvKmTkMVUUhP7R6AGfR5J5FzT2YjS/YV KaI/3lIgRihaDuGd0RhvDjwYQGz/qqouoj3L6Qd6A== X-Received: by 2002:a05:600c:a40e:b0:488:fd7e:1063 with SMTP id 5b1f17b1804b1-48a84468524mr89980775e9.29.1777630528207; Fri, 01 May 2026 03:15:28 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/28] hw/intc: arm_gicv3_hvf: save/restore Apple GIC state Date: Fri, 1 May 2026 11:14:52 +0100 Message-ID: <20260501101505.3485916-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630589034154100 From: Mohamed Mediouni On HVF, some of the GIC state is in an opaque Apple-provided structure. Save/restore that state to be able to save/restore VMs that use the hardwar= e GIC. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis Message-id: 20260429190532.26538-3-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_common.c | 1 + hw/intc/arm_gicv3_hvf.c | 94 ++++++++++++++++++++++++++++-- hw/intc/arm_gicv3_hvf_stub.c | 25 ++++++++ hw/intc/meson.build | 1 + include/hw/intc/arm_gicv3_common.h | 3 + 5 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 hw/intc/arm_gicv3_hvf_stub.c diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index 9200671c7a..9c3fb2f4bf 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -305,6 +305,7 @@ static const VMStateDescription vmstate_gicv3 =3D { .subsections =3D (const VMStateDescription * const []) { &vmstate_gicv3_gicd_no_migration_shift_bug, &vmstate_gicv3_gicd_nmi, + &vmstate_gicv3_hvf, NULL } }; diff --git a/hw/intc/arm_gicv3_hvf.c b/hw/intc/arm_gicv3_hvf.c index 22f19d274d..ae881092ea 100644 --- a/hw/intc/arm_gicv3_hvf.c +++ b/hw/intc/arm_gicv3_hvf.c @@ -13,6 +13,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "system/runstate.h" +#include "migration/vmstate.h" #include "system/hvf.h" #include "system/hvf_int.h" #include "hvf_arm.h" @@ -37,8 +38,13 @@ struct HVFARMGICv3Class { =20 typedef struct HVFARMGICv3Class HVFARMGICv3Class; =20 -/* This is reusing the GICv3State typedef from ARM_GICV3_ITS_COMMON */ -DECLARE_OBJ_CHECKERS(GICv3State, HVFARMGICv3Class, +typedef struct HVFGICv3State { + GICv3State parent_obj; + uint32_t size; + void *state; +} HVFGICv3State; + +DECLARE_OBJ_CHECKERS(HVFGICv3State, HVFARMGICv3Class, HVF_GICV3, TYPE_HVF_GICV3); =20 /* @@ -668,7 +674,7 @@ static const ARMCPRegInfo gicv3_cpuif_reginfo[] =3D { static void hvf_gicv3_realize(DeviceState *dev, Error **errp) { ERRP_GUARD(); - GICv3State *s =3D HVF_GICV3(dev); + GICv3State *s =3D (GICv3State *)HVF_GICV3(dev); HVFARMGICv3Class *kgc =3D HVF_GICV3_GET_CLASS(s); int i; =20 @@ -715,6 +721,86 @@ static void hvf_gicv3_realize(DeviceState *dev, Error = **errp) } } =20 +/* + * HVF doesn't have a way to save the RDIST pending tables + * to guest memory, only to an opaque data structure. + */ +static bool gicv3_is_hvf(void *opaque) +{ + return hvf_enabled() && hvf_irqchip_in_kernel(); +} + +static int hvf_gic_opaque_state_save(void *opaque) +{ + HVFGICv3State *gic =3D opaque; + hv_gic_state_t gic_state; + hv_return_t err; + size_t size; + + gic_state =3D hv_gic_state_create(); + if (gic_state =3D=3D NULL) { + error_report("hvf: vgic: failed to create hv_gic_state_create."); + return 1; + } + err =3D hv_gic_state_get_size(gic_state, &size); + gic->size =3D size; + if (err !=3D HV_SUCCESS) { + error_report("hvf: vgic: failed to get GIC state size."); + os_release(gic_state); + return 1; + } + gic->state =3D g_malloc0(gic->size); + err =3D hv_gic_state_get_data(gic_state, gic->state); + if (err !=3D HV_SUCCESS) { + error_report("hvf: vgic: failed to get GIC state."); + os_release(gic_state); + return 1; + } + + os_release(gic_state); + return 0; +} + +static void hvf_gic_opaque_state_free(void *opaque) +{ + HVFGICv3State *gic =3D opaque; + free(gic->state); +} + +static int hvf_gic_opaque_state_restore(void *opaque, int version_id) +{ + HVFGICv3State *gic =3D opaque; + hv_return_t err; + if (!gic->size) { + return 0; + } + err =3D hv_gic_set_state(gic->state, gic->size); + if (err !=3D HV_SUCCESS) { + error_report("hvf: vgic: failed to restore GIC state."); + return 1; + } + return 0; +} + +const VMStateDescription vmstate_gicv3_hvf =3D { + .name =3D "arm_gicv3/hvf_gic_state", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D gicv3_is_hvf, + .pre_save =3D hvf_gic_opaque_state_save, + .post_save =3D hvf_gic_opaque_state_free, + .post_load =3D hvf_gic_opaque_state_restore, + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT32(size, HVFGICv3State), + VMSTATE_VBUFFER_ALLOC_UINT32(state, + HVFGICv3State, 0, 0, + size), + VMSTATE_END_OF_LIST() + }, +}; + static void hvf_gicv3_class_init(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); @@ -734,7 +820,7 @@ static void hvf_gicv3_class_init(ObjectClass *klass, co= nst void *data) static const TypeInfo hvf_arm_gicv3_info =3D { .name =3D TYPE_HVF_GICV3, .parent =3D TYPE_ARM_GICV3_COMMON, - .instance_size =3D sizeof(GICv3State), + .instance_size =3D sizeof(HVFGICv3State), .class_init =3D hvf_gicv3_class_init, .class_size =3D sizeof(HVFARMGICv3Class), }; diff --git a/hw/intc/arm_gicv3_hvf_stub.c b/hw/intc/arm_gicv3_hvf_stub.c new file mode 100644 index 0000000000..a587332c7c --- /dev/null +++ b/hw/intc/arm_gicv3_hvf_stub.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * ARM Generic Interrupt Controller using HVF platform support stub + * + * Copyright (c) 2026 Mohamed Mediouni + * + */ +#include "qemu/osdep.h" +#include "hw/intc/arm_gicv3_common.h" +#include "migration/vmstate.h" +#include "qemu/typedefs.h" + +static bool needed_never(void *opaque) +{ + return false; +} + +const VMStateDescription vmstate_gicv3_hvf =3D { + .name =3D "arm_gicv3/hvf_gic_state", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D needed_never, + .version_id =3D 1, + .minimum_version_id =3D 1, +}; diff --git a/hw/intc/meson.build b/hw/intc/meson.build index b7baf8a0f6..c6de2d9d00 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -43,6 +43,7 @@ arm_common_ss.add(when: 'CONFIG_ARM_GICV3', if_true: file= s('arm_gicv3_cpuif.c')) specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c'= )) specific_ss.add(when: ['CONFIG_WHPX', 'TARGET_AARCH64'], if_true: files('a= rm_gicv3_whpx.c')) specific_ss.add(when: ['CONFIG_HVF', 'CONFIG_ARM_GICV3'], if_true: files('= arm_gicv3_hvf.c')) +specific_ss.add(when: ['CONFIG_HVF', 'CONFIG_ARM_GICV3'], if_false: files(= 'arm_gicv3_hvf_stub.c')) specific_ss.add(when: ['CONFIG_ARM_GIC_KVM', 'TARGET_AARCH64'], if_true: f= iles('arm_gicv3_kvm.c', 'arm_gicv3_its_kvm.c')) arm_common_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_nvic.c')) specific_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_irqmp.c')) diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3= _common.h index 9adcab0a0c..03ab3e8f2f 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -339,4 +339,7 @@ void gicv3_init_irqs_and_mmio(GICv3State *s, qemu_irq_h= andler handler, */ const char *gicv3_class_name(void); =20 +/* HVF vGIC-specific state: stubbed out on a build with HVF disabled */ +extern const VMStateDescription vmstate_gicv3_hvf; + #endif --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630697; cv=none; d=zohomail.com; s=zohoarc; b=ftNRIXWmFkJyHzH54JeFl3nMf06iLQ6JnpygIv1GgYJ1SeOSu/XWSGp8MKXDxUoAngw+08TaySV90Zekh/zT314QH8eM1LK8oDOty/jZE3yfrc+HdE7A4oVzjPRcR1mxSDd2E7n1yElOSr7zmr+TDoJ4dX5N6raQl0iI4tXt/vQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630697; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=mucT9JkcgWcTEcTQ1cCWs8CPWwXJ9sxAy5FNvU9aZGA=; b=AsLTCuu9qgJQhDdOcnVJPf0iOwaiHASIhoMfq9gRA+HXRyVPCm1SAg0JstKeeajla+afci3E/mvGSNsPyYxdy4zOh3kCZPzmhUL+QjJi3xeMp+gz2D8JpHaBFIEm5P+qlLc68XTNVae17Z+iiHZ5oYQDWNHkYtHuX5DUR2xoIoo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630697518725.7508346099131; Fri, 1 May 2026 03:18:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuJ-00042f-4V; Fri, 01 May 2026 06:15:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuC-00040k-KW for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:32 -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 1wIkuA-0000Bk-Fj for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:32 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488af9fdaa7so10169065e9.1 for ; Fri, 01 May 2026 03:15:30 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630529; x=1778235329; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mucT9JkcgWcTEcTQ1cCWs8CPWwXJ9sxAy5FNvU9aZGA=; b=LR0s5ATwmb2OEYvS/cibv9FcythORWohsL5cPJi4fv41rUU0NiT99uJmbF0fvp4ukv JCbHhdb+YVGNRG9+Ijcn3aV67kfAXuTISzykO7Rb6dTcd5tdz4cOrQH8Mbch74b+CK7K M8oRFZZoI2UEHmFhpZdXKc1tSjq8DlUxZ9yj55Q1qJwI1iWTHfigU7VcVhig90PHIPGk OvqrPLuAYVP2Q+fDXfo5VGTKFYyNStKADjUhgcJBNvKYTgIqnlH3qWLTXg2xi7H7xLyn qufNOCJHY9lm2qi/vNUngTKKsB5PF6AK8OZVZ43TvqTOr8tZb8mbm35XiBy7Gqmb5cV/ LT2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630529; x=1778235329; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=mucT9JkcgWcTEcTQ1cCWs8CPWwXJ9sxAy5FNvU9aZGA=; b=HKzxJBgWEtEUyDMnpZ2zcbl+nhOBaN8RGz/RNBTj29kVK5DG0KBTNRDBh6Mo4XXP71 xZt6GbM0vAw2V7h9eo9f8eQe/84n0HLrxRu0ZrjDxN1x3zBjvucAhNigs6yCWbd4mhju 5o5Pz+1mWxaypZI441KDA9RQjFkilBpJHpTPf/3tc75D0V2Ob/sBskZrrE0Fy/xvCHfp hOuF3g7xtL7ZnrrD7NRiRFurIO9EZvmUYMzRIoJA3QyxDqaOAqtTKoDt+cT6RvlKLVTo sVEFJxm1kQcaVGq0NOqIkD6mETLoDYWh2+KBmQZJFtdFH9XW0dWAVfO43NyzjNvG/tOa FgRA== X-Gm-Message-State: AOJu0YxL78St5vm9mS0YI00nbQ3aMI/w07iRQGyiDRl4WOEJxwkxZ9zF jYbmkmBZgrQINVPd3eoMwJCcCYmhDVdcGMqHtILan9IDt759RK8UIR3tS/V1lt3zzdnJR9pzGs1 Nk9p0 X-Gm-Gg: AeBDievxUUV1sc+FYahQ66q9kfhtRmPzrt1LkesE/W18IjLpSfW8lYvLlN7GVHXTdOe nN5GRzSq84lFFQzAOjOoF1a3HIyGu64LKWs+2pO6VAIGzV6FdbaQyPKgm1TsujaZZP0cftvK0cR tHJOUga3VVfVjCvA1p30Mjmh5OZtASoflOMXkvRjRZikJgc5M3FY7wOoa5SzlACPwH3p1q2esmz YM2vpUDz+b7SS+rG80eeHylJP55X1NGk9ag1rYOy1zTi+34Oxxj/Iwy6nGXcj2fiZVyKFti9IJC YoafKkgvbfeOtFFpCcrvkrV2oQR83JVh1RFZaxrFyYAF+EK3VU3L+WJrpDZ1K2Bs00YcAqcjYgg 6zLxFFh2syZK+NDfibp3DEOJ1Le56nFjsAOP26Id7fxP+fS1I+0sVRPZWoiNjMKShSknde/ssOx bzQgZOZCbpyVupNzdrCQFW0OoOrxCLGaaXg9SrbeuBYdwpbATIGX9F3lubQg3g0E9Pp0B4Y2ThE deZ6sE/55+rojPyn3U2xQ4d0Y3w/aCC9c9lyZBeTGh9fZAvS0KX X-Received: by 2002:a05:600c:6285:b0:488:a797:f0ac with SMTP id 5b1f17b1804b1-48a84485623mr113448415e9.28.1777630529050; Fri, 01 May 2026 03:15:29 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/28] accel, hw/arm, include/system/hvf: infrastructure changes for HVF vGIC Date: Fri, 1 May 2026 11:14:53 +0100 Message-ID: <20260501101505.3485916-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630698654154100 Content-Type: text/plain; charset="utf-8" From: Mohamed Mediouni Misc changes needed for HVF vGIC enablement. Note: x86_64 macOS exposes interrupt controller virtualisation since macOS = 12. Keeping an #ifdef here in case we end up supporting that... However, given that x86_64 macOS is on its way out, it'll probably (?) not be supported in QEMU. Signed-off-by: Mohamed Mediouni Message-id: 20260429190532.26538-4-mohamed@unpredictable.fr Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- accel/hvf/hvf-all.c | 46 ++++++++++++++++++++++++++++++++++++++ accel/stubs/hvf-stub.c | 1 + hw/arm/virt.c | 23 +++++++++++++++---- hw/intc/arm_gicv3_common.c | 3 +++ include/system/hvf.h | 3 +++ system/vl.c | 2 ++ 6 files changed, 74 insertions(+), 4 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 5f357c6d19..add265e0c8 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -10,6 +10,8 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/error.h" +#include "qapi/qapi-visit-common.h" #include "accel/accel-ops.h" #include "exec/cpu-common.h" #include "system/address-spaces.h" @@ -21,6 +23,7 @@ #include "trace.h" =20 bool hvf_allowed; +bool hvf_kernel_irqchip; =20 const char *hvf_return_string(hv_return_t ret) { @@ -216,6 +219,43 @@ static int hvf_gdbstub_sstep_flags(AccelState *as) return SSTEP_ENABLE | SSTEP_NOIRQ; } =20 +static void hvf_set_kernel_irqchip(Object *obj, Visitor *v, + const char *name, void *opaque, + Error **errp) +{ + OnOffSplit mode; + if (!visit_type_OnOffSplit(v, name, &mode, errp)) { + return; + } + + switch (mode) { + case ON_OFF_SPLIT_ON: +#ifdef HOST_X86_64 + /* macOS 12 onwards exposes an HVF virtual APIC. */ + error_setg(errp, "HVF: kernel irqchip is not currently implemented= for x86."); + break; +#else + hvf_kernel_irqchip =3D true; + break; +#endif + + case ON_OFF_SPLIT_OFF: + hvf_kernel_irqchip =3D false; + break; + + case ON_OFF_SPLIT_SPLIT: + error_setg(errp, "HVF: split irqchip is not supported on HVF."); + break; + + default: + /* + * The value was checked in visit_type_OnOffSplit() above. If + * we get here, then something is wrong in QEMU. + */ + abort(); + } +} + static void hvf_accel_class_init(ObjectClass *oc, const void *data) { AccelClass *ac =3D ACCEL_CLASS(oc); @@ -223,6 +263,12 @@ static void hvf_accel_class_init(ObjectClass *oc, cons= t void *data) ac->init_machine =3D hvf_accel_init; ac->allowed =3D &hvf_allowed; ac->gdbstub_supported_sstep_flags =3D hvf_gdbstub_sstep_flags; + hvf_kernel_irqchip =3D false; + object_class_property_add(oc, "kernel-irqchip", "on|off|split", + NULL, hvf_set_kernel_irqchip, + NULL, NULL); + object_class_property_set_description(oc, "kernel-irqchip", + "Configure HVF irqchip"); } =20 static const TypeInfo hvf_accel_type =3D { diff --git a/accel/stubs/hvf-stub.c b/accel/stubs/hvf-stub.c index 42eadc5ca9..6bd08759ba 100644 --- a/accel/stubs/hvf-stub.c +++ b/accel/stubs/hvf-stub.c @@ -10,3 +10,4 @@ #include "system/hvf.h" =20 bool hvf_allowed; +bool hvf_kernel_irqchip; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 77891f0820..47400214a2 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1163,7 +1163,7 @@ static void create_gic(VirtMachineState *vms, MemoryR= egion *mem) * interrupts; there are always 32 of the former (mandated by GIC spec= ). */ qdev_prop_set_uint32(vms->gic, "num-irq", NUM_IRQS + 32); - if (!kvm_irqchip_in_kernel()) { + if (!kvm_irqchip_in_kernel() && !hvf_irqchip_in_kernel()) { qdev_prop_set_bit(vms->gic, "has-security-extensions", vms->secure= ); } =20 @@ -1186,7 +1186,8 @@ static void create_gic(VirtMachineState *vms, MemoryR= egion *mem) qdev_prop_set_array(vms->gic, "redist-region-count", redist_region_count); =20 - if (!kvm_irqchip_in_kernel()) { + if (!kvm_irqchip_in_kernel() && + !(hvf_enabled() && hvf_irqchip_in_kernel())) { if (vms->tcg_its) { object_property_set_link(OBJECT(vms->gic), "sysmem", OBJECT(mem), &error_fatal); @@ -1197,7 +1198,7 @@ static void create_gic(VirtMachineState *vms, MemoryR= egion *mem) ARCH_GIC_MAINT_IRQ); } } else { - if (!kvm_irqchip_in_kernel()) { + if (!kvm_irqchip_in_kernel() && !hvf_irqchip_in_kernel()) { qdev_prop_set_bit(vms->gic, "has-virtualization-extensions", vms->virt); } @@ -2444,7 +2445,15 @@ static void finalize_gic_version(VirtMachineState *v= ms) accel_name =3D "KVM with kernel-irqchip=3Doff"; } else if (whpx_enabled()) { gics_supported |=3D VIRT_GIC_VERSION_3_MASK; - } else if (tcg_enabled() || hvf_enabled() || qtest_enabled()) { + } else if (hvf_enabled()) { + if (!hvf_irqchip_in_kernel()) { + gics_supported |=3D VIRT_GIC_VERSION_2_MASK; + } + /* Hypervisor.framework doesn't expose EL2<->1 transition notifier= s */ + if (!(!hvf_irqchip_in_kernel() && vms->virt)) { + gics_supported |=3D VIRT_GIC_VERSION_3_MASK; + } + } else if (tcg_enabled() || qtest_enabled()) { gics_supported |=3D VIRT_GIC_VERSION_2_MASK; if (module_object_class_by_name("arm-gicv3")) { gics_supported |=3D VIRT_GIC_VERSION_3_MASK; @@ -2486,6 +2495,8 @@ static void finalize_msi_controller(VirtMachineState = *vms) vms->msi_controller =3D VIRT_MSI_CTRL_GICV2M; } else if (whpx_enabled()) { vms->msi_controller =3D VIRT_MSI_CTRL_GICV2M; + } else if (hvf_enabled() && hvf_irqchip_in_kernel()) { + vms->msi_controller =3D VIRT_MSI_CTRL_GICV2M; } else { vms->msi_controller =3D VIRT_MSI_CTRL_ITS; } @@ -2505,6 +2516,10 @@ static void finalize_msi_controller(VirtMachineState= *vms) error_report("ITS not supported on WHPX."); exit(1); } + if (hvf_enabled() && hvf_irqchip_in_kernel()) { + error_report("ITS not supported on HVF when using the hardware= vGIC."); + exit(1); + } } =20 assert(vms->msi_controller !=3D VIRT_MSI_CTRL_AUTO); diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index 9c3fb2f4bf..f7ba74e6d5 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -33,6 +33,7 @@ #include "hw/arm/linux-boot-if.h" #include "system/kvm.h" #include "system/whpx.h" +#include "system/hvf.h" =20 =20 static void gicv3_gicd_no_migration_shift_bug_post_load(GICv3State *cs) @@ -659,6 +660,8 @@ const char *gicv3_class_name(void) return "kvm-arm-gicv3"; } else if (whpx_enabled()) { return TYPE_WHPX_GICV3; + } else if (hvf_enabled() && hvf_irqchip_in_kernel()) { + return TYPE_HVF_GICV3; } else { if (kvm_enabled()) { error_report("Userspace GICv3 is not supported with KVM"); diff --git a/include/system/hvf.h b/include/system/hvf.h index d3dcf088b3..dc8da85979 100644 --- a/include/system/hvf.h +++ b/include/system/hvf.h @@ -26,8 +26,11 @@ #ifdef CONFIG_HVF_IS_POSSIBLE extern bool hvf_allowed; #define hvf_enabled() (hvf_allowed) +extern bool hvf_kernel_irqchip; +#define hvf_irqchip_in_kernel() (hvf_kernel_irqchip) #else /* !CONFIG_HVF_IS_POSSIBLE */ #define hvf_enabled() 0 +#define hvf_irqchip_in_kernel() 0 #endif /* !CONFIG_HVF_IS_POSSIBLE */ =20 #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf") diff --git a/system/vl.c b/system/vl.c index 0e1fc217b4..516ed7890b 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1781,6 +1781,8 @@ static void qemu_apply_legacy_machine_options(QDict *= qdict) false); object_register_sugar_prop(ACCEL_CLASS_NAME("whpx"), "kernel-irqch= ip", value, false); + object_register_sugar_prop(ACCEL_CLASS_NAME("hvf"), "kernel-irqchi= p", value, + false); qdict_del(qdict, "kernel-irqchip"); } =20 --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630596; cv=none; d=zohomail.com; s=zohoarc; b=a5XC9o0v9j0OKdt0C9Iru6vwVJzxn2yNYki5xy7/m1K0BNLo3YfNWF0cDWJ0xtGOgR7lFUgIrPHhj5YyAxc8yh2Y6qwKN57NFe4M8m6JNeGXyDMUYMX/JdjKu7WAUm8XjAqKzHUOLmOByqWdOvYdVBsUSUZ3k9Hd09e5gdN6aK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630596; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=fMdZfrrkzecJWCuD5PoaO2/5BTBAqtW4a8Hufi0KypM=; b=YqByt0ggNkGYA/xFVmdF5M6jAgXI62gFxnqRSpu/82hOhe7AjKIOjyT4l+objcUIL1nqPhnhGfmUwD68Jjs8W92MvDux/IbclG154eSmfnNpkIzNhHQuKqz9l0GJM+urarR4QuEdp24ewiv2hIqn5ow3qpZTRxS96DzQs8vVRz4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630596609465.3317770506884; Fri, 1 May 2026 03:16:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuM-00045h-U6; Fri, 01 May 2026 06:15:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuF-000416-C8 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:36 -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 1wIkuB-0000C6-Ft for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:33 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so29040645e9.2 for ; Fri, 01 May 2026 03:15:31 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630530; x=1778235330; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fMdZfrrkzecJWCuD5PoaO2/5BTBAqtW4a8Hufi0KypM=; b=I1GvvExkjV+ZCD4nz7qgbEzVpUUMZVKrCY1PjcaEfOHfdOW9nQbrw2JdvnGUWj2QmC POpSB7Xf+ohWhdZjVsHfVxUvBXGI47z/u2xo7dnr0qanmO2oy1+PAVrq/87pexKvnrSS yrQG3ejtWuRlgFfmy7U84U3q+oD97l/uokHojUe+rBt8Cp0VpIe3yl1f6RsWVUHnyhMW ubCP4fql5Q4NAQr+zttbvc/nIY8umdWoj7f/ht2g5MDtwn/FvwnTkNQY+vMj8b/Leufk k4UyqpUDsmZ/u0T/5gc6y1VlP7yVvBbjd6AawQipmnPpsd6NjvaOA2jR4TM6+ms8B1EP VTFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630530; x=1778235330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=fMdZfrrkzecJWCuD5PoaO2/5BTBAqtW4a8Hufi0KypM=; b=qg/txRrnrWNJxGVI7PQONKi+TnJOuN5zpWDFy+p12wL/M8hlzbRc77HkJLV4llnoYZ gJ6X856IA5Kz5NPs33/NlNT1qyOOpqwChvSxxBBEndKQgatnUmymyZPVFXVE9ZdbwebQ mCTZXmZqFRZhaPuFamqUl/CgeRBOnhNDBggjkhSWot6oWyf/5fYmCSFL7Afcme8eUmfG nJsCeaSK0hNYKtzRTalSbfM2avr+IWKKprai2cWSWZMil8WWzruF1R68a4Pns4tetiwd uuc/VDi/Jg5Wno3HWxYVlwxjTP5vjTdqChpoKAA6kPAY9oWF4LQbZx3zNKlksGAKy5ai hWHg== X-Gm-Message-State: AOJu0Yx10sWK9Fru2LU01LxdlLoRqaRewGMvV+RNJ2+0Cb9nQP812eAn FQ6+Kvbr8VJVq6vXpfmX6r09ZHrKQfvSJEF5eLLNKbahUAg9ukyrod/q5NL2vGw5Vyedeey4HG3 v/142 X-Gm-Gg: AeBDietHCwFOPG652V3UryEKHztTC6eqVT1swzFTLApVHLg+Fx5+66Y6OopfikXIQKo dvM7e8EIlCM7gHzoqQOvt634f9yUWJM/QQlfK62zwyzz/NJGhM0Cs13+iE8VfOzXgBDPEZ6YAI6 8Ma8nMV+3wVAKC+f6CAkmoXlKApJ3CteomMxV4EDJRq4YFGzc4KfD/ozfGv4B1F3RcYJMxPdrcL 9roxvQRUuWIlv9u58+/TC3X/PnIaKrMhg4DwVgJL4Ojt3M8e8Y2u+qbBnO533HHDB1HSwUTMJp0 nAaqoM/1OLJPHUNj4jKgmrkTlci/UAAYsdA9qu1ocmKjBTR2v9MUD88qEhk3gcwrhxCsz8ZnSlw Zvr6GUgetsMqoKodlgufEp80DOz83BWejXzEi3nFBOL9Uu9XFbfXvyZxvZrcPWdjHmdA4J9VJ8f eCvDRkKYv+55aoqBiFWdwxMs/c9B5R/w3yWypol72CDmM1HO3MPLB3TAoQfCKZLUtsIumS1bU31 sJ1474tWyX/tQ1WcXSDJFwigOUN9ITB1dKsHZsp/T5yL+cw0b2+ X-Received: by 2002:a05:600c:699b:b0:488:ab26:8fe0 with SMTP id 5b1f17b1804b1-48a8446d81emr112810375e9.15.1777630529991; Fri, 01 May 2026 03:15:29 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/28] target/arm: hvf: instantiate GIC early Date: Fri, 1 May 2026 11:14:54 +0100 Message-ID: <20260501101505.3485916-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630597289158500 From: Mohamed Mediouni While figuring out a better spot for it, put it in hv_arch_vm_create(). After hv_vcpu_create is documented as too late, and deferring vCPU initialization isn't enough either. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-5-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index ef4c3671e9..a028c99e24 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1230,6 +1230,28 @@ hv_return_t hvf_arch_vm_create(MachineState *ms, uin= t32_t pa_range) chosen_ipa_bit_size =3D pa_range; =20 ret =3D hv_vm_create(config); + if (hvf_irqchip_in_kernel()) { + if (__builtin_available(macOS 15.0, *)) { + /* + * Instantiate GIC. + * This must be done prior to the creation of any vCPU + * but past hv_vm_create() + */ + hv_gic_config_t cfg =3D hv_gic_config_create(); + hv_gic_config_set_distributor_base(cfg, 0x08000000); + hv_gic_config_set_redistributor_base(cfg, 0x080A0000); + ret =3D hv_gic_create(cfg); + if (ret !=3D HV_SUCCESS) { + error_report("error creating platform VGIC"); + goto cleanup; + } + os_release(cfg); + } else { + error_report("HVF: Unsupported OS for platform vGIC."); + ret =3D HV_UNSUPPORTED; + goto cleanup; + } + } =20 cleanup: os_release(config); --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630661; cv=none; d=zohomail.com; s=zohoarc; b=XI6pg5zYOvZ9xUp4DFzKcHEZeS8+0rpn3VPSv8afgdB0qTMAO9CrL76XSsq0YSnO5PnNR5fCQc8P/PswuI7jp6HnbtHFNbxFu6kcg85y2fysUREgZNP3qfm8Hv3bYqYuDtuAm9iGkgXU8luQ5ocKP/TwgoSTKwEUFFGhB4dLOzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630661; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Lb+Hv2gpBFCMBdugccmdMigUPrnD4ShbuSoaq16Of18=; b=Eem2CZh7vJ3uj6uL42GaplZKoB3aaxkrYOCCvVkj+k+SuijaE+BRNEhN2L+WlGKEFyalrUnD/2TYWec/AGqDtjd92nWkJUngFp1NpAkqkZ6rPUqYswdx4Q1cA5NYBbm0Kz85+9XKdSn139lYnfzCBOguK78D3S3dMaZksTefytE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630661494852.1422231835033; Fri, 1 May 2026 03:17:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuO-000468-Ps; Fri, 01 May 2026 06:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuF-000417-Cj for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:36 -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 1wIkuC-0000CM-C0 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:34 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-48984d29fe3so26212475e9.0 for ; Fri, 01 May 2026 03:15:31 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630531; x=1778235331; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Lb+Hv2gpBFCMBdugccmdMigUPrnD4ShbuSoaq16Of18=; b=EHPjQVOXc0lhVi//RRcY6I0UNkISzQxGzSAqhe55eeYiP5cwyv3PfgKj7IhMevkalG YT90vqAcHYq+OSc4j27+O+xe7v+IbICGHb1ZyeLE02QcKRCpqAoeTR/bAmh8kd7Dbans JYglRBJB+XeuJJOmCcowfUpEFnaKThiWj9EooEALvX8ozNKPWNB4cipBJvZzoKRGrL0u wvVABi9YnKx9Dnd2/wefHHYylTgxSm21L2tnaH+NES9R/3mz5ldbvsPWHbjhYHw6B1yV xvV+V6qX+94P9mrO1l7SJMwJwuzN/nA60UYr5E7XWWuPFgO7cDEwb2FPK5GkWhmTEg+O N9JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630531; x=1778235331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Lb+Hv2gpBFCMBdugccmdMigUPrnD4ShbuSoaq16Of18=; b=Nvftv1WGCbK3Y9OxxqWAo3OLK9whRvT3FqE8QA9bkUqJoTQjjvcjk4nvejrh+eTViE fcvjLdX4G4QVvLGoMlOjDkVxh2myJ4M6NAWkO/D1uU2C2nu7tutRarJJvOpw4bgaaJKS aGpKCpanUh2WXIpeEvcdWkRb4YsYjV89cxZx4Srmabs+2ROg6wElWDsIxb6L+tV7cFiX mqEKK7XBuvIf7yqX+bbVywFs176S5kfQLXhwIwqx8ctGQ2i4AW6XyEw6neVlgU344t3T P67KeqGad0Ke5EIOyytxkEbuDHirlUkoDeRG8hRmXmILJ+4HyPA0cy8ItHwvQHT69jDg 6TFg== X-Gm-Message-State: AOJu0YxH7SAgUnkOPflqLT685jiCzQi0T+GxAag/HF41rmv59gh8Hv4I HrFECTZOIjmDQ8c56kFNDKXPn+vpPOvG+jTYcGDkgeRV+RwqAftKuM2BnEbsKMr/syfGU+9fDhP OPasU X-Gm-Gg: AeBDietSLYH/HONXSf0tarajmYco1O7zik3bjDzEN/06juhmFuOahGbPdT/WjEf8ZSy ggxLHe3Xt2PzUhl6bWqy5UtZ0tkROPUv7U9O2vDwPJ+UvuNQy6H3QD0l8WacPJkUcuzNupddzBq MqctBUmvv+OTRUrf2BZ4akkSYL+ClK65Q+k22qDkrCCNvKGucfdoake1MduQmbZ+7d/mgW4k/x6 x7EyWFhmLGi+9851YRb9jYRHaa2BG260NHUoj6yESdxRBz6WRD5xFyJd+uXgm6OyuoRPR/OmN7T Lz1PpBMprY6qCxyz8lRgziZYANvNjWcASkprCTpN+stk0Pr1Yv0YvcOjRfLdxvTFLSKP1rNczA0 QrquEjTlVju1/FTtn5sfuqeydVZaTmu/Y5tw4Lq0BCdfju5LwTCJ/FwU19epcUoffOZmpX4ixJJ Fg41Hit1effc4vzlBqh7VS8JcYMoogUoa8lW6gQHSym0sstG4s/vPqMfZ3VDqOXjVRAXJchk1d+ RRsC9HrhfPMWz88n7SStaTRSACOMiXiT/ZeRSTRyQ== X-Received: by 2002:a05:600c:1907:b0:488:c683:be89 with SMTP id 5b1f17b1804b1-48a83d6ee9dmr110383975e9.9.1777630530969; Fri, 01 May 2026 03:15:30 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/28] hw/arm, target/arm: nested virtualisation on HVF Date: Fri, 1 May 2026 11:14:55 +0100 Message-ID: <20260501101505.3485916-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630662168154100 Content-Type: text/plain; charset="utf-8" From: Mohamed Mediouni Add hvf_arm_el2_supported for querying EL2 availability. An hvf_nested_virt_enable workaround is added as nested virt has to be enabled early on HVF. And adds hvf_nested_virt_enabled. Signed-off-by: Mohamed Mediouni Reviewed-by: Manos Pitsidianakis Message-id: 20260429190532.26538-6-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- accel/hvf/hvf-all.c | 6 ++++++ accel/stubs/hvf-stub.c | 11 +++++++++++ hw/arm/virt.c | 5 +++++ include/system/hvf.h | 5 +++++ target/arm/hvf/hvf.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 67 insertions(+), 2 deletions(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index add265e0c8..da29aa3aa3 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -24,6 +24,12 @@ =20 bool hvf_allowed; bool hvf_kernel_irqchip; +bool hvf_nested_virt; + +void hvf_nested_virt_enable(bool nested_virt) +{ + hvf_nested_virt =3D nested_virt; +} =20 const char *hvf_return_string(hv_return_t ret) { diff --git a/accel/stubs/hvf-stub.c b/accel/stubs/hvf-stub.c index 6bd08759ba..7643e8c5f5 100644 --- a/accel/stubs/hvf-stub.c +++ b/accel/stubs/hvf-stub.c @@ -11,3 +11,14 @@ =20 bool hvf_allowed; bool hvf_kernel_irqchip; +bool hvf_nested_virt; + +void hvf_nested_virt_enable(bool nested_virt) +{ + /* + * This is called unconditionally from hw/arm/virt.c + * because we don't know if HVF is going to be used + * as that step of initialisation happens later. + * As such, do nothing here instead of marking as unreachable. + */ +} diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 47400214a2..ca50411020 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2987,6 +2987,11 @@ static void virt_set_virt(Object *obj, bool value, E= rror **errp) VirtMachineState *vms =3D VIRT_MACHINE(obj); =20 vms->virt =3D value; + /* + * At this point, HVF is not initialised yet. + * However, it needs to know if nested virt is enabled at init time. + */ + hvf_nested_virt_enable(value); } =20 static bool virt_get_highmem(Object *obj, Error **errp) diff --git a/include/system/hvf.h b/include/system/hvf.h index dc8da85979..a961df8b95 100644 --- a/include/system/hvf.h +++ b/include/system/hvf.h @@ -28,11 +28,16 @@ extern bool hvf_allowed; #define hvf_enabled() (hvf_allowed) extern bool hvf_kernel_irqchip; #define hvf_irqchip_in_kernel() (hvf_kernel_irqchip) +extern bool hvf_nested_virt; +#define hvf_nested_virt_enabled() (hvf_nested_virt) #else /* !CONFIG_HVF_IS_POSSIBLE */ #define hvf_enabled() 0 #define hvf_irqchip_in_kernel() 0 +#define hvf_nested_virt_enabled() 0 #endif /* !CONFIG_HVF_IS_POSSIBLE */ =20 +void hvf_nested_virt_enable(bool nested_virt); + #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf") =20 typedef struct HVFState HVFState; diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index a028c99e24..09f41094e5 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -27,6 +27,7 @@ #include "system/memory.h" #include "hw/core/boards.h" #include "hw/core/irq.h" +#include "hw/arm/virt.h" #include "qemu/main-loop.h" #include "system/cpus.h" #include "arm-powerctl.h" @@ -1103,6 +1104,10 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPU= Features *ahcf) (1ULL << ARM_FEATURE_PMU) | (1ULL << ARM_FEATURE_GENERIC_TIMER); =20 + if (hvf_nested_virt_enabled()) { + ahcf->features |=3D 1ULL << ARM_FEATURE_EL2; + } + for (i =3D 0; i < ARRAY_SIZE(regs); i++) { r |=3D hv_vcpu_config_get_feature_reg(config, regs[i].reg, &host_isar.idregs[regs[i].inde= x]); @@ -1218,6 +1223,19 @@ void hvf_arch_vcpu_destroy(CPUState *cpu) assert_hvf_ok(ret); } =20 +static bool hvf_arm_el2_supported(void) +{ + bool is_nested_virt_supported; + if (__builtin_available(macOS 15.0, *)) { + hv_return_t ret =3D hv_vm_config_get_el2_supported(&is_nested_virt= _supported); + assert_hvf_ok(ret); + } else { + return false; + } + return is_nested_virt_supported; +} + + hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range) { hv_return_t ret; @@ -1229,6 +1247,20 @@ hv_return_t hvf_arch_vm_create(MachineState *ms, uin= t32_t pa_range) } chosen_ipa_bit_size =3D pa_range; =20 + if (__builtin_available(macOS 15.0, *)) { + if (hvf_nested_virt_enabled()) { + if (!hvf_arm_el2_supported()) { + error_report("Nested virtualization not supported on this = system."); + goto cleanup; + } + ret =3D hv_vm_config_set_el2_enabled(config, true); + if (ret !=3D HV_SUCCESS) { + error_report("Failed to enable nested virtualization."); + goto cleanup; + } + } + } + ret =3D hv_vm_create(config); if (hvf_irqchip_in_kernel()) { if (__builtin_available(macOS 15.0, *)) { @@ -1420,6 +1452,13 @@ static void hvf_psci_cpu_off(ARMCPU *arm_cpu) assert(ret =3D=3D QEMU_ARM_POWERCTL_RET_SUCCESS); } =20 +static int hvf_psci_get_target_el(void) +{ + if (hvf_nested_virt_enabled()) { + return 2; + } + return 1; +} /* * Handle a PSCI call. * @@ -1441,7 +1480,6 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *= excp_ret) CPUState *target_cpu_state; ARMCPU *target_cpu; uint64_t entry; - int target_el =3D 1; int32_t ret =3D 0; =20 trace_arm_psci_call(param[0], param[1], param[2], param[3], @@ -1495,7 +1533,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *= excp_ret) entry =3D param[2]; context_id =3D param[3]; ret =3D arm_set_cpu_on(mpidr, entry, context_id, - target_el, target_aarch64); + hvf_psci_get_target_el(), target_aarch64); break; case QEMU_PSCI_0_1_FN_CPU_OFF: case QEMU_PSCI_0_2_FN_CPU_OFF: --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630675; cv=none; d=zohomail.com; s=zohoarc; b=U4MxTC5sw0iM24Zt+M6Wn5a8IfQPukZqnREB7C2Z8T7yEjjSWUCS9+YZ4nI4+P9S4g5iKKWvQLT3vHQ4bNhktkXn2YZlY6ZSu6HF+1EZY8r+wFKEIZ2zvSF1ylA+oeDUkKhOHPk/VxMA1zje5hbwDQT5/tXmT7NGm3bmDAZwKCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630675; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=2Jd4Bv7gDeHF4Ecup4fCdp7ybRRPNHud/bLTRm6ZvJg=; b=HeM5IWh0V3PpcFPt1K6P9WKZYSwVK0Hz+j7poE13S+fjls4J8/nW63UGJlV2+iFX+DHnuF0OvDYi7s74RtjmgJWt35Ye3hQFCBNYLCZAwHvknj7TxnvuuNXTjkBATZbYmpKyhFDopOA18s1sOw2zUuCHAEvnZxMfqpbMIqFw2WE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630675014401.476453801262; Fri, 1 May 2026 03:17:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuN-00045l-C0; Fri, 01 May 2026 06:15:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuG-00041C-08 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:36 -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 1wIkuD-0000CT-9w for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:35 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-483487335c2so19479185e9.2 for ; Fri, 01 May 2026 03:15:32 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630532; x=1778235332; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2Jd4Bv7gDeHF4Ecup4fCdp7ybRRPNHud/bLTRm6ZvJg=; b=s8SdvKWv1EJqiJLs1M4/TtKgmdbIpJXGDrQnP0nQod0LJMv8bIXchuKxE9ASw9b3Br +wMsIt+bMCi7Fc2LWKj4YDK7J0vMrT7bqnsR8QHp94LGzAMriYjN4g0pB5lNi/y7q6If /X8QG+BQnPvJJ5bqz1eM+2cf5dOqBMdL1/6fBcVUwxoT7oPMLL39dWOb/zeDwnDiOJf8 gO79eZdGhW4bqUsOXaJC1Sa9S51eO7XzaGdoEq8GV/f+KIYfKYHb57GlSZ6Usp1eeBgg 7r1BI54lX0oLT9i1vTLl5jyS9OWASGF5T6wq5qKj+sL0n57nRDKMEsIPw+6GSpYjOHr4 z1xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630532; x=1778235332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2Jd4Bv7gDeHF4Ecup4fCdp7ybRRPNHud/bLTRm6ZvJg=; b=Kzi3BLb4NPz/Tk/Dx4ZiX0WAxnpW0X5KBH6ofgFr9dU+L60Oag5GysFLvz+sbBZGOb HCg+uYBwHrs7SBx8p48kfR0Y3PudVwjbP6U+KHRqU32AAV2H3FTEfiKGt2ne6R04+25J pkpl2G2f9o6qSTt34q+9rU+fonBOWxIJGsYuuLb1bhe35qEhLPnlX+kv0yFHILJijZGO /a7DalFBohV1r9pgI1iudMn1/Xy3ZPuIWvnuNAyLlXLptX72+5YRF8qYz3MMFt87CVKz PlAY7tVzTO8hASrC79PeeoZorVmM+y6T2EZlupLxe66ajNzCkkOgvr63dGh6sVCGAmIi NvAA== X-Gm-Message-State: AOJu0YwEQneTHcCjIMosypmhE9uRlmWgVRf61zzingjpZx7OgEzXBoaS tFtTfDVjgbJxBjYvq3WQbZkQ96wgJFPGELmyz/PwwzPpUEG9z66oUHiD1RcXz/vc0WXbeO/wpPT WsJwp X-Gm-Gg: AeBDiev30Vhzax5BX2d7XDXFHIic2LRErDE3ABzEDLhXumxm3T31i/xfikyyBCHnX5C 7WDPyYgbF3zrgc/uAcF/l5WVsSFMwoTQUO94xU3qowsaNc/FimQuutDwrgCNGW0OZYugTVy7zAL hAClA/qaFJclanHqOUV/pNRBAJB6iBMszrFNTd0uuOaEWsliJeBDtT8dTmsxJohIGzab/4hb+H3 M2TKaTAL3TEKRTJk+hdIZxRx+Y6aOsVQa/d/WdqEctffVTV6fyFE7brHP2FhH/Dr5w1sPo0rUIT gjqe/tmICUD9QTiCTKwP8IPzmyNZPngb7A+2otRFM2TOs3VXxiIP7kpX7HdiRuk7QhemuEUt9SN N5rD/qS4pCp3Fwm+MKfuDeEmdXmrLH9jr6raoY1BjKTSwGPHT9fUNwRQ9hMd49Q8kVaPBj3qXbk kLiILPnf5408rwDk8N5jR5thI/ewnw0jlXMHqr0nnfPDu/7fxvJZdPEm6LK3YiOcWzC4CWFgY2J mEhOu9cH0z0zMxyXn/PWbRLkvZG8xX5L7ywTavLtOSM9m/nDTLH X-Received: by 2002:a05:600d:c:b0:489:fec9:a17e with SMTP id 5b1f17b1804b1-48a844f4fd9mr83236095e9.12.1777630531792; Fri, 01 May 2026 03:15:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/28] hvf: only call hvf_sync_vtimer() when running without the platform vGIC Date: Fri, 1 May 2026 11:14:56 +0100 Message-ID: <20260501101505.3485916-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630676201154100 From: Mohamed Mediouni When running with the Apple vGIC, the EL1 vtimer is handled by the platform. Signed-off-by: Mohamed Mediouni Reviewed-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-7-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 09f41094e5..fa0a22fdc3 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2368,7 +2368,9 @@ static int hvf_handle_vmexit(CPUState *cpu, hv_vcpu_e= xit_t *exit) =20 switch (exit->reason) { case HV_EXIT_REASON_EXCEPTION: - hvf_sync_vtimer(cpu); + if (!hvf_irqchip_in_kernel()) { + hvf_sync_vtimer(cpu); + } ret =3D hvf_handle_exception(cpu, &exit->exception); break; case HV_EXIT_REASON_VTIMER_ACTIVATED: --=20 2.43.0 From nobody Sat May 30 18:35:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630659; cv=none; d=zohomail.com; s=zohoarc; b=mqY6kouT+vI1Ndx7tUbLNkCXgnGQxjeSpjvC3sbNcCDpkEFH4cPAb1Y3+VfV35YjNyKk/+5WPC341Pqr27xI22tpVi1mKkZ/D6ZV4YC5H7yQr85Coizb07f0Xbk7bEoJ4b9iHPE71SEpXD54+Y5u9XbkBgU9/eq2kQbZtZA2gBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630659; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ErZn9qmgXZtVOOp/Xbnqo1NJ59jCbutyDEpe1t2jpNk=; b=a02QQL4hM5Qmu2jWaAxxUi1YgqmF8RIyC3t51Du4BRO3Q+0iYA4n1o2VhkzyZ/1jdBmNS27gIhU5fDWhneQmnlVt4oEGGXFEXn2sF/TDug1i/ATZb49sW468oSJfbG/J3eMDsDHr0kWbnuoB75Y+NtaNsf5GbfA46pbWFbNE1BM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177763065962750.59604425878854; Fri, 1 May 2026 03:17:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuK-00043h-7D; Fri, 01 May 2026 06:15:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuG-00041j-Qp for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:37 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIkuF-0000Cs-4M for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:36 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-483487335c2so19479275e9.2 for ; Fri, 01 May 2026 03:15:34 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630533; x=1778235333; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ErZn9qmgXZtVOOp/Xbnqo1NJ59jCbutyDEpe1t2jpNk=; b=pOGxbXOSxh14t82MqsQAZX2KtcTHkrg8XyhfHPD0jsYwbzOkw/+6aWQ/o/qay5WK3Y +h3vOO7oEmJqiz2nLgM1aaau13FUER1kxDJDUMZjq2Nhtz06VAttL3TGEI925sOJdHJ2 LzBX1zt3odvGUoyMdijR1j6meEZ1hbgau6ZY0Fs46IuIBCKqi/cHjj6vqbaOrHM/BUxR 9CtVTYOSVOOtQ6cSsXLDtd4Ft8LGtBaHuxv/zc0l7/sDBsb29fZUYZgCxUfdM6EIuy2R 3w/EIEbjhn4+/htOOS7xdf6eZkWw6Qzh5zJ7Q/zxcD32iEKIWlZu0iadSzHEMbzObPYp V01g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630533; x=1778235333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ErZn9qmgXZtVOOp/Xbnqo1NJ59jCbutyDEpe1t2jpNk=; b=GIeSVF0cndpRX/EgOHqsEIvoFpuknQdPGmLFlFEZx3NCEzs/5PTh9Mu9rmeO51/7SN UZNOJzGNMVcuJjLHt918pehTjT6CuvAQ4h/gZ5gQ/mfTSxJnww2YUYESf31WtwG1+PPZ W7gGX45GwGKfSoIs0F70nTfaqloShgOB2lDVJ+FhgVhsoWHv7xmGHnJzGt3XqkFsLMFs cA+ilAYGOBcBx+8RT5DZ6M4i6wGgxppxH3XR9J7D4Dq27XxEkfEqFYBf7YgkIrL1hxNO jWX02XlYWykvie46+56T7Zcccf0NJHC8DL1Te2Nm1v9SmKRxjDYemi6hozFCqz0VmfCF CoUg== X-Gm-Message-State: AOJu0YyT6d5TKL/KX68iiPxPawtlMlJDjYVjPrvJXn9ErC3IgVbWcIE9 oNCRthTjQc7SLXARuyMS+1uM6wezN3Mi/1fBHQ3ObQDqcAE9MfNm1I+KMJd2AeBhAq/8cSaKDYU xcWGo X-Gm-Gg: AeBDietYQxjyo57JISKM/cBpLUR0EUPD5P2tJaaPA8zQffZayGDkIrvRkT+wR1xjNF2 IWcsf+AugJiQLMUadY89fOiYIpZBL5xxHYPNN1bgwClbz4gynjCNRCltpcsT0YVCRFeGMk4ch0o 2rnoVTdKXbzH+6frnBZxEgyxh0bi/Pu6RRYyflaIyAdydBGt7eSni89AFFuwMGGuP9Q0Rd2WgtT kw5y947hpy+WBtTVqk1sfr+5excF3qp2uFYtCNkRut4stTfzeKhKejg1lQr5bwd1OLCcTo8uRrG HqSROs8J6ODH2muCeZTPF+C/AcUOyeeXSBY1u31qcmBQZmpiRzSoJYMxvgTzdCnU5yc2e3QlLDn L6pEPxcANdOO0ej0naHtlTITy8nNeYK4sNdhAD1HSnOuLBxvTPKonDqVGqtk8ummkxI9oxJkWRN 8dICc3QyaUW7FYcigzFI3IEQSx3MYrnpEQOuTVRlEU8M+4r8//3mcE3dy/dE9tyj1qRq0goao1y oVQxpDfSh+8cywTmVYkLo/WXxE8rzosGg7YZ/Rz0A== X-Received: by 2002:a05:600c:a119:b0:48a:75b9:5e07 with SMTP id 5b1f17b1804b1-48a844f4de3mr80097015e9.11.1777630532647; Fri, 01 May 2026 03:15:32 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/28] hvf: gate ARM_FEATURE_PMU register emulation when using the Apple vGIC Date: Fri, 1 May 2026 11:14:57 +0100 Message-ID: <20260501101505.3485916-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630661562158500 From: Mohamed Mediouni From Apple documentation: > When EL2 is disabled, PMU register accesses trigger "Trapped MSR, MRS, or > System Instruction" exceptions. When this happens, hv_vcpu_run()=E2=80=AF= returns, and the > =E2=80=AFhv_vcpu_exit_t=E2=80=AFobject contains the information about thi= s exception. > When EL2 is enabled, the handling of PMU register accesses is determined = by the PMUVer > field of ID_AA64DFR0_EL1=E2=80=AFregister. > If the PMUVer=E2=80=AFfield value is zero or is invalid, PMU register acc= esses generate "Undefined" > exceptions, which are sent to the guest. > If the PMUVer=E2=80=AFfield value is non-zero and valid, PMU register acc= esses are emulated by the framework. > The ID_AA64DFR0_EL1=E2=80=AFregister can be modified via hv_vcpu_set_sys_= reg=E2=80=AFAPI. However, despite what that documentation says this is actually gated on usi= ng the Apple vGIC instead of nested virtualisation per se. Apple introduced both at the same = time. Signed-off-by: Mohamed Mediouni Reviewed-by: Manos Pitsidianakis Message-id: 20260429190532.26538-8-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index fa0a22fdc3..9d64f2e1a5 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1601,7 +1601,7 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t re= g, uint64_t *val) ARMCPU *arm_cpu =3D ARM_CPU(cpu); CPUARMState *env =3D &arm_cpu->env; =20 - if (arm_feature(env, ARM_FEATURE_PMU)) { + if (!hvf_irqchip_in_kernel() && arm_feature(env, ARM_FEATURE_PMU)) { switch (reg) { case SYSREG_PMCR_EL0: *val =3D env->cp15.c9_pmcr; @@ -1862,7 +1862,7 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t r= eg, uint64_t val) SYSREG_OP2(reg), val); =20 - if (arm_feature(env, ARM_FEATURE_PMU)) { + if (!hvf_irqchip_in_kernel() && arm_feature(env, ARM_FEATURE_PMU)) { switch (reg) { case SYSREG_PMCCNTR_EL0: pmu_op_start(env); --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630650; cv=none; d=zohomail.com; s=zohoarc; b=cKdvmpOBR3Occl7ggXJoi7Ijez32mpp1idxG+zMGckMOw+TpWJKiF1b5bgjP6tQHbVy41AE2djjWJN98T/QbMoRVL9XQ8XOQBlYxAFyRHaz2uXtNBFUhtntdgAqgkarN4okjC01b/bqhhcmY4i1Fw92xogVCeVQ0AHiH++Djbo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630650; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=PWDJWe2AZnBQY7IEBTYHtAZi/b84KqQOngZk5MTLZWU=; b=YpDDF9u46OiKVAezCmYHABKoZyhEHinEEFqSYqI6stBk1txxMje9jImkdLVs4E2kNEyJp4ULKfEysUxk6q0p0BkM8HmUvUHc3JNWud7/AOo2Bblv1H4KuD95UIrtNA8SSV+dztIntzFTjeNjqIJZX9jBfDPeE3eWyrLkbh7OB2Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17776306505412.3321547294629; Fri, 1 May 2026 03:17:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuK-00043V-53; Fri, 01 May 2026 06:15:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuH-000421-8x for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:37 -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 1wIkuF-0000Cy-4t for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:36 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso16032825e9.2 for ; Fri, 01 May 2026 03:15:34 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630533; x=1778235333; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=PWDJWe2AZnBQY7IEBTYHtAZi/b84KqQOngZk5MTLZWU=; b=EPfgCyv530SKKZqhAfto+zEIYx/DSem6+rcMRqSkWVIiiPACDwSnFXFs0r9tgVhJoA nTHhkjZyw5vzHEF/WQIkj/6uZHVHu/6L+o2vV+lOf9EOdSCxfV/aKc9crGwseEDujjgy N/5k+6IeHVB4XOd1BdQbxT2ZOWE0tLFV34QV5W+pAwitR4NUK276juXK907J/VDKC7lM +FUqFV3cB5htvIVyuDejcn4ssS9CaTi4WTfs5AJ5yrMTTk3hCB76kkDKaNdI06W/bdmW NHTchkGlef3FL48g71nX2e+EzYNVRaNKxCiH26SsYi+2/sZNiRNkvpLgJp8AJglrckbS O8Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630533; x=1778235333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=PWDJWe2AZnBQY7IEBTYHtAZi/b84KqQOngZk5MTLZWU=; b=Z/ByJ2N18CyGbxWliPhqCsbRL/cWPc6crW2+I5F9Q7iglbZOtsXymxQnv7N+FCqDbj HlXJZ2325O+5g4gguyCU+FbTgTX/ns+9neDEN2AFsTLFXJhi/9WBp7Kx803zxuoAlOvA z1sJBnh+obhlLOmK/IwoAqCA7wmeP8o6vo3LmbiUPZixcoesLeo2+zjzPdXoUHuHtYfn BBly6V1BJGSu7zS6FNkkLKNRJZgAVncVCXvQnf+j6F+v6OUn1g9+ZZLQ22JR9WGEYnnB tx1ccgd4R3j6GHpvlC4khSwAtjxVfq5BGhej92OPnlVfbsDYRhw0QGjKGSxuYr+3uCYt /p+Q== X-Gm-Message-State: AOJu0YyHes8JJL+R54uNqsyl5O42CkY+JeDpdjOFbz8TG7mYfQv0bpCL z9OATjTQEJgEBYO615ckIsCx0yF/VY1PMbEkfH0aaOUGjI1gjiC0+hkPKT61OVEOoOhPhoES2C5 qrthj X-Gm-Gg: AeBDietVYsm5O9QEBin1V8bAZ0Gxvom2c47fXzEMAaPiVzEkmeAQR6xQ0JFWHbhDA9L onvABjdn+BOYlu9dGgeYr1980Q1gCNS8XmEiqAjKIetF5WKvxqnk4FwuiDCIfeRwV9orBHhGK3z FQg9g+QNXggrVSSKuKE9LX0sQ7Z6pHc9A77bj/zfaD43CaXnkdRmZWcXQ3OE4fVyGWZc0TIY2jM 06pRYw/gdEfMYFtbv9oUFhIzcwUwvpBkQ3TfIo5xbNpL5hWgxoZYBdI6O6E4qwv9eqI4waspPdQ 3GG4l5dnJnCRpdUCgkm5crMC/UFGNdMyZLWerGninAlFijRX9dl2xzCwDcZIWRTsy1wRYAjvDXw Xmub+WJ1JM180dAxjNgX9JZPOX8X8jfupb5uheHDK2WTW3iX9rDhiy+9MoQJ99oh3ICAw5CCbIc Eha4qu/gD3fLf/p4FBg/ctkEA24M0sjbUyTxRrnmtm9ujlPxDh4jk4gDhV2DwW3c0J6AFDJk0Tl qdd4m0erIznEnsYJff0A3vwnJOs9uRVEmh0ofZVbA== X-Received: by 2002:a05:600c:8719:b0:489:1f97:6b1d with SMTP id 5b1f17b1804b1-48a8ebaa93cmr39418675e9.28.1777630533518; Fri, 01 May 2026 03:15:33 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/28] hvf: arm: allow exposing minimal PMU for kernel-irqchip=on Date: Fri, 1 May 2026 11:14:58 +0100 Message-ID: <20260501101505.3485916-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630651468158500 From: Mohamed Mediouni When running with the Apple vGIC, a minimum PMU is exposed by Hypervisor.fr= amework if a valid PMUVer register value is set. That PMU isn't exposed otherwise. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-9-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 9d64f2e1a5..390a3529ff 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1145,6 +1145,25 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPU= Features *ahcf) =20 clamp_id_aa64mmfr0_parange_to_ipa_size(&host_isar); =20 + /* + * Windows wants at least the PMU's cycles counter to be available. + * + * With kernel-irqchip=3Doff, we "emulate" the cycles counter + * in reference to time in QEMU. Having that, even with + * ID_AA64DFR0_EL1.PMUVer =3D 0 is enough to make Windows happy. + * + * As it's a very inaccurate implementation with its only purpose + * being making Windows boot, expose ID_AA64DFR0_EL1.PMUVer =3D 0 + * when kernel-irqchip=3Doff. + * + * When kernel-irqchip=3Don *and* ID_AA64DFR0_EL1.PMUVer =3D 1, + * the OS provides its own PMU emulation, which is currently + * a cycles counter only emulation. + */ + if (hvf_irqchip_in_kernel()) { + FIELD_DP64_IDREG(&host_isar, ID_AA64DFR0, PMUVER, 0x1); + } + ahcf->isar =3D host_isar; =20 /* --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630714; cv=none; d=zohomail.com; s=zohoarc; b=Jj9i7YZRf47uBhAkcrwf+dPs//GpyVZ6MZAaCy7mxjvFXICHgfWZNCGSsOmPWv7Sh03evnW7f9a3LMKFtDcko2UlPax9WllIngEfvXk3U2faacwUcVq0wS6+/hP88c6CBtVHodj/SDDyiGpWXSMT88WJyV4JLEiSUMNIuiV8grI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630714; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=OInFSah93JMGYAyEONqdnm1Dp5zsBSy9UAN4mJo6cQ8=; b=ATWPFg3Jvw7OzNhlq2o+GwNVKmoCHExIPMAqMngySqowzUhQ5pvcpu1Eg8igi19agoOBQuX65kRbmSdChA7NDWeA2GOCuTdTRYuTqWq3bedV1WIiG2zKiG+NukyyTvLYxZkPRFt4a6Artvdg1RXRkGk8bjfuRrT22cJsgHVP9Gk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630714849863.8051113999912; Fri, 1 May 2026 03:18:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuP-00046N-F2; Fri, 01 May 2026 06:15:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuH-00042Q-Ku for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:37 -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 1wIkuF-0000D4-RA for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:37 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4891cd41959so15952085e9.3 for ; Fri, 01 May 2026 03:15:35 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630534; x=1778235334; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=OInFSah93JMGYAyEONqdnm1Dp5zsBSy9UAN4mJo6cQ8=; b=HFstDFX6ePSfZnPF1jMRRZxJNzvohwXluI+l4rLRBopJ6/lM4rxWK/iTP+8d3jC9v8 6mgRlx8MDJhdoqmyi0LVtaAuPe/RtQRloWnOMNsEDxiGSe7wuSGekUTypV5i+30UTncw p0RfnkyhWf2Bg+ixa61jGsftFtxzh7j0zAtJ2sckVmjJLWdgj1PNRqT5kFcG5BAPTXYx +9skUGAnkyakUS5Wd/nOjkRjFuSYbTFtG+zVeg7lV9d4ZyssJQrNkUXcLi0nJ0yEpZqV 6ueJpTDl8/e3rPjf6Rf0M2RhYv3M1P8vTmmx/Rlho9jzQ0MxAGrDWAbE3fLTqWK64tjz fRMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630534; x=1778235334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OInFSah93JMGYAyEONqdnm1Dp5zsBSy9UAN4mJo6cQ8=; b=JVCbYVk+LJpZnVcK4yfeQ8GCQapT4Bh35N+ShCM0riZOkyAbkc5hhMxNB5ozY6PAvp zVEPUz2JAv9y0/9fYQdMThgxWHo1UwhQcSaijDpK+TIK77bSElLwMMuxLBN9LCIl16Mc J9IDMXBWfG0ZFBaXgnKKjvwekMXH/40cqRwlW28PEalFVFNa7xtzjq1voYLBKKZpxtW/ hfbthshvGO+AicWbb/l197USDIhYYJnGHy46dfdoSCEz6ivXvDx6PMRPJf/pZ58QIvsb wKDx9lKGl7neHEtaKOnWPnrdNRtNPMk1Dd/jGB3gWHPBh/RksuYD2buFJ2+ykFTdUJkj ueZw== X-Gm-Message-State: AOJu0Yx3sfqB0/ZKDuG0NQswT2GOo08dZXMJLs9fqJATFOnEL3N7+un5 F0tMzWNou1cuf9/UHjiDi4meCBwABEBlx2QmNnol/66Av11NkbpZp4ky1MA5lVNjkUNenivCK7O 0Yi5e X-Gm-Gg: AeBDiesT2UpHMA6pAkCOFElVaPDoRdUwkjFQjJeRVuPqpawlZO+RjC9P7eq2bkzVhJZ 5Lypw8QYRAAheli1leCSxm1Nwdong6mcIHjNsgfml1JWf7y1qq1NDouG6w4Kg5w+XAlPH8Q/X7l 6zWoH/bcsfaVla4AcV8itC3aeGchIQ38pE5GpMxOuKsIJRoD3xW+XwqdzNrNvj64JkST4/DkIlV ADsaF+Zf2uDJ0RxdjQeA4xb97T2vEEi6/pDiDswsUTE5+dXT89naOM/1eQu09lG8kb4sQi7Uxyn kTiYt6dtShfTGfNZK+IaWOo9/unkII2dGgvqPGynxKetHsSH4DLsjFEgxPrpzHiUAwlD7eW10Ll IBvDc/NSeY10rzXt2k/WmZ+ZtMXLixP3YXnBRdaXfbLgsQ2UXf9j13xOFsz5d/eZNlFUxqke3GS Yg2N9DXyIsp5AQ82Vd6QIVBiPXQbOeTfDXxxv9MrxW/uhZjgqzGdIGMnzR53k3zxcKDW4bQEJSf +pcBEb8QebWAXCtk5NYFMEY8bAPoNgoQnE63UaFAQ== X-Received: by 2002:a05:600c:3b16:b0:488:9439:880d with SMTP id 5b1f17b1804b1-48a8446406dmr108050065e9.29.1777630534438; Fri, 01 May 2026 03:15:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/28] target/arm: hvf: add asserts for code paths not leveraged when using the vGIC Date: Fri, 1 May 2026 11:14:59 +0100 Message-ID: <20260501101505.3485916-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630715724158500 From: Mohamed Mediouni When using the vGIC, timers are directly handled by the platform. No vmexits ought to happen in that case. Abort if reaching those code paths. Signed-off-by: Mohamed Mediouni Reviewed-by: Mads Ynddal Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-10-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 390a3529ff..38f88c1a80 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1696,6 +1696,7 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t re= g, uint64_t *val) case SYSREG_ICC_SGI1R_EL1: case SYSREG_ICC_SRE_EL1: case SYSREG_ICC_CTLR_EL1: + assert(!hvf_irqchip_in_kernel()); /* Call the TCG sysreg handler. This is only safe for GICv3 regs. = */ if (hvf_sysreg_read_cp(cpu, "GICv3", reg, val)) { return 0; @@ -1986,6 +1987,7 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t r= eg, uint64_t val) case SYSREG_ICC_SGI0R_EL1: case SYSREG_ICC_SGI1R_EL1: case SYSREG_ICC_SRE_EL1: + assert(!hvf_irqchip_in_kernel()); /* Call the TCG sysreg handler. This is only safe for GICv3 regs. = */ if (hvf_sysreg_write_cp(cpu, "GICv3", reg, val)) { return 0; @@ -2393,6 +2395,7 @@ static int hvf_handle_vmexit(CPUState *cpu, hv_vcpu_e= xit_t *exit) ret =3D hvf_handle_exception(cpu, &exit->exception); break; case HV_EXIT_REASON_VTIMER_ACTIVATED: + assert(!hvf_irqchip_in_kernel()); qemu_set_irq(arm_cpu->gt_timer_outputs[GTIMER_VIRT], 1); cpu->accel->vtimer_masked =3D true; break; --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630629; cv=none; d=zohomail.com; s=zohoarc; b=YrneqT5f0aayhzdlQsVSJMpA5wMHqyWpDtgsq4tYrSOrg9mlhSqp3lnhinY/fW3iwsnJ7V5qPOKCCRnKPvCjwTj4eoAX5DBmjSrc/rLAYRCDbbbIQQ+7M+i3TEc4ZjmgHSKXLIv5wyM+P740KuXooIYJd6Sqte6yst3hb/kb6/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630629; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=EaU21xUEzEpe3YMvUriI5xAjjTThJB/xFqiCk8ad028=; b=Wj6JQ0YnvA2jWrRoaLnC3//uz1yyMSmuogd7CPIiMbyQ5D686SqIb7s7Pgku3qFdCcId4EAmwt/jm4RZYV3E4mZgO9qSQtLlYWAkMJDLqrjT453kSPL24fWCcK2aR2KXEIR4iwtxcqXMayc4abHc83Ek536LUQs6ZdV6Go2Fxfg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630629437236.2919947782242; Fri, 1 May 2026 03:17:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuN-00045n-J6; Fri, 01 May 2026 06:15:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuJ-00042j-7d for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:39 -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 1wIkuH-0000Dk-0j for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:38 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-488b8bc6bc9so11355755e9.3 for ; Fri, 01 May 2026 03:15:36 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630535; x=1778235335; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EaU21xUEzEpe3YMvUriI5xAjjTThJB/xFqiCk8ad028=; b=wtNHsfAiVNyPha90wLAArAj7hHI5J2WotCETONzKA3Tj9OtXEniefYUt8wC+wuS0q8 7YCuNiC4vLxHzp/iLEWEbYkZQTmG31MX7hDlKLAzk++ZWB7tVYZNoaMcLp6Red2KFkiL raSEVH257+as678V34Yxv0+Sgf9vPzuYo6ez7Cvby34ud73U3LZ/u9pzd3MmNsdgO8zq lUc3m+StH7JRSURVwbM15xio4BOe2pGZV44Lf+8Zfyb1dNGvNa8Fo20/89gucDeRVvyp +PKfSbEZhoP1ACQYLKxrK6/Ev5kK2RsXHO7VrNz4qN29n9Lw5qY2X/EamXrn0id26wqO 9lcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630535; x=1778235335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=EaU21xUEzEpe3YMvUriI5xAjjTThJB/xFqiCk8ad028=; b=B08f6qnL5kEDkZJF/1VhzpPEz+oLI9+gIIaTFtK9t9IT89VZ9z/1ZD1ID6COwzQjQu nNfaY3qwRjPmOYU70suDmUZQhEo6gaX6GbSN+mrNXcxv1WBdwppngR4Z/faI8X/b/8jF bkcw21phCgsDdEAReB1AOTVTWWf3q1j0SGz62tRetS/eCbUS2QDvIDPETkhpqxMf3Ina cushsDIqAeInZNw6Ykpll0Q8mFEQSOJPCDQ8y8cIrmQfuY5HAe9DI9jvnRk+h8br8sXH uZjGR3Lvc8+k6a8QNcWG4ybfQLvFKYypKrHxN1zFiowD1VphDfvmIa29+lVZMPXKRgMC 788Q== X-Gm-Message-State: AOJu0YyLuk1UegzdPN+t42erY9SLaDDtFBhLg6GN7kTkRdjblFWE/mx7 CqVOpwqDF3oZYA6IfTqfiNt5T6zV4vKz0y56JWxH0yIdNszqgVc9+9xcEwdrmizG4SZEDUoK8CX Mjj8s X-Gm-Gg: AeBDieuKNhphSFcYpsJKH6EP6dk5xTzNVJEFxXxXvmZE03kWE9nrmgwYvS4jyevteo8 qYmmS56jjaeYgW60oCnHJ1poALHsRrqD4HivD1qteY15/A/FQ93nFV6m1B81zXxmGXXNP+Qqm1V Vq1GIvokaZh+7wkg/I9LP5ePeuuB3sPadX+6RNgBl5F2e1t2JDCUy4uiva2ZHZ7zEwxhAizxXOj VI6wVEDo5nuNZLIEAv684QUE3BdaPG+8gRZPu+LBd4YYXyS4UhwMgmxzA/JTYbKhQu02zf23Kuy 3wDaBRDRitVfvWICc1W8cDfjMK/2WzGLspmgqQpsQF5e0RqGMxIsC7wTQ7J61BYy4BzsATKbiS/ YntdEg58Ol/NeB+1zuHpnbGBCR3i/1RPr9M+5VmPMkFIEbClq3Cvi+5t+MRDhHxNL4RM9zLmoTD CXS0vvuVI+YLAtn/Amv+hBJ6PmXmLXDtTpRCxFc4V1z9S/GHNx+zx2g+K+gqykAWvwA9Ee49bW0 reYmURAcDtINrM31nhnZH4/V62KTVFbnW5wrE+qhQ== X-Received: by 2002:a05:600c:a40e:b0:488:c40b:c8a4 with SMTP id 5b1f17b1804b1-48a83f6e2e9mr84215805e9.1.1777630535333; Fri, 01 May 2026 03:15:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/28] hvf: sync registers used at EL2 Date: Fri, 1 May 2026 11:15:00 +0100 Message-ID: <20260501101505.3485916-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630631608154100 From: Mohamed Mediouni When starting up the VM at EL2, more sysregs are available. Sync the state = of those. In addition, sync the state of the EL1 physical timer when the vGIC is used= , even if running at EL1. However, no OS running at EL1 is expected to use those r= egisters. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-11-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 61 +++++++++++++++++++++++++++++++++---- target/arm/hvf/sysreg.c.inc | 44 ++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 6 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 38f88c1a80..ecfe06cd8c 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -467,37 +467,75 @@ static const struct hvf_reg_match hvf_sme2_preg_match= [] =3D { * * SME2 registers are guarded by a runtime availability attribute instead = of a * compile-time def, so verify those at runtime in hvf_arch_init_vcpu() be= low. + * + * Nested virt registers are handled via a runtime check, so override the + * guarded availability check done by Clang. */ =20 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" + #define DEF_SYSREG(HVF_ID, ...) \ QEMU_BUILD_BUG_ON(HVF_ID !=3D KVMID_TO_HVF(KVMID_AA64_SYS_REG64(__VA_ARG= S__))); #define DEF_SYSREG_15_02(...) =20 +#define DEF_SYSREG_EL2(HVF_ID, ...) \ + QEMU_BUILD_BUG_ON(HVF_ID !=3D KVMID_TO_HVF(KVMID_AA64_SYS_REG64(__VA_ARG= S__))); + +#define DEF_SYSREG_VGIC(HVF_ID, ...) \ + QEMU_BUILD_BUG_ON(HVF_ID !=3D KVMID_TO_HVF(KVMID_AA64_SYS_REG64(__VA_ARG= S__))); + +#define DEF_SYSREG_VGIC_EL2(HVF_ID, ...) \ + QEMU_BUILD_BUG_ON(HVF_ID !=3D KVMID_TO_HVF(KVMID_AA64_SYS_REG64(__VA_ARG= S__))); + #include "sysreg.c.inc" =20 #undef DEF_SYSREG #undef DEF_SYSREG_15_02 +#undef DEF_SYSREG_EL2 +#undef DEF_SYSREG_VGIC +#undef DEF_SYSREG_VGIC_EL2 =20 -#define DEF_SYSREG(HVF_ID, op0, op1, crn, crm, op2) HVF_ID, +#define DEF_SYSREG(HVF_ID, op0, op1, crn, crm, op2) {HVF_ID}, #define DEF_SYSREG_15_02(...) +#define DEF_SYSREG_EL2(HVF_ID, op0, op1, crn, crm, op2) {HVF_ID, .el2 =3D= true}, +#define DEF_SYSREG_VGIC(HVF_ID, op0, op1, crn, crm, op2) {HVF_ID, .vgic = =3D true}, +#define DEF_SYSREG_VGIC_EL2(HVF_ID, op0, op1, crn, crm, op2) {HVF_ID, tru= e, true}, =20 -static const hv_sys_reg_t hvf_sreg_list[] =3D { +struct hvf_sreg { + hv_sys_reg_t sreg; + bool vgic; + bool el2; +}; + +static struct hvf_sreg hvf_sreg_list[] =3D { #include "sysreg.c.inc" }; =20 #undef DEF_SYSREG #undef DEF_SYSREG_15_02 +#undef DEF_SYSREG_EL2 +#undef DEF_SYSREG_VGIC +#undef DEF_SYSREG_VGIC_EL2 + +#pragma clang diagnostic pop =20 #define DEF_SYSREG(...) -#define DEF_SYSREG_15_02(HVF_ID, op0, op1, crn, crm, op2) HVF_ID, +#define DEF_SYSREG_15_02(HVF_ID, op0, op1, crn, crm, op2) {HVF_ID}, +#define DEF_SYSREG_EL2(...) +#define DEF_SYSREG_VGIC(...) +#define DEF_SYSREG_VGIC_EL2(...) =20 API_AVAILABLE(macos(15.2)) -static const hv_sys_reg_t hvf_sreg_list_sme2[] =3D { +static struct hvf_sreg hvf_sreg_list_sme2[] =3D { #include "sysreg.c.inc" }; =20 #undef DEF_SYSREG #undef DEF_SYSREG_15_02 +#undef DEF_SYSREG_EL2 +#undef DEF_SYSREG_VGIC +#undef DEF_SYSREG_VGIC_EL2 =20 /* * For FEAT_SME2 migration, we need to store PSTATE.{SM,ZA} bits which are @@ -1335,6 +1373,9 @@ int hvf_arch_init_vcpu(CPUState *cpu) #define DEF_SYSREG_15_02(HVF_ID, ...) \ g_assert(HVF_ID =3D=3D KVMID_TO_HVF(KVMID_AA64_SYS_REG64(__VA_ARGS= __))); #define DEF_SYSREG(...) +#define DEF_SYSREG_EL2(...) +#define DEF_SYSREG_VGIC(...) +#define DEF_SYSREG_VGIC_EL2(...) =20 #include "sysreg.c.inc" =20 @@ -1362,11 +1403,19 @@ int hvf_arch_init_vcpu(CPUState *cpu) =20 /* Populate cp list for all known sysregs */ for (i =3D 0; i < ARRAY_SIZE(hvf_sreg_list); i++) { - hv_sys_reg_t hvf_id =3D hvf_sreg_list[i]; + hv_sys_reg_t hvf_id =3D hvf_sreg_list[i].sreg; uint64_t kvm_id =3D HVF_TO_KVMID(hvf_id); uint32_t key =3D kvm_to_cpreg_id(kvm_id); const ARMCPRegInfo *ri =3D get_arm_cp_reginfo(arm_cpu->cp_regs, ke= y); =20 + if (hvf_sreg_list[i].vgic && !hvf_irqchip_in_kernel()) { + continue; + } + + if (hvf_sreg_list[i].el2 && !hvf_nested_virt_enabled()) { + continue; + } + if (ri) { assert(!(ri->type & ARM_CP_NO_RAW)); arm_cpu->cpreg_indexes[sregs_cnt++] =3D kvm_id; @@ -1375,7 +1424,7 @@ int hvf_arch_init_vcpu(CPUState *cpu) if (__builtin_available(macOS 15.2, *)) { if (hvf_arm_sme2_supported()) { for (i =3D 0; i < ARRAY_SIZE(hvf_sreg_list_sme2); i++) { - hv_sys_reg_t hvf_id =3D hvf_sreg_list_sme2[i]; + hv_sys_reg_t hvf_id =3D hvf_sreg_list_sme2[i].sreg; uint64_t kvm_id =3D HVF_TO_KVMID(hvf_id); uint32_t key =3D kvm_to_cpreg_id(kvm_id); const ARMCPRegInfo *ri =3D get_arm_cp_reginfo(arm_cpu->cp_= regs, key); diff --git a/target/arm/hvf/sysreg.c.inc b/target/arm/hvf/sysreg.c.inc index 7a2f880f78..c11dbf274e 100644 --- a/target/arm/hvf/sysreg.c.inc +++ b/target/arm/hvf/sysreg.c.inc @@ -153,3 +153,47 @@ DEF_SYSREG_15_02(HV_SYS_REG_ID_AA64ZFR0_EL1, 3, 0, 0, = 4, 4) DEF_SYSREG_15_02(HV_SYS_REG_ID_AA64SMFR0_EL1, 3, 0, 0, 4, 5) DEF_SYSREG_15_02(HV_SYS_REG_SMPRI_EL1, 3, 0, 1, 2, 4) DEF_SYSREG_15_02(HV_SYS_REG_SMCR_EL1, 3, 0, 1, 2, 6) +/* + * Block these because of the same issue as virtual counters in + * that caused the revert in 28b0ed32b32c7e5094cf2f1ec9c0645c65fad2aa + * + * DEF_SYSREG_VGIC(HV_SYS_REG_CNTP_CTL_EL0, 3, 3, 14, 2, 1) + * DEF_SYSREG_VGIC(HV_SYS_REG_CNTP_CVAL_EL0, 3, 3, 14, 2, 2) + */ +#ifdef SYNC_NO_RAW_REGS +DEF_SYSREG_VGIC(HV_SYS_REG_CNTP_TVAL_EL0, 3, 3, 14, 2, 0) +#endif + +/* + * Also block these because of the same issue as virtual counters in + * that caused the revert in 28b0ed32b32c7e5094cf2f1ec9c0645c65fad2aa + * + * DEF_SYSREG_VGIC_EL2(HV_SYS_REG_CNTHP_CVAL_EL2, 3, 4, 14, 2, 2) + * DEF_SYSREG_VGIC_EL2(HV_SYS_REG_CNTHP_CTL_EL2, 3, 4, 14, 2, 1) + */ +DEF_SYSREG_VGIC_EL2(HV_SYS_REG_CNTHCTL_EL2, 3, 4, 14, 1, 0) +#ifdef SYNC_NO_RAW_REGS +DEF_SYSREG_VGIC_EL2(HV_SYS_REG_CNTHP_TVAL_EL2, 3, 4, 14, 2, 0) +#endif +DEF_SYSREG_VGIC_EL2(HV_SYS_REG_CNTVOFF_EL2, 3, 4, 14, 0, 3) + +DEF_SYSREG_EL2(HV_SYS_REG_CPTR_EL2, 3, 4, 1, 1, 2) +DEF_SYSREG_EL2(HV_SYS_REG_ELR_EL2, 3, 4, 4, 0, 1) +DEF_SYSREG_EL2(HV_SYS_REG_ESR_EL2, 3, 4, 5, 2, 0) +DEF_SYSREG_EL2(HV_SYS_REG_FAR_EL2, 3, 4, 6, 0, 0) +DEF_SYSREG_EL2(HV_SYS_REG_HCR_EL2, 3, 4, 1, 1, 0) +DEF_SYSREG_EL2(HV_SYS_REG_HPFAR_EL2, 3, 4, 6, 0, 4) +DEF_SYSREG_EL2(HV_SYS_REG_MAIR_EL2, 3, 4, 10, 2, 0) +DEF_SYSREG_EL2(HV_SYS_REG_MDCR_EL2, 3, 4, 1, 1, 1) +DEF_SYSREG_EL2(HV_SYS_REG_SCTLR_EL2, 3, 4, 1, 0, 0) +DEF_SYSREG_EL2(HV_SYS_REG_SPSR_EL2, 3, 4, 4, 0, 0) +DEF_SYSREG_EL2(HV_SYS_REG_SP_EL2, 3, 6, 4, 1, 0) +DEF_SYSREG_EL2(HV_SYS_REG_TCR_EL2, 3, 4, 2, 0, 2) +DEF_SYSREG_EL2(HV_SYS_REG_TPIDR_EL2, 3, 4, 13, 0, 2) +DEF_SYSREG_EL2(HV_SYS_REG_TTBR0_EL2, 3, 4, 2, 0, 0) +DEF_SYSREG_EL2(HV_SYS_REG_TTBR1_EL2, 3, 4, 2, 0, 1) +DEF_SYSREG_EL2(HV_SYS_REG_VBAR_EL2, 3, 4, 12, 0, 0) +DEF_SYSREG_EL2(HV_SYS_REG_VMPIDR_EL2, 3, 4, 0, 0, 5) +DEF_SYSREG_EL2(HV_SYS_REG_VPIDR_EL2, 3, 4, 0, 0, 0) +DEF_SYSREG_EL2(HV_SYS_REG_VTCR_EL2, 3, 4, 2, 1, 2) +DEF_SYSREG_EL2(HV_SYS_REG_VTTBR_EL2, 3, 4, 2, 1, 0) --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630559; cv=none; d=zohomail.com; s=zohoarc; b=WLephDZZgjLGJS2oKNGBhzdj6KEmv9Xh1Owk4eRKMEMZkv0qdYcn1Y3n4fAvKjpVrMZBAVmJORQWwfyOYnHiBM+zSvi18sO9VAIGuh/g1DbDdcXwzvBbvM2Y5E6e/olrC4DmPl2hSuHEikENABE3PVr4HZu5jLRIUEWyz8f9rKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630559; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0V88ZatR1lmUbDKzZHFEAjN9VwU8JnhgBh76WZWQXeA=; b=d/gRb0iMTzshJBFtEfoyvHDbWqMz4vOmHFCRgL2IM7M17seEZy2L/cgrkUN0gX3VjOVNcgw4AG0Je79IOhvtdVhDjr814qhl7Oy8KpTMEJiXbHI8jqTiWzM6+CxFgiJIu9xS4kaBOQDrWCmlfMoafOWpuSVsROvekpGkfihh1rA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630559252926.8590348901217; Fri, 1 May 2026 03:15:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuQ-00047B-5y; Fri, 01 May 2026 06:15:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuJ-00042y-C6 for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:39 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIkuH-0000FA-Ml for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:39 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-488ab2db91aso21250545e9.3 for ; Fri, 01 May 2026 03:15:37 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630536; x=1778235336; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0V88ZatR1lmUbDKzZHFEAjN9VwU8JnhgBh76WZWQXeA=; b=Qiniast3dXqeeeH3qdR5d1ZwTVtFg8I/a5wC2WXY3dlbp8IyEa6yVO2KNyipFRv7bQ JvyjgcwDGqZdMAwV06EfywabXuD13bh8KyGx4x6/UXan/CHv3jEkqjEp2YBr9nXZqLnr FdioDthAlCejkkAkn88RLIHGp/CnAiCtJLzvLGIBRk5ynADkU2HknRTWlzGjVs4DTO+U YrSYQXJxnUhPv9xcdYFO7nzdm3qoKkq5qLTSHk+ltH1CUtWyqCU0/pngAUtpY3TSd7nV +HqPrFZQqhMCo4WPlnkhNjojQVK9KUPZ5oMLoX8T2yq70RrFs4Cf1Retp0b3V5I7tocE AmLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630536; x=1778235336; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0V88ZatR1lmUbDKzZHFEAjN9VwU8JnhgBh76WZWQXeA=; b=pRE2u/gMMXyAAVIiAAyzIuvbcHD45GmILHujpcTXgY13aJMiFXdUYg5PysurRn1HzY Zgh2E8uIijhKqejQDzEzNntTBU1BdK5iPodWHvK1qdpKbPK8aESn0vmZEQ6j8Ypox6ju mAniPwgcQcaD0EMrw5NQKoXfMfADeKj+cN4YfTyBolHCtcvEW/6gJUAPmEB0VI29IBE6 oRIXq5kAmlISCgg8iDxt8YZ4YtcQ0lkESTlBB3FQD9s4CfeMLMdWpSlCUmFV3K+FBoVS cNF/agOG7WjUZse0xS2k57PKOxpTa31uxpZWBCGLhSlEu5iUXA2kJDLSaZZpIujXXMZC R+ww== X-Gm-Message-State: AOJu0YxEP89dWDUP/XtViTxv5ijCvBzqIyQvXAJQ7392STIhvEUOrA+7 KK8dwERzvLxsBDlbW/bnxpj5Azm9LjlpTBoDII2e10ZNIN9RYB6WI+rNdWUHYK1LMgG7t9h0vWP pwwj9 X-Gm-Gg: AeBDietFWhKGxXCvUh9kKimGXSV1U82bN0uVAsMb3LZFow13XU7bSsdy+7fQBrcOLv2 sMARzZkTnGTqzwIjzaIx6cX0HTbhFVPCc88zyUQaU7lixmJr0exOMCbcX5JSZ7gMEdaYlHrDOhK lqiR7xQmSIgNhF5+37SpctL+iJkYYyBiJZ3Kkd1FP5KeXiJtfYGBtW0I/PRnEkHDhpFbhzOkou5 0KTmIXKCpaEu5EivDuIqm/dVC63xKtSu1lY1YaKAf3proo/yDmG/wsOhCGGkDJxCE91LrqW4qYA RSpH3ZAEVFHzcm0z2HE8irD3mNZr5pWRkTAMISUwwnKfFKAZOhvK2yFxnq7RqXfWeBxkSfLfkww 9eBaY6d24+a9lDV8WTmPLoppW97g0Q7CDUBocHOwr5rlNZdOyRscUbJISzLJT85GD1HzAljD+9h l7HHZEumk8bP7iaUFuCnIXZGt/M6kTTZRPL/Y3rWDdDRswIiX9wQss8lUyXu2GaqxMn7TQvRbH3 NZEtl5NcCXP9Q6pW0wFSBDnVHddbJpEVURqJmNfGCP1j/c4KcH6 X-Received: by 2002:a05:600c:354d:b0:488:8b99:54a1 with SMTP id 5b1f17b1804b1-48a8445e8bcmr105631535e9.28.1777630536211; Fri, 01 May 2026 03:15:36 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/28] target/arm: hvf: pass through CNTHCTL_EL2 and MDCCINT_EL1 Date: Fri, 1 May 2026 11:15:01 +0100 Message-ID: <20260501101505.3485916-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630561210158500 From: Mohamed Mediouni HVF traps accesses to CNTHCTL_EL2. For nested guests, HVF traps accesses to= MDCCINT_EL1. Pass through those accesses to the Hypervisor.framework library. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-12-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index ecfe06cd8c..1894be6b0e 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -296,6 +296,10 @@ void hvf_arm_init_debug(void) #define SYSREG_DBGWVR15_EL1 SYSREG(2, 0, 0, 15, 6) #define SYSREG_DBGWCR15_EL1 SYSREG(2, 0, 0, 15, 7) =20 +/* EL2 registers */ +#define SYSREG_CNTHCTL_EL2 SYSREG(3, 4, 14, 1, 0) +#define SYSREG_MDCCINT_EL1 SYSREG(2, 0, 0, 2, 0) + #define WFX_IS_WFE (1 << 0) =20 #define TMR_CTL_ENABLE (1 << 0) @@ -1719,6 +1723,14 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t r= eg, uint64_t *val) case SYSREG_OSDLR_EL1: /* Dummy register */ return 0; + case SYSREG_CNTHCTL_EL2: + if (__builtin_available(macOS 15.0, *)) { + assert_hvf_ok(hv_vcpu_get_sys_reg(cpu->accel->fd, HV_SYS_REG_C= NTHCTL_EL2, val)); + } + return 0; + case SYSREG_MDCCINT_EL1: + assert_hvf_ok(hv_vcpu_get_sys_reg(cpu->accel->fd, HV_SYS_REG_MDCCI= NT_EL1, val)); + return 0; case SYSREG_ICC_AP0R0_EL1: case SYSREG_ICC_AP0R1_EL1: case SYSREG_ICC_AP0R2_EL1: @@ -2007,6 +2019,14 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t = reg, uint64_t val) case SYSREG_OSDLR_EL1: /* Dummy register */ return 0; + case SYSREG_CNTHCTL_EL2: + if (__builtin_available(macOS 15.0, *)) { + assert_hvf_ok(hv_vcpu_set_sys_reg(cpu->accel->fd, HV_SYS_REG_C= NTHCTL_EL2, val)); + } + return 0; + case SYSREG_MDCCINT_EL1: + assert_hvf_ok(hv_vcpu_set_sys_reg(cpu->accel->fd, HV_SYS_REG_MDCCI= NT_EL1, val)); + return 0; case SYSREG_LORC_EL1: /* Dummy register */ return 0; --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630641; cv=none; d=zohomail.com; s=zohoarc; b=jQ8V7P4tNtByO5bR9jG5kDYFLN+1q8A+d42Cur50DmMFapo64bDofiGSvoqNXYXShOMpAkjMjvzNM7xwN0d0iR3TAGZrzYxEqBZbHfjssRtPPgQWBvFh0atfa46pFoqKeMpqnMMgJVdV9yEhljYYbDsJAV1xBTgxQ/Dh6KSI0qM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630641; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=FNx1Ywj4Qu3y0jOumawWKaDs7AucOHa5C++JOEYBlgo=; b=mfaXuGBMrA0OLu2CBmXviB2tJhUIvgF2MlTTELOPoh0gOLoTyXMqBFLYF2gEKogS5LfkdP0xs4sJN18ViI6POD4d/CJNNgnpb04kb5JBPYW3gnN8Al0Tkgof1JtXnDsm3IWE2ANNmVTtBoBD3Q3Ir3t78MYXIeLLX808KjyTecc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630641711876.3584384417079; Fri, 1 May 2026 03:17:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuO-00046B-Tz; Fri, 01 May 2026 06:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuK-00043i-6b for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:40 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIkuI-0000G8-Ij for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:39 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso16033095e9.2 for ; Fri, 01 May 2026 03:15:38 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630537; x=1778235337; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FNx1Ywj4Qu3y0jOumawWKaDs7AucOHa5C++JOEYBlgo=; b=Ap27P3zOp70CiIHWgic7Bs5v7IO/1c2PgVHQ3CrscKwaxf0SwIjHchQhRTdzmaqAaY zQmJyaWJ55J5MJrk7uyKrauXEoxPggW0Rtn2FzAZeTfnJ2s4P1VCTdfPnaeB3nxFqRG3 lw07Z7DbT35Q0xB+FRfaZatxIPFkBTBUXWuIqlKLcWqbpEvy+L+rmdyf79sxYPmahELp aLZfOABsgPcEfYAGhJ4mxAYebWq5VN47DXsNUfKTyxzPijTrCDgGEqySUCkyxpTt7nXO cKgD2+gRZ2so/ex5mK/1bOsy84Puul+2huTO1jYFus/+hbAeNtXS9pviYRZEHKxmIARz mRlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630537; x=1778235337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=FNx1Ywj4Qu3y0jOumawWKaDs7AucOHa5C++JOEYBlgo=; b=pct2+yGKHu1Nenxf7mNVcfZ78/gQ/4lISOp0BN1NFcx1Yp0G82mJq9XCDlVAoyVeLi go6Fj3esj+eg9u16CQiXA1AS1JiewusJjjLLm+0AUSSHYpldQEwi57rB2rRy7FZdf8d6 6Zvsl8CArhj2mfwBx74eMroUehbIBSz1CObiG3l9kU5U+Qvdq/BazqxScHDvFBFPKnNm wN8z/u5I/yjao8dIdNiOTZyNcAh1xEmrOglCzswM3nsYiAOhKVLTPGMjzqjSN4Wj7Pn4 6BuOBCPWnfcQtH1d//FYSNyu2AJL/lvmJcGHdYSBtnpjfnH88z8SfhumfIfgsb288+7y RFHA== X-Gm-Message-State: AOJu0YyzUb/aEdSfAPy9eAF5RL5osCSRhwO2K+J4RSk/QMjB0+nmT8TL 3jtaRGyJgHU4eUkdi21Ix97CQEdsT/vigjq4h2T9WmZNgRmyNjurQcWr2ZztjNOy1DXyWqePKJB /9RM+ X-Gm-Gg: AeBDiesFoa7VS0pX2p9zkoew88HWEEA0Ps27VFQNbdSdGo+mowH9YOwo6nSJkSO/cXQ 032vnaqBviGkB3+wW1C+Nrn+vf/KtsPCEzOmLulkjpKvX7qc0ldViBRDyYsA01UtqY82Vq0JkS9 L9+rAfRb8lCnA4PoqiDNoZuOtwlwlLGAadUDbpmmGCeEQ5XZFph3UHRnPJL1vD24D4+SbRwT0QB kUM80DDj3ASMrxaIrBEwUyjGdDogQDR+/olDTlGZGEQrjMteQ6TUlgSPgypc0j2Aw71RxNHBG8T ERPgp8G2Fbq6BWF85d0ef9PGIfz9Eudf5Y898G9hhGpRd7LSrk4LqoLFno6550t0e/G+H0KQKPY 3PpgjbEy1PPw8c+Zu+sDOye0STt6F9phk/2j9/2AJ8ehW1a4XUMNkn43sG7j23WYVxqgtJgvmFK 8cjQDa18WcS4BElgsSJ1Lj47oTt96YRSu94AZVatNeH+MiWDLaLEhQLrkhPLZ/DvAFdqTQRy2/8 RSDvQWKzfsimgXRG0EPjVSfhGUBrEq3fzWjjzmoiA== X-Received: by 2002:a05:600c:8b21:b0:48a:6fd4:d3d3 with SMTP id 5b1f17b1804b1-48a8eb99216mr39064985e9.20.1777630537073; Fri, 01 May 2026 03:15:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/28] hvf: arm: disable SME when nested virt is active Date: Fri, 1 May 2026 11:15:02 +0100 Message-ID: <20260501101505.3485916-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630643494158500 From: Mohamed Mediouni Currently, Apple doesn't support the nested virtualisation + SME combinatio= n. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20260429190532.26538-13-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 5 +++++ target/arm/hvf_arm.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 1894be6b0e..6062e08c49 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1206,6 +1206,11 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPU= Features *ahcf) FIELD_DP64_IDREG(&host_isar, ID_AA64DFR0, PMUVER, 0x1); } =20 + if (hvf_nested_virt_enabled()) { + /* SME is not implemented with nested virt on the Apple side */ + FIELD_DP64_IDREG(&host_isar, ID_AA64PFR1, SME, 0); + } + ahcf->isar =3D host_isar; =20 /* diff --git a/target/arm/hvf_arm.h b/target/arm/hvf_arm.h index 8029d48caf..59e19f6e84 100644 --- a/target/arm/hvf_arm.h +++ b/target/arm/hvf_arm.h @@ -11,6 +11,7 @@ #ifndef QEMU_HVF_ARM_H #define QEMU_HVF_ARM_H =20 +#include "system/hvf.h" #include "target/arm/cpu-qom.h" =20 /** @@ -35,6 +36,10 @@ void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu); if (__builtin_available(macOS 15.2, *)) { size_t svl_bytes; hv_return_t result =3D hv_sme_config_get_max_svl_bytes(&svl_by= tes); + /* Nested virt not supported together with SME right now. */ + if (hvf_nested_virt_enabled()) { + return false; + } if (result =3D=3D HV_UNSUPPORTED) { return false; } --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630679; cv=none; d=zohomail.com; s=zohoarc; b=Y+cd4M/utHdPylV0/0bVNB3Ro/GNMVNxG1UFxvE6eMzYtfVld3IRi1J8LiWngrJlA/cAAL8KxKPQdIpOdVkzK5qqgrJZKHG2WcK4Y8Wn66AZFDrDvSwNRjbdBq3H5/miz9svIyQwSYRdEug3DonTa269CnxFeBxDdwFnplGKvCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630678; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=JNEtBvOkPyY2VflHuwbXWSp3/7gfXfuP2T8jg+5DLbA=; b=EJOflRG3ZePjpTTLPfijktsh67uvNfKaN5S+rKKQrw84tlZMEPFbLhejORDUGcYG+xovegvEDpzY89qPHKG9W4DyeFuYEc0DUEmymLzq1SHLBkrjmUt9NjlcIDlWID2yR2wsWc3MjCb+khOAtjmEz0yTZA6FghmvTRchbfeOte4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630678991802.6218832045947; Fri, 1 May 2026 03:17:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuQ-00047U-Qx; Fri, 01 May 2026 06:15:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuL-00044j-1n for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:41 -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 1wIkuJ-0000Hm-AG for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:40 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-488b0046078so14846445e9.1 for ; Fri, 01 May 2026 03:15:38 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630538; x=1778235338; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JNEtBvOkPyY2VflHuwbXWSp3/7gfXfuP2T8jg+5DLbA=; b=EkczOc64KN2Htjz+XLRDKhu8L9M/jkJ3wvkpqOUumaQ3aEYv+4aPk8YnPvmdED3LxZ FwI/yczuyAI+DoYhZafbB18XA54paNjhP/kLFyiT3KenIJlfiZFs3kALSpGbETgMAwTk kjYqbSJnOgwRXbjXIMMm6rPwQVdhao2FP9fVNicF8t1e5KhyErL8gBGpXELz6hC2Vble 38HIskjwd62szXus35kHe9Ny8SOVjfKHm2bkQ0pTieNQSn4SiJp/fuDCi88N2UY7RMfn vChWKJuL1612UZzfHtzvpM5sBWU88LKdMKiHplquNa5TD5UdSgTPdvTYWa6sZO+x/GaX 4+EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630538; x=1778235338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JNEtBvOkPyY2VflHuwbXWSp3/7gfXfuP2T8jg+5DLbA=; b=UpqI64NaWCPp3yIGfNsE29iWPJ9UpKkyhQ5iw6Y34zvL96fvvltMntcQ+OQ5iTeDzZ RJObcRnUSxOc0uqlYco0zZcZrWKKYObkBBfg3hWI3Xuk4S91TvOVsZQKzOYlzu+lHAuQ 40KuV8V+hebgJvNv2xWlrDUMzB+m5nupBM4j3JOGvPQbalvgBb4kCjyV1yTVwLBABKZR dIyzXUs/Gazkc8Msp+LV9H0jJm6y4M0eWy2N4iGYZbsELANsRIfP578CZMqiNKq+ew7Z Lkf+4MET7Zo9wP0dwx0fcbru9Lphp+LZU0BELlSSelS/ydY82LYVAAnR+4TBKWNW0VKM uKag== X-Gm-Message-State: AOJu0YwJfr7PxL5daDZr3pnFiOkVA3DdL82rpwcbQMojBw25ki1Rxxmn QtHS9S7spywSxfCuRuRKb7SHMX2lPo75eMGkSXDqAwB3ohd3GySJnW7zvuclwdKOmeW+DzhnDdD ZcD15 X-Gm-Gg: AeBDiess9JWusPOGBbFay9tHgoBqZzXiUK8LcOoJgEMGTi6PT7zJKHchQw2J1O78FR5 bTAGwi8FQc6bN5SZPV4Gz2inCA2Qefc0D/vZF7Z9EMhtiQC72kDdPiL3VefKAJ7PzH+UDmW+W36 jaV3cVVBFZkF/9pthWQYZt12i1Oh2IAAleAVquhsIXtc0puMj60O670II9SHr4EjwX2333buF6i P67cuhStJogfhv2ODb4TnbnhiumcGV8tSwDBJnbywIg66hU/OLDKV4msSEooB8JSGi3O8qpMDpZ OzhCCJ8O4PJQfM7rWuMLjXwJjMlpJtWJg/DZEP9AG23pr82jrdJ1dRKLFw/4iHedggJHGavJzZ2 AArEzDvj2XpkJ8LuKwh17ggRE4K0i60i2V8JKxm3b+kbadc/TsO9SN8m9saZSuCulkK6OoAMLeG 9d0rj1OUT6HkzCLb6k3lHrlmN0hINeetcDSsyjioW1U24MqcnAy+Xq4yaa0YrD3wFYJ5n/JFxqt 0rOBKAJXLEUBsh24O+hUi44aPYYF3ubl2bX3CCaKw== X-Received: by 2002:a05:600c:1f8f:b0:48a:8905:a500 with SMTP id 5b1f17b1804b1-48a8eb74345mr34514715e9.12.1777630537886; Fri, 01 May 2026 03:15:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/28] hvf: arm: physical timer emulation Date: Fri, 1 May 2026 11:15:03 +0100 Message-ID: <20260501101505.3485916-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630680222154101 Content-Type: text/plain; charset="utf-8" From: Mohamed Mediouni Enable this through leveraging TCG's physical timer emulation. This allows nested virtualisation to work with a kernel-irqchip=3Doff + GIC= v2. Signed-off-by: Mohamed Mediouni Message-id: 20260429190532.26538-14-mohamed@unpredictable.fr Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 6062e08c49..2252b96f83 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -189,7 +189,9 @@ void hvf_arm_init_debug(void) #define SYSREG_OSDLR_EL1 SYSREG(2, 0, 1, 3, 4) #define SYSREG_LORC_EL1 SYSREG(3, 0, 10, 4, 3) #define SYSREG_CNTPCT_EL0 SYSREG(3, 3, 14, 0, 1) +#define SYSREG_CNTP_TVAL_EL0 SYSREG(3, 3, 14, 2, 0) #define SYSREG_CNTP_CTL_EL0 SYSREG(3, 3, 14, 2, 1) +#define SYSREG_CNTP_CVAL_EL0 SYSREG(3, 3, 14, 2, 2) #define SYSREG_PMCR_EL0 SYSREG(3, 3, 9, 12, 0) #define SYSREG_PMUSERENR_EL0 SYSREG(3, 3, 9, 14, 0) #define SYSREG_PMCNTENSET_EL0 SYSREG(3, 3, 9, 12, 1) @@ -1719,9 +1721,15 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t r= eg, uint64_t *val) =20 switch (reg) { case SYSREG_CNTPCT_EL0: - *val =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) / - gt_cntfrq_period_ns(arm_cpu); - return 0; + case SYSREG_CNTP_CTL_EL0: + case SYSREG_CNTP_CVAL_EL0: + case SYSREG_CNTP_TVAL_EL0: + assert(!hvf_irqchip_in_kernel()); + /* Call the TCG sysreg handler. */ + if (hvf_sysreg_read_cp(cpu, "PTimer", reg, val)) { + return 0; + } + break; case SYSREG_OSLSR_EL1: *val =3D env->cp15.oslsr_el1; return 0; @@ -2015,12 +2023,14 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t= reg, uint64_t val) env->cp15.oslsr_el1 =3D val & 1; return 0; case SYSREG_CNTP_CTL_EL0: - /* - * Guests should not rely on the physical counter, but macOS emits - * disable writes to it. Let it do so, but ignore the requests. - */ - qemu_log_mask(LOG_UNIMP, "Unsupported write to CNTP_CTL_EL0\n"); - return 0; + case SYSREG_CNTP_CVAL_EL0: + case SYSREG_CNTP_TVAL_EL0: + assert(!hvf_irqchip_in_kernel()); + /* Call the TCG sysreg handler. */ + if (hvf_sysreg_write_cp(cpu, "PTimer", reg, val)) { + return 0; + } + break; case SYSREG_OSDLR_EL1: /* Dummy register */ return 0; --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630653; cv=none; d=zohomail.com; s=zohoarc; b=f3QnBGkIHiXHMoKNk/eWnj0xFPHLp85554t9mWr31qNvkNZNwDZx2lkDo/532bEhdQQMIBa99dUMtN18OcHEGx87V4WIERqyX6TBZy+yLrU+Hxm+0ahVag6QbVVFDKZc+HrkeZ5fSJW75HLgLKds6rVymWvt8xaDopXd5kZtdcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630653; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Hv7cYvxktwy54oula6sxtUsfnL7h+pinIsGYrJfHrDg=; b=QCjkGVvKdWqdT7TfEpNBOCNz9mahqamPMZ/MRYEL1BWBcKdp471hDVmCPDrC6heq9vXH47iwNTb6Fd1rFLPexfmQXQvGq8Ok5dsHDbAYvlqOYro8vzk9/fkDzJOm8R3k2Qj60vYXfALp8pVBNG1mXvwq1GDNU1RnSMP+MrLkYbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630653219181.73769317505878; Fri, 1 May 2026 03:17:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuO-000466-Da; Fri, 01 May 2026 06:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuM-00045O-GO for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:42 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wIkuK-0000Kn-Uo for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:42 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4852b81c73aso12611455e9.3 for ; Fri, 01 May 2026 03:15:40 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630539; x=1778235339; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Hv7cYvxktwy54oula6sxtUsfnL7h+pinIsGYrJfHrDg=; b=EjWWXDG4LkrClItHHAsyn9zSmKkmhxTkmtWIsMFY+7hGbjQz9l0qqR4YshO0OBbaB+ WVwH3b1c84XupvCAu/M2OuNstPsj/A7RnDRtStwGrtskcNUOjp/m9cfrHBg9oXDEtnit oN8rzYcl6r3IyTyU3Qy7ABxfse9orSFLTm+tQkrMRcf9w10n+b2t2EegMQyXq1eu99gZ L0dT7qlbu/xEtrogs+NCsPSQV42nH72xDcBZEgl9bXd+yk+B3sxweCdjE5NRCRaERvaF /vMd7Yd6uFh5bAONYf+F12JWqJPqhh1hV51PzFcnTg31bFfRrmdwFobBspUd0ftW7Wcf HcWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630539; x=1778235339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Hv7cYvxktwy54oula6sxtUsfnL7h+pinIsGYrJfHrDg=; b=DjfaSWY1m1tKqPG5Tt/qiatvGIEl1l9FKV3Sp0NRgvxSh5+nau12TzA/GLtQiDMiG5 1cSMAwMarnduUnvJ38qVEzVp+P9xKoYmB7q6my2wQL+S9/QLWgTmCa7yayvpF/hpoybh aOzoKFUwqteZ2EKtwvFRSMM9sc9j2Zfjn9K1KeXFFunIfwV68p6/mFk8VkGjPqYTjaPy LETZsPlJjRmxd3Igo2GBmUySFbnoLrF9cYlFlmGllKjSK/iJFHAM2tT/MD+p3Sh5wWLi 9W3GPI1NeiCs/GGC2fyblw+4oPG2FfgD7N73VDcc4xDzfIhkZKGPSL+ioyM25oIP2PjT yCKA== X-Gm-Message-State: AOJu0Yw+Idq76Uod11Y0BiAaJ4FiTLg5ZU2s2so5S0+W7pw2C7owgIPy aw2XK4aS100aqDSDjt3zD7vV1ZiCn0wk5/ILWMqm+G7AaksUGxQwy1I7ftVIfGQnsON3IPgvvR7 AVSFr X-Gm-Gg: AeBDiesXcLrFp06Op0Wcj9NrfY6FlTE283OZpENFruv0U8izXbOHJVFtgGGsL3BoQiC 8hSV8B+J9fyBCSkhci4p9qMyRt9DkQs+6sliRyQQHZ9JeGZD64iCLK6aAhXrHlfQCtfxeOMQMiZ INQTror2IRwmVbfyZY9G7E781ATX5+1arwqMO19rUFqFGuq+XueTMQgyCa8vFifIC55Bub2RBW/ pCtjXIzB4X6IUfvYnGFjB5MGPuGtFbDPnZpps0si82CQ1rrP9ogcaQnflP3piJWQnI9tG/K0Pnn 3ziU4+5E8eZnnrHvWZYbnp2elcSZKp9NLcWJ7a0AjMRiPbCYLLmP0TJoQlccIYiU8m287tlQcrZ /09zH2gCG/9TCqbkIPnCleMseAdPZZgv4u0cXrcPDUTrvR2H2n+5xczP7SHvGSK8FniHFD5r/UN BCWXdfrFGc0b0zZ8G2HAond5Yx0VnKsf1qE0Xu+aCoAKdsh4374NZUWqm5MfTi0zp+G9K9Hb+sJ OhzLeZv2nWLC25npO1jS3D0eEQePh+qJLWFHKotNQ== X-Received: by 2002:a05:600c:1382:b0:488:a977:8d6 with SMTP id 5b1f17b1804b1-48a84458db6mr101313175e9.19.1777630539565; Fri, 01 May 2026 03:15:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/28] hvf: enable nested virtualisation support Date: Fri, 1 May 2026 11:15:04 +0100 Message-ID: <20260501101505.3485916-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630653836154100 Content-Type: text/plain; charset="utf-8" From: Mohamed Mediouni Signed-off-by: Mohamed Mediouni Reviewed-by: Manos Pitsidianakis Message-id: 20260429190532.26538-15-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- hw/arm/virt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ca50411020..ad0a459987 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2719,7 +2719,8 @@ static void machvirt_init(MachineState *machine) exit(1); } =20 - if (vms->virt && !kvm_enabled() && !tcg_enabled() && !qtest_enabled())= { + if (vms->virt && !kvm_enabled() && !tcg_enabled() + && !hvf_enabled() && !qtest_enabled()) { error_report("mach-virt: %s does not support providing " "Virtualization extensions to the guest CPU", current_accel_name()); --=20 2.43.0 From nobody Sat May 30 18:35:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1777630671; cv=none; d=zohomail.com; s=zohoarc; b=eFUZZXy0WXJDMwzxQD0EK7ptB7/RHc6W2fRbKA4e7ax0bahfAzwxEcBxDj0MqVmbAXZRswfteaGUSYl3u43cGqmo2SJUP9t21bSNR6OlGqc1+i9IIxyu68QV7irmOAO3Patjl1drBm6ItirGd/l1eU2cfvG4b7PSOVl1wvPtAO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777630671; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=L9CjgKuIn/enkAlQvRU0xfpossUgh2O4ehxD2AGrQ84=; b=OsrtQSHb3UOe1ByXNucJ/BIEP4Vy++XUHOXaPnQWWW1HMbfQEB/ljB2f0enQrkdJfJKAgwfmhy6EN2tgYezrX5nYLsTRsRWnTt8PRthyehhqu58w4aNTeFuK0l6UQYqzMgqGXcMPJkuUgIPkpPnQKH+pqN7DLkcGygSSG7Kpwwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777630671004532.1989211348969; Fri, 1 May 2026 03:17:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIkuT-00048q-1s; Fri, 01 May 2026 06:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIkuO-000469-LJ for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:44 -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 1wIkuM-0000M9-Ph for qemu-devel@nongnu.org; Fri, 01 May 2026 06:15:44 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-483487335c2so19480145e9.2 for ; Fri, 01 May 2026 03:15:42 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a8fede418sm12863335e9.6.2026.05.01.03.15.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 03:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777630541; x=1778235341; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=L9CjgKuIn/enkAlQvRU0xfpossUgh2O4ehxD2AGrQ84=; b=nNn3rHR6BdJVFtv2vUekuZlf1KPACpSkgsS5XhpzNZt5NOEoSO4qH1xdzVLpQ0+pAv VbIV86duXpgdPBtG1T0oeEu0jtAu44x4RLKPUOej2XuDrkiaiECL6BmzdPU2oByIcWlE RhZKW7SyBmhykfJ5cbfCjZvAnhjViTS9XnSjQz7TZMe0ra2zpONiJec5IJHZj+MoqGTN jThNxZ1d9/i94i6KcMxprOYkRVS+xIwSY6G98ZXvQYEmCjUpZOT6KaHSeKjknJrH6OxK Q7ivzqTwaqtA6U2uAzpJ3pl9Isvd4/lI0es6Rdu6d3tYJSX1WlI4IfDyAR7BA1IJt6iW 1l5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777630541; x=1778235341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=L9CjgKuIn/enkAlQvRU0xfpossUgh2O4ehxD2AGrQ84=; b=nngXaoMywZutn67BytFGyNAzBoK49Nl+ADYzZ7mBZC3AdQRsUgR9ogy5ExFSP/KQ5Q C/WCbVg7zqqL86dAaJ7v84cW5F0b4MwS0/DRrzqdzpgj5ribi9IaIVoznD2M8NVt2bYD tZuwTumzkYSBgf/aQTKmtHjKPUCnHCn88XuvfydAGkyIdpYm9mDaxT8ubs8AzzQnBBUP 0Y2kngYWynF/W3mBaYB82Q/StjEqhWI5CEm2wJkUWEBSpGsboZc91l7Si7bu/huk3AYN zyvfVovIBlnZhGd+Yw9q5/7y1v6TA/ZkFb2m4TwWhnm0eAA+mPQ1SfnZlapYaDsnyivZ tpQA== X-Gm-Message-State: AOJu0Yymc1w1qPVdwAflbhtB268p6trOIrE1M6dG28I1y35VxKmdK/Re +lGuPzRjyQO+3z8vTeaMkFvBRZdCTOze6Am8uOA1bxAEo6ZTP23y0lFyla3unQ6SP3kr+RH8kh/ rk6Tt X-Gm-Gg: AeBDiev5dgpU1g1Vj4XIBn+H/lMIs19SfgGu+G3ca0zXbRXXaskbMGx/3ND1PLjRET9 nww7MURgIpxPvfUNgNdrYI6ZwipOcgNTcL+rhDVY08QWlq6KIc3CIEnqVYqToMiOuwaIKCzFDts YZFQ9iQS9DVy3BfSp/Z86VXfdsY4+y6v24qbMLWiqbdfkFy4Dlz/LkbRaIGOKKwBJbT+U1N0vsa KX4JxbTSJqK5+cjil6HigNNcZr3viksBSP4BpWQnKf8mS2s2zvXOF57f+VYZBYL73MLkKRv4hY3 ri1bzlUDBqZiTYQ7vLUBx3i3ekHN1L74/k/JBvVrk10VKpO665HUhrT2gTZbpqEjyNfWECIkniE 83kwfg3jy2vhAvONYdTx1q+vkirpgbVoPqRcSHLDfi8guUd8lo4XpfjjRrnb8HN5h00uzn6DHw5 Wb+4Zxk69tDf9duGaaOgLuTZHPDqd7GwUUwgvB03h9703TkqBbmj15pKZcLx76KV90RQmeSJ/VN 66ae2xk0+wFALhQbu5EwLBHjp5dg36nQL4pHUzwIA== X-Received: by 2002:a05:600c:6088:b0:489:1cd2:610a with SMTP id 5b1f17b1804b1-48a844ec847mr102891865e9.9.1777630541439; Fri, 01 May 2026 03:15:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/28] hvf: arm: enable vGIC by default for virt-11.1 and later Date: Fri, 1 May 2026 11:15:05 +0100 Message-ID: <20260501101505.3485916-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501101505.3485916-1-peter.maydell@linaro.org> References: <20260501101505.3485916-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1777630671527158500 Content-Type: text/plain; charset="utf-8" From: Mohamed Mediouni Save states are incompatible between kernel-irqchip=3Don and off on HVF due= to opaque vGIC state. Signed-off-by: Mohamed Mediouni Reviewed-by: Manos Pitsidianakis Message-id: 20260429190532.26538-16-mohamed@unpredictable.fr Signed-off-by: Peter Maydell --- accel/hvf/hvf-all.c | 11 +++++++++++ hw/arm/virt.c | 15 +++++++++++++++ include/hw/arm/virt.h | 2 ++ include/hw/core/boards.h | 1 + include/system/hvf_int.h | 1 + 5 files changed, 30 insertions(+) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index da29aa3aa3..946dbca59d 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -25,6 +25,7 @@ bool hvf_allowed; bool hvf_kernel_irqchip; bool hvf_nested_virt; +bool hvf_kernel_irqchip_override; =20 void hvf_nested_virt_enable(bool nested_virt) { @@ -204,6 +205,13 @@ static int hvf_accel_init(AccelState *as, MachineState= *ms) } } =20 + if (mc->get_kernel_irqchip_default) { + bool kernel_irqchip_default =3D mc->get_kernel_irqchip_default(ms); + if (!hvf_kernel_irqchip_override) { + hvf_kernel_irqchip =3D kernel_irqchip_default; + } + } + ret =3D hvf_arch_vm_create(ms, (uint32_t)pa_range); if (ret =3D=3D HV_DENIED) { error_report("Could not access HVF. Is the executable signed" @@ -230,6 +238,8 @@ static void hvf_set_kernel_irqchip(Object *obj, Visitor= *v, Error **errp) { OnOffSplit mode; + + hvf_kernel_irqchip_override =3D true; if (!visit_type_OnOffSplit(v, name, &mode, errp)) { return; } @@ -269,6 +279,7 @@ static void hvf_accel_class_init(ObjectClass *oc, const= void *data) ac->init_machine =3D hvf_accel_init; ac->allowed =3D &hvf_allowed; ac->gdbstub_supported_sstep_flags =3D hvf_gdbstub_sstep_flags; + hvf_kernel_irqchip_override =3D false; hvf_kernel_irqchip =3D false; object_class_property_add(oc, "kernel-irqchip", "on|off|split", NULL, hvf_set_kernel_irqchip, diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ad0a459987..fe19030886 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3769,6 +3769,17 @@ static int virt_get_physical_address_range(MachineSt= ate *ms, return requested_ipa_size; } =20 +static bool get_kernel_irqchip_default(const MachineState *ms) +{ + VirtMachineState *vms =3D VIRT_MACHINE(ms); + VirtMachineClass *vmc =3D VIRT_MACHINE_GET_CLASS(vms); + if (hvf_allowed) { + return !vmc->hvf_no_kernel_irqchip_default; + } else { + return true; + } +} + static const char *virt_get_default_cpu_type(const MachineState *ms) { return tcg_enabled() ? ARM_CPU_TYPE_NAME("cortex-a15") @@ -3835,6 +3846,7 @@ static void virt_machine_class_init(ObjectClass *oc, = const void *data) mc->get_default_cpu_node_id =3D virt_get_default_cpu_node_id; mc->kvm_type =3D virt_kvm_type; mc->get_physical_address_range =3D virt_get_physical_address_range; + mc->get_kernel_irqchip_default =3D get_kernel_irqchip_default; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler =3D virt_machine_get_hotplug_handler; hc->pre_plug =3D virt_machine_device_pre_plug_cb; @@ -4079,8 +4091,11 @@ DEFINE_VIRT_MACHINE_AS_LATEST(11, 1) =20 static void virt_machine_11_0_options(MachineClass *mc) { + VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + virt_machine_11_1_options(mc); compat_props_add(mc->compat_props, hw_compat_11_0, hw_compat_11_0_len); + vmc->hvf_no_kernel_irqchip_default =3D true; } DEFINE_VIRT_MACHINE(11, 0) =20 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index fc7950da85..13e135a460 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -138,6 +138,8 @@ struct VirtMachineClass { bool no_tcg_lpa2; bool no_ns_el2_virt_timer_irq; bool no_nested_smmu; + /* HVF specific: support for kernel-irqchip=3Don introduced in QEMU 11= .1 */ + bool hvf_no_kernel_irqchip_default; }; =20 struct VirtMachineState { diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index ca63304c95..29c68931d8 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -280,6 +280,7 @@ struct MachineClass { int (*kvm_type)(MachineState *machine, const char *arg); int (*get_physical_address_range)(MachineState *machine, int default_ipa_size, int max_ipa_size); + bool (*get_kernel_irqchip_default) (const MachineState *machine); =20 BlockInterfaceType block_default_type; int units_per_default_bus; diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index 2621164cb2..ad7d375109 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -112,4 +112,5 @@ bool hvf_arch_cpu_realize(CPUState *cpu, Error **errp); uint32_t hvf_arch_get_default_ipa_bit_size(void); uint32_t hvf_arch_get_max_ipa_bit_size(void); =20 +extern bool hvf_kernel_irqchip_override; #endif --=20 2.43.0