From patchwork Tue Dec 19 19:12:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 755983 Delivered-To: patch@linaro.org Received: by 2002:adf:b181:0:b0:336:6142:bf13 with SMTP id q1csp1603591wra; Tue, 19 Dec 2023 11:21:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IExqawXU+ptLSnxX/sU9YFUyNjGPeruuyqx/VITh+ZvQMEJVmJfuQUG0+rKw3c2Fm66lgSt X-Received: by 2002:a05:620a:800a:b0:77f:8bd:7308 with SMTP id ee10-20020a05620a800a00b0077f08bd7308mr22596493qkb.157.1703013672904; Tue, 19 Dec 2023 11:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703013672; cv=none; d=google.com; s=arc-20160816; b=b9GuxmLjfV2HIjndjf3Ga/X4Ec6kFUARKCl7MF9gMGwvysmbow/9atjCp3HTG5u5mG wF8Y+ZSfPKvWgRWi+bUX7U3JpFoIyhkS67AJ4Qq2orXxYiIYxPjs+jk1vpAWOnl6lnWn w2glfCpLjzt2cl/osUGdZu1UCYF8UAXx1pjgy54exvv5s/PXxvXUH2DyaIQlf8OJd99W qROt1Z+xYmO91BrHlpL4XgBFYcoH6HSp8wEz5FMhmXsyqnvUq9UXK8XW3UfPEOH8fpxN 4NlAuu0gYeWSt8G1BcDVYI4mqdccHfkRQFt6SJlTkYRp/Cq1vE30WZtd4yCPK188RjFI Ofkg== 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=mV1FstJ24t/zgC1MccTigP3pcwPlKu6JPGqh4aMLl+Y=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=gMeIiyRhverZUrJN1zDGAxPnonwqKfn6zHZJiMLps8mg8PcQkPD4fzHAxxXByMxfOP M7cPuETfpV+W9hVsfScLCqUCcTVLfHXe2D4I6T56g5KB8FTopTfgN23oao4OUKN0ZSSH dqx5fN98p2lyxMUBRotiyxlUq87Fr4oa75nJUprUqjYfZKRNVitfIghTYxRV4S4Mqj5u jJ/lnfgQR0yu3m3DL2xxvlYOLTiONto7YdAH1woLV1defG9/EwjQj5PF5y3ihl8Du8a1 bipG/glJkHVoL0V268GBFPJ6gr7HkJ17tIq2Gg7K8wqDRRyMqF8V9JkifaGvb++0TwFH yvyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HSBpxcnk; 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 s6-20020a05620a254600b0077f12a793bdsi585830qko.594.2023.12.19.11.21.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2023 11:21:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HSBpxcnk; 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 1rFfXM-0002FE-Rr; Tue, 19 Dec 2023 14:13:52 -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-0001zY-2d for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:34 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFfWx-0001sA-EU for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:30 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33678aeda3fso62945f8f.3 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=mV1FstJ24t/zgC1MccTigP3pcwPlKu6JPGqh4aMLl+Y=; b=HSBpxcnkmyTbOdmUQln6188XXPSyqQ+CHpalRvB+U6gLMcQLDapAe1c+msanSmVXT5 kdyJcciSkwfJ/IPop4CQC53QwP85SjXbIpsIWbEq0DPRHfxapT6PJJghFxTOsg332iKK i/7O0ResTrXdJVDfP0RpsPZKd7GWETOQXDu1GvuM+hf1z7SyCXzZ7GWqkboVdnFvAQDb 1hKN5bealGE27DKrzw08wQ54JSlSbXzmf+ctMhB1yJF6ZpGf7dABpqqrYO1pjGQtZhU5 qEzHuAuI93ft5pFoi7Uyd4ieY91kJIp/JT1+2SH7jP5478s1ql53j6pEcUMPg+6P0yAT 8IgQ== 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=mV1FstJ24t/zgC1MccTigP3pcwPlKu6JPGqh4aMLl+Y=; b=SoYFlBiapuSRjLEBq9TdsA4aWfodG6nbo9S9abzIVl36Vs0cyy/+KwAUcVantXqYDQ G4PYnlUZTqD7aJghxKuwrUG66LKwGDlLiYmI47fkVyq61Yhtvr6HPg/wUfk8Okf/KILI TakCDUGoTSscxr8J9wxBq95O2D/zkKh/3mU5CaDdxdoq6HNIOZLzTOJHmcsriE5j/YqH l9FPBnKDaqyVXrb9+CaMZvX+jNjcMNRiaEO1F1StJui6FuLVQJXUht4EuQYl1uWNH3d7 p4fPths/ClfHu3hnK7MHmQBdt5hRJ7/C6RNhACpHYtFg8SwaTKFyxKIQaixUjbDhZatK afpQ== X-Gm-Message-State: AOJu0Yzk6nx92NeeqnBghBH9kJwM8mUqLC5HbVwUNoyjU8iWaYVyWKnV f2e4AchunDRcT0+UOYXdCSHbzxNFZbdiMdzgrDs= X-Received: by 2002:a5d:6641:0:b0:336:5be9:adfd with SMTP id f1-20020a5d6641000000b003365be9adfdmr3515616wrw.68.1703013206162; 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.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:13:25 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 35/43] target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument Date: Tue, 19 Dec 2023 19:12:59 +0000 Message-Id: <20231219191307.2895919-36-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::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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-15-philmd@linaro.org Signed-off-by: Peter Maydell --- 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 e4cd21caefc..075487e62f1 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -1302,17 +1302,16 @@ static void kvm_arm_vm_state_change(void *opaque, bool running, RunState state) /** * kvm_arm_handle_dabt_nisv: - * @cs: CPUState + * @cpu: ARMCPU * @esr_iss: ISS encoding (limited) for the exception from Data Abort * ISV bit set to '0b0' -> no valid instruction syndrome * @fault_ipa: faulting address for the synchronous data abort * * Returns: 0 if the exception has been handled, < 0 otherwise */ -static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss, +static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, uint64_t fault_ipa) { - ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; /* * Request KVM to inject the external data abort into the guest @@ -1328,7 +1327,7 @@ static int kvm_arm_handle_dabt_nisv(CPUState *cs, uint64_t esr_iss, */ events.exception.ext_dabt_pending = 1; /* KVM_CAP_ARM_INJECT_EXT_DABT implies KVM_CAP_VCPU_EVENTS */ - if (!kvm_vcpu_ioctl(cs, KVM_SET_VCPU_EVENTS, &events)) { + if (!kvm_vcpu_ioctl(CPU(cpu), KVM_SET_VCPU_EVENTS, &events)) { env->ext_dabt_raised = 1; return 0; } @@ -1420,6 +1419,7 @@ static bool kvm_arm_handle_debug(CPUState *cs, int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) { + ARMCPU *cpu = ARM_CPU(cs); int ret = 0; switch (run->exit_reason) { @@ -1430,7 +1430,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) break; case KVM_EXIT_ARM_NISV: /* External DABT with no valid iss to decode */ - ret = kvm_arm_handle_dabt_nisv(cs, run->arm_nisv.esr_iss, + ret = kvm_arm_handle_dabt_nisv(cpu, run->arm_nisv.esr_iss, run->arm_nisv.fault_ipa); break; default: