From patchwork Thu Nov 23 18:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746498 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1035965wru; Thu, 23 Nov 2023 10:36:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcoj0+m/bohqweeEVF6llPvhf+nqeSPBwvrQ9vhiqix3FF69L9pOUfFB8YiZxz/JudhCLM X-Received: by 2002:a05:622a:1345:b0:423:857b:7609 with SMTP id w5-20020a05622a134500b00423857b7609mr5352759qtk.11.1700764582043; Thu, 23 Nov 2023 10:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764582; cv=none; d=google.com; s=arc-20160816; b=X9fLp6iQK4saKPnxe17Gff0X1m1EFjp65YGRGav/VAqup07vfH2UfnBKgQ8oeIIplW EOrWx4hXh5dxML2JsSDoXHJZcxM9mvoN/UTeWZU1V6ocbmXn85CjpVnorKisJ5ofQypM FfHBsfFCCGWrOpo85xUHoA9a5Drj3ylLxYmyGaJg3jJjx3KMXJw9VuGhkYeyJC4qZ/UK u6uIK8M5dgu+93FJ8Mijoayd/k5xZUFSTAbbK36jIeUft/QtL05ywIwSmt5lMR/hhVqS 6DeuXNtvFVmwqX4xTIjQcUb5sl5JDXp6spceCzD0ZpRFfg7e/+K9TQMDIWbD93VcYKCE udgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EggnDxiS3lb3CDYKGlg1a7WOxUSv7txLuyeSgPzo5Gg=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=goycKy14I8duwGB7Un4tYK0+28OO6gOHXcKw2BRiDdpm7ORaoi3eped+MqzPPjjdFM j1s7dSusybcWDv9Qpw4d8MmCmcqi3n1Yx0U1lNwVSlTRXdJ7Mcj/LuSeBCPlOvbwL3iJ sxLTwrej6m5haYfxddlNUUruClwT4jC+3tUGDpfyxcu6R0DcgxCFm/pE58fnQXtqdHZt psXETkkIk5lDlWtLAINiZO4pgIB62OeiGwz0JgrN2J95cNgZSHyKYAiTAccCkmWq3tCL VW9RM79NS7yc5ap99tAt2B8iiJO1M/5Le8acJq0ntEGNNFt236QMiRrB5BGDclvKqcwr +AVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jc5YS1ys; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n6-20020ac85a06000000b004197d8cff5fsi1531879qta.612.2023.11.23.10.36.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:36:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jc5YS1ys; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EY9-0007xJ-2r; Thu, 23 Nov 2023 13:35:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EXy-0007bN-E1 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:33 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EXw-0002m0-V7 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:30 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40859dee28cso9075445e9.0 for ; Thu, 23 Nov 2023 10:35:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764527; x=1701369327; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EggnDxiS3lb3CDYKGlg1a7WOxUSv7txLuyeSgPzo5Gg=; b=jc5YS1ysaXGid2dJ8paaQL3XXcEjWfoJVN08kZNzuL0ZXA2QUnEAJAaiBzuElubUPG aO5mvzqLWjqQyTx0GtBxmwhwEdmaTfHD70NRNVOw+1e8vF97SiCDo/cjOoZXddWYGSUT i2IFpEfM0du32Prlx0zBmxLrX5C5gYdGDE9za7DSoBqGcoKTEAoztCqliuL96jOSosfX 96pWuEFqE1fiHx5Ji4o7c3iZQ0OrywMHdiI2YO1HWYKh0dXa/dEaG7NdHMVFyGc2IWMM e50tgWPZ0D2HU9mZgasMxBr02Fd7PXFijP+dY9qgsszIxURVZBaBX3rSyV1TDUzOq8uz SjAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764527; x=1701369327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EggnDxiS3lb3CDYKGlg1a7WOxUSv7txLuyeSgPzo5Gg=; b=Ghmt+n/49tRMOYV+4+GYDFkYAwzmyIONDCx6zK38tZOSiKWo6L/Hfw31TitJv3HE9+ Jts9ezBAlaKo/KjeRLFGvo5+0UmPHFOSIk3q/VIqP2CImjM+7WDq9XDAXNjmIBi7oxPV qlDLS/Sxd3kjuSP45yXtBEx8AoHvTWnUnrlaRFj2m8Kh4HAMpm+y2SY3pk3yWNiPrf4x LgMyMAbM1TfA3aMQfPQQQxcCcsDiqvHoix1igHEm6af/eNiSi0nCv37u+j5SRiq3x9Xj 02CX8ikti4UgG3C1//CczfhLp29M0V6VgJabl70cHFXgRigJ0IH8zLC+s5M2n+xQfvf4 awFA== X-Gm-Message-State: AOJu0YyjHrN7LJMEe8f6xjHNDnrLXxYcb/XzZ1grcIBlNp20Xyml6L0B 7CIoMu9L0pq80B4Pu/261N9kaskIICmTZYWn4aI= X-Received: by 2002:a7b:c8cc:0:b0:40b:346c:f3f5 with SMTP id f12-20020a7bc8cc000000b0040b346cf3f5mr345640wml.30.1700764526586; Thu, 23 Nov 2023 10:35:26 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id t17-20020a05600c451100b0040b379e8526sm2034152wmo.25.2023.11.23.10.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 01/16] hw/intc/arm_gicv3: Include missing 'qemu/error-report.h' header Date: Thu, 23 Nov 2023 19:35:02 +0100 Message-ID: <20231123183518.64569-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org kvm_arm_its_reset_hold() calls warn_report(), itself declared in "qemu/error-report.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- hw/intc/arm_gicv3_its_kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index f7df602cff..3befc960db 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_kvm.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/error-report.h" #include "hw/intc/arm_gicv3_its_common.h" #include "hw/qdev-properties.h" #include "sysemu/runstate.h" From patchwork Thu Nov 23 18:35:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746504 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036262wru; Thu, 23 Nov 2023 10:37:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5xIfPYgjy2ANA8wWVpsYKES4v4QMous+B/X8k/Sp6Ayi1soVINLRVV8Mwn2kpDrfgj1A8 X-Received: by 2002:a0c:f704:0:b0:66d:58a2:d23d with SMTP id w4-20020a0cf704000000b0066d58a2d23dmr253375qvn.61.1700764632012; Thu, 23 Nov 2023 10:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764631; cv=none; d=google.com; s=arc-20160816; b=LEVhhseH9LT2+uw46M8NBmXZ3F2wrmUQl35UNtFKZ1XOSQrOcGPvcLRi8VEmJJBPA1 iIDkJv8X4sO5VCyduwOPFAnKLWVUEfCoVLTjlh2t19n/2Gnj3e3pydw2Mw9pz22OPI4L tV+nXWpUSYMzgFC06chVycjQcIsSy7iT0GNqzRtgrvE/UTceSAqdR9lQvu9nNnBUppqM o+Mj9sM/ke6WCulXREUUxNy7whcfaiFivzsmqkw/cVqgGb8g0EYzvYksY58k5GyhxCqm 45Sdw5DSk+zk9wJcKizoBPBj/k+mA2B2zSj5u5awRTmg6OhObm9r8aiUuxEzPJddnlA+ ih9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BmQzUMP7VYVa7fjT/YSlrE9ib44vaPa3uhyPvwmHEck=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=LSWhUAZXxsTGQHgscNgve5OW6qVeDzgQGXZlCIJMt9fMbOBLbUlJ8q2R+uWt1Ctb/p uzdGyHgo2frb812iH31i7FXBaeXCpSunBKrrG+zV5LDLhM4MjymKZ21F3Mzk9XBvZo7T wVKzNX9HFA3obyt/gTv1F7IYdSeA2F/BXZuxCxo70Nu0OowT03CQyIXn9WD1BLaSG8aQ ySCF7zPUmIK5Nu5gJGND9t+MBgnOfnmwk+85FAjn8kxuYvzVnL2WNRIOolmjgk59HTp1 2tAddHOMXmT5GWCDGjNfeMVLw0wgvGskw1PZJWY6Xtz1EuMRECHnFbgRebVA4OvZFyeH UnnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oqT1lGyR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o7-20020ad45c87000000b00677ad1d6c7dsi1757389qvh.274.2023.11.23.10.37.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oqT1lGyR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EY8-0007sF-Fj; Thu, 23 Nov 2023 13:35:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EY3-0007eT-VA for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:36 -0500 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 1r6EY1-0002x0-M2 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:35 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40b38a1351fso3007005e9.2 for ; Thu, 23 Nov 2023 10:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764532; x=1701369332; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BmQzUMP7VYVa7fjT/YSlrE9ib44vaPa3uhyPvwmHEck=; b=oqT1lGyRCH4nIrs1nYlqwoTtl6g3qeWqyG6kyJveApboSFe+cfSbuvpoXTFLK0/CcL 5TEzgEaQdk526HtmNDoidfNawSL0Y0gB8TysOV4q3NibkqZPqFgbNW3j5siGZhjiSa06 hPVhlV+awnjOimhxhAuyf9BPZsDhiMPSPMPq945qnkzZLb7PPhf1Tgg5yAaDRajOqBKL Z74j4r56xpGOvwDtM0UhxKUFJGJXWgg5qbsj48RLj2xNbH8EX1wJs7+mO8jai13WQAUK jB8czHxqRtMr0pf8EiPhN5J74obSbQEurO1r6kaZTPnsyDzD3qu68QnkzCI7kdGWR70C ReCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764532; x=1701369332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BmQzUMP7VYVa7fjT/YSlrE9ib44vaPa3uhyPvwmHEck=; b=jW3ITXBhg0XtIlwBT8d8kkqVvZfQrDphJkZiFiyMJMm8oIokQoWnq8Hbk5Ajc9Zbvx sAsMB+jFwKQFuukUdwwQvZ0fImVNUcJLplnDYlrJC3+ul8rtNhYGXHsa2mVqBottfaFY wDKmyBmgUnp92jtJksQ44lludnbs9VgSeIWI6djgTlkkn07CZakq1OIRmR2rxlObtvcc xzWdT7XlhQfnmNQaIcCYV64coMMc0tydpKGF6d27OTpqTsO6Hv5fnxzTntCVdNXbkTxw gUTVbxkfZJoKXe5ouMni8BkndZHrUGvvRjTt37TYdJ8RcO1EsTu7lgXx01H8ieKw5Af9 qJ/g== X-Gm-Message-State: AOJu0YxHcIS2IZoEmQ8sDvrjqfIA3HYVZ/QgCbLGHoYIyHphA8GP2S+t X6h/kvoqKM9bbjBCflG65HpAUhJmxMXiFqthekg= X-Received: by 2002:adf:ec03:0:b0:332:c723:12ad with SMTP id x3-20020adfec03000000b00332c72312admr176313wrn.66.1700764532048; Thu, 23 Nov 2023 10:35:32 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id o10-20020adfcf0a000000b00332cda91c85sm2327141wrj.12.2023.11.23.10.35.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 02/16] target/arm/kvm: Remove unused includes Date: Thu, 23 Nov 2023 19:35:03 +0100 Message-ID: <20231123183518.64569-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Both MemoryRegion and Error types are forward declared in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 2037b2d7ea..50967f4ae9 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -12,8 +12,6 @@ #define QEMU_KVM_ARM_H #include "sysemu/kvm.h" -#include "exec/memory.h" -#include "qemu/error-report.h" #define KVM_ARM_VGIC_V2 (1 << 0) #define KVM_ARM_VGIC_V3 (1 << 1) From patchwork Thu Nov 23 18:35:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746503 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036209wru; Thu, 23 Nov 2023 10:37:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6BdtlVIybkdAqpy7KWANz7Wfdwrq3YWMVHotX1TExKrIfS++NUvQi9ueN688FdnWOIEOX X-Received: by 2002:a05:6358:9191:b0:16b:4041:88a2 with SMTP id j17-20020a056358919100b0016b404188a2mr154427rwa.10.1700764624576; Thu, 23 Nov 2023 10:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764624; cv=none; d=google.com; s=arc-20160816; b=bEpq+HTnGT1RygLqgtGcszjCbtDJ0BG88JC9fFUaK7tygyK0CajKv2VdV4NFXppdJ6 YBq+QtSck8Lzj/37oMQ76pZkYEzSFVacDC82Ty2fbvuRlmuI5AYmhcTXvZC4U6Mv+lvh mJ8DjJBAAUoyftFiKJlI7JzrDL+hph6TDpWzQ3AbraXCe2aqGzTe8KfCbgdH1bkWYx5U GwkrTkE/bT+jO3LYamfqy0i7wY+70RGDKGl//7WKsJy9eQex00YppXxZtReJbFDUpdx0 yzzDTapTKh3jB9Jp0XN3DHa+4DEN/ECFre40+UO4VOSxX7Tx2iMQ4WcjtwkcQNi3nOqX 5cDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=Y3OITILd610Ym1/TujTiTzhYV2yDIXiD9Gwfb+pxlEupp08Q9RbkJp0bfCsZ5lh+oC wMGLeodP+BXpouyloXORN5qTe+ROnT9XAF9KHS16afTUJaApkX/pRtgwuqCAdz2iyXuo pPratcG2/Vlp9XMbq6itvd6lc7NzG2ZKngQDdnh8nzjKYOD0dbyNLBy7ZJsM2caKEaG/ PK9rO6mQ2fGiBt8BwbzuXjHkc4C2p/EqgHoBeRZoqmFuUc3QizlE/FFPBYaFz4WmXz3G Tst3trmewbBS0Z+JSHZ2vYQ1C+v15lvdzMbiMu3oQYjpCXCtPwWpES9nq/SAJUa7QWvL wiow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=quoyJIPc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g15-20020ac85d4f000000b004237b4532c9si1644483qtx.462.2023.11.23.10.37.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=quoyJIPc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYE-0008A6-4Z; Thu, 23 Nov 2023 13:35:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYA-000812-Ma for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:43 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EY8-00032G-4a for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:41 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c8880f14eeso14593391fa.3 for ; Thu, 23 Nov 2023 10:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764538; x=1701369338; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; b=quoyJIPcAfapZdut8H3QrV+VIpNOj2pRTRq6bAnVJ+cG+LbnzS5kUJeLk610k5XlvU QRR9630dgl5zed7xbsDVbHw97JI7AUXeWtYXHxAh/8EM9RnyYgJuZrerH7wst73iZQK+ BKYYrEZG8xLnHyulLpgcQCKNU+hSpZsGAy3B59RdSo1BPEY6ETRI3jVGiYKpiSjjsGa9 EyxvK4QWVBCNC6ArMs6RHHU98mkP3JOSq8R5sT3f4U/pvb+RGudiQxWIQ52i3gt896gZ wSuqJVq561ShqejTNhngMWhfvdYl3NAQYqyQcVvpsteNGtJcIsmoPx9ytnTvCoIegR2I irWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764538; x=1701369338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; b=wO9pESa4rk6M324wdLFWMjWoeo76Y2TmPjk0YdjLNYfc/MlvWg121u6z7odm+HmMT5 DpuA2EXDWMHNIyDUz9D1KUZvl+RZh8s33UbZGGRffFKvFLI0e3ylDCPQRxFfwozVTDGO FktTsSkFQUNygXlNm5jDydG88NAMfhvFcrJW0UcihMCUuU7rzRM50RRn/sq7qaPq+HCi aEOpnM/g/MusFT2YFAUwjx7chHvidLkFtb12HWkGLB6LBoiMcJmKHZ6BQ9GoWx8yeZs4 bj7NcV/EJJtrr03/ArHer1Me40fHVcOoFTZz3y4s8rmVCIj6UYEDUkhTuHER7CUzWsB8 OclA== X-Gm-Message-State: AOJu0YzD3NZouLWc1JYUwQ/kbLhftRvnh9N58pPp55u++Y3CAia9rOPB oklKp80g3ZgxL4tBFtqcEBvmHrHWiej70WJONWE= X-Received: by 2002:a2e:b00e:0:b0:2c5:70f:614a with SMTP id y14-20020a2eb00e000000b002c5070f614amr155623ljk.17.1700764537845; Thu, 23 Nov 2023 10:35:37 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id o7-20020a5d6847000000b0032dab20e773sm2268980wrw.69.2023.11.23.10.35.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 03/16] target/arm/kvm: Have kvm_arm_add_vcpu_properties take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:04 +0100 Message-ID: <20231123183518.64569-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 4 ++-- target/arm/cpu.c | 2 +- target/arm/kvm.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 50967f4ae9..6fb8a5f67e 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -153,7 +153,7 @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); * Add all KVM specific CPU properties to the CPU object. These * are the CPU properties with "kvm-" prefixed names. */ -void kvm_arm_add_vcpu_properties(Object *obj); +void kvm_arm_add_vcpu_properties(ARMCPU *cpu); /** * kvm_arm_steal_time_finalize: @@ -243,7 +243,7 @@ static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) g_assert_not_reached(); } -static inline void kvm_arm_add_vcpu_properties(Object *obj) +static inline void kvm_arm_add_vcpu_properties(ARMCPU *cpu) { g_assert_not_reached(); } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 25e9d2ae7b..97081e0c70 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1686,7 +1686,7 @@ void arm_cpu_post_init(Object *obj) } if (kvm_enabled()) { - kvm_arm_add_vcpu_properties(obj); + kvm_arm_add_vcpu_properties(cpu); } #ifndef CONFIG_USER_ONLY diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 6e3fea1879..03195f5627 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -495,10 +495,10 @@ static void kvm_steal_time_set(Object *obj, bool value, Error **errp) } /* KVM VCPU properties should be prefixed with "kvm-". */ -void kvm_arm_add_vcpu_properties(Object *obj) +void kvm_arm_add_vcpu_properties(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(obj); CPUARMState *env = &cpu->env; + Object *obj = OBJECT(cpu); if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) { cpu->kvm_adjvtime = true; From patchwork Thu Nov 23 18:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746513 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1037354wru; Thu, 23 Nov 2023 10:40:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGw9JMUNtIPreKcxm3E5Cju5xVD2p3htdHdSihET9y2uSOQrjDSwiSFm3gQVhTVmP2oxk0z X-Received: by 2002:a05:620a:118b:b0:77d:784f:1951 with SMTP id b11-20020a05620a118b00b0077d784f1951mr269008qkk.1.1700764804005; Thu, 23 Nov 2023 10:40:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764803; cv=none; d=google.com; s=arc-20160816; b=M1PRopscts48UepkarBGyQfKmampTgFYm8ndOyAQRljWxe2TWcLO8XrmHK+7UJVsh0 BL/VBfJpIl0Twx+azlqF/7FCuCXZU9Em3Z9/RDpYMeXoKrqffi/AWBMuxwyz15UI7d29 7x26zK+kuhaghWoH/osi+1x0R83aEWItQkaOTmK50XCH/NptY8yRWISF4cWUuzOlUDoj taj+2YutfjG7R9m3KLCPVXLg0xsTrr1ySbfpcqtCsu4+z7RK3lXZr/dVYxttxfpzqkZv i+rCnDmbayZMTjmd+9pbDAOlb7Gdh72SJFECUD1A5fMvEKS+LAaojpdAmEB63su/LxKA Q/9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=Oh2xakDTv01xJg32jvCrvbUMZoBBL4OfQAavl9sqxSfp2r+aGzTz6KP8tR2cAbIRjC EJKha1auK0S/z2Amr+lgn2AYRR+Z5OA7mlKXbocD/jcbE0+lYmcL12E9gxeIhkTTpdMK SVKq0jc7vJscJ6fXak5+r07HU8W2IKD8Jh2Ujmt9eoP/yQPSNrPfQfhdqbQkWwYaxxDr mx4T5Nao1dkM2x+T7QVYxYgjzNAo847CuephWjNVuXq2jevOTAdHE16bOqiJza3cULmR 8LIy3KOoqrjgHFBtI9fkwuJR2RkchnrmxZ9o7I4eWcBIPlMTG4MYVUknf+26e3jqS6AY yE4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vnn7iKeZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b7-20020a05620a270700b0077d79a9ce11si656271qkp.552.2023.11.23.10.40.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:40:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vnn7iKeZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYH-0008E6-0E; Thu, 23 Nov 2023 13:35:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYG-0008Dp-06 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:48 -0500 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 1r6EYD-00038Q-6T for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:47 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40b399a6529so437185e9.1 for ; Thu, 23 Nov 2023 10:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764543; x=1701369343; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; b=Vnn7iKeZrXS1iwb59lu64o7mg1AY1LIi/CBkCgOReeR5D2fYm/DgRKgmiXlB0jCJq2 G/6O+KZbRqpc8mFunZOYjTLppQ5et7pdO4RYGGj70HyHqvMlUVLhwU3vOEYza4ihtcB8 FrxLpuEuJXuNYZZTaGmB4hlonyFO3HBOUT8hrXYkDi1ol49HtZmoSG0Oo5mlw3CO6EKZ keBBr6hFkh9wRLjQcIeZKTK1LkHpfC0b+n4Sz6GOzdNL78TDjCfK/P2r833UXEMYRxk2 P2uNQYndYDn6tJiWKezknt18QrxtyvEkrRYrUhI4+cZhCAnx2Wp/lES58UBeaH2dUMQo BHyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764543; x=1701369343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; b=FCaLeX3ReXk8CvplieNz8sOSXPTVbUtjujevW2GzgBoQLLWXKfFVoLDp3faxxk53IM y88sOf2DmxDI6ZAmtv8MGV7Vd46GUR/eFTxHuXGq4hZePKhjLvmWDwQGUJRmeOddBK8R nhF9/D9LB2y8LxRXuTAp1gD/6m2KtjbWnYPg7O5NN4iUtzXtjn9jIIcwSH8SWbs/k/Ud j6ZZwAqIH50HUV8KzVKXcviW2vYDsauTRborf42DDbrRy1eGBFBNwWolS65StvSUS2D/ PLFGllTVzBMlCrxMsJbFepCkShlO4WtpT+sL/nE7+7yIl955jpvfccEyhQiNOs13nv67 wM+Q== X-Gm-Message-State: AOJu0YyJ5NYqOpe7mamvqgeBlFXlmzg1q4mL3JZsqhAX7r73oP1eB9wa TV6fBvkpS7eulppWP3VIAApCJ+vXAc5CWFiLgiA= X-Received: by 2002:adf:e981:0:b0:332:c9f5:e5b5 with SMTP id h1-20020adfe981000000b00332c9f5e5b5mr54137wrm.0.1700764543126; Thu, 23 Nov 2023 10:35:43 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id k15-20020a5d628f000000b0031ad5fb5a0fsm2315722wru.58.2023.11.23.10.35.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 04/16] target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:05 +0100 Message-ID: <20231123183518.64569-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 03195f5627..71833a845a 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1857,14 +1857,13 @@ uint32_t kvm_arm_sve_get_vls(CPUState *cs) return vls[0]; } -static int kvm_arm_sve_set_vls(CPUState *cs) +static int kvm_arm_sve_set_vls(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); uint64_t vls[KVM_ARM64_SVE_VLS_WORDS] = { cpu->sve_vq.map }; assert(cpu->sve_max_vq <= KVM_ARM64_SVE_VQ_MAX); - return kvm_set_one_reg(cs, KVM_REG_ARM64_SVE_VLS, &vls[0]); + return kvm_set_one_reg(CPU(cpu), KVM_REG_ARM64_SVE_VLS, &vls[0]); } #define ARM_CPU_ID_MPIDR 3, 0, 0, 0, 5 @@ -1921,7 +1920,7 @@ int kvm_arch_init_vcpu(CPUState *cs) } if (cpu_isar_feature(aa64_sve, cpu)) { - ret = kvm_arm_sve_set_vls(cs); + ret = kvm_arm_sve_set_vls(cpu); if (ret) { return ret; } From patchwork Thu Nov 23 18:35:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746508 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036484wru; Thu, 23 Nov 2023 10:37:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJcvfW7qbR1UVlVp9MVqcf2DAmoBajwb2D5JLEML6D7t1cGOe78Rg+PHWEf3QsYTZy9O5p X-Received: by 2002:ad4:5042:0:b0:66f:b857:cbbb with SMTP id m2-20020ad45042000000b0066fb857cbbbmr452488qvq.12.1700764667363; Thu, 23 Nov 2023 10:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764667; cv=none; d=google.com; s=arc-20160816; b=o6NmqZxM2FmQ6uqX4CCR9diVK+9+er0ajSzM2IL3A1gqm/O0FTNVq7cXyCHHDeCUPI 2r9RRyM52xYKYIy8qENXJPwooOhrbDTuh9YdYx01sphndNFKDYzQW+coPHwfVOMtKLdp GC5OxaMJ5Prd8elFPOFmyqb/WrvPuiG0NM2Esg7pQOh9yXWF4w2ahNUY4G+rOV2LWX1k RvAy8Rt6kgmaJEpqAlu5oQzDG9aVvxHkGIfwrvG9dNjR7lb5gVKvk7JaRDUT0iC+Qwmf k0jfZVWsEyNsPgHUg2ka9DZ9OnrKwe1gwENU0YEoruuFZm7Tbf3pByLiZZs7jyETo0R/ oMtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BbxwUSVkjdWQxr0WbjMFM/ALqAenG4WEeRbrPnMTydM=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=ZC1vUL191BrUCWasMpKnAKRv0VLuL7JddDH6Pc6DreyFwve14ZaY+riaSIDZiJ3iH7 rvwJnrIdKRfdYccy8FGFM2JRGNYURCzzbr6RengJSC4m9JEbUm+qYa54I89j/yY5kbj0 gIqr+iJalLddJqW7faSN4fXVLD0yaH8jymHE35PEA5xlwOAv5QrDfvNWMxfUXo3MCSIy 3h4syEo4vAaQ79YmJxeNmNES5cJ9Z056c1w/P0Gn16K6c3LA5Emw4sa42Xo+Fb52z2jF L5Bi1eTvtv0wLan9QhBzjfZYrylkq7ElIqnwaU/EQyK9ZkDmz75KV5ajn7Q+3+8Z+d5k N8Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=drVCCUgi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id mx3-20020a0562142e0300b00677fba3afecsi1591283qvb.212.2023.11.23.10.37.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=drVCCUgi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYR-0008If-Nn; Thu, 23 Nov 2023 13:36:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYL-0008GM-Oe for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:53 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYJ-0003IZ-2d for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:53 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3316d3d11e1so698128f8f.0 for ; Thu, 23 Nov 2023 10:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764549; x=1701369349; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BbxwUSVkjdWQxr0WbjMFM/ALqAenG4WEeRbrPnMTydM=; b=drVCCUgivC4QoUNSe2vDbvsBZD65rNXSpvZjVagLCVQ/wbRcvk2WbqNygGa25QyxYH OFs+HOp4TxMT9Lft/Hg+Dov784uzzA+oJxaDMBpjnoPC3fhcQcU8UN0iX0velzzegZyd 6SLJDi7Djw/X9LKrtOpx8hWC3bHv/hBOFY1TffxQqpKyd7WL2KnvkCRBywKRKIy07kvZ l7yG4UpQ/Xpnt2F0D7AhNKXAVg7Sms/W+MQ1Rikrcdj5vJx423EcgXQybwaWCwlx2WFO bfVMjuHH5I+aIeuGbPkUkCTWHMz8NS+/MZuBBhA7rUZIWlacg/Z/mDIcVVJz0wL7Hy5N lu9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764549; x=1701369349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BbxwUSVkjdWQxr0WbjMFM/ALqAenG4WEeRbrPnMTydM=; b=md/KTU8K81e3KADpm0uLlNHq/j8A5hx7qKKt6JloAWKoVE0zWv/i7wtsjcnYhQMtNT j3bPCuAY075irOzI7zCLCcFVQ1lHccC5lUUV5tLLxwNfYyZAVqJ2kVRzl04XaidahqY7 UIgmfJj8ZWBenSo5XBA5Jau/qparYOqOmxJAEdzSJrzOYxq3eiwQJw4Bjk/8NRxBLs3X wqjpuYNmhEZsjUFxM1KRdA4dZppLOT87oTyV6r3JEcYJPcj98LLgxMsXZMv/FNKAFNLf yHtrLUMbxBY7Se4KH6Iz2OOOyYUQUog7eLY/sCQsyBSCOLyv3eB3kLNW/ae9NPsDe5uK 2xhg== X-Gm-Message-State: AOJu0Yzzx5hrWRB9sODuiNNaOhZ1I4YVzviptyu3g1YurDxkwUmEDFNk Dgi3nD6aURHNpLCoeqlCC0swx5YENMYRjnaoTAA= X-Received: by 2002:a5d:4ac8:0:b0:332:e2e5:46a5 with SMTP id y8-20020a5d4ac8000000b00332e2e546a5mr37511wrs.7.1700764549059; Thu, 23 Nov 2023 10:35:49 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id f6-20020adfc986000000b0032d829e10c0sm2293981wrh.28.2023.11.23.10.35.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 05/16] target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:06 +0100 Message-ID: <20231123183518.64569-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé --- target/arm/kvm_arm.h | 6 +++--- target/arm/cpu64.c | 2 +- target/arm/kvm.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 6fb8a5f67e..84f87f5ed7 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -129,13 +129,13 @@ void kvm_arm_destroy_scratch_host_vcpu(int *fdarray); /** * kvm_arm_sve_get_vls: - * @cs: CPUState + * @cpu: ARMCPU * * Get all the SVE vector lengths supported by the KVM host, setting * the bits corresponding to their length in quadwords minus one * (vq - 1) up to ARM_MAX_VQ. Return the resulting map. */ -uint32_t kvm_arm_sve_get_vls(CPUState *cs); +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu); /** * kvm_arm_set_cpu_features_from_host: @@ -278,7 +278,7 @@ static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) g_assert_not_reached(); } -static inline uint32_t kvm_arm_sve_get_vls(CPUState *cs) +static inline uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu) { g_assert_not_reached(); } diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 1e9c6c85ae..8e30a7993e 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -66,7 +66,7 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) */ if (kvm_enabled()) { if (kvm_arm_sve_supported()) { - cpu->sve_vq.supported = kvm_arm_sve_get_vls(CPU(cpu)); + cpu->sve_vq.supported = kvm_arm_sve_get_vls(cpu); vq_supported = cpu->sve_vq.supported; } else { assert(!cpu_isar_feature(aa64_sve, cpu)); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 71833a845a..766a077bcf 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1803,7 +1803,7 @@ bool kvm_arm_sve_supported(void) QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN != 1); -uint32_t kvm_arm_sve_get_vls(CPUState *cs) +uint32_t kvm_arm_sve_get_vls(ARMCPU *cpu) { /* Only call this function if kvm_arm_sve_supported() returns true. */ static uint64_t vls[KVM_ARM64_SVE_VLS_WORDS]; From patchwork Thu Nov 23 18:35:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746499 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1035979wru; Thu, 23 Nov 2023 10:36:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtsiygJCa1IHTMWmLpKQOEIZlrmckLO/dkpnM9Hj0f6Q8TllmVY3vqVl657/z0EZ4oJcpT X-Received: by 2002:a05:622a:120c:b0:423:7669:49c3 with SMTP id y12-20020a05622a120c00b00423766949c3mr56541qtx.19.1700764585281; Thu, 23 Nov 2023 10:36:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764585; cv=none; d=google.com; s=arc-20160816; b=Xsfryy+b1bXcqsCRlyNNEEVdtXQmhRsk7ivJ4JvQwZhJ4g0GlOZ8hh319IpSH1u1on CJGjHfO2JUn6HppXgT9r04FuQ5VIsUAC1Gn4c5pWbW9xPPQqTNMo/l8tkVX+IQFwxIq0 p6zh5RYRdzI6rrzAlrk3pN1VseMRWUsHbwcic+AIVhB2gW5nvJY8bJ34VKQldi+ozPkT QzCOPDv5HhOXtfyQ+dOhOUvjyq/chhVsbYsiswyGIAnAY3sjQzs0oVT5kak257elvVRd 5gZEYnho39jtr6hPMtre/y9lsfcnKNQxpNUl67G89pPEMJRoWaDhIlZXhlF1ybLjQncq k30A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=APkzUJ5V8QYL4MOU/zl88wqY6eeEqD/ibNzL1bZO05g=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=pQjc1g9kxL4Iw86UtEU59zMy6tQSlrjcLQimdT/2H/1ViucAS7aRNWMHfS/WNFuYYv rPSmmM5izwDdrI9Iq+yI2rWy/N9ibkfaPtjTA7iyhYvjaIme8boDUZ415iyH3Z5vybvd 3pEoLPh3hBCQwDBJSqK2GXIg+Dlw0FNJ1m1lbrg4iwzl6FQd3gQ7LIaOU+2ODYwEInA9 9g0irVBShFd9cYCwNOlhqLR8dnhJuBUoDet0hwD/WodRImdDLQq2SsS63eQe3x8ji0T0 AtNKfWMapxgKQei4bFQYewa13uhNL/fcof/kkujfQGVBOCCOVyQ8yv9U6hKQ7W3UhxNc 8N/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hoeKflBF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f3-20020a05622a114300b0042393b3c45asi565833qty.481.2023.11.23.10.36.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:36:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hoeKflBF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYV-0008U2-LF; Thu, 23 Nov 2023 13:36:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYS-0008O2-CH for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:00 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYO-0003QU-Dl for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:35:58 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c876e44157so14096091fa.2 for ; Thu, 23 Nov 2023 10:35:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764554; x=1701369354; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=APkzUJ5V8QYL4MOU/zl88wqY6eeEqD/ibNzL1bZO05g=; b=hoeKflBFH0s3aCxlmYwKPvp7nRxUQiZqOir7ZHUppR4UXWxuJ4CCQXyTWje5Yr4noj St37h+1uNT1nbScTH+GbexSlosqNkS+0KmaolOyAHrDiQA4lvU8ny2cXcsywJjWcIv2C Pv9sRmIcuk6MdVxRubau2e/gpyWJ0+pHGD1ZGvkmz1fPA2AgUdyJ95wx1HaQY80ckNFa chOyKxq0PcwyxU+mVL0HE/rddbJGjpnIOXzBQYg3h7pknWYFJBoUcm0lIhUwq02Omolb HB36kMXFeRNzyNzRXOZ/tyek4tWUcoXnpEqiaAu2NhM9gHvwbl4Gy/s89bn81UP288HJ OTDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764554; x=1701369354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=APkzUJ5V8QYL4MOU/zl88wqY6eeEqD/ibNzL1bZO05g=; b=GV644NDplnwPIm36bbg3H7ocSId/sr3dbhj+ASdzGFPTvCzIvClzP3wNef3omwQ9Rh IUC6JeRqmfKMDBYYr8t7+OMZLn6s7ZxgAWa/dicgWFbJrEpxzXmK4iA+GzjKSUiOc8v4 SNK+i6195Av6KSvICklEqtcynpcwA0MOzCzWAwMz7iOTtjbcKTi9U0GjxYfMsq4v8A5Q zLm675R03nm619M2O8Gf0foJUuuNNHiOfz6rFcoUQlBM1zueVs2a/3f0/VuYGXJxAP+s kjUI42h/XdMnlz3kOX8wHWapol8jjGxb00SNH0BgiJzyH3Y5PoFCCTOlBee6OczBMn6j Riog== X-Gm-Message-State: AOJu0YxYQZsoaLZKhXoYa9QSt+c/d2652Ut9Zsf+crzhv4GpszK1m4Qw SUX+Kt12TvYq6JDLoyAWM/8F6qVszTI6/i8izmY= X-Received: by 2002:a2e:9e09:0:b0:2bc:e330:660b with SMTP id e9-20020a2e9e09000000b002bce330660bmr180065ljk.9.1700764554485; Thu, 23 Nov 2023 10:35:54 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id bg11-20020a05600c3c8b00b0040b2c195523sm3477497wmb.31.2023.11.23.10.35.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:07 +0100 Message-ID: <20231123183518.64569-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 766a077bcf..73f4e5a0fa 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1691,18 +1691,18 @@ void kvm_arch_remove_all_hw_breakpoints(void) } } -static bool kvm_arm_set_device_attr(CPUState *cs, struct kvm_device_attr *attr, +static bool kvm_arm_set_device_attr(ARMCPU *cpu, struct kvm_device_attr *attr, const char *name) { int err; - err = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr); + err = kvm_vcpu_ioctl(CPU(cpu), KVM_HAS_DEVICE_ATTR, attr); if (err != 0) { error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err)); return false; } - err = kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr); + err = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_DEVICE_ATTR, attr); if (err != 0) { error_report("%s: KVM_SET_DEVICE_ATTR: %s", name, strerror(-err)); return false; @@ -1721,7 +1721,7 @@ void kvm_arm_pmu_init(CPUState *cs) if (!ARM_CPU(cs)->has_pmu) { return; } - if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { + if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { error_report("failed to init PMU"); abort(); } @@ -1738,7 +1738,7 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) if (!ARM_CPU(cs)->has_pmu) { return; } - if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { + if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { error_report("failed to set irq for PMU"); abort(); } @@ -1755,7 +1755,7 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) { return; } - if (!kvm_arm_set_device_attr(cs, &attr, "PVTIME IPA")) { + if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PVTIME IPA")) { error_report("failed to init PVTIME IPA"); abort(); } From patchwork Thu Nov 23 18:35:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746501 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036047wru; Thu, 23 Nov 2023 10:36:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGq82uevrrmRt2moB9vk/Wosff39HdHjjy9gCmlJm1anGuiJO9gFJKSuIbL7vYOrr+ftLB8 X-Received: by 2002:a05:6358:9141:b0:16d:b577:e9f1 with SMTP id r1-20020a056358914100b0016db577e9f1mr146905rwr.9.1700764596173; Thu, 23 Nov 2023 10:36:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764596; cv=none; d=google.com; s=arc-20160816; b=Es2RmH3kkjPEacLpYGpmqoFSrlio4pNCzMhmYCbwqDa4VHsa43gFiYh36VK5N5H+zo iOoLBfkI2Cnovb9ssaODdnngE5vvPuITx6REeMBj4f6LYDblMkKCOelywvrJxNLtdfl0 dAuJspW3FlJxr2LDTF0AQVknmNIszyJ2Hs1L/sno3CVaP2VnIUaIFtZhNt6T8m4vhXAs lC1635oL8gFOmWHACY8XrY6YSikx34eCMWKkNvtt7WK2VHokYDUsfh28gQiyJMAWdgI5 p+X1grFnK7HwYRX4u7tOy6ALU798mnhgCKn66Ttj9yy+PJWu6BKOVsYwFj9dmN9Ej9K4 3cdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=znNmY7edfJI2fYiqN/HJeKsLDF9NhHOuefv0PghAu5M=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=aAu6D8Yx3iUTc90D3/HgV3IW4RSocCpNczqXWQ0u+bswQnTemaZuO8QyY6rkXDhyYx UH/biF2miuQAplRuzQ0opIIvtHiHu0YEZ7/Cjkw8/o2sTmvgf55DjaNI5fxekKq3ijAX /upok5AYNMccTQYcVs8cdWLVZfvDB+IK0Id5rWymv2QNaoHEbA73bIOwN/Oa/fpiOppY fQN+jlr4CHrywDMuNMndAOdLViI72NM7UVUIyLkvgz4dpHId+SbNCSCmrkSS/SIzmpRu DYMCag02vzS33vsGMTQaBgqNNbFXNORfNtjQgVLTKOgieZ/lNqlty5KQOSfpVxhC9kQK nzDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aISRMIb3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bs14-20020a05620a470e00b00774184acfeesi1598649qkb.297.2023.11.23.10.36.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:36:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aISRMIb3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYa-0000Qk-Uo; Thu, 23 Nov 2023 13:36:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYZ-0000Di-0H for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:07 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYV-0003Zy-46 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:06 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-507c5249d55so1658087e87.3 for ; Thu, 23 Nov 2023 10:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764560; x=1701369360; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=znNmY7edfJI2fYiqN/HJeKsLDF9NhHOuefv0PghAu5M=; b=aISRMIb3EXzCHdPYMMYXbXEVzJ4HUSKW/jyB8jDC6rp4ICdohW0swYrkfEgS1PA5aV JqEeIviLVD/49XqfDYtI+zBe06+4v87JWwttOVMOi2IPqgXzL/oY7QtDMwoEAzyU8uXO 3WFVE6a+95R3qU/dzpUSL8rAqOgUhadD7CeLA1Y3MAPhxcakDj1UgCh/O6+9rr4QIjE5 U7VFtyKO+n/QHzFMtMzDkdR75LZPNhh40bgWn0RUBoFUmVkzOM8sgEsYVeODAZTD3f3q vGgOXd3rTrDHIWigrU3hdMndLMbK27fEEzhgvP420JlVqld9hhT0YV+ZJhzkzBUgXatP IBVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764560; x=1701369360; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=znNmY7edfJI2fYiqN/HJeKsLDF9NhHOuefv0PghAu5M=; b=UXwDgxlFrlt4VyM1iQTacQvyfZOp2e544MMhoptu/8yujFTbTMKiWfExTwFiwN2sn4 URsdkf1sgki9wRLm3Du2+zrFXxLmHkxmwoDQkuJBQglWEAQxI/kPON4VEf1pE2taisLU y+DFhvHrlJu3GR6pT83oI7GyR3FftwQJjeF35nW1YwQ88uZpG8O4+yGaifeZaebmjcY7 siX2x3i0QcI4pQBY7SH6de/KBhBlLVgR7eeL85CvL+d/z8z4kQiM2LkiDQJ7WQHesGqz hCG+3F6K+PXP5VLOepy6AiDwzORwoZ29B6v0f5AU1qL7PzAlfnw8ikUOONqH7Yt3I+My k9RQ== X-Gm-Message-State: AOJu0YzJYKw40T4hvPX04MHqMwQcYLPmresDb22u9VLJ+9UJ1sgCR1Ln cZxI4La5FgXv2q0Ul4Srvn1zWWV6fDa/UxpXJQY= X-Received: by 2002:a05:6512:39c4:b0:509:4655:d8d5 with SMTP id k4-20020a05651239c400b005094655d8d5mr92555lfu.11.1700764559795; Thu, 23 Nov 2023 10:35:59 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id f9-20020a0560001b0900b0032196c508e3sm2352293wrz.53.2023.11.23.10.35.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:35:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 07/16] target/arm/kvm: Have kvm_arm_pvtime_init take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:08 +0100 Message-ID: <20231123183518.64569-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 6 +++--- hw/arm/virt.c | 5 +++-- target/arm/kvm.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 84f87f5ed7..0e12a008ab 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -205,12 +205,12 @@ void kvm_arm_pmu_init(CPUState *cs); /** * kvm_arm_pvtime_init: - * @cs: CPUState + * @cpu: ARMCPU * @ipa: Per-vcpu guest physical base address of the pvtime structures * * Initializes PVTIME for the VCPU, setting the PVTIME IPA to @ipa. */ -void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); +void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa); int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); @@ -268,7 +268,7 @@ static inline void kvm_arm_pmu_init(CPUState *cs) g_assert_not_reached(); } -static inline void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +static inline void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa) { g_assert_not_reached(); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index be2856c018..b6efe9da4d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2003,8 +2003,9 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem) kvm_arm_pmu_init(cpu); } if (steal_time) { - kvm_arm_pvtime_init(cpu, pvtime_reg_base + - cpu->cpu_index * PVTIME_SIZE_PER_CPU); + kvm_arm_pvtime_init(ARM_CPU(cpu), pvtime_reg_base + + cpu->cpu_index + * PVTIME_SIZE_PER_CPU); } } } else { diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 73f4e5a0fa..82c5924ab5 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1744,7 +1744,7 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) } } -void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) +void kvm_arm_pvtime_init(ARMCPU *cpu, uint64_t ipa) { struct kvm_device_attr attr = { .group = KVM_ARM_VCPU_PVTIME_CTRL, @@ -1752,10 +1752,10 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) .addr = (uint64_t)&ipa, }; - if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) { + if (cpu->kvm_steal_time == ON_OFF_AUTO_OFF) { return; } - if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PVTIME IPA")) { + if (!kvm_arm_set_device_attr(cpu, &attr, "PVTIME IPA")) { error_report("failed to init PVTIME IPA"); abort(); } From patchwork Thu Nov 23 18:35:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746509 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036604wru; Thu, 23 Nov 2023 10:38:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNCmO6VfY4mOTEWXRYSItQgNlG2uNZsabIU1bsVVEkWZyhL9zpTSLgNFWzr1cJ5T1Udpd6 X-Received: by 2002:ae9:f446:0:b0:77d:5cf2:af6e with SMTP id z6-20020ae9f446000000b0077d5cf2af6emr260991qkl.6.1700764685614; Thu, 23 Nov 2023 10:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764685; cv=none; d=google.com; s=arc-20160816; b=mjtlIqalHYgBwi98wMLXWLew6gXq5CPlA8ZeFae+M0j2mfmwxRumNd1NHTLDit7vmr dBspG9FO8HlZT6cm+548u4GGDxmBVK6X/hxPmt7W9Z3Ck1u7qJggy/FpAyCp3I3lHrt0 Sn8v7A2fS/tRzzkdQH8AOiuGla0z8uQcaw/OetIKvx5R9YUu6nd2Ds4sype2oxQXKn26 Mb7TO7JsKXKPMK193/tetBu2Px6fhQs4yCcMV7eHTEZeQOw82Kb8lysKiHZYhDCezUmN BDOf4oVya7avh0Qnu6GuAPp/oAAFcSf6RrZge1+W31Cv1ly32QSEyyPZ4y6XvOidDWl1 5d6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sJjfIOalwsvZmq2fy7v7JKs3hNC/WaTRJ81yhz4vDXw=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=jC1vRMscR4sLIl7Wy5eo4/nVj9xl9h8bic+gNRyhD3016Ni17vHKjwiEvc3HFxeFKx 2EPmPdnxJgq3C/MoGywPLV2Yapdx/Y+5YnpUNCdpzuDPK0pzmwNjavxdN883dTBsjXPi zSeMfFwa/GFTNYAgPsAvjZPoDQhVHlOKWsJDnaa47qpELz0FvhUjWP11YA38Cc4L4qZ2 cF4ddcgvh2sOSCBZjG63tEBXcs0szuntYy0kbsoHxeTk9ce8311IP8PFWRAQ2vYWrrtl 9Ayr8ZLlzHQ8vKoNq+MZsXGVhTFvOfmHfBPRMZeU7INspzAL/DFh1MobSCtURRJyPe8+ Vgzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Prpr/+53"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v3-20020a05620a0f0300b007759389094esi1636353qkl.82.2023.11.23.10.38.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Prpr/+53"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYe-0000o5-D9; Thu, 23 Nov 2023 13:36:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYb-0000Sq-5c for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:09 -0500 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 1r6EYZ-0003kT-1w for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:08 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40b399f0b6fso471235e9.2 for ; Thu, 23 Nov 2023 10:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764565; x=1701369365; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sJjfIOalwsvZmq2fy7v7JKs3hNC/WaTRJ81yhz4vDXw=; b=Prpr/+535ghApSNq6W8KTKA8AW/mEtDE94INo/NEkasATn8LW8OtPuvCVJLSYFfqty XKMQmIOoTrZw89y38yO8f4Pz+FB8Yyr5fIYlBJxlAw4inDw7N5S4h0nA0kZzr9iO7t7N 2FBLXtAlV6nNga9hojKjdgHL8Thg7XBd7rYkaPyYlRr+Nr+YzeQBHHGskLYPn7b1UKp9 89UvOZrQTYhQ65TrBmpn4J72zrSyk9e9MbS6LvVyvEJXd7T0Wr5LHi5XGoaamiJoXNMv c/xB99hxaeVHKPJP2VHeyxFtJ37pJhhIIspMlIA+JwO3gvBYsEi6gh40BoaX/zW4Iw+H DKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764565; x=1701369365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sJjfIOalwsvZmq2fy7v7JKs3hNC/WaTRJ81yhz4vDXw=; b=lHqxpg/sQdgSUKdm9KlvD+l10liogfqrqHNGH6/wSkFOpQPukndbTde68xMDbwI33t 3KqTKSrg9mIYfdhfSXDsLS27G5RI2wc/gSgyyZUhW5vU4K7YhmOLLjx9nsac7oQaTcP2 0GeQd49F+e0j/aKqCcPfJXECyq/CKK+VNUO+A48T+ZtL3Mb2uws7gN1Zyjurfs0768HB LNKfZQoTYiyCheRUPSn0vh1/MmW0Aoc2FR4HueyLXjHzqzuTLqv3ByzmSlZHz3iDy7LG 8TJNRKNzaEheb3Wo0cSo7/kDOVNHGXf4UJ8GIEXRLTxA63wLV+hqpW+hDBRWIJ9hiDAk 9e2w== X-Gm-Message-State: AOJu0YxH+qlXwIMMXopzrPPiWf8H00prqChPZDpQXc8M2xvzPp9SXWHx fvIzTtOUq7Gct/93qeOIp5dq+MUidAPhfQV4ESg= X-Received: by 2002:a05:600c:1c12:b0:407:612b:91fb with SMTP id j18-20020a05600c1c1200b00407612b91fbmr290352wms.30.1700764565221; Thu, 23 Nov 2023 10:36:05 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id u11-20020a05600c19cb00b0040a507f546fsm3526409wmq.8.2023.11.23.10.36.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 08/16] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:09 +0100 Message-ID: <20231123183518.64569-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 4 ++-- hw/arm/virt.c | 2 +- target/arm/kvm.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 0e12a008ab..fde1c45609 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -200,8 +200,8 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa); int kvm_arm_vgic_probe(void); +void kvm_arm_pmu_init(ARMCPU *cpu); void kvm_arm_pmu_set_irq(CPUState *cs, int irq); -void kvm_arm_pmu_init(CPUState *cs); /** * kvm_arm_pvtime_init: @@ -263,7 +263,7 @@ static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) g_assert_not_reached(); } -static inline void kvm_arm_pmu_init(CPUState *cs) +static inline void kvm_arm_pmu_init(ARMCPU *cpu) { g_assert_not_reached(); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b6efe9da4d..63f3c0b750 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2000,7 +2000,7 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem) if (kvm_irqchip_in_kernel()) { kvm_arm_pmu_set_irq(cpu, VIRTUAL_PMU_IRQ); } - kvm_arm_pmu_init(cpu); + kvm_arm_pmu_init(ARM_CPU(cpu)); } if (steal_time) { kvm_arm_pvtime_init(ARM_CPU(cpu), pvtime_reg_base diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 82c5924ab5..e7cbe1ff05 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1711,17 +1711,17 @@ static bool kvm_arm_set_device_attr(ARMCPU *cpu, struct kvm_device_attr *attr, return true; } -void kvm_arm_pmu_init(CPUState *cs) +void kvm_arm_pmu_init(ARMCPU *cpu) { struct kvm_device_attr attr = { .group = KVM_ARM_VCPU_PMU_V3_CTRL, .attr = KVM_ARM_VCPU_PMU_V3_INIT, }; - if (!ARM_CPU(cs)->has_pmu) { + if (!cpu->has_pmu) { return; } - if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { + if (!kvm_arm_set_device_attr(cpu, &attr, "PMU")) { error_report("failed to init PMU"); abort(); } From patchwork Thu Nov 23 18:35:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746511 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1037179wru; Thu, 23 Nov 2023 10:39:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMVtqyyZ1c4THHK0yxzs0hvVAyI6/k6UvGKl7MxrZQRSb68d0xNqH64WHCEExGOtD7SpE2 X-Received: by 2002:a05:620a:244f:b0:77d:5f66:f97f with SMTP id h15-20020a05620a244f00b0077d5f66f97fmr5879575qkn.11.1700764777170; Thu, 23 Nov 2023 10:39:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764777; cv=none; d=google.com; s=arc-20160816; b=AhGjXIx17kukievubVxYHRiUqkaPfp8okASevsF1Ips0YpukEYAd6mFTRXejC77H/D 5UG+xgG7kLV4v7SMzQwXNvm+DbRvzI4aI7QREgVvHbOodnUJWfDWUtkEstKCx0SFTGhZ +2HvxMlgfAS2VaLLS8eFvGMXgH2xAKzbDnP409Bbr0XqrLCkeHlWsB/sysx/RzXvYH+W zMLdEYtCyjquMrtlytkoMCQZN4HfPUcPL083guDN7y0FCaqJkRGg6Eo5nbphpux/RFyz MQLWTqVaKD+DTr2tPuf0URqfsioVYhT7n1OfPho60OKpdQ3ZCKVG5cvYVzz9jRVHvf9b GRZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OSjIUExNNTZZyxxju0j+hfpNF1ayVJnEfjEBE24u3Js=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=d1crRdeQtwjNN37+IwwvzotVAGBDVmEirTISKFSqQYfgft2P2U7c+74v6tQMD09qPt xJr13Q/gk336xyAoE9doqn9LnBnu5vbjija8pKiRrdbz+xMw42oOEdiFDxEtw6wWfDTl lzkuaXu0ZLQbOC6QAt8Qzu4hRbcwJwh8IrRchdhkrjZRcVWp+HwquGINvsluayOnVy3O bp4KTZGakFiOUdB9wXnEgFAr+/GYYtlemvXd3JS7esYq2G114X4ACTISZBGme+kmpRa6 GP2+wSA88tjdQBNvSzFcYCIn7fWnM9LaFr4TZAMy+ZvPhPJtPib0XvqGnZujug0XTZaE s48A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ipoqtP5y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bq44-20020a05620a46ac00b0077d5f433170si1646349qkb.105.2023.11.23.10.39.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:39:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ipoqtP5y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYi-00015p-Jz; Thu, 23 Nov 2023 13:36:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYg-0000t8-5p for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:14 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYe-0003sA-Fn for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:13 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-332ce50450dso741804f8f.1 for ; Thu, 23 Nov 2023 10:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764570; x=1701369370; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OSjIUExNNTZZyxxju0j+hfpNF1ayVJnEfjEBE24u3Js=; b=ipoqtP5ygKqADHCz6TCmOWMiWZ1tApjhbS6zxF2O4AH+eI2jWxSleWpFdJr/TW1tdc NkVz6UNwV1gVuCWpoAPyhwzsA605RCdeI5h8/dttswixltb7JoE8vYk/l+c0C9fEMtqh u9Rh5/DX6+W2Kfvf+AZrdx/rNrVevusHji4UCUu1yj0K874kc3STE1bEsj85xnArjVuf U8Ej8WXvaPQcfn0ETLWD7NVzXi8WpwN/7NcrF9xDB9Bbs3ZA5fOe2mXzDorkB+I/dnUr 5vt+Hniffzy0+qAeAKvht0ZjDLov3HIwXVlvGHDLICmVFa4BdoUCicRMkhZFQqwXiPhO 5LVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764570; x=1701369370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OSjIUExNNTZZyxxju0j+hfpNF1ayVJnEfjEBE24u3Js=; b=lmHsLKi0h7pgKnNjPTjoU4Z0CiLYXhnNB944LIzFtM3JvkjKkAd2zrd6LW//Zb++eI rWLxXyg3t4vJC2zngTd2Av6mrgKleR2lqJ9nuZKZWPQtNDHQxr1j0gJAKRZprahhBeBx yLYR4oMpcL84ZnfYb4dSm2u0mDdO4Eena8YFKTAVe3femYW/u1Hh+M1tdTV97VWn2PwX 2e4RfvfG1nN/DjkxMtSEYAQOC4FA3sQXdhmPj90QSxwep24nCW2FyNPJrrLvI+a9KiBF usL9vsmtuvgfKmaU/YFlGWz/ISnPsq+8TZgabLX5sZ9bmcLQkoWFgOkJKRdm5I+G1Hry vxNQ== X-Gm-Message-State: AOJu0Ywce9JoxMaYngOP5y4bOwxd/IVqG4c1LQK76tdFbiknqVgOrem9 hS8hQgPvomw86GezdsAnJ72AOUAtiqsQlImzaTU= X-Received: by 2002:a5d:6152:0:b0:332:e75e:f39a with SMTP id y18-20020a5d6152000000b00332e75ef39amr228741wrt.35.1700764570576; Thu, 23 Nov 2023 10:36:10 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id n8-20020a5d67c8000000b00332e84210c2sm259285wrw.88.2023.11.23.10.36.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 09/16] target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:10 +0100 Message-ID: <20231123183518.64569-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 4 ++-- hw/arm/virt.c | 2 +- target/arm/kvm.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index fde1c45609..55fcc35ed7 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -201,7 +201,7 @@ int kvm_arm_get_max_vm_ipa_size(MachineState *ms, bool *fixed_ipa); int kvm_arm_vgic_probe(void); void kvm_arm_pmu_init(ARMCPU *cpu); -void kvm_arm_pmu_set_irq(CPUState *cs, int irq); +void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq); /** * kvm_arm_pvtime_init: @@ -258,7 +258,7 @@ static inline int kvm_arm_vgic_probe(void) g_assert_not_reached(); } -static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) +static inline void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq) { g_assert_not_reached(); } diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 63f3c0b750..040ca2d794 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1998,7 +1998,7 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem) if (pmu) { assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU)); if (kvm_irqchip_in_kernel()) { - kvm_arm_pmu_set_irq(cpu, VIRTUAL_PMU_IRQ); + kvm_arm_pmu_set_irq(ARM_CPU(cpu), VIRTUAL_PMU_IRQ); } kvm_arm_pmu_init(ARM_CPU(cpu)); } diff --git a/target/arm/kvm.c b/target/arm/kvm.c index e7cbe1ff05..f17e706e48 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1727,7 +1727,7 @@ void kvm_arm_pmu_init(ARMCPU *cpu) } } -void kvm_arm_pmu_set_irq(CPUState *cs, int irq) +void kvm_arm_pmu_set_irq(ARMCPU *cpu, int irq) { struct kvm_device_attr attr = { .group = KVM_ARM_VCPU_PMU_V3_CTRL, @@ -1735,10 +1735,10 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) .attr = KVM_ARM_VCPU_PMU_V3_IRQ, }; - if (!ARM_CPU(cs)->has_pmu) { + if (!cpu->has_pmu) { return; } - if (!kvm_arm_set_device_attr(ARM_CPU(cs), &attr, "PMU")) { + if (!kvm_arm_set_device_attr(cpu, &attr, "PMU")) { error_report("failed to set irq for PMU"); abort(); } From patchwork Thu Nov 23 18:35:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746512 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1037241wru; Thu, 23 Nov 2023 10:39:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFL1Zn8vBMiXcUZoWARRlBDUzXudlyI4n9gVYrQt8k7odhNTgdi6g0wmC6N94u9QM7nGQP1 X-Received: by 2002:ac8:4e8b:0:b0:418:af7:e001 with SMTP id 11-20020ac84e8b000000b004180af7e001mr245930qtp.41.1700764790228; Thu, 23 Nov 2023 10:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764790; cv=none; d=google.com; s=arc-20160816; b=k7mSTikG86sedPFRv+JeOO+BihlTlXKpxBOYbyDuKUIa3b7yTL1glUDRn14E49K5sn xwZvBe//ExXg65+gB6wr316McFBlLa5UtFowMNIPTvblGB68Nc+ZIvBkOsJw4BtaFpzb fvQGZ46MI8DT8jjxddmPtmn+q36rZDs32YIV2n88bLmlIkmCCWSNduVV+v0C3yV1SmqD SarhkISUGtbLDNMjE4YGhG5Wmse0eF6XiGazdakbzoITG0H4+PM2CeG36XPfCWM4aQVn 7OpIRXCb6SPu+9ap7fgPIjGGuG246fc13sDhge328AwklPU32ZWK/SQzgiR1+/HouQBp IBOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=vMvXizukxMlS6wty+ctS/EqOAd6Jrsv/CSVfQOdk2fmO1b2GVg7D0J8TaYBXm0TMl6 oj6IOih2+ND7HkIhAFz9hJYRMefIFTSnTewGOexjV4H49bRSPR0uHvH2+uM7PIx+xMm0 G8u3V5XV1cM7U0sG5LgLDEwMIkd9F26fR7TIoa44vR9UkIw1FRnDREhUMnaDycbD6rjK OVMaG+swdNJx/kSv4nr+PjrtQOtS6VoyayQC0KebAk2OLxV2SNcJSY2KQi+6RB7f8PEp V22ECDAYJFZvSEi88gnk6Sxhb6ZzAyImbIHUgRRbcq4vbm8jaICdkbJ40P680trycjRU 3u6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qSYMdogV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u11-20020a05622a010b00b004236dbc42c1si1587804qtw.518.2023.11.23.10.39.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:39:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qSYMdogV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EZ1-0001nd-7y; Thu, 23 Nov 2023 13:36:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYz-0001mb-Iy for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:33 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYj-0003uL-Qd for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:33 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-331733acbacso763098f8f.1 for ; Thu, 23 Nov 2023 10:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764576; x=1701369376; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=qSYMdogVsR5QF17T/uoqjmVpkOq/cWmd5ku+ldgEebJ+IXH2+r2Etny1oQhuyWrUQ5 5tiV2+somkcBtIsr2wse57y6oDP2TXUSCwOSkZNXpir/OEP1j4UBKmAJsdm1n0NFDDOU D5A3chbynqsrsvNLFKoRGkSpOKgmqChzeiiYXhlL2cKHi2ulnv8FTpTP4AuTZbs+6JJS DsUT8EKgj7Aw6ujhFE/0Fn4dQeADBSTN67y9WxqnoXoLu4WpWm/ONiJ/JnMhp9oEOo0d WOcr93YjM6X6hypsyJU+pji5CDfqfyXGtbZl0dt3coegwhj7h2rmIE/IgVY7dVelI3ax J4hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764576; x=1701369376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=XtpyUcRM60qRSrjJfhRyQg0+EpHwr64W4NIvgUO2pS36TbfbzbRW8EJsFji8/Q1J+i DAo8LrP045X8qg9dGdY8cr9lH3xC1vFuqsQpMYt27yEyrT+9TxTJINDt+gYXBv/dl4s+ XFjE0D+Ba8L3S6eZG4CShCw1WyaNK0C+PY92ERGJbYBcVryAzuNG4c/flpPDfXC4wkv+ hz1U1lh2MHINuc6fol/PrKg3wp2vRvYvwwT66HZ7k+MHdlrWDftK/2rn1fLoTO4VgTva rFVV9EOrPMDEuY2AN/e67GouugiWSpF9uYFqXe4gSIv+SSzO+8rKQ5x2zdxQk9feTIhw IH5Q== X-Gm-Message-State: AOJu0YzTRCWz2brBKMhdT2RWa2Gr+MlJXWWjl8iEs2GP1xQI1KZOLICI ntmeuMiwFAPkYHtmoJoMhY/0QrNO9BHPuwdLb2k= X-Received: by 2002:adf:e692:0:b0:332:e4fd:3263 with SMTP id r18-20020adfe692000000b00332e4fd3263mr195947wrm.62.1700764575984; Thu, 23 Nov 2023 10:36:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id df2-20020a5d5b82000000b003317796e0e3sm2280492wrb.65.2023.11.23.10.36.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 10/16] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:11 +0100 Message-ID: <20231123183518.64569-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan Reviewed-by: Gavin Shan --- target/arm/kvm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index f17e706e48..854e423135 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -60,7 +60,7 @@ static ARMHostCPUFeatures arm_host_cpu_features; /** * kvm_arm_vcpu_init: - * @cs: CPUState + * @cpu: ARMCPU * * Initialize (or reinitialize) the VCPU by invoking the * KVM_ARM_VCPU_INIT ioctl with the CPU type and feature @@ -68,15 +68,14 @@ static ARMHostCPUFeatures arm_host_cpu_features; * * Returns: 0 if success else < 0 error code */ -static int kvm_arm_vcpu_init(CPUState *cs) +static int kvm_arm_vcpu_init(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); struct kvm_vcpu_init init; init.target = cpu->kvm_target; memcpy(init.features, cpu->kvm_init_features, sizeof(init.features)); - return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init); + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_VCPU_INIT, &init); } /** @@ -984,7 +983,7 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu) /* Re-init VCPU so that all registers are set to * their respective reset values. */ - ret = kvm_arm_vcpu_init(CPU(cpu)); + ret = kvm_arm_vcpu_init(cpu); if (ret < 0) { fprintf(stderr, "kvm_arm_vcpu_init failed: %s\n", strerror(-ret)); abort(); @@ -1914,7 +1913,7 @@ int kvm_arch_init_vcpu(CPUState *cs) } /* Do KVM_ARM_VCPU_INIT ioctl */ - ret = kvm_arm_vcpu_init(cs); + ret = kvm_arm_vcpu_init(cpu); if (ret) { return ret; } From patchwork Thu Nov 23 18:35:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746514 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1037515wru; Thu, 23 Nov 2023 10:40:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiorzv9V7Pi+NCHXQ+xww/GiyGIU8QIw8ym6A9vnA+k0Dn2Dk64YBQqNezGPWLJmvcQdr6 X-Received: by 2002:a05:622a:1495:b0:418:f70:df1 with SMTP id t21-20020a05622a149500b004180f700df1mr237791qtx.42.1700764828396; Thu, 23 Nov 2023 10:40:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764828; cv=none; d=google.com; s=arc-20160816; b=DCDk05vnseG82xl9XNQt+Jpls53Ya8FW8yme7I4aqR36xO505SaHu9fL9LXsXRnWxP nYx49WuU1KKl9PuWutmxuIEOApu+g8dIxOQsSaMfAJQsvcgsxvG1/sgQh8ENZnxzxi5t DPdJdmlaNvfsJx7VNsXS8HrEfbBbWvZ3cE12KW0g91QkQdn6UtueB4TpUKlnHhlP24x6 17KNF0TBHYzPL6Nt9oILoY3FnCHF2o/MCa6kITbRwsp1jNpW7j42iaEV2QZZlbgjI7us spC1h6bPNDvE9SDbfxDZAUt53ttTCyesZVkueGDVJpLLY+A07XXgMy8DiTNnH3Yzg2wu LbFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h+SHiNudBaJoVQ05FaR4tXQE9WbV9fq8fmbm8eyNxHM=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=h7BJw9LMIl36hMQV9ZhIgVrTwP+O+4S6YD2am02/HR06/WzXXHU3x/moDycqYbfT/Q e0WLYcktGxSeag2GQwozjEEDJ8B3AzbJGHBteSFRJsSd9c1xN1AAE2z5G7Cwe+4S6ilu Fsfk7bVzMiIs5SPF53lVV8zvCQyGS3DZQmppRg3EEB240KllMwyWm174pLZYDFYh1qwz 2oadRwD0GMhFUXFdNpAVNl0bVhS7sjqHpnOcfDYXePVg4kyM0Dw68l5uautm8j7M7rpp 9wvC58W1ng1tV+cnrGNEWd6OuroYeRwVvOPmBUdQnK9i2eoK3T2RAsH9u46zMyyUud5R hL/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zvQTdhXi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k8-20020a05622a03c800b0042377d4b6e7si1592694qtx.28.2023.11.23.10.40.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:40:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zvQTdhXi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYu-0001gG-Mt; Thu, 23 Nov 2023 13:36:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYt-0001a8-GN for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:27 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYq-00041V-KM for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:27 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3316d3d11e1so698435f8f.0 for ; Thu, 23 Nov 2023 10:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764582; x=1701369382; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h+SHiNudBaJoVQ05FaR4tXQE9WbV9fq8fmbm8eyNxHM=; b=zvQTdhXiJj6hrfwnu85wFIUp1a8zz5SREPfu7WHTiR42m3MoXSMEEpAbL6yQwy2ToO G/6i0usTOpvsj6qXviLfjicgX1E8p4GpOo62Nea18TWt51E5CQkbbkxHL9n6s9V2IOa+ L2znCPU9Qb8oC6CqsERG1eNcBpfO2RiIU+/Bcv1jY1nH9fmZCBG2Opj8IMkkEtaC8Jq0 xMXIAUNz+ViYNAheS1CPO0d/Djm3MT2dEzRmyUl9NfgiMRvWUNyVVRrOm9SjiklZfZSR lKzn+RYISJIGt90GXxCbvFF9rZnAGWnTC4wzKQ34y36dEQE45ZA4d3qj7okeI1X6gwmB 750w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764582; x=1701369382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h+SHiNudBaJoVQ05FaR4tXQE9WbV9fq8fmbm8eyNxHM=; b=qC+acj/Cy5YM2o4Y/x0V2Q5FLPbxAN0kM7Ku90raprFIgTJsqTiqYqO9mVV57EFP/+ VuQBcMhQAh+5TtGvoih/N91OiwGqFmy17szggSAgpY8st2kyxfDCXse5Qn0vt/0GDMY+ NSQ3o7PrkbLanxzUwBH8537fgHrIBzQHSlGJduM9Txe/0TwXR6pv+bV4/kAvfmXRMVvz 2207HlGBun7KMYZcBBhq8vj+u+HL4nwxr6MCGt3sdaJK8KDFAUmrMlRKI4zxXcWPuTOf 5Ulqm9uye/3D7lRuq8uaLmaPCyuq0GhpEUGy8tliTtvq6jdVnyrNS6aFQQ+MhhEKhlyf xXEw== X-Gm-Message-State: AOJu0YwUAVQirHZMk770lB8nfbjoio/VtWnAoiWgyGPVsjIl74aSoN6d N1e6LSNjY88M+w+t0X14ONX9ayFaE5L3bPf5yuA= X-Received: by 2002:a05:6000:1ccd:b0:32d:c792:fcaf with SMTP id bf13-20020a0560001ccd00b0032dc792fcafmr2898941wrb.26.1700764581996; Thu, 23 Nov 2023 10:36:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id d1-20020adfe881000000b00332c4055faesm2259393wrm.87.2023.11.23.10.36.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 11/16] target/arm/kvm: Have kvm_arm_vcpu_finalize take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:12 +0100 Message-ID: <20231123183518.64569-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 854e423135..dba2c9c6a9 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -80,7 +80,7 @@ static int kvm_arm_vcpu_init(ARMCPU *cpu) /** * kvm_arm_vcpu_finalize: - * @cs: CPUState + * @cpu: ARMCPU * @feature: feature to finalize * * Finalizes the configuration of the specified VCPU feature by @@ -90,9 +90,9 @@ static int kvm_arm_vcpu_init(ARMCPU *cpu) * * Returns: 0 if success else < 0 error code */ -static int kvm_arm_vcpu_finalize(CPUState *cs, int feature) +static int kvm_arm_vcpu_finalize(ARMCPU *cpu, int feature) { - return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_FINALIZE, &feature); + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_VCPU_FINALIZE, &feature); } bool kvm_arm_create_scratch_host_vcpu(const uint32_t *cpus_to_try, @@ -1923,7 +1923,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (ret) { return ret; } - ret = kvm_arm_vcpu_finalize(cs, KVM_ARM_VCPU_SVE); + ret = kvm_arm_vcpu_finalize(cpu, KVM_ARM_VCPU_SVE); if (ret) { return ret; } From patchwork Thu Nov 23 18:35:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746502 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036131wru; Thu, 23 Nov 2023 10:36:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0DPTaPdTQvDinWLLfB6I+Z1AxLPDTuMFhELmNlPulApiUgmKCDdu/v8lN8Rt5780U85vV X-Received: by 2002:a05:6870:7b48:b0:1e9:c224:bb91 with SMTP id ji8-20020a0568707b4800b001e9c224bb91mr157503oab.38.1700764609296; Thu, 23 Nov 2023 10:36:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764609; cv=none; d=google.com; s=arc-20160816; b=bayn3r5q18W3zdonmhLEBZ/YI3oSJUZNemPpi4sJCMHN3yu6o1lkh5vi1Ly+Ss8fHC 8OeYEl6861tlrY7PYv+/xS9LhfEUogQWgul7nAP3ikC5UexpycZwB2gBuQdceO+vbFfw eGPpMF1hWiWXpNgCzQ7iWDVZsQ2omkPXyWuMrVAXvY9gwG2YB1Gx/JhxjqUA0aS9QBO8 ZMQCIq+R7ZJ4bfBNACCA/fg6HsB7YxE2j4pYjQOmN7uSXxatDJ8uS7whtZ4WUWuDA2b8 1hY318x5ZCZgVNnAtKx4MQa8Q7LayOONHyPgeEXRe9sutmLosGydfnU3Bpq2S13zTDak jf7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wFeYHB+Hwgz28c/uPKH/ogtnPZczZab/kLjBCnJSUvs=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=Vl9gAiqSSvDKD/qWCx1bAsZGQU7oBDS+eLeS4mKw0MOfQuhuK3nfz4EInQXyi8x8p3 qP4jNYiJ5330UgpE/4yhcsUPDmx5lct5qchsQ9aLAZYgDKdmkE4xGWkBw+PxBSCvWjhB 6q/YKozU90+zuzIWHgNObFMO2RgtoA0ZQbWVFIJ5mWtreY4DuAHqZJdfxmy8qe97ZXLL UYH1OL0JCrS8pydKI+8rS/h6LZf3NY9WvrTw/jt3kuC610u0rVYoG1FFsRNEY96QKL/v kd+KBvhM1XDcBUnSK+w0jn4Jlp/POq/xygHbcoAfnPoGeNo9KwR8937w+Zo72iLQ1DKb ZyIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QtSQwl5x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l4-20020a05622a174400b0041793b4dfcdsi1655722qtk.303.2023.11.23.10.36.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:36:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QtSQwl5x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EYz-0001mX-I4; Thu, 23 Nov 2023 13:36:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EYy-0001ls-1B for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:32 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EYv-0004As-CW for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:30 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32f737deedfso645334f8f.3 for ; Thu, 23 Nov 2023 10:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764587; x=1701369387; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wFeYHB+Hwgz28c/uPKH/ogtnPZczZab/kLjBCnJSUvs=; b=QtSQwl5xPrMQc4Swr3wxWer0KY7f2I2T/l0tD9Jc3Euolo+15/E+O2l8JqfAHB9ij6 fmPuw7Sp3cJRHHTdG0rcOLuX1DW7spaQB1Lxpml/XxXlk8lt0SZcNo/ZYwxW47EeVNgh 7jDBlqP4KpfzDuuwquckpjK2UbWIKrxLCO0Azq02HjyYCxVqMq2FVIUeMLgtdd2UMtaA CnSE5EcGOjx3Caq0Jv+pXGQ+h8VawTXbHhdP4nb/LQtGVKxh5hPh+QS6pKwhTLsf+1E2 XcZkYH0YAhs4jkwQIUxpYS+s4mFluQ+0UQodifaSAu9URQUl1Hm0kqAnENeI47pKcsj1 +r5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764587; x=1701369387; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wFeYHB+Hwgz28c/uPKH/ogtnPZczZab/kLjBCnJSUvs=; b=aZgtmYTRFj55W3KaM12OGFN3/MyeLclqLNghaTtbIlJbITrFQ89R4vaZldXJc+dVkd 1MkfiZHfbeOf8W1C4y1d6bKu8K2D/DhLmGImkLVB34JACvhBCz+KZgueZgTkTcnZpIEI w0JkCm7rLaPxLU3Nybq6qHGImCRBR1easMe+nu5VhP7A2cYyr2VOAhTKi8Ip50PgAnaW I4LLqQjhyThmIVuyJdQo51M9Ap53xbMRG0Wg0tuAWpbKbIsBd4JXhan5dayvCE9I5yIy 7sWJPp8TNKrCN+83ywzcBGu3H90VuGG11SluFFVHUP9p9ucJBstP7rg0b4OtDJCUAGqa IEGQ== X-Gm-Message-State: AOJu0YyApKfa7dyCTXq5KbDTXapMuwbUaETIjHXgYfOw8kHvnt3J9XIm k5eWwnz61mKo22DUZxchMP31G/6bWaaU2O1LZtY= X-Received: by 2002:a5d:5690:0:b0:332:e65a:4a07 with SMTP id f16-20020a5d5690000000b00332e65a4a07mr231040wrv.32.1700764587343; Thu, 23 Nov 2023 10:36:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id s11-20020adfeccb000000b00332c6c5ce82sm2325696wro.94.2023.11.23.10.36.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 12/16] target/arm/kvm: Have kvm_arm_[get|put]_virtual_time take ARMCPU argument Date: Thu, 23 Nov 2023 19:35:13 +0100 Message-ID: <20231123183518.64569-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index dba2c9c6a9..57615ef4d1 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1036,20 +1036,19 @@ static int kvm_arm_sync_mpstate_to_qemu(ARMCPU *cpu) /** * kvm_arm_get_virtual_time: - * @cs: CPUState + * @cpu: ARMCPU * * Gets the VCPU's virtual counter and stores it in the KVM CPU state. */ -static void kvm_arm_get_virtual_time(CPUState *cs) +static void kvm_arm_get_virtual_time(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); int ret; if (cpu->kvm_vtime_dirty) { return; } - ret = kvm_get_one_reg(cs, KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); + ret = kvm_get_one_reg(CPU(cpu), KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); if (ret) { error_report("Failed to get KVM_REG_ARM_TIMER_CNT"); abort(); @@ -1060,20 +1059,19 @@ static void kvm_arm_get_virtual_time(CPUState *cs) /** * kvm_arm_put_virtual_time: - * @cs: CPUState + * @cpu: ARMCPU * * Sets the VCPU's virtual counter to the value stored in the KVM CPU state. */ -static void kvm_arm_put_virtual_time(CPUState *cs) +static void kvm_arm_put_virtual_time(ARMCPU *cpu) { - ARMCPU *cpu = ARM_CPU(cs); int ret; if (!cpu->kvm_vtime_dirty) { return; } - ret = kvm_set_one_reg(cs, KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); + ret = kvm_set_one_reg(CPU(cpu), KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); if (ret) { error_report("Failed to set KVM_REG_ARM_TIMER_CNT"); abort(); @@ -1291,16 +1289,15 @@ MemTxAttrs kvm_arch_post_run(CPUState *cs, struct kvm_run *run) static void kvm_arm_vm_state_change(void *opaque, bool running, RunState state) { - CPUState *cs = opaque; - ARMCPU *cpu = ARM_CPU(cs); + ARMCPU *cpu = opaque; if (running) { if (cpu->kvm_adjvtime) { - kvm_arm_put_virtual_time(cs); + kvm_arm_put_virtual_time(cpu); } } else { if (cpu->kvm_adjvtime) { - kvm_arm_get_virtual_time(cs); + kvm_arm_get_virtual_time(cpu); } } } @@ -1881,7 +1878,7 @@ int kvm_arch_init_vcpu(CPUState *cs) return -EINVAL; } - qemu_add_vm_change_state_handler(kvm_arm_vm_state_change, cs); + qemu_add_vm_change_state_handler(kvm_arm_vm_state_change, cpu); /* Determine init features for this CPU */ memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features)); From patchwork Thu Nov 23 18:35:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746507 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036466wru; Thu, 23 Nov 2023 10:37:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUOkBcZWfHHdwdFmynM5TCRDA5RNuMawn0gdW15r5XXcsio3Z0b3hk5icZs6b1ZLlXz/CD X-Received: by 2002:a0c:f88c:0:b0:66d:1706:6f39 with SMTP id u12-20020a0cf88c000000b0066d17066f39mr337016qvn.34.1700764664876; Thu, 23 Nov 2023 10:37:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764664; cv=none; d=google.com; s=arc-20160816; b=tYFM+eAlcLxHvnBdFIzvwib5P50eMTBlUX9OU+4QK//2CBnxbkdjOs57HbVXg3Xajo TCM/oRSMdlRgSuyEMKhA8k5dW/MKJUHX6XjHsFRBnPQhcw69MJ+3Sa4/pISDG86c8aYK rp6YzvGY+3AB41HIx+r2Nubdb8f/UsKQq9ucN1rXb5vvZCUQak5QYGB4sFzZkD4F4Jwf wetkSacMEtdqUhXdql3EtcxYfgPIeIWVpBtYUdnVz6xOcXW3X/qadLHJjGuMePaz7LYF bNjvJY4JgkxMr4Tasi/gXW2/Wt3r8DUxWOU+NyUPBRl+6MDlKstQ23IW9pr6Q61QT6CD X+5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Otvbi712uFgYyup+pTZVJRpTHa74RGjJF86YXo2+tew=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=xbI87eem+Z1wrEyakBYjkW0IvieyeGttyrU3kYr0B+hCyl3WUf0FELt/4oJ5t+31mE f//JI+ueP/ybW0cB8U4hsue52j3Ii8T7ngdgWxcyUzyXyvgu/S4ehEtFglHhlJ/I987O zxgutIMAban8zxlvuGP3hLbaSHO9K/b4vJs5SctrHDYrkvLkv86jXUgsyhX7nO6y9w4t xkZ59uAOZ3FtnqNJuTFhZRA1E5EB5p6i4gCwAHxxj21vzU31fBHYbKUPyyWUPcUv5aTt 1V3N9yWJCFRaPGjYKLmSlNYxCHty8ondYAd8dK3lmcuaGRFYf9TZMb4D7KAB7n3KkLdb BD/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="z6WX0/37"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dr13-20020a05621408ed00b0066cefaf6564si1584142qvb.611.2023.11.23.10.37.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="z6WX0/37"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EZ7-0002F3-37; Thu, 23 Nov 2023 13:36:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EZ5-00026K-M2 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:39 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EZ2-0004ML-SY for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:39 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083f613272so7873875e9.1 for ; Thu, 23 Nov 2023 10:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764593; x=1701369393; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Otvbi712uFgYyup+pTZVJRpTHa74RGjJF86YXo2+tew=; b=z6WX0/37kVj4Ytbt5JWMflQ8rjgC/o80znwUT8H2IEr6kE87burufmPJKlJYgbnoqh C7D0n6jagVKNGeZV2hPneXxRqrqHjbkl8t+uNVQOGrw+NgFclu+xgSCxRg0vk4OuPQ2M US75btifb40rQAzensdIL2ojviXQjEhgffS6WNqjNbhtW48gXi6gV74FRTwboSHh/0iY 4d+F4I/CCaWkrdf9BTdL20cR7ZR1axvKoNAB05yUb2mBsCOJjfJZiZn09ct5z6nMh6Fx qaQRLTmtsFLIi9A88gV5Vy6ezFpoWdn1xv42rNyI7wvgaeziq/qy55rL+wj+64gVb6cA HAYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764593; x=1701369393; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Otvbi712uFgYyup+pTZVJRpTHa74RGjJF86YXo2+tew=; b=AshJVk8L77CjECyqz9xZ98cGqzNRpdjAbflSNQLQfLxNPVbDujAOTsExpLmQnVfX1u X0Y81N03VU5s4pVElNnSkl32iE965q35+6jYl33F21UI+sd4aetrGvqCLnnbFU0h1K2Q +Is9SBnHrvUCZcZzPBahETeaYd7DAckxekEh78zuKGEuySRrB7dLN6vWW3KRZQDFSiqT /Cvg1QU2RS8AG6TFRsaNMtig3g+2sB0YaTC7wFq2GYt98F7Gb23cd8JGfevCx7eZEU8F sjQak/U4cQmvcr54/6d1NHNNlQ2MFDKrH2qWWD5GWkNAuzPPZnbzIOmc6ddyD2AMxGe2 b/Gw== X-Gm-Message-State: AOJu0YzQkEVsvEFGYjBjjGDHIIf7K9RKYwpG6DrPjXwHLaZ+KWCzuZHy tvB8nMYt/EOPbwcOQ38KfjZzGlyvI+yST0XP2t8= X-Received: by 2002:a05:600c:1ca6:b0:40b:2a69:6c1d with SMTP id k38-20020a05600c1ca600b0040b2a696c1dmr367611wms.4.1700764592790; Thu, 23 Nov 2023 10:36:32 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id f9-20020a0560001b0900b003143867d2ebsm2344690wrz.63.2023.11.23.10.36.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 13/16] target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg Date: Thu, 23 Nov 2023 19:35:14 +0100 Message-ID: <20231123183518.64569-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 57615ef4d1..91773c767b 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1172,18 +1172,18 @@ static int kvm_get_vcpu_events(ARMCPU *cpu) /** * kvm_arm_verify_ext_dabt_pending: - * @cs: CPUState + * @cpu: ARMCPU * * Verify the fault status code wrt the Ext DABT injection * * Returns: true if the fault status code is as expected, false otherwise */ -static bool kvm_arm_verify_ext_dabt_pending(CPUState *cs) +static bool kvm_arm_verify_ext_dabt_pending(ARMCPU *cpu) { + CPUState *cs = CPU(cpu); uint64_t dfsr_val; if (!kvm_get_one_reg(cs, ARM64_REG_ESR_EL1, &dfsr_val)) { - ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; int aarch64_mode = arm_feature(env, ARM_FEATURE_AARCH64); int lpae = 0; @@ -1220,7 +1220,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run) * an IMPLEMENTATION DEFINED exception (for 32-bit EL1) */ if (!arm_feature(env, ARM_FEATURE_AARCH64) && - unlikely(!kvm_arm_verify_ext_dabt_pending(cs))) { + unlikely(!kvm_arm_verify_ext_dabt_pending(cpu))) { error_report("Data abort exception with no valid ISS generated by " "guest memory access. KVM unable to emulate faulting " From patchwork Thu Nov 23 18:35:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746510 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036678wru; Thu, 23 Nov 2023 10:38:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOdzCI+xzPIT8bDyZK/apK/ctgFaaMwP+ltvl+geX17+DksBeyNiRptxW8vtWO6amm0AD5 X-Received: by 2002:a05:620a:16d3:b0:77d:5cff:a816 with SMTP id a19-20020a05620a16d300b0077d5cffa816mr219393qkn.57.1700764701036; Thu, 23 Nov 2023 10:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764701; cv=none; d=google.com; s=arc-20160816; b=aeFZguZpWSW7Anm427s9iqw8uqQPT+/zupmh1U6DlWsuEtnOG9yKkz/lkzRRBSQ+3p OH0uzX7kNn1g9pNPewD60X16RLKSIyTzOZKWnyu7tHjvE8hOekZYYVow8h6xtCD7BumL P1do1OUTGzdnvAwadyr8T/OCPAS9gIIrm1FYxidLRDBppBOxliadN9yeFbdjRGhZptoU NEC0Sal/11I0grgP8YUukxNrRGEBu+INAfDZpVXQooOpPeqqt8PcsO9i9mbjI4t4DchK NDcVhs3p8tmfyuCkaWZInQmoNR2/pkPGsXQ5wXEo09U9Zc0mgf8sESQA9Hstl6UvIsH0 fNfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q9UsbPHxQcdfZLTnOccu24vjYBcOtxtHjR4chUoHDsY=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=qYUT4drJDivcgOjcQVAWdN3dRvtr2BG5FHmGaV3tUNSI/Y1cu3l6MPaPbN3kV/CTny EC/tLpeKRxX5hSCSVw07sWOZnc0wM+ZnC/K+eHEIX4wZlJl8yab67Rpo9OZZItifPri+ vexvHrJPdgKY8gCgskfDI2xSCidnYnXrLi183YP19CJDJtMeZiEGyYMkuJSYuHWs43x0 OvckK1wK7lhzkuhJEXdJE+Tcf14QdHwKLMcN0XSpInj0m2ZxqsdHPEEgiIl3ILx3d6qv 8vY4qBLy2xdralX2Uktf181P+4bQCifmsdYjmX1Jt7RmuyUtD98dycaLOksh3Z011KA6 920A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQ+AZFNP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020a37e105000000b0077d6aa47a69si1493484qkm.493.2023.11.23.10.38.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:38:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQ+AZFNP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EZB-0002go-Cv; Thu, 23 Nov 2023 13:36:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EZ9-0002ST-JU for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:43 -0500 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 1r6EZ6-0004Ut-0S for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:42 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4083f61312eso8916215e9.3 for ; Thu, 23 Nov 2023 10:36:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764598; x=1701369398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q9UsbPHxQcdfZLTnOccu24vjYBcOtxtHjR4chUoHDsY=; b=SQ+AZFNPQ1n7W/NNNVfEuUAP6huWtqxvSGezFArwucJ2kr9Xe+nWWZVyQmGr7Xviaj zA96j2h5v3sTRLz00gKY8u3nC1F5tXiEeB9CN4C1LW98yspeQW9xvLIpO6ypF/5XXsBc 9zbKlUX8RHoyW8+0OaXy2rfxJe1hTcOUF0fgcbI3d/RMu3ueOCVHIwUlzdNHpXdXGhvM KIZDMxb7guclLsOVRPvuk8pmdIKtAP4i6+UcDiL2bhYnqzTfR3nt39GbwvflWoMkqEtQ b1d03YX60ifznvU7fTr4G2s2nypgalqJaCsp2QJf8gbrfxVtF3QuC9PZluaSy4nMfOag JqFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764598; x=1701369398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9UsbPHxQcdfZLTnOccu24vjYBcOtxtHjR4chUoHDsY=; b=H6Fe2FoFDzqTZMkcceB5fAwV7smxfpfVXXPPM6SizVKfT9Lzz2uPCi27SD1Une5wLE hJPz7VbPZ6NhF8vhvstr6GJ+1Pbni/5Okfmsm+2EnTfmjYSGyuICUkKt6QDXIMHhUW2D ijdrqY5a4+tdkfSy/iUlWQxA/vXq7LtGmJMlp08TfPIeZZbXEMhJZUvJzx7zGboUqn/q dcSGJPmQaP5F/6EoeVHzbI1T5toBhcOHvALXQf7yQ2LN56Fx8kp7MyrNoLS71yR8i7Q6 /H8e1rKDMiBQGYZX9KudvkK06fIigTnzb5OL3kENlPdGyYM/D7i6i+Ik9MQMy5vgJfVS QiHg== X-Gm-Message-State: AOJu0YwQQ/tb/RerBE9UJw7tudvOIR0HtTb+rE8r0apvqUvrw2+igP5z 8Wbim3HeOwhNstLy4e7zYAItoE1GNkYQ00IZXss= X-Received: by 2002:a05:600c:3110:b0:3f5:fff8:d4f3 with SMTP id g16-20020a05600c311000b003f5fff8d4f3mr326179wmo.7.1700764598088; Thu, 23 Nov 2023 10:36:38 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c4f9000b0040b38292253sm1316405wmq.30.2023.11.23.10.36.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 14/16] target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:15 +0100 Message-ID: <20231123183518.64569-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 91773c767b..9f58a08710 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1304,17 +1304,16 @@ static void kvm_arm_vm_state_change(void *opaque, bool running, RunState state) /** * kvm_arm_handle_dabt_nisv: - * @cs: CPUState + * @cpu: ARMCPU * @esr_iss: ISS encoding (limited) for the exception from Data Abort * ISV bit set to '0b0' -> no valid instruction syndrome * @fault_ipa: faulting address for the synchronous data abort * * Returns: 0 if the exception has been handled, < 0 otherwise */ -static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss, +static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, uint64_t fault_ipa) { - ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; /* * Request KVM to inject the external data abort into the guest @@ -1330,7 +1329,7 @@ static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss, */ events.exception.ext_dabt_pending = 1; /* KVM_CAP_ARM_INJECT_EXT_DABT implies KVM_CAP_VCPU_EVENTS */ - if (!kvm_vcpu_ioctl(cs, KVM_SET_VCPU_EVENTS, &events)) { + if (!kvm_vcpu_ioctl(CPU(cpu), KVM_SET_VCPU_EVENTS, &events)) { env->ext_dabt_raised = 1; return 0; } @@ -1422,6 +1421,7 @@ static bool kvm_arm_handle_debug(CPUState *cs, int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) { + ARMCPU *cpu = ARM_CPU(cs); int ret = 0; switch (run->exit_reason) { @@ -1432,7 +1432,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) break; case KVM_EXIT_ARM_NISV: /* External DABT with no valid iss to decode */ - ret = kvm_arm_handle_dabt_nisv(cs, run->arm_nisv.esr_iss, + ret = kvm_arm_handle_dabt_nisv(cpu, run->arm_nisv.esr_iss, run->arm_nisv.fault_ipa); break; default: From patchwork Thu Nov 23 18:35:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746506 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036394wru; Thu, 23 Nov 2023 10:37:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3FDWehSYPSqma/Onku0CyZa4Sfu37EoUoWsah1Dqr3xVur2EdSsV3ZcAN3Vk9EGb2Kg9T X-Received: by 2002:a05:6870:a2cc:b0:1f9:e9c3:5b45 with SMTP id w12-20020a056870a2cc00b001f9e9c35b45mr182951oak.19.1700764654271; Thu, 23 Nov 2023 10:37:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764654; cv=none; d=google.com; s=arc-20160816; b=TgkkT8WeQGA2wBjTcsrVoyIhfFJGRPI/OVu0uX4uWUtN7GPAwVrNlc3oIVO52HWi2c B82BwcgbydTHwwcUS+peVTAsPa/2/2AYL0VD0b1yIVQfQ8BCBA5ileQjF5i5MsvgWEX0 iw/LIMdUz9dKVOcHsQ73sjRe3gkwq8i5gP99+ZCCWP2c4l+Tj2rNehtoMlri08i6dP+N xEY7+KZmdFPCbMoNq2ebDL3v0rv2fV4PHsXhuod4uXOumNGJbqM3FtfNomrFCa5EK0q2 v3S6VCHxSGKsMGQIOkvE90fqzTU62n42urCRCY0TDm1IS4NS2Qz2KInbdOyVsNFSTzTL wv7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cqp56K59q3umRruYVBhFmPPZuHH1N9xP5Bn9Um8qZmE=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=K+yYJFXPrbORLtWxcPRE1Yp69pEVtQTs/mXZRV4GldQtGeKMbG03stJ1QsySxMBiOS cFj8wilbmaJXVT46yNT39G/HeJp6nIVCFEDnqUjY2/fxn1E9wEnLw+U4x0kHVqT5GpeI Dj7cbPWsxNa3iVS4+LV9Bnr/4UHj9+Is51AZFXhLsgeAbgMBGBX2bsZKar0//Oy1QV1t q7vKbwYEBd8t+PV51HLd6AVQla3OpI3viHTULV4Eye7kTmFMSWfhHLk2Sb63T3wq+fEV Ph9/oMg5OrRKDq4+yTD9MWYXJOTc071i4kL+qMnzkdBtZd7klhqNfMDvLV9oqlwph0Zi pTdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HLqYtlMn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k17-20020ac85fd1000000b00423839bde26si1600045qta.671.2023.11.23.10.37.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HLqYtlMn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EZF-0002y8-Ae; Thu, 23 Nov 2023 13:36:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EZE-0002qP-3g for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:48 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6EZB-0004dj-D7 for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:47 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-332cb136335so755726f8f.0 for ; Thu, 23 Nov 2023 10:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764603; x=1701369403; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cqp56K59q3umRruYVBhFmPPZuHH1N9xP5Bn9Um8qZmE=; b=HLqYtlMnh0jWNf19X2dsHZN85dajy7ar8QpIWU6ci8yRmzx4jyMXFLhwEvjFnHv6Mp UBBfDXrXxB/QNB2v+3NPywiMQ9issPeNS0naUg3/R6nXXPglZ9mAZlUIQoZN/wjnY/2W EdHqCXS5pL60oVWkYL+tmePJ09YQefQ+XL2/r7QJQvofek2ZTQXLPxChd9A9ScggD8R5 Dt/t6KD/O4REpDehJotMTrsI4iuXXv8oR6uifZLMzuhCJeZ8hHXfpUBQOrgENWisksnQ BpUkE5EhYS8anW+ep9AHxfaROX0NvUp6HzzxRqqoDRQITv44ChQOxpwhzr489beHlZ8I RxUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764603; x=1701369403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cqp56K59q3umRruYVBhFmPPZuHH1N9xP5Bn9Um8qZmE=; b=F0AKUSZufrh72hiIosWpptaYtWQdaortQzIZgT+D60qBY599v4/N/RILAkU6k9WeA4 inK6m44OjhpRKJlXvGnxqgWVhhA5C9xz//8xT1dc4Q2upRDt9/yZWfyPvy7Te79zkjHg t8C7yBTy4PKVqj1YXHZrpdWRnP9quBUDWrwWuJY3A6g5ZzmjKAtM3B3054feIcEKFyuK F4FVl6/OZGDcu7YRsUATyVQXYk0mNUbsmofMtJ4qbhMrTtOil9qmRCkANkdt/B1ASUZH DO9pOKQsgT5sINS/W0tKLa9j1slxIdWukOBfE79bK1LizyvmKNRrs5ZNWsZMBq8g1Umv wpMA== X-Gm-Message-State: AOJu0Yz1c0TvZDe+Me6OuyAWgySPvKL7VUH3+BcJzWd5ETLnGq7YCmY4 BaNNGkhbbU1NhP3Fy8EN6tMMvk1+30LdcvX2Rds= X-Received: by 2002:adf:f88c:0:b0:319:7c0f:d920 with SMTP id u12-20020adff88c000000b003197c0fd920mr198305wrp.57.1700764603697; Thu, 23 Nov 2023 10:36:43 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id h4-20020adfa4c4000000b0032d8eecf901sm2346025wrb.3.2023.11.23.10.36.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 15/16] target/arm/kvm: Have kvm_arm_handle_debug take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:16 +0100 Message-ID: <20231123183518.64569-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 9f58a08710..1f6da5529f 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1344,7 +1344,7 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, /** * kvm_arm_handle_debug: - * @cs: CPUState + * @cpu: ARMCPU * @debug_exit: debug part of the KVM exit structure * * Returns: TRUE if the debug exception was handled. @@ -1355,11 +1355,11 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, * ABI just provides user-space with the full exception syndrome * register value to be decoded in QEMU. */ -static bool kvm_arm_handle_debug(CPUState *cs, +static bool kvm_arm_handle_debug(ARMCPU *cpu, struct kvm_debug_exit_arch *debug_exit) { int hsr_ec = syn_get_ec(debug_exit->hsr); - ARMCPU *cpu = ARM_CPU(cs); + CPUState *cs = CPU(cpu); CPUARMState *env = &cpu->env; /* Ensure PC is synchronised */ @@ -1426,7 +1426,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) switch (run->exit_reason) { case KVM_EXIT_DEBUG: - if (kvm_arm_handle_debug(cs, &run->debug.arch)) { + if (kvm_arm_handle_debug(cpu, &run->debug.arch)) { ret = EXCP_DEBUG; } /* otherwise return to guest */ break; From patchwork Thu Nov 23 18:35:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 746505 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp1036269wru; Thu, 23 Nov 2023 10:37:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJbcvVtfLcY+6U5baV7R9F+x9hSZu+W+ECODTqvR8gM5+4bW1jdVAf8a6zeePXOzTEsi35 X-Received: by 2002:a25:2057:0:b0:da3:74ad:e05e with SMTP id g84-20020a252057000000b00da374ade05emr85676ybg.40.1700764632899; Thu, 23 Nov 2023 10:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700764632; cv=none; d=google.com; s=arc-20160816; b=WJiVCpPRZvpEzlLXxiJTG0jo7pxec08naGnIz4MZjfwfhqO3LuDlCHSBN5Bo2Nc4QK O0tw2ZwNH5ip3zjVoOTE0OWZFBCLr7BQbzJ6OU4lCbabSERp3SMx73gWNmugwihltsgM 6cnjJKYNKtzMQ6Dxeg7DnKPHxT1bvkUda6yO0cb+jv3uGTFwru27UGhaOng+tKmROsG4 /rEyF6gsmNm1Cznaw5m4p1Rn+4IIpOC3tzyK5ak/N/m6r5tlw2MbZFcqOaHtvsKjKgBf BqJINOAuPNaqelCpxS6/yQ3J8n6M8hzdQpfnwbsDBaZz+tVDAx4q0dCefuIBjx316hzO aMjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jApUa9NwPbQ48ykKJDUlLJN0yCBFVC5cyFHqkJvQSW4=; fh=vteyIG+vxxCYuwp1F8LdzHfX6jaUSeyJC9WWnpPrzwM=; b=w4UJn5lieN0qG4Nb0HLWPu+QC7VVMORK5JXJMzsjdgSW1AWd3KpcjVwAsNHKu6fAFU w/FQXCAp7PXASeqWBgKql+8XDuPAPQrPsIBWM6SbHZbPSYpmm5TvwI/3+gor4HxeFu8m VNPb43pLhuGdoVkCauCZcilz0sAHicnk5o7WVX3WcEWmXNj6k378xv97ODBaUIxEG04z yz7nLGZqUTS0Y1a6Ce0LiuPxXzS0/NQlLl9gNfw31MmopohvI2KH1j1NeyEE+2uuE8JX RzgjBte3rAo7TnoyXRtuWMh8UexR2QLpWskEmxXcFrgzjT6rAzG0SmfHqHAg3KbwZU5a pdJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yJtmhxtU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t13-20020a05620a450d00b0077bcbb62af2si1602233qkp.650.2023.11.23.10.37.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2023 10:37:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yJtmhxtU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6EZL-0003d6-Gt; Thu, 23 Nov 2023 13:36:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6EZJ-0003US-EX for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:53 -0500 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 1r6EZG-0004ec-QX for qemu-devel@nongnu.org; Thu, 23 Nov 2023 13:36:53 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40790b0a224so7663155e9.0 for ; Thu, 23 Nov 2023 10:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700764609; x=1701369409; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jApUa9NwPbQ48ykKJDUlLJN0yCBFVC5cyFHqkJvQSW4=; b=yJtmhxtUoJnYuLJDMSXKV8X4DcDWdQAn6sewzh/gkeuP13p8LDli4cAzAeVA5JbN+i B6Ykra93TplqRAPmWOavS3m+/b17tbpUIxzszQnF6BpNZx9OPigmhdbkHj+Pg5cKH/24 4jbnenkOQT/47qF0/KvyAasw7Pg09zlWpdqI8fx8zeJaUOtzqGbYOigctQ0yZKVKNJjT TkjjfmzeR42yzfk44iwlok5YvNiKDpxihGvpB5Rsc44DUjwMuUngUY4iX2yTPcDPoaOJ 1Qy+Y3cwcBnMTYC4EVSiJDVgbHQ/AnLww9It39X4i6sFzRPZKUH9IsKPyYarPyspveSq qtDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700764609; x=1701369409; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jApUa9NwPbQ48ykKJDUlLJN0yCBFVC5cyFHqkJvQSW4=; b=Thf2Xtjy2nmqHl2lftVUJOF55uzi1SyXf8vOhecGB+LkvTgVeqnWhqibXtBh4Nbx2w kKRcHGC7iyL14lI2DBnJkJPXy8s2RALtIfmJ/o/kk1wtgkYnxPJB+3aUPrP5ZVE5tTxY lNRKzThWwnykWWCIDBtEkY1ppbTzfmlOq6PEaYAIj/wax5k+Yg9kqFfF6jr7w0iSijt6 kmhiot6n8r3au3YxxMiQYS40BSR71gYL1zhuDJsUc4s3+T4HdqILT4l32qvYB7zyxcQa fnlYhaIK9qkhpqaQZP+747XmZs8Lc9VkOT50ucyYxTP66JUoQOxrQbKFZvJ8USXG+Xx2 i0fg== X-Gm-Message-State: AOJu0YzfZdrUBGt3SJ/gqU7ubpGhlTdm0yZ0ELMf9yeafvA/eB3sF7sb eLwuRv5r2GAC8LNdh/ZQSzU2hGDqVpyQ6dvAFJ8= X-Received: by 2002:adf:efca:0:b0:332:cfbc:cb44 with SMTP id i10-20020adfefca000000b00332cfbccb44mr191483wrp.43.1700764609133; Thu, 23 Nov 2023 10:36:49 -0800 (PST) Received: from m1x-phil.lan ([176.176.165.237]) by smtp.gmail.com with ESMTPSA id i2-20020adffc02000000b0032f7f4089b7sm2318145wrr.43.2023.11.23.10.36.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Nov 2023 10:36:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 16/16] target/arm/kvm: Have kvm_arm_hw_debug_active take a ARMCPU argument Date: Thu, 23 Nov 2023 19:35:17 +0100 Message-ID: <20231123183518.64569-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123183518.64569-1-philmd@linaro.org> References: <20231123183518.64569-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 1f6da5529f..cbfea689cc 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1455,11 +1455,11 @@ int kvm_arch_process_async_events(CPUState *cs) /** * kvm_arm_hw_debug_active: - * @cs: CPU State + * @cpu: ARMCPU * * Return: TRUE if any hardware breakpoints in use. */ -static bool kvm_arm_hw_debug_active(CPUState *cs) +static bool kvm_arm_hw_debug_active(ARMCPU *cpu) { return ((cur_hw_wps > 0) || (cur_hw_bps > 0)); } @@ -1493,7 +1493,7 @@ void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg) if (kvm_sw_breakpoints_active(cs)) { dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP; } - if (kvm_arm_hw_debug_active(cs)) { + if (kvm_arm_hw_debug_active(ARM_CPU(cs))) { dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW; kvm_arm_copy_hw_debug_data(&dbg->arch); }