From nobody Sun Nov 24 08:10:01 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1725372415; cv=none; d=zohomail.com; s=zohoarc; b=KiYXKkihTEz/3GkWxmTG3jTwWKKeLLxK2eqims7hc4u4nf3Cm6T8MIiXHGooaq7F+iUP6/6WDShwVytRagakMPiNRgTPBHInD8VWXOZDiyULWfHB/hPIiB+wSFceVcB1T52q4OaFIGFVNiALaS/zOtkPc0HeyvSbaHr5FQRKdAM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725372415; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=51dTN7MmTiEpTD17LoLSRBqs9+ZPE1zu8h5Dd7a9Uh4=; b=W7RxLy49h7mXRx+SHEte0352PrvrwmcIZv/losg+mxP2e8F9oUuyiU5gMxYN4jX2W4ynclYA6CU0/mtVNIHWNUpp9KfYJDFgAfpjgVJ9/LcGiTmlxZM9BbvFsNEc3rd5RYC0SPPyfCk/KRSlpBDiURAjxTvbRxsY8SctRSdoB2Y= 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 1725372415246764.4685661649362; Tue, 3 Sep 2024 07:06:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slUB3-0002S6-BH; Tue, 03 Sep 2024 10:06:37 -0400 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 1slUB1-0002Qv-Bo for qemu-devel@nongnu.org; Tue, 03 Sep 2024 10:06:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slUAb-0007HD-Fi for qemu-devel@nongnu.org; Tue, 03 Sep 2024 10:06:35 -0400 Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-aQIiQYxiPsiQMZNcTfj00w-1; Tue, 03 Sep 2024 09:44:56 -0400 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-205428e6facso37645545ad.2 for ; Tue, 03 Sep 2024 06:44:56 -0700 (PDT) Received: from localhost.localdomain ([115.96.207.26]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2051554407bsm81030575ad.217.2024.09.03.06.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 06:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725372241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=51dTN7MmTiEpTD17LoLSRBqs9+ZPE1zu8h5Dd7a9Uh4=; b=XrRt1eLoU/h8Pdc/e9a+DIqRXjADMi7ldthBBVsgZtT4ebEhSsJG7W3+h7cCAUfH6oN8dA Ihkrr4uttW7q7OOedKNBoCBD/2Zbqqd6OF73xfbQ2Odj4PjFPd2QzoXDhwqzH7wOMTtTF8 rcYB1+RV2A0YL69YKC6Q5Uamv/Ku4hA= X-MC-Unique: aQIiQYxiPsiQMZNcTfj00w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725371095; x=1725975895; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=51dTN7MmTiEpTD17LoLSRBqs9+ZPE1zu8h5Dd7a9Uh4=; b=Fv71dqTd4fqNTmQHutVEW4myoHhzbPulFmur2Y4RRq1ZXtZoZkxrvrTKQr4kCpvD+W RcUuthAdnJpt8l81wagFbo0XfRZG2ge089vvBn4andIPcKXhKOu/iBw2TtPrnYNpqBZn YzR8zvpRBG90YX1mXctafGvPHeTkvnmod5msw2xsTEaHVOaX/Obai7PtoB+MBnK7o5iI PwgDsH9UmJ0kHU13+l+xJ6BzgmFi3gVw4GsSPFmpUfcFb1SXtbZ3M/UKZ5eKD/ip4ecb +avhOf5IBQwzlHLuGPnztFT4GlToUfynjVLxZ4uXf1c1vJoXog2JZz1pGdUg+ZF3pBvv qlWw== X-Forwarded-Encrypted: i=1; AJvYcCUUM7rtHcjdgHtteQo2Vc3qgyPmn55MAU6AYpy4cYs8acsR0oOf6dm+mQDypeJCt2xqBZGfTmM9F79h@nongnu.org X-Gm-Message-State: AOJu0Yx48svWAtnMApVzBHUgREhDp5m5DQC9Q66AIazHUfU4agTIM183 gF8LJVrvXuVFjJY9R2t8ttkV34CcO9IxDbBVsdTQUMRsrSlT+B0nTNHaMSbml9ZQbAFju/LybM4 bJvhPPUrzN0mMKibS8D+RzDQCfPYPK5a3CYhjzu9HkZqETmlTEGfp X-Received: by 2002:a17:902:dacb:b0:205:5136:b2fb with SMTP id d9443c01a7336-205841a4376mr63797755ad.23.1725371095172; Tue, 03 Sep 2024 06:44:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkgI5zV7G/OfX9mZdLAgTTnOsa1DlSYl0W1zMp7fZyMcYyBFePdiPohhZh6ka7KNNAEWdSZA== X-Received: by 2002:a17:902:dacb:b0:205:5136:b2fb with SMTP id d9443c01a7336-205841a4376mr63797535ad.23.1725371094763; Tue, 03 Sep 2024 06:44:54 -0700 (PDT) From: Ani Sinha To: Paolo Bonzini , Marcelo Tosatti Cc: Ani Sinha , philmd@linaro.org, kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [PATCH v2] kvm/i386: make kvm_filter_msr() and related definitions private to kvm module Date: Tue, 3 Sep 2024 19:14:41 +0530 Message-ID: <20240903134441.40549-1-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 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=170.10.129.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1725372416931116600 Content-Type: text/plain; charset="utf-8" kvm_filer_msr() is only used from i386 kvm module. Make it static so that i= ts easy for developers to understand that its not used anywhere else. Same for QEMURDMSRHandler, QEMUWRMSRHandler and KVMMSRHandlers defintions. CC: philmd@linaro.org Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/kvm/kvm.c | 12 +++++++++++- target/i386/kvm/kvm_i386.h | 11 ----------- 2 files changed, 11 insertions(+), 12 deletions(-) changelog: v2: make QEMURDMSRHandler, QEMUWRMSRHandler and KVMMSRHandlers private to kvm.c diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 2fa88ef1e3..d714f54ee4 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -92,7 +92,17 @@ * 255 kvm_msr_entry structs */ #define MSR_BUF_SIZE 4096 =20 +typedef bool QEMURDMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t *val); +typedef bool QEMUWRMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t val); +typedef struct kvm_msr_handlers { + uint32_t msr; + QEMURDMSRHandler *rdmsr; + QEMUWRMSRHandler *wrmsr; +} KVMMSRHandlers; + static void kvm_init_msrs(X86CPU *cpu); +static bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rd= msr, + QEMUWRMSRHandler *wrmsr); =20 const KVMCapabilityInfo kvm_arch_required_capabilities[] =3D { KVM_CAP_INFO(SET_TSS_ADDR), @@ -5728,7 +5738,7 @@ static bool kvm_install_msr_filters(KVMState *s) return true; } =20 -bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr, +static bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rd= msr, QEMUWRMSRHandler *wrmsr) { int i; diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index 34fc60774b..9de9c0d303 100644 --- a/target/i386/kvm/kvm_i386.h +++ b/target/i386/kvm/kvm_i386.h @@ -66,17 +66,6 @@ uint64_t kvm_swizzle_msi_ext_dest_id(uint64_t address); void kvm_update_msi_routes_all(void *private, bool global, uint32_t index, uint32_t mask); =20 -typedef bool QEMURDMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t *val); -typedef bool QEMUWRMSRHandler(X86CPU *cpu, uint32_t msr, uint64_t val); -typedef struct kvm_msr_handlers { - uint32_t msr; - QEMURDMSRHandler *rdmsr; - QEMUWRMSRHandler *wrmsr; -} KVMMSRHandlers; - -bool kvm_filter_msr(KVMState *s, uint32_t msr, QEMURDMSRHandler *rdmsr, - QEMUWRMSRHandler *wrmsr); - #endif /* CONFIG_KVM */ =20 void kvm_pc_setup_irq_routing(bool pci_enabled); --=20 2.42.0