Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1090639rwl; Fri, 24 Mar 2023 06:15:31 -0700 (PDT) X-Google-Smtp-Source: AK7set9D6mpgXgs18Zqic0tJxHGP9tbv2cT0HddQCs57VSamq64Dt6RfKDO90sWQC39ui5181HNY X-Received: by 2002:a05:6a20:4b23:b0:d9:1ec8:e9bb with SMTP id fp35-20020a056a204b2300b000d91ec8e9bbmr2760293pzb.28.1679663730925; Fri, 24 Mar 2023 06:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679663730; cv=none; d=google.com; s=arc-20160816; b=o0L9lRADTq5vedpLvgn5YXlXm8gqWmtk+v2fhynE7c8LxEZJJ/s+BwemIfe+M3WjfW LMtZGfHNc4R4R/w0tA4AewCEa/CefB+jUazE2KqGfsbV/dbWZdoEmj/AlOyup2J5gPY1 gjcSZY8BjNYdIcfWUOeuJxByv78jDY7QXMf+MzqOSBqwx3lWXQmzveIBp1MNQtJSDYi0 myCDrhd2SpXKA+jJYQBcu8imD7yl5sPVnxBtkvNIht01rqHCluwiQImekGiZ/l3vLCua s2A/hl5VQrPhrle/Ts/FmHTp0O1VQg7e6jbAI56OQPvJ+UvYWRoQ1BuW/R9Iay5N0HGX LauA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=m5SDxOoolUK9Wyj28+FiVDVLp5CYB42n63XNmD+YPlE=; b=f2yV1pjsI8dLtv4SvphQeeOvEUArXg0YzLwWQ71h4lgCSaxHRa02qpzLJ0QHgnVewz xCD3bVneeebXawWb4toiCF+gxRUd7cZuSkXJmRlRdoTu2TTOM7YuhLCrBTD4+4GpIVy7 e0M0kKTNcpJCx8+lxshNM68YxMowC2ljrb9cY/Zfb5uTy5W1xm3ZhUaPG5U24gkQC7Rt p4B47KbKb0h+OW8nH2AQpjKqRRqpZracUMijHGyYQ5cwsqQYPW9wGTDaz3RdWbf5P6rP GQaZDIzvKnOty/CU8zUUcRiUVCOUbDH5YrHPU8klh6Z2HlMiBk4a8OCAWSahBapatPab dWsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ytMvk5KV; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a63f508000000b0050f53eec0b6si18170192pgh.192.2023.03.24.06.15.10; Fri, 24 Mar 2023 06:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ytMvk5KV; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231665AbjCXNMz (ORCPT + 99 others); Fri, 24 Mar 2023 09:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231725AbjCXNMy (ORCPT ); Fri, 24 Mar 2023 09:12:54 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7437233F7 for ; Fri, 24 Mar 2023 06:12:51 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1679663569; 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: in-reply-to:in-reply-to:references:references; bh=m5SDxOoolUK9Wyj28+FiVDVLp5CYB42n63XNmD+YPlE=; b=ytMvk5KVgQRedv8mr4wFKR0DO5fmbSqb3ChOsdilvijfKLnIyYqSXS29UAI0WUosZYmzYT mFlFFlygRR7ApEpgezqlFhVFC8mAK0nDaF69BH0oqJbs096Gr6c3D+axw90drHil2Fgiae kFtprePDE1iyEAeIbSNU1/b40zSKhRcwZDvfXmU51YfJG1fiBqdhI7al3H4UH05F6zkJdo 04koG4M37nZcNWoS0AARgUP+1zo7hz4mCdE3oC73wS45fUuxOCkonbiQOfU6qb63AdIpnW cYAgWIcsGXqjPlXOMOaBrFni1xAII2lzA0R27+3Qgnv7Nkt9g68FAzWAzr0TwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1679663569; 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: in-reply-to:in-reply-to:references:references; bh=m5SDxOoolUK9Wyj28+FiVDVLp5CYB42n63XNmD+YPlE=; b=7CTYTqnV2ghA9YVCkgUVTCctt71Ga0GrdDjJGAoTxO/bzk4Wre+hWvrpqPd80hugL0Uw1f QiSkN0aDsLCNGnCw== To: Borislav Petkov Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/microcode: move @microcode_mutex definition near usage In-Reply-To: <20230324120019.GAZB2Q09ODVq0iYz5l@fat_crate.local> References: <20230324114720.1756466-1-john.ogness@linutronix.de> <20230324120019.GAZB2Q09ODVq0iYz5l@fat_crate.local> Date: Fri, 24 Mar 2023 14:17:10 +0106 Message-ID: <87edpenvkh.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-03-24, Borislav Petkov wrote: >> If CONFIG_MICROCODE_LATE_LOADING is not enabled, the compiler warns: >> >> 'microcode_mutex' defined but not used > > How do you trigger this? I was doing some tests with CONFIG_PREEMPT_RT. I did not think that mattered, since the mutex is obviously defined but not used for !CONFIG_MICROCODE_LATE_LOADING. Digging deeper I see that initializing @wait_list in __MUTEX_INITIALIZER() is what is allowing unused global mutexes to go unnoticed. Since with CONFIG_PREEMPT_RT the mutex is different and initialized differently, it is (correctly) detected as unused. CONFIG_PREEMPT_RT cannot be enabled yet, so this patch is not urgent for mainline. But at some point it will need fixing. John Ogness