From patchwork Fri Jul 12 11:03:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ott X-Patchwork-Id: 13731616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF6FDC3DA4A for ; Fri, 12 Jul 2024 11:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=veUUGt+GBKRUflAP/4u3UadYVzXIYYKM+vDLIvIs2Yc=; b=Ftc0R2hfBuNnr9l/TyecCmB2ku HpUBb6h5DkjSgQgIJ98pk4+dQh8zDe1QE46mu66CDHKCwnT+QBFtv1IBz7Ynk4h+RzscT8mpYCWBc sf8wBkoIyBnmWUpH+2r4EgWirbCVtEe9RkNjSe/24r4tfBw2qC16PlODQgzWgAfUKJnVzhiZxVgq+ Bfr17CUZ5ipp262QMCEnHlIBXMdKiDw9kG32UI8u7OC3U9hFdK6vnF4T+90IXgi4W0pscQs7EyfR2 /LBfsmo45HB2EVWf4sGjY9AaEWk8dgHSCk5Y/ZFyEDxe02P2jFX5vonUJxr7DQD79cxt+J1NVeQnU GcE9enTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSE4X-0000000HNoe-19t4; Fri, 12 Jul 2024 11:04:17 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSE44-0000000HNfn-0eS6 for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 11:03:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720782226; 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: in-reply-to:in-reply-to:references:references; bh=veUUGt+GBKRUflAP/4u3UadYVzXIYYKM+vDLIvIs2Yc=; b=amqrOkbcJiqMpOw4ybz5dukXIrvJPDrfXpp2CaWqtk97YQaFW9RCCDtyjn7OMv8GpWuw1H ZMwYCCu3HV0oVdqzHJyn90SSBxI7pAVlYfMU83I2ByEBgJj7j4reKoS/bWjgNjjHjyIUps CBjuZQi/VkkkuKs+ikN4UTv4AY8ZW04= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-497-d7TK_RYpP0uk3rSy7bJkiA-1; Fri, 12 Jul 2024 07:03:45 -0400 X-MC-Unique: d7TK_RYpP0uk3rSy7bJkiA-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3d92b2a96beso1725609b6e.3 for ; Fri, 12 Jul 2024 04:03:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720782224; x=1721387024; 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=veUUGt+GBKRUflAP/4u3UadYVzXIYYKM+vDLIvIs2Yc=; b=o6ZAUhkuWuf/i2ksep12XOc40wokDnqE3fGR7rLKOgsRoNAmqx7BVuujDpuZvG+0fP 5PUZoI7ClCO7csI514ELUMbwq/fIg9ew3VUrYPCp57E4v09oSXGhSxlm8e7lESKhln4I 31OKK5zCXd0FNUzAZbvybjGXDDye/XeXSFstYrN4cORhIgmX607K1UOnQTx1YFBw4JjH NKE+JSyTbm+haeLp+boNC8e4hmYZEMK3kmHPzqOvrg0o6bqYyrN0vKHerxAbf5kIF49f WUNDYQgqll3b7FfrtyP5FcxADF6nnCcnHELBYLr/UWcfbs8jA67uBREIJYPLvWfog1pW jCFQ== X-Gm-Message-State: AOJu0YwuUYeZmyD8XofbdUmZQFry2nhR5FudPojW7FZBH6U5g0tNaiGt hZKHpJRJ8BxQ4UgNpNFUnfZzNb3bDYxbWpENfFd/jN2l0HgrqBWej2BSFhR6k+ACBWP5LAJ1mVL 9wq5HvI8yV2AO1P3R6lLpxPS7lkjrl83O+150/PKHZo/LUPxN2e3/TbaFjQ3lO1PyobBsP98/Q8 YEdqFUpzXaDQwdOBWiHuIzS0vMHb9aJMqicr1VbeEDrGZHpDLzxeTv/g== X-Received: by 2002:a05:6808:1451:b0:3d6:2fb8:2905 with SMTP id 5614622812f47-3d93c08ccc9mr12087103b6e.42.1720782222559; Fri, 12 Jul 2024 04:03:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaYoe9jS++ITWpl1K24bjqJ7Ih4Tcqa5GejquSQMQtKX8znz1DvmZfOWT4pcFyOh59vOw1Ew== X-Received: by 2002:a05:6808:1451:b0:3d6:2fb8:2905 with SMTP id 5614622812f47-3d93c08ccc9mr12087065b6e.42.1720782222096; Fri, 12 Jul 2024 04:03:42 -0700 (PDT) Received: from rh.redhat.com (p200300c93f45e50062e5f8c654844c9a.dip0.t-ipconnect.de. [2003:c9:3f45:e500:62e5:f8c6:5484:4c9a]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79f18ff834csm390498685a.5.2024.07.12.04.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 04:03:41 -0700 (PDT) From: Sebastian Ott To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon , Zenghui Yu Subject: [PATCH 1/3] KVM: arm64: fix override-init warnings in W=1 builds Date: Fri, 12 Jul 2024 13:03:30 +0200 Message-ID: <20240712110332.10970-2-sebott@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240712110332.10970-1-sebott@redhat.com> References: <20240712110332.10970-1-sebott@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_040348_288897_754D8E03 X-CRM114-Status: GOOD ( 13.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove double initializations in cases where that's easily possible - like extra NULL initialization in static global structures. In the other cases just silence -Woverride-init. To fix warnings like the following: arch/arm64/kvm/hyp/vhe/switch.c:271:43: warning: initialized field overwritten [-Woverride-init] 271 | [ESR_ELx_EC_CP15_32] = kvm_hyp_handle_cp15_32, | ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Sebastian Ott --- arch/arm64/kvm/handle_exit.c | 5 +++++ arch/arm64/kvm/hyp/nvhe/switch.c | 6 ++---- arch/arm64/kvm/hyp/vhe/switch.c | 3 +-- arch/arm64/kvm/sys_regs.c | 5 +++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index d7c2990e7c9e..2c049746657c 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -291,6 +291,9 @@ static int handle_svc(struct kvm_vcpu *vcpu) return 1; } +__diag_push(); +__diag_ignore_all("-Woverride-init", "Allow field overrides in exit_handlers"); + static exit_handle_fn arm_exit_handlers[] = { [0 ... ESR_ELx_EC_MAX] = kvm_handle_unknown_ec, [ESR_ELx_EC_WFx] = kvm_handle_wfx, @@ -319,6 +322,8 @@ static exit_handle_fn arm_exit_handlers[] = { [ESR_ELx_EC_PAC] = kvm_handle_ptrauth, }; +__diag_pop(); + static exit_handle_fn kvm_get_exit_handler(struct kvm_vcpu *vcpu) { u64 esr = kvm_vcpu_get_esr(vcpu); diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c index 6af179c6356d..bf49afc01542 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -200,8 +200,7 @@ static void kvm_hyp_save_fpsimd_host(struct kvm_vcpu *vcpu) } } -static const exit_handler_fn hyp_exit_handlers[] = { - [0 ... ESR_ELx_EC_MAX] = NULL, +static const exit_handler_fn hyp_exit_handlers[ESR_ELx_EC_MAX + 1] = { [ESR_ELx_EC_CP15_32] = kvm_hyp_handle_cp15_32, [ESR_ELx_EC_SYS64] = kvm_hyp_handle_sysreg, [ESR_ELx_EC_SVE] = kvm_hyp_handle_fpsimd, @@ -212,8 +211,7 @@ static const exit_handler_fn hyp_exit_handlers[] = { [ESR_ELx_EC_MOPS] = kvm_hyp_handle_mops, }; -static const exit_handler_fn pvm_exit_handlers[] = { - [0 ... ESR_ELx_EC_MAX] = NULL, +static const exit_handler_fn pvm_exit_handlers[ESR_ELx_EC_MAX + 1] = { [ESR_ELx_EC_SYS64] = kvm_handle_pvm_sys64, [ESR_ELx_EC_SVE] = kvm_handle_pvm_restricted, [ESR_ELx_EC_FP_ASIMD] = kvm_hyp_handle_fpsimd, diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c index 77010b76c150..4e4ff2bd51c9 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -415,8 +415,7 @@ static bool kvm_hyp_handle_sysreg_vhe(struct kvm_vcpu *vcpu, u64 *exit_code) return kvm_hyp_handle_sysreg(vcpu, exit_code); } -static const exit_handler_fn hyp_exit_handlers[] = { - [0 ... ESR_ELx_EC_MAX] = NULL, +static const exit_handler_fn hyp_exit_handlers[ESR_ELx_EC_MAX + 1] = { [ESR_ELx_EC_CP15_32] = kvm_hyp_handle_cp15_32, [ESR_ELx_EC_SYS64] = kvm_hyp_handle_sysreg_vhe, [ESR_ELx_EC_SVE] = kvm_hyp_handle_fpsimd, diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index c90324060436..00fb6f1e9a48 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2255,6 +2255,9 @@ static bool access_zcr_el2(struct kvm_vcpu *vcpu, return true; } +__diag_push(); +__diag_ignore_all("-Woverride-init", "Allow field overrides in sys_reg_descs"); + /* * Architected system registers. * Important: Must be sorted ascending by Op0, Op1, CRn, CRm, Op2 @@ -2803,6 +2806,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { EL2_REG(SP_EL2, NULL, reset_unknown, 0), }; +__diag_pop(); + static bool kvm_supported_tlbi_s12_op(struct kvm_vcpu *vpcu, u32 instr) { struct kvm *kvm = vpcu->kvm; From patchwork Fri Jul 12 11:03:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ott X-Patchwork-Id: 13731617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F6A5C3DA4A for ; Fri, 12 Jul 2024 11:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6xAST+V6lWXBsnEaGTLUMH67LdmttdDtWSOQgal7aQQ=; b=yMqIX+sKSTJerADyOt4Vvj5Idl CgOzEFO9vpWnZ32inTLpx/1Xa6L37mYyRJQJVx8bQSy6mrjC5IQuG6K0O2VUP+rT4aU3BoAb7xs0F 80ixgTwbOaUiLWKnbHFZKZis4a5IFdNeBztxLjANlsrQRxf5wCE0Pok92WlJ5RwdCuLaqe6G6eB/R Fe1BhLxi+9uzS46ZHiUb3Q+KESQGXvl2wt0fQSTc2gwV6Wo8gEedcPhZKPkdFnGgEHTE4K7YsDVfT izEVFp6MardTqkP9sWy8idrv+qBjXhKzD5IvHcEN1Iot5b20joUA3jkKuAY+rbBm/eJCXsUM95V+y S+47lTdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSE4n-0000000HNun-283s; Fri, 12 Jul 2024 11:04:33 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSE45-0000000HNg4-0vND for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 11:03:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720782228; 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: in-reply-to:in-reply-to:references:references; bh=6xAST+V6lWXBsnEaGTLUMH67LdmttdDtWSOQgal7aQQ=; b=fj4Qaq2eyWmoObqVsz3q4jRyUugDe5C+AZLH21LyPjeJ40ViD9bbQ4KqDg1bqeUI6uVWMx 75m4++8xw69Yr1c4qJsJ0g0NCOv1zvrV+qucy3JvF6Q1yGszGynQjLPgWSmlRg6W6dT8Us 2FWI2E9CeL5ouiax25czZBqzG8vRa08= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-fz8mormwOi2UNdBHJnFw1A-1; Fri, 12 Jul 2024 07:03:47 -0400 X-MC-Unique: fz8mormwOi2UNdBHJnFw1A-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-79efca8478bso195886185a.1 for ; Fri, 12 Jul 2024 04:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720782226; x=1721387026; 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=6xAST+V6lWXBsnEaGTLUMH67LdmttdDtWSOQgal7aQQ=; b=IDUJKtodkG610E9Bl1ohvu89ofuHsocPhF3u0I8DHqs0EwfwxgaX2roS4I+nGxTjpy kwwsw8puglFB6AYAg9p2qj4E07PxFuZj/dmsJAOj0CriyCPIm8xBE2PKRj8/86YmP9to G5JBD6fTzCO9FhuEd7j/MaxRFEzy1lrE4asJ5SE5UAxKBPg6JfuO2N8sjIVAVN3SNc8d 4Wf3oSknzTLCufnFMkktidpIXPsKYkb344tDx/Fd67+Mvbb1gwmvpaQu6at/YJXyu4IQ uTROtK4iDuxDGsYszMnVnL7Phxj1ISj9tUtNdL52iVuKlrHSA/YoeQMv50vR+NablHsP vtWA== X-Gm-Message-State: AOJu0YwH6yHOzoOq+ANk3n1iuZsvRkFXwjoJQc8lUYk2ZgHF/XPD0NQe iUduvoLkueP1GDf4+UpGenBvhLHoJgJN4p/hJDR/iiMKJNne/KRzKG3oVn1NM/39RcZfQlwMFzy 8K1KPt9CWZ88OiBe+oz2t91b73SfsToG7A8ixdq36BaREoLisR/Om0zskdCwcdxwn2Rlg/79p3/ KSu6kxcQMDEyoqn6MkW39mznTLUfobaXjLDXV5jS/+ENsBC0nyzwI4rw== X-Received: by 2002:a05:620a:909:b0:79e:f850:e4de with SMTP id af79cd13be357-79f1991b083mr1092097585a.0.1720782225694; Fri, 12 Jul 2024 04:03:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRtK3var3gfeKJIjD1DbrBau/cSSmMTHNiKReqsoRwrLr/R+k8zDdqm587bqmZ6Jq9LLcrog== X-Received: by 2002:a05:620a:909:b0:79e:f850:e4de with SMTP id af79cd13be357-79f1991b083mr1092094585a.0.1720782225283; Fri, 12 Jul 2024 04:03:45 -0700 (PDT) Received: from rh.redhat.com (p200300c93f45e50062e5f8c654844c9a.dip0.t-ipconnect.de. [2003:c9:3f45:e500:62e5:f8c6:5484:4c9a]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79f18ff834csm390498685a.5.2024.07.12.04.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 04:03:44 -0700 (PDT) From: Sebastian Ott To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon , Zenghui Yu Subject: [PATCH 2/3] KVM: arm64: fix kdoc warnings in W=1 builds Date: Fri, 12 Jul 2024 13:03:31 +0200 Message-ID: <20240712110332.10970-3-sebott@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240712110332.10970-1-sebott@redhat.com> References: <20240712110332.10970-1-sebott@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_040349_356595_1F939968 X-CRM114-Status: GOOD ( 17.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix kdoc warnings by adding missing function parameter descriptions or by conversion to a normal comment. Signed-off-by: Sebastian Ott --- arch/arm64/kvm/arm.c | 1 + arch/arm64/kvm/vgic/vgic-irqfd.c | 7 ++++--- arch/arm64/kvm/vgic/vgic-its.c | 18 +++++++++++------- arch/arm64/kvm/vgic/vgic-v3.c | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index c818818398a5..2cbc23dd554d 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -164,6 +164,7 @@ static int kvm_arm_default_max_vcpus(void) /** * kvm_arch_init_vm - initializes a VM data structure * @kvm: pointer to the KVM struct + * @type: kvm device type */ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) { diff --git a/arch/arm64/kvm/vgic/vgic-irqfd.c b/arch/arm64/kvm/vgic/vgic-irqfd.c index 8c711deb25aa..c314c016659a 100644 --- a/arch/arm64/kvm/vgic/vgic-irqfd.c +++ b/arch/arm64/kvm/vgic/vgic-irqfd.c @@ -9,7 +9,7 @@ #include #include "vgic.h" -/** +/* * vgic_irqfd_set_irq: inject the IRQ corresponding to the * irqchip routing entry * @@ -75,7 +75,8 @@ static void kvm_populate_msi(struct kvm_kernel_irq_routing_entry *e, msi->flags = e->msi.flags; msi->devid = e->msi.devid; } -/** + +/* * kvm_set_msi: inject the MSI corresponding to the * MSI routing entry * @@ -98,7 +99,7 @@ int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, return vgic_its_inject_msi(kvm, &msi); } -/** +/* * kvm_arch_set_irq_inatomic: fast-path for irqfd injection */ int kvm_arch_set_irq_inatomic(struct kvm_kernel_irq_routing_entry *e, diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index 40bb43f20bf3..ba945ba78cc7 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -2040,6 +2040,7 @@ typedef int (*entry_fn_t)(struct vgic_its *its, u32 id, void *entry, * @start_id: the ID of the first entry in the table * (non zero for 2d level tables) * @fn: function to apply on each entry + * @opaque: pointer to opaque data * * Return: < 0 on error, 0 if last element was identified, 1 otherwise * (the last element may not be found on second level tables) @@ -2079,7 +2080,7 @@ static int scan_its_table(struct vgic_its *its, gpa_t base, int size, u32 esz, return 1; } -/** +/* * vgic_its_save_ite - Save an interrupt translation entry at @gpa */ static int vgic_its_save_ite(struct vgic_its *its, struct its_device *dev, @@ -2099,6 +2100,8 @@ static int vgic_its_save_ite(struct vgic_its *its, struct its_device *dev, /** * vgic_its_restore_ite - restore an interrupt translation entry + * + * @its: its handle * @event_id: id used for indexing * @ptr: pointer to the ITE entry * @opaque: pointer to the its_device @@ -2231,6 +2234,7 @@ static int vgic_its_restore_itt(struct vgic_its *its, struct its_device *dev) * @its: ITS handle * @dev: ITS device * @ptr: GPA + * @dte_esz: device table entry size */ static int vgic_its_save_dte(struct vgic_its *its, struct its_device *dev, gpa_t ptr, int dte_esz) @@ -2313,7 +2317,7 @@ static int vgic_its_device_cmp(void *priv, const struct list_head *a, return 1; } -/** +/* * vgic_its_save_device_tables - Save the device table and all ITT * into guest RAM * @@ -2386,7 +2390,7 @@ static int handle_l1_dte(struct vgic_its *its, u32 id, void *addr, return ret; } -/** +/* * vgic_its_restore_device_tables - Restore the device table and all ITT * from guest RAM to internal data structs */ @@ -2478,7 +2482,7 @@ static int vgic_its_restore_cte(struct vgic_its *its, gpa_t gpa, int esz) return 1; } -/** +/* * vgic_its_save_collection_table - Save the collection table into * guest RAM */ @@ -2518,7 +2522,7 @@ static int vgic_its_save_collection_table(struct vgic_its *its) return ret; } -/** +/* * vgic_its_restore_collection_table - reads the collection table * in guest memory and restores the ITS internal state. Requires the * BASER registers to be restored before. @@ -2556,7 +2560,7 @@ static int vgic_its_restore_collection_table(struct vgic_its *its) return ret; } -/** +/* * vgic_its_save_tables_v0 - Save the ITS tables into guest ARM * according to v0 ABI */ @@ -2571,7 +2575,7 @@ static int vgic_its_save_tables_v0(struct vgic_its *its) return vgic_its_save_collection_table(its); } -/** +/* * vgic_its_restore_tables_v0 - Restore the ITS tables from guest RAM * to internal data structs according to V0 ABI * diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c index ed6e412cd74b..3eecdd2f4b8f 100644 --- a/arch/arm64/kvm/vgic/vgic-v3.c +++ b/arch/arm64/kvm/vgic/vgic-v3.c @@ -370,7 +370,7 @@ static void map_all_vpes(struct kvm *kvm) dist->its_vm.vpes[i]->irq)); } -/** +/* * vgic_v3_save_pending_tables - Save the pending tables into guest RAM * kvm lock and all vcpu lock must be held */ From patchwork Fri Jul 12 11:03:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ott X-Patchwork-Id: 13731618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F141C3DA4A for ; Fri, 12 Jul 2024 11:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MsvQ75fAXsh3PNmutFTZ+oUFOtcjE1xAsn2yQswaCk8=; b=eZ50tKxAErycfMiiPT1CFCijra dj3++YrZ1fMNweBoNI1Rnx4T8h2DN5sYAA6reAwB7EIvwMlHhFj8bFe2OGc7xxcakeF0HiHABc0qZ 6tRo/DT2EUjSnCgr7X/e0gZvc7DivAKUOry3LplUfBX1dtYV0yyqHH3eUEby9mb+2XzedUY2pTAtR 7MAHmc4kMFHgr3OB0/wZxJwO3ImRLmKgOixhbtvxQ2Kzarx8RaAtRjtyM4Uw2Nr7/vpH6xwZw0oV3 7ZfUeZl4/Iqwy4y6/YToKnltr3tghVDy4QXr3Fwz/osJjYQF2D4cM4b29whGFQC2GnEBm7wLH85iH h42EoV/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSE52-0000000HO0d-3clA; Fri, 12 Jul 2024 11:04:48 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSE47-0000000HNgh-30Bi for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 11:03:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720782230; 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: in-reply-to:in-reply-to:references:references; bh=MsvQ75fAXsh3PNmutFTZ+oUFOtcjE1xAsn2yQswaCk8=; b=PIdwtbzXHvZck6Ulg7zT0QGJH4AaO2wR+k5UqG4O+5dTFEo0qpyJBmIgf1wK6t9g2oHTwm i1ztonQlnbEDJypLgCdwuT3sEuRXCJIN3cltEpSjPgXEL3bDKybJOFrJgRHR6YJsFFgBoB ZZRyMiFRhefB+jKQk3NgZiUzrJ3HZ1g= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-656-kOLnNFfrOvm1Bz6eX6mWDQ-1; Fri, 12 Jul 2024 07:03:49 -0400 X-MC-Unique: kOLnNFfrOvm1Bz6eX6mWDQ-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-79f0da8e7c7so166824385a.0 for ; Fri, 12 Jul 2024 04:03:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720782228; x=1721387028; 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=MsvQ75fAXsh3PNmutFTZ+oUFOtcjE1xAsn2yQswaCk8=; b=DlftqdY2wqRQS3+Ip1MBhTON0ghOerQsF+jqINt7ym5OdwP+2ZOJKmi1w3ameQIe1D k0XWqqfQF/20GpW1uQPSXFAOv2Ymge+a3cpGFkLJD6ItqXTYjwBiQHabXITTQpk55KJV KH96sf6oglSxbxS1V6qlgqvKYEa8K0UZMe/EqTdvCZMg4+fta+XE/F9ofoAp84ht5c0q C4XPoLSEc4cwfo4p7niZlSTQERO7CkPC9pQlJWFZ6CPDYrsANWKKHDrR4DTOZGfmvXvx TvG+SWLv9Q/xqQsA6IuCz3r5a+wS2WCuFwmtEW8pZFib+8BTaDIzKh/fhec915EWiLwh AP0w== X-Gm-Message-State: AOJu0YzqrCLnDmJYd4MF1tMstV/D39V0n+XThahpUHpfgyfPzOvotmY8 2UxOilXarzrSVeMAj9vjgr4fj2JIokwXklAqgDbqqRVsNc4mVPbuGTKlLg/qoYfSF6/yFBAFCTz NZPiNH+7OVc0gsSyM4/eWfvr8u/C5rTKNlOT4FdcAZDKea5DwKiz69CmFY9caKf4WDGMcxzDTab rvIliI3WNpi7R1FgW/IZnXPisOR+d6EcehHggBEu0pjQflk01x36nyjw== X-Received: by 2002:a05:620a:2186:b0:79c:119e:2b44 with SMTP id af79cd13be357-79f19a51d7fmr1225835385a.3.1720782228730; Fri, 12 Jul 2024 04:03:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/x1W3ipOkWAMomp0zXTQ02Ix+7KNx4A712Y6gcZalpd9XUggvSO3hVJNYViAZWFdOQfl+eg== X-Received: by 2002:a05:620a:2186:b0:79c:119e:2b44 with SMTP id af79cd13be357-79f19a51d7fmr1225831585a.3.1720782228362; Fri, 12 Jul 2024 04:03:48 -0700 (PDT) Received: from rh.redhat.com (p200300c93f45e50062e5f8c654844c9a.dip0.t-ipconnect.de. [2003:c9:3f45:e500:62e5:f8c6:5484:4c9a]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79f18ff834csm390498685a.5.2024.07.12.04.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 04:03:48 -0700 (PDT) From: Sebastian Ott To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon , Zenghui Yu Subject: [PATCH 3/3] KVM: arm64: vgic: fix unexpected unlock sparse warnings Date: Fri, 12 Jul 2024 13:03:32 +0200 Message-ID: <20240712110332.10970-4-sebott@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240712110332.10970-1-sebott@redhat.com> References: <20240712110332.10970-1-sebott@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_040351_847271_15DBA4E5 X-CRM114-Status: GOOD ( 12.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Get rid of unexpected unlock sparse warnings in vgic code by adding an annotation to vgic_queue_irq_unlock(). arch/arm64/kvm/vgic/vgic.c:334:17: warning: context imbalance in 'vgic_queue_irq_unlock' - unexpected unlock arch/arm64/kvm/vgic/vgic.c:419:5: warning: context imbalance in 'kvm_vgic_inject_irq' - different lock contexts for basic block Signed-off-by: Sebastian Ott --- arch/arm64/kvm/vgic/vgic.c | 2 +- arch/arm64/kvm/vgic/vgic.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c index f07b3ddff7d4..974849ea7101 100644 --- a/arch/arm64/kvm/vgic/vgic.c +++ b/arch/arm64/kvm/vgic/vgic.c @@ -313,7 +313,7 @@ static bool vgic_validate_injection(struct vgic_irq *irq, bool level, void *owne * with all locks dropped. */ bool vgic_queue_irq_unlock(struct kvm *kvm, struct vgic_irq *irq, - unsigned long flags) + unsigned long flags) __releases(&irq->irq_lock) { struct kvm_vcpu *vcpu; diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h index 6106ebd5ba42..480b5c7e2031 100644 --- a/arch/arm64/kvm/vgic/vgic.h +++ b/arch/arm64/kvm/vgic/vgic.h @@ -186,7 +186,7 @@ bool vgic_get_phys_line_level(struct vgic_irq *irq); void vgic_irq_set_phys_pending(struct vgic_irq *irq, bool pending); void vgic_irq_set_phys_active(struct vgic_irq *irq, bool active); bool vgic_queue_irq_unlock(struct kvm *kvm, struct vgic_irq *irq, - unsigned long flags); + unsigned long flags) __releases(&irq->irq_lock); void vgic_kick_vcpus(struct kvm *kvm); void vgic_irq_handle_resampling(struct vgic_irq *irq, bool lr_deactivated, bool lr_pending);