From: Prarit Bhargava <prarit@redhat.com>
To: Jessica Yu <jeyu@kernel.org>
Cc: linux-kernel@vger.kernel.org, cavery@redhat.com
Subject: Re: [PATCH] modules: Only return -EEXIST for modules that have finished loading
Date: Mon, 15 Apr 2019 08:04:05 -0400 [thread overview]
Message-ID: <2c27c9cf-0ce3-1c7f-bdc2-760d6d37d4d1@redhat.com> (raw)
In-Reply-To: <20190415112313.GA4080@linux-8ccs>
On 4/15/19 7:23 AM, Jessica Yu wrote:
> +++ Prarit Bhargava [02/04/19 09:39 -0400]:
>> Microsoft HyperV disables the X86_FEATURE_SMCA bit on AMD systems, and
>> linux guests boot with repeated errors:
>>
>> amd64_edac_mod: Unknown symbol amd_unregister_ecc_decoder (err -2)
>> amd64_edac_mod: Unknown symbol amd_register_ecc_decoder (err -2)
>> amd64_edac_mod: Unknown symbol amd_report_gart_errors (err -2)
>> amd64_edac_mod: Unknown symbol amd_unregister_ecc_decoder (err -2)
>> amd64_edac_mod: Unknown symbol amd_register_ecc_decoder (err -2)
>> amd64_edac_mod: Unknown symbol amd_report_gart_errors (err -2)
>>
>> The warnings occur because the module code erroneously returns -EEXIST
>> for modules that have failed to load and are in the process of being
>> removed from the module list.
>>
>> module amd64_edac_mod has a dependency on module edac_mce_amd. Using
>> modules.dep, systemd will load edac_mce_amd for every request of
>> amd64_edac_mod. When the edac_mce_amd module loads, the module has
>> state MODULE_STATE_UNFORMED and once the module load fails and the state
>> becomes MODULE_STATE_GOING. Another request for edac_mce_amd module
>> executes and add_unformed_module() will erroneously return -EEXIST even
>> though the previous instance of edac_mce_amd has MODULE_STATE_GOING.
>> Upon receiving -EEXIST, systemd attempts to load amd64_edac_mod, which
>> fails because of unknown symbols from edac_mce_amd.
>>
>> add_unformed_module() must wait to return for any case other than
>> MODULE_STATE_LIVE to prevent a race between multiple loads of
>> dependent modules.
>>
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Reported-by: Cathy Avery <cavery@redhat.com>
>> Cc: Jessica Yu <jeyu@kernel.org>
>
> Applied to modules-next. Thanks Prarit!
Jessica, could I have the URL of the git tree?
Thanks,
P.
>
> Jessica
>
next prev parent reply other threads:[~2019-04-15 12:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 13:39 Prarit Bhargava
2019-04-08 14:19 ` Prarit Bhargava
2019-04-15 11:23 ` Jessica Yu
2019-04-15 12:04 ` Prarit Bhargava [this message]
2019-04-15 13:20 ` Jessica Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c27c9cf-0ce3-1c7f-bdc2-760d6d37d4d1@redhat.com \
--to=prarit@redhat.com \
--cc=cavery@redhat.com \
--cc=jeyu@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®