From nobody Sun Nov 24 08:52:44 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=1726058282; cv=none; d=zohomail.com; s=zohoarc; b=U08SrwUn7tmsyLVtx02bZaS0ZXXpVSspflLJMIl2LcKt6jNKNiCnHv2ElttVPVDzXdfTDwlrQAwkzor/geu+j8bYGETCzAc+yAPAT25rZrn8H2bVNLlM4X9astLXAjzhZU3FceYoUdol0wmsmLmYaDB1CZNuJY4Sgjch0ssqkYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726058282; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pit7qiYVqnOWSVjEH0t9en0kWfam4PoVe6YUyM257fE=; b=G8rx+TPE6c3ukMtqAgAf+f8iR7PFyvHeV4IwfACTU7JtcPxOAk546SX+pa7vPj9UXyPO7RFy51s4XK1n7YQCMj9cnwTXLoCzVKT+BHuCG+YfEeObT4rg2/Vs5TbD6m4vHZ/LidTUvdLX2k9a17YL5QrcA5g8eYUaDiCIwVQ0sig= 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 1726058282056265.20259366199934; Wed, 11 Sep 2024 05:38:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soMXx-0005VD-NA; Wed, 11 Sep 2024 08:34:09 -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 1soMXv-0005H5-Kl for qemu-devel@nongnu.org; Wed, 11 Sep 2024 08:34:07 -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 1soMXt-00012u-LA for qemu-devel@nongnu.org; Wed, 11 Sep 2024 08:34:07 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103-p4mEJYwUOLKIPs-Kb8fT6w-1; Wed, 11 Sep 2024 08:34:04 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42cb0ed9072so37259025e9.1 for ; Wed, 11 Sep 2024 05:34:03 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb449aesm140800895e9.25.2024.09.11.05.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 05:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726058044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pit7qiYVqnOWSVjEH0t9en0kWfam4PoVe6YUyM257fE=; b=Fqx0A5tyDLp2yzzOTqTHfnI+4qw+YFi6MMewuwM1GAIcdPlMF3vPrQE01NAFpEWJ/yYh+Q 0E6/bGxbrmNXg4XIv8ha3IwlaRhKuO80YYTnw3s7YV10pEbvkSBgLnsztgF8FP061xd3GP WHtWjtolLWRhoMNebhxuCTGCoZCoQp8= X-MC-Unique: p4mEJYwUOLKIPs-Kb8fT6w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726058042; x=1726662842; 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=Pit7qiYVqnOWSVjEH0t9en0kWfam4PoVe6YUyM257fE=; b=Hf62JALdAIcHVTuCjsV5ceIluvntqbqajYFyl6MPFZaqVjmZcMsEYs1UT71m5svLQy dxC02zFI/e/estb2wfBA6V4kOG5LLfTSn6URymL9pWDb2eEGeiKMNCHlG7LlArqEIJj1 UGcH7yEWA77SvftugLq0xMgjozRVcFPcex0U4MU6Ap905I6+KSM9lybsHScGSRHGtSva KdAlunDSdLAwBUaE01X3ClWf3Nsn8CDPmEg3vaR9lwDtGoFUfo38bl/zsImCZ/GRgyb5 69H/l3UC+0Xkxw2lin1SP9coPvoiJVl2EGQWYaeoLEFhiEpXST2PBt+ISfLcyrV4hRFu KASg== X-Gm-Message-State: AOJu0YyT+QHdKfe0r6n3dVBgmpqi6Cs1iyFh/HzqVZWrsKyW6Yjfq+3k 6vW9tnnv6Sqqy28/1et1SF9+K6+qS8V8ZSbsEg3XqmvCDQQbBrTZ7AN7HXzecZz+oGp4w5nRrLT c9ivdKJqV4d3VBiXwT4Xy/XAxl7VKoqvh60Q3DOr0OKf9GJ+jgMS9q/jKlW9JWz3EEvt4X8GxeU UnWUVccSklOP9fguQFSJnXJTp3Ntuj4mK7uq2uu1o= X-Received: by 2002:a05:600c:358a:b0:42c:b950:6821 with SMTP id 5b1f17b1804b1-42cb9506a4amr83041095e9.19.1726058042011; Wed, 11 Sep 2024 05:34:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPWOPoXwIRnhEFSJs4L0bBpigenF/2c5N4PsmiDOGtEEWyhQYmJ1jtGqUQP5AttL87YqQpXw== X-Received: by 2002:a05:600c:358a:b0:42c:b950:6821 with SMTP id 5b1f17b1804b1-42cb9506a4amr83040825e9.19.1726058041501; Wed, 11 Sep 2024 05:34:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Ani Sinha , philmd@linaro.org Subject: [PULL 06/17] kvm/i386: make kvm_filter_msr() and related definitions private to kvm module Date: Wed, 11 Sep 2024 14:33:31 +0200 Message-ID: <20240911123342.339482-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240911123342.339482-1-pbonzini@redhat.com> References: <20240911123342.339482-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1726058283910116600 From: Ani Sinha 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 definitions. CC: philmd@linaro.org Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Ani Sinha Link: https://lore.kernel.org/r/20240903140045.41167-1-anisinha@redhat.com [Make struct unnamed. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm_i386.h | 11 ----------- target/i386/kvm/kvm.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h index 34fc60774b8..9de9c0d3038 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); diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 381f414d1e0..d95013a2ce6 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 { + 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), @@ -5735,7 +5745,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; --=20 2.46.0