From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764582; cv=none; d=zohomail.com; s=zohoarc; b=hVMcZGXgeXrRzzvoNkqcCU1TRPfdlvlVQHKXK1ZcfDacNf5S5A5JsPnJ3LbKpguvjqEC/6JqKKb1fmiOSzAME095Pc8VRdc5f4drOeWA+dyK1CYyI0BeMvP2mdbJQan2uk60sbgOEtPuxydoQuQoQrAXV1LHtGZUjsu9vHyEAJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764582; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EggnDxiS3lb3CDYKGlg1a7WOxUSv7txLuyeSgPzo5Gg=; b=VccAdrdcmbVgGFLQ8DEXP0fS/+BRdciAbSVBSjiVETKDWHfOeGrgyH6maVs/BHXujIJ+cu1S1PJm1YYBpSnC7oKoYbE5zRkpcv49leO5/EoL76VPV+4IS8YjbWPiofeSpqSKGYKl1vkcJcrlMs56NjrjjJp3VgEgpvj4ESTj/1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764582380486.6675971257929; Thu, 23 Nov 2023 10:36:22 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFvWOwOd7e1Y5lDPZTFF3Xq4nOUA9yN5q2GNMAzYiEapwPBFpCHPMn1UoTV4j1koXw+yTkL1A== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764582853100001 kvm_arm_its_reset_hold() calls warn_report(), itself declared in "qemu/error-report.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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" --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764632; cv=none; d=zohomail.com; s=zohoarc; b=HnA7j5HJjerReDMtWuAhpzeJveAMEOwvNqUk9z+eaYckH7Lyla7AxrgtqgpozCzIPno9rZS+CcDYtDQ5lUlHafqmi0/PlDcTpGqmgOiDFXtLgqbwDnInzp1tenMW8RhWrlvzwttrM4g1Cn06RQkm5FWTb9YpbLFQ6aBpxe8UTi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764632; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BmQzUMP7VYVa7fjT/YSlrE9ib44vaPa3uhyPvwmHEck=; b=aeb8dEsZ1PP7tnyBt/ehjhk0t4+x/7wW77iTAelnVZBWe/hRUR7vGhh2CWUYaTjrA0fyxX7ZhFXt6x7Qu/QFMc6oa8YFHspT/1IRI7Ph0e1b6vC0d/90dSXRvcVtJOBAoznB9YuZyqmZoABm/IyimncZ8ldg9C0rh2qjhdy++AE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17007646322511019.8849323167706; Thu, 23 Nov 2023 10:37:12 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHUaninjtMft4ooDyc4hnH3umDC4N+Bf3mITGO5bL3XKGyp7f1b/sTY697AHiIj2YfXI4zDtg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764633753100005 Both MemoryRegion and Error types are forward declared in "qemu/typedefs.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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 =20 #include "sysemu/kvm.h" -#include "exec/memory.h" -#include "qemu/error-report.h" =20 #define KVM_ARM_VGIC_V2 (1 << 0) #define KVM_ARM_VGIC_V3 (1 << 1) --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764624; cv=none; d=zohomail.com; s=zohoarc; b=FQKmvCFUJ2QiJP0/DVFpn/liHJHK5TDoLASSPFn5LFkK2DLv8tBZfpXiwGn3feLY81IzCMP15QiLH7LYsmZlxiqfSBNoofrfh7SWAZA0kJNUP+WwYE/cHRwpmr80Wbd4DDmywTi3Rze5Z7sV9drGBCJQwWLNApXDdcx9CaLABqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764624; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LUz0XGe6SRMXqOSVJvQiXoUHGpw35/yPoukvsO1/DGo=; b=JLS6TXbSfYFi9k/k0dRW37mvO5dHkJHO9gbJHrIEEostFQzt2F7Y2D6Kc1M1iCIIzVZLX6Rhy+q7pL7Hf47OZ5Z0/D7W0aUek2zJkj7iNS0mehWkeTB5xXm6ey/I5Z3gMf/M2mEh7F4DVOwgdacibRhtbSgBOTbTjr4RGBZndy0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764624860125.82964243169624; Thu, 23 Nov 2023 10:37:04 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IEuvPz5wMMJnFnPWouwjZrhQZklg8n8Qlh0fxAWkPyyLyC5CqCfflm8sHoGFAVFUlWKAA2E+Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764625796100002 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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); =20 /** * kvm_arm_steal_time_finalize: @@ -243,7 +243,7 @@ static inline void kvm_arm_set_cpu_features_from_host(A= RMCPU *cpu) g_assert_not_reached(); } =20 -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) } =20 if (kvm_enabled()) { - kvm_arm_add_vcpu_properties(obj); + kvm_arm_add_vcpu_properties(cpu); } =20 #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 valu= e, Error **errp) } =20 /* 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 =3D ARM_CPU(obj); CPUARMState *env =3D &cpu->env; + Object *obj =3D OBJECT(cpu); =20 if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) { cpu->kvm_adjvtime =3D true; --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764804; cv=none; d=zohomail.com; s=zohoarc; b=BxuFJQy/44I2rEhigfLrddVvuGlIx/7rsrMRGfGC3zrIJ9K1K/bhQBxoIru2d2+UQwoJj4SPuHyjY98XZsdkkDt85ph2DTl747dDKEUp63iyJUCVT/lPOMJKEYPzGuEGLGDTYeFs01aL3owaxguXgfQotpLR+HpnNpzXl2cNSos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764804; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+UF32mbiOniogqxmnEO/G/4hA+3MFqbkOICeJQxcwIQ=; b=FsSFkKp2dFSuUxv0ZnY/nY+mhAgdDoX1KVX1iowC+QHQQbcnudlecpg5UIxyfnStN6BMpd7tCZjKNXB9mCLA4FRQbuLeELxSC/NYLo5ktgFt4gRcUMC49malIwhLEA3sL2DfaD8lK3TDN8AWKWKFZ7fg8klBj8hyGorqzPIWGKU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764804158915.4093848601184; Thu, 23 Nov 2023 10:40:04 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IGltS3KwJOeq5TCm3ydg30w+N35sZn3hV62TeTHE6Z8rqYBJAB1D8TeLnzmMQ7S92iGYMJJ4Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764804357100001 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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]; } =20 -static int kvm_arm_sve_set_vls(CPUState *cs) +static int kvm_arm_sve_set_vls(ARMCPU *cpu) { - ARMCPU *cpu =3D ARM_CPU(cs); uint64_t vls[KVM_ARM64_SVE_VLS_WORDS] =3D { cpu->sve_vq.map }; =20 assert(cpu->sve_max_vq <=3D KVM_ARM64_SVE_VQ_MAX); =20 - 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]); } =20 #define ARM_CPU_ID_MPIDR 3, 0, 0, 0, 5 @@ -1921,7 +1920,7 @@ int kvm_arch_init_vcpu(CPUState *cs) } =20 if (cpu_isar_feature(aa64_sve, cpu)) { - ret =3D kvm_arm_sve_set_vls(cs); + ret =3D kvm_arm_sve_set_vls(cpu); if (ret) { return ret; } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764667; cv=none; d=zohomail.com; s=zohoarc; b=YH0srIT/44fpa2NQe2e0b26IzgWGIH3XsBOqbty8pOf7/J0p+Ozo4tXxHGoRfR+lzkqJnZBtjUH9qsgljvGbl4KLjnive4QmrPGKDYAd3H3L06BccscF7CKxw/TSllDpNZFPOS7Uy9zdIoEMcax6dWoRaBnbfGZf5qETlRbO0Xs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764667; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BbxwUSVkjdWQxr0WbjMFM/ALqAenG4WEeRbrPnMTydM=; b=gxP+iuMMZuUKPUHXBiZJ0zwdZKPbE6c75fpR2KaK7dP3L5LEViAs42jYUCuMBL1/oAAx2T39CDUPvRgVifoX7jLS2ZiRVZ3PQEEQj9eUS3svelJ0O0ToYUFYGaMg13vgIZPjSVjFxmPPp5NPIit6AXrw7nI8S+uc+10ah9Wwh+0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764667469800.1442651552727; Thu, 23 Nov 2023 10:37:47 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHVpBW+fxUIX3fX8nnHCAT1wph7WRPj0AJYgOhwR4F2XpN2KJZ++ptoCV/AV5CvKejHxGVv1Q== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764667915100005 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=C3=A9 Reviewed-by: Richard Henderson --- 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); =20 /** * 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); =20 /** * 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(); } =20 -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 =3D kvm_arm_sve_get_vls(CPU(cpu)); + cpu->sve_vq.supported =3D kvm_arm_sve_get_vls(cpu); vq_supported =3D 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) =20 QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN !=3D 1); =20 -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]; --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764585; cv=none; d=zohomail.com; s=zohoarc; b=AX0n9nPJaeUz/PLwqba1nmL4GPw1PGGVHRTdh9JMnnlWcmJZ57jtgYuttCzd+EuGYLtQqBxfzkx7AQdH9y49+dq9A2MrakesraikZzGPQGUCRUmUEF7JhoQc2A5Whb+iTqwkbrOgaYr1/fChtjeHnCvHPSeuPB2eB4n6Zg6FU8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764585; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=APkzUJ5V8QYL4MOU/zl88wqY6eeEqD/ibNzL1bZO05g=; b=HftgV8ackqIy1xCePdA1sbcoZeJEAKvgfQxH9d8cdObC2+WTwd9EAe3VoVrG5UHYuJUbjE8dI4WpEtogseOOrkT/5Hhq4ON56cwzlmAM2QYiBbGl9J9K1bpxouf7q8cQlaOZpwWhSQLJ0mBtVH2o0tdX+p3qI7l0k3YVQLOnZkI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764585575629.1833934232806; Thu, 23 Nov 2023 10:36:25 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IEMHSuxheCHpy3+JITp+0heG5juBUPBJg9h7cDu77hpzkqvd1orzB6IYTMkszJ7lWDnZPfVaA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764586787100001 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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) } } =20 -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 *a= ttr, const char *name) { int err; =20 - err =3D kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr); + err =3D kvm_vcpu_ioctl(CPU(cpu), KVM_HAS_DEVICE_ATTR, attr); if (err !=3D 0) { error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err)); return false; } =20 - err =3D kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr); + err =3D kvm_vcpu_ioctl(CPU(cpu), KVM_SET_DEVICE_ATTR, attr); if (err !=3D 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 =3D=3D 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(); } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764598; cv=none; d=zohomail.com; s=zohoarc; b=de+cNCmiIrzf327Xxtv3Zl8+5PTmeSyOsMAQJhqiKnrGVsLFGwCZpMlwv2hXdAtobJ+uPSHvNcRpil0cfEczQbNYy5PYaauEqXnEy+Pvq2BkGv9VQ6ZM39EF8Sevb757fuF147oKUPA0ZhoQoKmOyRSfWkqC7xFhWDxXO9g6qjA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764598; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=znNmY7edfJI2fYiqN/HJeKsLDF9NhHOuefv0PghAu5M=; b=G75QftXCv55zPvITiWkwrcdVX7gfzWH6NoJAv7q3ebLoF0ftsX602F6Q68OaLV4HlLUflFN8j3fsZ/7gGXGT2gSO//ribGhDQkynjpIrODmi3tPZr95r8hSoKIWypbjbEdw2irzWiUniQR12/YEKLGQYN0N07n+lndiOiKgTIcs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764598170496.2576454842351; Thu, 23 Nov 2023 10:36:38 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHwNsCUBI8C+HAtmr6ne5j7ja7Y9f5/nmCmQj8iQdnpHgN1KUrN2rXfn6mGSeu6MN85RsnNzQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764598853100002 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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); =20 /** * 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); =20 int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); =20 @@ -268,7 +268,7 @@ static inline void kvm_arm_pmu_init(CPUState *cs) g_assert_not_reached(); } =20 -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) } } =20 -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 =3D { .group =3D KVM_ARM_VCPU_PVTIME_CTRL, @@ -1752,10 +1752,10 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) .addr =3D (uint64_t)&ipa, }; =20 - if (ARM_CPU(cs)->kvm_steal_time =3D=3D ON_OFF_AUTO_OFF) { + if (cpu->kvm_steal_time =3D=3D 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(); } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764685; cv=none; d=zohomail.com; s=zohoarc; b=AGvn58Suxq48SpUgoZsScfgdnuxFCM4b7cmPIYHX4VtuKPVaKH9K6BH3A5GAuxTqSqTZMpLWPZzivOiIjKsM2oTSVABlHohwU2MYDyiIVj7roDM2LIMCw9qjgZt9LCgPRSdskY8VQr16YAS5UAh01UUkKZ19Iq2ewhoRbkAaNK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764685; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sJjfIOalwsvZmq2fy7v7JKs3hNC/WaTRJ81yhz4vDXw=; b=BKUvISXTl+GgSPJEtmN03u7IXN6cCnIt+XaDxS8kPN65pFGYyiC+fQC7SORjfHugiDbGrIasxf/MmdXDVt1UByi+GyVV1+fdP8o4kOslYkX1EDKkNtd6GVx5GEHlXTJMdXtlA26hx5IE/ZZqoXb+ooAx6cPp7kOVtZZBLjUlN9c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764685839343.2730129306806; Thu, 23 Nov 2023 10:38:05 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IELE79MyLBbOsT4/Sz7U570tGHdhzEvWk2p61WIGplYDA6HA/ukUNXBzijqXiExJ/9+xOAMnQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764687903100003 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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); =20 int kvm_arm_vgic_probe(void); =20 +void kvm_arm_pmu_init(ARMCPU *cpu); void kvm_arm_pmu_set_irq(CPUState *cs, int irq); -void kvm_arm_pmu_init(CPUState *cs); =20 /** * kvm_arm_pvtime_init: @@ -263,7 +263,7 @@ static inline void kvm_arm_pmu_set_irq(CPUState *cs, in= t irq) g_assert_not_reached(); } =20 -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, st= ruct kvm_device_attr *attr, return true; } =20 -void kvm_arm_pmu_init(CPUState *cs) +void kvm_arm_pmu_init(ARMCPU *cpu) { struct kvm_device_attr attr =3D { .group =3D KVM_ARM_VCPU_PMU_V3_CTRL, .attr =3D KVM_ARM_VCPU_PMU_V3_INIT, }; =20 - 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(); } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764777; cv=none; d=zohomail.com; s=zohoarc; b=iTJwqOle9HmQLJIp5R3fHNVWjnmauor2UJYG1RkYiPDXRKZz7F4tmaQLWefFi6gWlhgpEmfaN8FXov/qHWg5kwN51lnMSJASwYk4KWVAjxoPBvqcZtN6WteUn6gDcPdP2HaPeT6foFcTM8r6ggubprnP3GYzRF/48QElz76hE8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764777; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OSjIUExNNTZZyxxju0j+hfpNF1ayVJnEfjEBE24u3Js=; b=KajL/vegOm6REZjwkzP0fjq/pA/j4tRmkAvrkQgmJ4nXUmoUKyoLpU4QI8jbuOzu0uUdaOeHLOcEi34dkmmZ9uH1rU3tRZk6ukIOGuM6ClOKyncOpveRAuSbcxHZAkV+7y2W4DlpkqG0kmyk9xgDriI6ocRKOOfV6PKm9QfXusM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764777734224.7660730014536; Thu, 23 Nov 2023 10:39:37 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IFgzxS1rMr+4vJyVHw8yTL7+XlGZ+6k9Z3h/Y0p6Y8WoWsGCe6GudKC213LdZDrUfDjX2soLA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764778309100001 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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); =20 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); =20 /** * kvm_arm_pvtime_init: @@ -258,7 +258,7 @@ static inline int kvm_arm_vgic_probe(void) g_assert_not_reached(); } =20 -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) } } =20 -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 =3D { .group =3D KVM_ARM_VCPU_PMU_V3_CTRL, @@ -1735,10 +1735,10 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) .attr =3D KVM_ARM_VCPU_PMU_V3_IRQ, }; =20 - 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(); } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764790; cv=none; d=zohomail.com; s=zohoarc; b=SUj1z216EeEs7vGCUN0ffqajwgXQI0JCO96pSNTpwVZYYG/r0EbnReoy/gmr5qXns02Krw7kPcX5BrP0X73c2p7La/oQO41rGiPuUoGCghobI11br7J77hywEMgQb7/uHC+l49NujltiYW6+WTGWlCJTaVvnRFpEuT/FFN3jQ9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764790; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l8RzLhxd8bqvmSn68iMRFd2gB17HmY4vJB225vFPDs0=; b=lHj1mXwOse8dzletWf5A2c5C6SafkCK93qK5Lq0OS6C9kObtvA8sy0YCR20GtUqGhGWlF6G7QiMJVAm0U2Zzv8QbeWwUkYAT/iMF7RLQLW6rqEcOA4GYd/LjqGqDA1MPfKPpIPXC3jYxPJN0WIBSG1O9nmg9VYqponcS5/j/6jE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764790573500.62507731357505; Thu, 23 Nov 2023 10:39:50 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IG5GC8HVJIZKPKWSlma3WIDntOcBcKs3KAgQTxK2CctJ0Mz0JEghM6PU+RJlDjJ80AiGWLb9g== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764792347100003 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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; =20 /** * 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 =3D ARM_CPU(cs); struct kvm_vcpu_init init; =20 init.target =3D cpu->kvm_target; memcpy(init.features, cpu->kvm_init_features, sizeof(init.features)); =20 - return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_INIT, &init); + return kvm_vcpu_ioctl(CPU(cpu), KVM_ARM_VCPU_INIT, &init); } =20 /** @@ -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 =3D kvm_arm_vcpu_init(CPU(cpu)); + ret =3D 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) } =20 /* Do KVM_ARM_VCPU_INIT ioctl */ - ret =3D kvm_arm_vcpu_init(cs); + ret =3D kvm_arm_vcpu_init(cpu); if (ret) { return ret; } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764828; cv=none; d=zohomail.com; s=zohoarc; b=iP2JHf5yUvuZn70kqvi5iR4Aj/6SGa+RXiyaUJyBRBxQU3nuP33JfUdmojLkGj5j/4xEKUUenNdd0ZjqsUzIj+XgsCI49hlK+6daoPEkjiwtSXE+12n5CKAmprK5SmdL9WWn/DhxfE97+b8zfYP3+y8ukIDG0Wzv02L/ZZErhHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764828; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h+SHiNudBaJoVQ05FaR4tXQE9WbV9fq8fmbm8eyNxHM=; b=B4azptMW8Wrv4I9GE96ip6XRzLaP5GzHiHfanzznnJepwbOmcsp5u3Y5Z8PDpazY6cvu6AqETPxFyA9APGAMXcAzXjKKIySDMtBn8A/Ws+F9r2uwL7NjAW73UNNEeWpPHUuY2phO9BmwvoGwSCHVFay8UpH8xDBJWix2Yet6+NE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764828738423.32568269863384; Thu, 23 Nov 2023 10:40:28 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IGQXfk+qml3Ss0hlOkQY//xmWL0biF8uHQpwCUZdUFgs8ebq6vM/C+/PFHbdhDwvJD77doXJg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764830456100003 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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) =20 /** * 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); } =20 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 =3D kvm_arm_vcpu_finalize(cs, KVM_ARM_VCPU_SVE); + ret =3D kvm_arm_vcpu_finalize(cpu, KVM_ARM_VCPU_SVE); if (ret) { return ret; } --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764609; cv=none; d=zohomail.com; s=zohoarc; b=BbkYVJwUxfVMPHdLW4xrpy89JiX9mdd6SKnb1jQz9Cffvyv+CCYhAXclsK6jrGsXsguYqMpSKIgJCaOLTOrBgovPGWGLDSR85qTRenCb8zg/lGuc5CbByiB3qDCioP0zBm7IeVQ395ZBo/XV3cUYZ4iTAQS0h/9q7nnrNuGvcr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764609; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wFeYHB+Hwgz28c/uPKH/ogtnPZczZab/kLjBCnJSUvs=; b=PvPng7V/q4bm3Se1ZTceQi/g2CymtO4M1pEo8mJxsl4g3bIrCrQsIv3XtUR1Kvjn3RgxijTi4I8tUt/ix8PW/4EYQsMSd0cjh3ziQLJTGuLzRhe0tjE/8pihB/4k7gVqSSI/5xw6uZiv1M91Ggwo4u6ZQt1oKRn92k1jNFjGeTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170076460959575.29555135258818; Thu, 23 Nov 2023 10:36:49 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IELxbckK8uZXazOGgHv1fiTUgL1Ik/QjVMUZesvDWJ1t4LowVH54N1HBPUHto+6Kfzb13zJ1g== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764611707100003 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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) =20 /** * 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 =3D ARM_CPU(cs); int ret; =20 if (cpu->kvm_vtime_dirty) { return; } =20 - ret =3D kvm_get_one_reg(cs, KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); + ret =3D kvm_get_one_reg(CPU(cpu), KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vti= me); 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) =20 /** * kvm_arm_put_virtual_time: - * @cs: CPUState + * @cpu: ARMCPU * * Sets the VCPU's virtual counter to the value stored in the KVM CPU stat= e. */ -static void kvm_arm_put_virtual_time(CPUState *cs) +static void kvm_arm_put_virtual_time(ARMCPU *cpu) { - ARMCPU *cpu =3D ARM_CPU(cs); int ret; =20 if (!cpu->kvm_vtime_dirty) { return; } =20 - ret =3D kvm_set_one_reg(cs, KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vtime); + ret =3D kvm_set_one_reg(CPU(cpu), KVM_REG_ARM_TIMER_CNT, &cpu->kvm_vti= me); 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 k= vm_run *run) =20 static void kvm_arm_vm_state_change(void *opaque, bool running, RunState s= tate) { - CPUState *cs =3D opaque; - ARMCPU *cpu =3D ARM_CPU(cs); + ARMCPU *cpu =3D opaque; =20 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; } =20 - qemu_add_vm_change_state_handler(kvm_arm_vm_state_change, cs); + qemu_add_vm_change_state_handler(kvm_arm_vm_state_change, cpu); =20 /* Determine init features for this CPU */ memset(cpu->kvm_init_features, 0, sizeof(cpu->kvm_init_features)); --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764665; cv=none; d=zohomail.com; s=zohoarc; b=PKZ3KsjqaDQGnNsiTbQpF2O9X/qHbaeamSyUSIc180/Q0B+55Q3P4h7BshRZIHSKYFMR8hLXK8dqmQUdoHXoOLtWGXIHo1+VPjxRrIKcF3XQsX0kWy5ITPdEo9lYBHccni44r5jo1aol+oWNMS8Cn27TzIE4xC1VsyvzGXkRCnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764665; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Otvbi712uFgYyup+pTZVJRpTHa74RGjJF86YXo2+tew=; b=Rbij91F53NA+j5Ajv7Zq8nXV/Ijfp0jfKF0HFls5EdFfKD1lKkFquVbtvzs1ZV00EbDuCAL85W2gmbqzl8kZ/e31tMnp+Y7gqbvlH2gbjEU1LGRMF7fpXliEwXv4Zr3Zv8ammaa5vGa6IHW1hrKGdJAuc3wdj4K9XFHuKwWmK3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764665184786.3193493631367; Thu, 23 Nov 2023 10:37:45 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IEUBNzl5yBDCfKyFqc+ys+ZzNDGN5X1VuZj0wqdqnY4mEGUORfFfHklyOF+YrYSPYd7f1KZag== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764665869100001 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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) =20 /** * 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 =3D CPU(cpu); uint64_t dfsr_val; =20 if (!kvm_get_one_reg(cs, ARM64_REG_ESR_EL1, &dfsr_val)) { - ARMCPU *cpu =3D ARM_CPU(cs); CPUARMState *env =3D &cpu->env; int aarch64_mode =3D arm_feature(env, ARM_FEATURE_AARCH64); int lpae =3D 0; @@ -1220,7 +1220,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *r= un) * 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))) { =20 error_report("Data abort exception with no valid ISS generated= by " "guest memory access. KVM unable to emulate faulting " --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764701; cv=none; d=zohomail.com; s=zohoarc; b=VYjjZdgJ7xsZm9N1OQsVNxeDDXebbiwTFEmxFXO5noIEsBR5huIGprZRS7uFJ3efyB7WiLAuWDVxfHdiG8pCkRIXmkUUooedYW46VmTHjM0aw/tzT+h2LEnIAnEf8wdIdEYfbRDlKl5GEeoaHHQbc+pCa9a+7FCSv1sYmc3yft4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764701; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q9UsbPHxQcdfZLTnOccu24vjYBcOtxtHjR4chUoHDsY=; b=HJ1RdA/3aYzn3DlopW6LaCnb7AkmIfvzycpcjNUOwkRu8IciNozFU0ZNbHAl/ub4l52uFx6KA/Wak+ucD3kjhw++6Phbzo0mqfPQS4m5lmGwDz4D8DiZk0SXZ1j2Qbhr/6vKrAijE8n2346Qjbf0V87fmTkOVX9qrYfdIsxqZa4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764701489753.9780297781931; Thu, 23 Nov 2023 10:38:21 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IEJ2lh8WurQcqnItjOupFjCOAnMT36WCiJMaD5yOR1INcukHMgwcm3UIh/Q5/8UZwJUKg3ttA== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764702030100001 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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, b= ool running, RunState state) =20 /** * 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 =3D ARM_CPU(cs); CPUARMState *env =3D &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, uin= t64_t esr_iss, */ events.exception.ext_dabt_pending =3D 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 =3D 1; return 0; } @@ -1422,6 +1421,7 @@ static bool kvm_arm_handle_debug(CPUState *cs, =20 int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) { + ARMCPU *cpu =3D ARM_CPU(cs); int ret =3D 0; =20 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 =3D kvm_arm_handle_dabt_nisv(cs, run->arm_nisv.esr_iss, + ret =3D kvm_arm_handle_dabt_nisv(cpu, run->arm_nisv.esr_iss, run->arm_nisv.fault_ipa); break; default: --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764654; cv=none; d=zohomail.com; s=zohoarc; b=PKJR6o+eds+qKwui2RBtenDd1ITbI/sJZjPXCtl4I+j262njD9rO1BoE760DoUzHhgnh6qGfNcAQg6EqHEmIUp2i0aroq5kZt6ZZZttXRbgVjB0zPEcndJy5xF5nHvy2/tZ3igoDTuTC57Y4JmXBmUM+PHSuHXDq4A0yfqz9H7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764654; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cqp56K59q3umRruYVBhFmPPZuHH1N9xP5Bn9Um8qZmE=; b=Bos8kGUqiLFVPpaxQOn0DDdNuL3KbpqB8JFZPZoeFOtjPnygiOrUdMB/+akVemRtDQ2hRDRqejqCmXkgE5jEXb+hPaNMTh5+OH2ia6ikuFLtr9uy3P89UieFgPYDzXyQfd2maHC7MUQGoAmsua4HfEPUU6WpnUUdj5NbJtxiVEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764654679794.5751338706515; Thu, 23 Nov 2023 10:37:34 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHytQoZi9KH8CyFExLRcgAcv8tHyMDkToDBwOGPZdW9JwNZM10ep/0eQg9tIrJxtcYAlwyL4w== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764655885100001 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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, uint= 64_t esr_iss, =20 /** * 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, ui= nt64_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 =3D syn_get_ec(debug_exit->hsr); - ARMCPU *cpu =3D ARM_CPU(cs); + CPUState *cs =3D CPU(cpu); CPUARMState *env =3D &cpu->env; =20 /* Ensure PC is synchronised */ @@ -1426,7 +1426,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run= *run) =20 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 =3D EXCP_DEBUG; } /* otherwise return to guest */ break; --=20 2.41.0 From nobody Wed Nov 27 04:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1700764633; cv=none; d=zohomail.com; s=zohoarc; b=Ssaw+N/BStcZjS4YWsIUiaCiEB+dnHBOZWAKRUcHpzSfLLisEdGNrm7Y7EjR+N5shV2tSBIekbRzTgB+I7dSLDlP1SaVndj3S7TtUsKocM1wJ0S4M7a6qYKs1IXaMRl8rbVLOsyzcr4j30jgJYUP0DWYEExR4ZhFT+74kSOwMLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700764633; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jApUa9NwPbQ48ykKJDUlLJN0yCBFVC5cyFHqkJvQSW4=; b=jka4wemT6EqYF62FmRVGgdQ+GR01U6HB4mkRvRuLIth+CvEYB80gSukNetwqFGimew+FKuLk1jrmKx7IEt3n7TLpxDI+tXnwFH8/R+1/LQQBOmNAFkkbYCoqdn/wupPkxG5SwdSS7DPzbJftlDOy0XX2vLcN/eRXstwtXMt5pMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700764633096407.59848002288925; Thu, 23 Nov 2023 10:37:13 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IGoH3/+9lMqDaE3gMOPiF0vZZLwfEqa9I1S+IVqZ94k9dU4tzrTTd1DiK72Wv7UvsKyi6Tjeg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700764633788100006 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=C3=A9 Reviewed-by: Gavin Shan Reviewed-by: Richard Henderson --- 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) =20 /** * 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 |=3D 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 |=3D KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW; kvm_arm_copy_hw_debug_data(&dbg->arch); } --=20 2.41.0