From patchwork Thu Nov 23 04:42:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 746457 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp688495wru; Wed, 22 Nov 2023 20:44:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyY6LaU1Y+VPbRDMEzDZn03RI4BAPkslRSdW888ZaWugztuSaS6XSkwAbaXIiLZXt6Q3Bc X-Received: by 2002:a05:6214:2408:b0:66f:ac87:73b7 with SMTP id fv8-20020a056214240800b0066fac8773b7mr3533559qvb.15.1700714688493; Wed, 22 Nov 2023 20:44:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700714688; cv=none; d=google.com; s=arc-20160816; b=f0mCmE91WNSQY1LOe6CCtItQH/JCzUGHYqFhdAP1TnJy+pYkjIv8mR4M7nkoCDV/K2 ybuAAHaHpfeT29a32zK8JH6iH+Rtk7N9XxZ4+kVnB1iB0EvNKNWm4vVh7+yQ26urOkBl IWgWtLFQq6DBBqBuNAHsvLnDiLp/dObQSQtuxoAb70ZrUmUCPpdw57198DDLcpg7ZBjQ Dsy3sM2mcKd0jlmlHYTTNGfYSEf6I19US1jua7NwY/gQf/IFH7em/hGGO/HjRvlCeY5q aF/c0ACTBY382kG2L9LgkLWpPKfAa1s3GYYq92peb6D2Z2HGRu59KCT/n//7cYV2uB9/ 9s2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f0csjBzUKQmzo27GffQhvUdSife+3bvwrwa84N7+vIM=; fh=9Ev+QBUhk6P6vR3LT1wYeDLexozsz44nqjfoyPajZCc=; b=w8Z/OWvmvtnlDj5J6tFdyiYmEd4RlCknQsui0rZ3ALjTZojJau0t7/L/T1reeluunU I/tupTxUhhaJdy4+dXIaA7WTBJj8YkEKaYkLgrcxpzF8S12mLOgzT//6QcEBjx89ak4n P5qRxrrq2pWioYwsgYrKr0I3UsRG8wd+RssdwR8RWIHrQQ1pVPhZS7dXCu8v0iVSNnHO pYqQmbLtYI4IvrhBnSX8iuMSyWxNzjq3C2KPmIDCBE2FGdhXcPXkGP5HaJ5mM4JkaVVf pIdEfshjtMHqPaL7rmqM43gUFr+GE/BkX9vXBCIDbYH+LqXZdsHhpcYvXkzMjig6TLHZ w+pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S6Gx1+Mc; 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 px8-20020a056214050800b0067894029d80si440400qvb.381.2023.11.22.20.44.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Nov 2023 20:44:48 -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=S6Gx1+Mc; 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 1r61YJ-0006bF-RI; Wed, 22 Nov 2023 23:42:59 -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 1r61Y0-0006OM-T3 for qemu-devel@nongnu.org; Wed, 22 Nov 2023 23:42:44 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r61Xw-0006BL-MM for qemu-devel@nongnu.org; Wed, 22 Nov 2023 23:42:39 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3b833b54f14so252090b6e.1 for ; Wed, 22 Nov 2023 20:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700714554; x=1701319354; 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=f0csjBzUKQmzo27GffQhvUdSife+3bvwrwa84N7+vIM=; b=S6Gx1+McceoIk4xJkUX9rJm41OLdLbr8Ra+QlV8LBa9+1VYWHLZQ2XsJz1my2+FfjA lEYabSfnFF0kRs08JDghCpi1bq4gJ2RwNUSC9fVCadQLpV1qrOfWFqNrPKjXLowaYlNB EAg99865AXp33esyj6l+jM96vXGvVnjgptAjlqEondHjdQTzFmpCNPrJUZpxxuXgkvex 8PYlsd3mzGw5uXUrkLkttC0kKsrsg+u/2HRslWmj+TMBtuJ4eKjWmu/n4sNhoCiKRef/ Vv/dSdZhpqDQ77YNmM46FbMitQx6ygcXcDcn8dQzc6cbrkN8ohZ0BqRDgONEf3j2DHKX 9QFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700714554; x=1701319354; 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=f0csjBzUKQmzo27GffQhvUdSife+3bvwrwa84N7+vIM=; b=OhQ8CiBCwWeKiDZLtgT+jpud8tGFcrb3Xo5yDv1Sk1hIWYEQ8eM1Uj3+Op8Mk7WGdv Wv4Cclt8wA0PEmWEAhhQ/RjlYU7Hsn/Lad3Vi1idz8YrHO7B80GvUlgRfggZjrmntVTf xhi5H0kYoRF5i8UOZXCeTXj5KPfk4N4m9U6FwO0J5CLH+46ESoGpd5Ov0BkdJqGD94vC rfzHtQdHyaZesxHtzaeR9sP/ROvyKujVa6IFX9LI4XbUPmMWytJtzpG7OHzcAiZLTtg/ IhHCmOl4o2CtpxQBDAFJVexvfuJe2Awhw0BmPSJp5NADwUMp18hGJvE7I09l5kYQyLTe pqmQ== X-Gm-Message-State: AOJu0YwFPzgAUqCseimGlnJrzYIYA9Y0ytaeVBKyjuj4GzH0VCJ188AF M3Klv8lwLjw4UZKftQWVHJsfBGGYJ/ORgoQd7ytDtEVx X-Received: by 2002:a05:6808:f92:b0:3b8:33d1:806d with SMTP id o18-20020a0568080f9200b003b833d1806dmr736999oiw.22.1700714553754; Wed, 22 Nov 2023 20:42:33 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id i7-20020a056808030700b003b8347de3c2sm73888oie.19.2023.11.22.20.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:42:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 12/21] target/arm/kvm: Move kvm_arm_cpreg_level and unexport Date: Wed, 22 Nov 2023 22:42:10 -0600 Message-Id: <20231123044219.896776-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123044219.896776-1-richard.henderson@linaro.org> References: <20231123044219.896776-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/arm/kvm_arm.h | 9 --------- target/arm/kvm.c | 22 ++++++++++++++++++++++ target/arm/kvm64.c | 15 --------------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index e59d713973..2755ee8366 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -87,15 +87,6 @@ int kvm_arm_init_cpreg_list(ARMCPU *cpu); */ bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx); -/** - * kvm_arm_cpreg_level: - * @regidx: KVM register index - * - * Return the level of this coprocessor/system register. Return value is - * either KVM_PUT_RUNTIME_STATE, KVM_PUT_RESET_STATE, or KVM_PUT_FULL_STATE. - */ -int kvm_arm_cpreg_level(uint64_t regidx); - /** * write_list_to_kvmstate: * @cpu: ARMCPU diff --git a/target/arm/kvm.c b/target/arm/kvm.c index ffe0db4293..dadc3fd755 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -817,6 +817,28 @@ out: return ret; } +/** + * kvm_arm_cpreg_level: + * @regidx: KVM register index + * + * Return the level of this coprocessor/system register. Return value is + * either KVM_PUT_RUNTIME_STATE, KVM_PUT_RESET_STATE, or KVM_PUT_FULL_STATE. + */ +static int kvm_arm_cpreg_level(uint64_t regidx) +{ + /* + * All system registers are assumed to be level KVM_PUT_RUNTIME_STATE. + * If a register should be written less often, you must add it here + * with a state of either KVM_PUT_RESET_STATE or KVM_PUT_FULL_STATE. + */ + switch (regidx) { + case KVM_REG_ARM_TIMER_CNT: + case KVM_REG_ARM_PTIMER_CNT: + return KVM_PUT_FULL_STATE; + } + return KVM_PUT_RUNTIME_STATE; +} + bool write_kvmstate_to_list(ARMCPU *cpu) { CPUState *cs = CPU(cpu); diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 61fb9dbde0..a184cca4dc 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -361,21 +361,6 @@ bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx) } } -int kvm_arm_cpreg_level(uint64_t regidx) -{ - /* - * All system registers are assumed to be level KVM_PUT_RUNTIME_STATE. - * If a register should be written less often, you must add it here - * with a state of either KVM_PUT_RESET_STATE or KVM_PUT_FULL_STATE. - */ - switch (regidx) { - case KVM_REG_ARM_TIMER_CNT: - case KVM_REG_ARM_PTIMER_CNT: - return KVM_PUT_FULL_STATE; - } - return KVM_PUT_RUNTIME_STATE; -} - /* Callers must hold the iothread mutex lock */ static void kvm_inject_arm_sea(CPUState *c) {