From nobody Sun Nov 24 08:38:19 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=1725372600; cv=none; d=zohomail.com; s=zohoarc; b=mbhESPYWjReKbdwUrsB9qi1w47XqZlZS1L4lfhoI/klsPnFgqmv+1OvbLAHoU2qKYa2r573ElRXmaTbfw+wQFqM8ikVzXu5kpnErBIaX0tBQepugWysPVkLdq9WNRrKchGsx55a3m2FZK7pHQ5hxqoG4l2XvI0dczGTD4dgVU2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725372600; h=Content-Type: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=jjhSCJBJuSAurBQThL2GuR+Yd4wjnt/EI+Br8d8wwkM=; b=gPOH9aHZ97Qh0YkM7VsXdl4izTP5r61zAqpLH+FL9yLqPn0EwICcCgwSYFjXkNWHcIsr7xtkLKM5KARdoTlI15lpNhK0gUVcZYuQryoAIgu6FpLFFAV/qhZkhP714bso0NWAWh811Rw4+6yDB1RxEfj8ECqt4Z4GavGNjOyRH28= 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 1725372600018693.5829340116791; Tue, 3 Sep 2024 07:10:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slUDn-0005Ou-Tq; Tue, 03 Sep 2024 10:09:27 -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 1slUDk-0005CE-MZ for qemu-devel@nongnu.org; Tue, 03 Sep 2024 10:09:24 -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 1slUDi-0008Ok-Fc for qemu-devel@nongnu.org; Tue, 03 Sep 2024 10:09:24 -0400 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-hTd0IyMKPW6oxUtYT9NXFQ-1; Tue, 03 Sep 2024 10:00:57 -0400 Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2052d07ff07so35447585ad.2 for ; Tue, 03 Sep 2024 07:00:56 -0700 (PDT) Received: from localhost.localdomain ([115.96.207.26]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2057554f328sm32900445ad.266.2024.09.03.07.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 07:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725372560; 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-transfer-encoding:content-transfer-encoding; bh=jjhSCJBJuSAurBQThL2GuR+Yd4wjnt/EI+Br8d8wwkM=; b=LthbPTNMrE0l7WrkqBr6UT/V71e9NkCEoQV0gwy3lZkhTQUypDqeJdwqmsBImaAGMxz7NV 0BV8enC7XrQ1bsEKvYueH6HaXhyA0IQQSJaq2WP6nhWsLOSQX9P4dRYq7UrTFZefEqcd53 na/Hvu+5ACWYgrVNHdAgWpvrHMt/RIo= X-MC-Unique: hTd0IyMKPW6oxUtYT9NXFQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725372055; x=1725976855; 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=jjhSCJBJuSAurBQThL2GuR+Yd4wjnt/EI+Br8d8wwkM=; b=DNXMRFZEjHVqwo7MPI9d2BnMUpJj5GjrBSg+/mP0kflBF7dbBQortx3ISUVjlMDqqd MpGVRid+2cdjDu61+ww+aVH5Be7Hhu9L4THiFe2l6yDR1DUPHwDhEMG0t/DUJM7M7fUS 37Zs8qa504Yw/KJNZSe4SfvpGTaoku0aknd1B6WsQzRXXYjRnX2RpY+JhxjQ4cM557Hh eiH3wbsE/ilqWi39Y2FiE57dnACFrepw2zN3j4Z4k/Wm+b57rFmu4jI0/8FIq5WKeDP8 /1MbLNVJ75p5tkY3P6B53bYSvZj40tYllPCU4XODyYvopnp8zvofjCMDDg6wp4u1s0uC xiIQ== X-Forwarded-Encrypted: i=1; AJvYcCUcecCYSrkAdct09fnR4zfJH4bXUP1+2t1xMScT4mkLzM0CJ48BNbgxlWAZUcqDNVmlNCkm6LBYBT34@nongnu.org X-Gm-Message-State: AOJu0Yy11v3HJJpXMSFkl7WT1xEaJYKv87iE4uCP5bvXD25TN9vsBySC 1nKmYI+GRShBP+kTCZ2kGH89WGsun/9EJ5UKboxzfdYGjWaONWQWxTeTX9KSjBSN+Ch3nExwW68 KZUEGjF5P2EzJSDuiI2fGsNd+wUYbILZbiwRxLUeBA5JRoS5jPMb9 X-Received: by 2002:a17:902:f786:b0:203:a02c:992b with SMTP id d9443c01a7336-2054bc96937mr79291745ad.3.1725372055366; Tue, 03 Sep 2024 07:00:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESt9Cl068xl1wlir0hWjmhG+W99U/WXJNrsXvb0csaMwc4arZlnKCEMz2eall7CtqN3IZy9Q== X-Received: by 2002:a17:902:f786:b0:203:a02c:992b with SMTP id d9443c01a7336-2054bc96937mr79291325ad.3.1725372054841; Tue, 03 Sep 2024 07:00: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 v3] kvm/i386: make kvm_filter_msr() and related definitions private to kvm module Date: Tue, 3 Sep 2024 19:30:45 +0530 Message-ID: <20240903140045.41167-1-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 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=anisinha@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.142, 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1725372601751116600 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 --- 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 v3: typo fix. tags added. 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