From patchwork Tue Dec 19 19:12:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 755957 Delivered-To: patch@linaro.org Received: by 2002:adf:b181:0:b0:336:6142:bf13 with SMTP id q1csp1601582wra; Tue, 19 Dec 2023 11:17:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnSipQJLDgw53YpAFIStD8FJ1w4GKyvfUZaTTG9O3DeI/cxtIXstKjjwXWkOBPoait0KsU X-Received: by 2002:a05:620a:19a6:b0:77f:5803:e00d with SMTP id bm38-20020a05620a19a600b0077f5803e00dmr25047515qkb.145.1703013420292; Tue, 19 Dec 2023 11:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703013420; cv=none; d=google.com; s=arc-20160816; b=uiX/lwX7Pt8S/Sh/RNkZbHJ1k+8IBxDQOdb9Q/Jc5+FHkb2fu+aaVRpXob8ScKuvKh Lru48o88LvjujM5lNh+RznClUiDq9098mNGWDTcAWpA2evX6tBm7qBm9mZEVTYAOmqUc kpjDVFGYVETyXArxMbi3okIecxIVE7wyapYSk+TxtEzIrtNDnceY5WG4rq+hh/2DPpBH +pRZovxQqqzvS2UwBFle3az51SWUpztaEjk/wQKVVBMsmGgd/rEVAcGYTf8V5BRub0/d Mi2tjCxQDM2HAQGaak+ebVuUPnkiAlDuA5HBI7uE4yPRpHo4NIBSUseiZf7DE/ALT7WV /hyA== 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=t6m3lX5Sl9TdeDH1xGZK0J7bT0+H3YIVfUxVvxyivcw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=H/YtbJS+U3osy9dsvs43owT5BFV2Qzmlz3fqrtlfUjwxv5ns3091TBURu6513FcfSz MLAn8HKfXiKeYz3LVlQfwKr/99CiTjPjAvXLnts3O80vzXwZGKjvaiy6Olo7dkNLTt4v mERvnz4Xlc8B2ItHjo8nl3UNJ/j7jEXTezLF4NXcdFeXwFTb+kJB7A2rQqeFC8/27Guq ngwxnZXpFQ32vdQbGl5S5YlosHQKXa5+80XuQK4YorcI4xjMuDs4D0vSWPBVeq/WOSVL Pcdue462+IwbwdR+v9SCB9/TeEgZe6jCTDvmqPG50BRIjgETS2H3A6SX5wieVq9liLxT hKsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GpdPtBWy; 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 ov11-20020a05620a628b00b0077d69b8a6c4si28118330qkn.663.2023.12.19.11.17.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2023 11:17:00 -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=GpdPtBWy; 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 1rFfWt-0001u6-JM; Tue, 19 Dec 2023 14:13:24 -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 1rFfWs-0001ss-0X for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:22 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFfWp-0001oD-Dk for qemu-devel@nongnu.org; Tue, 19 Dec 2023 14:13:21 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40c38e292c8so11265e9.0 for ; Tue, 19 Dec 2023 11:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703013198; x=1703617998; 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=t6m3lX5Sl9TdeDH1xGZK0J7bT0+H3YIVfUxVvxyivcw=; b=GpdPtBWy+sV+ur2LStTT0t9l8WpS9VNTqaqFDtsGLwqPB+pKjOLH469DjPuP49gMfy zFtbUkLNPrtre3oKDxRGUUhEt+lAJUM2UB7PyUQUxzKP1fWmhCJ7qBbSrMOmPQ6hVhGo htvT8CqSIAZ9lM5CkM4a8kHzkxM+q+XV4YQWkpI+C5SHwwy05p4AByT2g9+c0bn+YqEl obaNpowto8bPKI9EA+GnKzIkUDfXONR8yjkRlbOd3Qem/lQAl3SLetIpnCqYTka4VE2c Q6nl9Hto+rkfjAVo1dht+fB+ulBh2FVg5AeuzAPUVDJWnwSyZwom1IIjulALlA2PjMMc NMfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703013198; x=1703617998; 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=t6m3lX5Sl9TdeDH1xGZK0J7bT0+H3YIVfUxVvxyivcw=; b=DpbWWcKLB3g0hJfbfiYotgplc6IZCtUBUWUNj5eUT2CnlbPlFcxD4uXXMPWnHQnbGX 9J/GiafugKCt8yYKvGou7H9FNQ1RaDuMJzGEBa9HcG8d/LRD2XrqqLLVOmEw+jm6FEOI Gv3y7bzbcyz7BhIcQgdOpm9EYW9dR1IRMe79Nk/55/58+oya6B3bpmbNgV2W/KX1vOaQ 54XQOseFB5arNlfmLtCHqb3sGHfY1a2DWgMq2wbMCnH7s6HVH0j9ydvMAN53n3AzOsSN cTc4p0w7cHW6yVtvt86g+WdIF3SQ0WLGgbR2haY+CvRk7ppX1fPe0iPAyvcdNe1sMhNg m+Ug== X-Gm-Message-State: AOJu0Yzaf6yKMmlUeXgV5TQ9sllZfUz0TexV6wRIrBsPjKXR/W2xq9S6 EtLq/8xmnSWEMWrUfzQvQfls0SFE1lrFT9NtUTk= X-Received: by 2002:a05:600c:1c91:b0:40c:415f:cc48 with SMTP id k17-20020a05600c1c9100b0040c415fcc48mr804525wms.40.1703013198034; Tue, 19 Dec 2023 11:13:18 -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.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:13:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/43] target/arm/kvm: Init cap_has_inject_serror_esr in kvm_arch_init Date: Tue, 19 Dec 2023 19:12:42 +0000 Message-Id: <20231219191307.2895919-19-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::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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: Richard Henderson There is no need to do this in kvm_arch_init_vcpu per vcpu. Inline kvm_arm_init_serror_injection rather than keep separate. Signed-off-by: Richard Henderson Reviewed-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- target/arm/kvm_arm.h | 8 -------- target/arm/kvm.c | 13 ++++--------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 350ba6cb967..1ec2476de7b 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -98,14 +98,6 @@ void kvm_arm_cpu_post_load(ARMCPU *cpu); */ void kvm_arm_reset_vcpu(ARMCPU *cpu); -/** - * kvm_arm_init_serror_injection: - * @cs: CPUState - * - * Check whether KVM can set guest SError syndrome. - */ -void kvm_arm_init_serror_injection(CPUState *cs); - /** * kvm_get_vcpu_events: * @cpu: ARMCPU diff --git a/target/arm/kvm.c b/target/arm/kvm.c index d87d3e53e02..4a5553864a0 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -98,12 +98,6 @@ static int kvm_arm_vcpu_finalize(CPUState *cs, int feature) return kvm_vcpu_ioctl(cs, KVM_ARM_VCPU_FINALIZE, &feature); } -void kvm_arm_init_serror_injection(CPUState *cs) -{ - cap_has_inject_serror_esr = kvm_check_extension(cs->kvm_state, - KVM_CAP_ARM_INJECT_SERROR_ESR); -} - bool kvm_arm_create_scratch_host_vcpu(const uint32_t *cpus_to_try, int *fdarray, struct kvm_vcpu_init *init) @@ -564,6 +558,10 @@ int kvm_arch_init(MachineState *ms, KVMState *s) cap_has_mp_state = kvm_check_extension(s, KVM_CAP_MP_STATE); + /* Check whether user space can specify guest syndrome value */ + cap_has_inject_serror_esr = + kvm_check_extension(s, KVM_CAP_ARM_INJECT_SERROR_ESR); + if (ms->smp.cpus > 256 && !kvm_check_extension(s, KVM_CAP_ARM_IRQ_LINE_LAYOUT_2)) { error_report("Using more than 256 vcpus requires a host kernel " @@ -1946,9 +1944,6 @@ int kvm_arch_init_vcpu(CPUState *cs) } cpu->mp_affinity = mpidr & ARM64_AFFINITY_MASK; - /* Check whether user space can specify guest syndrome value */ - kvm_arm_init_serror_injection(cs); - return kvm_arm_init_cpreg_list(cpu); }