From patchwork Tue Dec 19 19:13:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 755966 Delivered-To: patch@linaro.org Received: by 2002:adf:b181:0:b0:336:6142:bf13 with SMTP id q1csp1602004wra; Tue, 19 Dec 2023 11:17:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMvM+6f9ru4OuIcQUorLko4XrlHkqXhQQtwiT2OG2qHNNhKdFSkLq5Gn5K1eNA7ZgycGfm X-Received: by 2002:a05:620a:2945:b0:77f:5f4a:24ea with SMTP id n5-20020a05620a294500b0077f5f4a24eamr21856253qkp.117.1703013474165; Tue, 19 Dec 2023 11:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703013474; cv=none; d=google.com; s=arc-20160816; b=iJTK4yJUOhjTyEJgQ/BhJOdpA+vowe3Nvd+JKBezs6xXY3Whqygn5FB7GlH4pnv+68 GDixpdidpQEA2nPviOBQV8IHM0JFfD/HjHK6aG1ojuN3RkbvzjxP84/rioEML+u4p7L1 rc3g4/JRX4XMzhMpPSxAzBvqteMLiYxN8mFQ6drjX+DX2g0T03g3gU0pYGcpwSBuntAC zGAebVoBWV/dpUxzv2ZXyGPESCeGmix8pla5CbDDmUDcfuji9z5RaNxptxOLyHDzLovL KhOjNBV+rP16HUIlkFR/F+VVcuO33xysaDSJeyrFYyUM+xsOOv1H2Gk+m+m6qlKw5raa RsyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=hXHi71kEAlJCpqi9ahK7azGhnduyvRCji9I/qeZQJBk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=p6oDiXJZDSFgFJ5PjiqHNeABIfUwEsm1h2qYn/7ixC+cgsip3whWtxp3P31swNxOAx cp+kujBFOTBFD+T2BmWEnv1RIC266VobO6XivkYEcj0KkLnFmVxORFbMmmGQXc0WYGjh B+tBgJuIIqgb+0kXxLyh+KmD5Z1ukct4thk5Oh+xkM7yAgUWBDp/9xaVS3RcHSNxABER m28YkLLwHnuVlWy9lFantwMokjymRNjH+8Lu3Z3a3DkEypaED3qncppD6lg1tj6yBWwS cAsdiw0raA15o5Ab2/8mOm51uLhI3rvkC6bC0rBZIKU+RCkinCrCU1IFbBDy11vSG8Kt Axsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vsd3gANf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l6-20020a05620a0c0600b0078104665d75si1541641qki.670.2023.12.19.11.17.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2023 11:17:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vsd3gANf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFfX5-00020q-I1; Tue, 19 Dec 2023 14:13: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 1rFfX4-0001zS-2U for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:34 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFfWy-0001sG-AX for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:30 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40c29f7b068so54206185e9.0 for ; Tue, 19 Dec 2023 11:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703013206; x=1703618006; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=hXHi71kEAlJCpqi9ahK7azGhnduyvRCji9I/qeZQJBk=; b=Vsd3gANflFneGA+YS05TmFSkGLznOeWxai9npqf6DHkqce9qKikWJ//prVPC5LPabI 8M8uHZNNSyAUEC+VBaFkJpjBMn/1O8mkO1/+OMJ3Kg+W0Gbxoe672YK8zFhEWJDBBDdO t+kwtXuFETAsiSjUFAUhyCYxkj7gLEBUmb09Gm8JFk1D1f0orR90bf+Aj3Oeepnp4ePs 8Ro92KGKS7pNwZSG2blKNN4BbUqq/TUUFMLtUN4gzhTFg538b80xSQAg6QuWlypMbxpx +VJtAnPhlYhAxttgr0hMZP0bTOTnIYIkJfCp+YYinwZotuWb16UuBTmF6oxIN5lTVxJJ Knxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703013206; x=1703618006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hXHi71kEAlJCpqi9ahK7azGhnduyvRCji9I/qeZQJBk=; b=JCNIiTDnEU49F+SEV33uTckiiT9YwBmLz02PFQc2yPGLXXj3GXXAoyOAD1bgSe7aaE 09wUKyosvS75sK9WgIm3KTeBXtlzv4yHo5vDuGlihpV47T+bxRbkGyr0Sae48kK3KSNV rfg+w9N32/zTb7+7B6zFbF8p3CbTg7Z/AtcT0V7+LvpHcBObuX2Qb4WWgSKm7MFHtXoq plzm/W90o3j52kJzoWPEujYb6ie/JrW/TEQAfQo+Hphp1UI2jfwmpG2S+DLHckhkbg2N Dqb1P5A+vxcZmVCycAh2HGDbrQ6fN8kyCft6ICij68+7+eOMI/o7fm1auFfnHJGFBIEM ersg== X-Gm-Message-State: AOJu0Yw9TaqQh0uRNNoLgYlObGvN4QLO0+MmUckszOLx2i2YvGtzbC9P JAwO2+8BmNItNywivSU2NxTgLUMHeq5ncrYU3d8= X-Received: by 2002:a05:600c:450e:b0:40c:2b2b:6414 with SMTP id t14-20020a05600c450e00b0040c2b2b6414mr8710138wmo.100.1703013206646; Tue, 19 Dec 2023 11:13:26 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id f5-20020a5d5685000000b0033657376b62sm12007754wrv.105.2023.12.19.11.13.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:13:26 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/43] target/arm/kvm: Have kvm_arm_handle_debug take a ARMCPU argument Date: Tue, 19 Dec 2023 19:13:00 +0000 Message-Id: <20231219191307.2895919-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219191307.2895919-1-peter.maydell@linaro.org> References: <20231219191307.2895919-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Message-id: 20231123183518.64569-16-philmd@linaro.org Signed-off-by: Peter Maydell --- 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 075487e62f1..6794dc8ad61 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1342,7 +1342,7 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, /** * kvm_arm_handle_debug: - * @cs: CPUState + * @cpu: ARMCPU * @debug_exit: debug part of the KVM exit structure * * Returns: TRUE if the debug exception was handled. @@ -1353,11 +1353,11 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, * ABI just provides user-space with the full exception syndrome * register value to be decoded in QEMU. */ -static bool kvm_arm_handle_debug(CPUState *cs, +static bool kvm_arm_handle_debug(ARMCPU *cpu, struct kvm_debug_exit_arch *debug_exit) { int hsr_ec = syn_get_ec(debug_exit->hsr); - ARMCPU *cpu = ARM_CPU(cs); + CPUState *cs = CPU(cpu); CPUARMState *env = &cpu->env; /* Ensure PC is synchronised */ @@ -1424,7 +1424,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) switch (run->exit_reason) { case KVM_EXIT_DEBUG: - if (kvm_arm_handle_debug(cs, &run->debug.arch)) { + if (kvm_arm_handle_debug(cpu, &run->debug.arch)) { ret = EXCP_DEBUG; } /* otherwise return to guest */ break;