Re: Unbootable system after fresh install on Sun Ultra 45 workstation

Marcelo Bezerra <[email protected]>
Newsgroups gmane.linux.debian.ports.sparc
Message-ID <CAKa1==h-KuiBKdDi7ePiVChQqONkAXQPO5NrW99uWR+==vp7Bg@mail.gmail.com>
I wonder if the code in
https://github.com/torvalds/linux/blob/a5806cd506af5a7c19bcd596e4708b5c464bfd21/arch/sparc/lib/crc32_glue.c#L62
should be returning non 0 when it lacks HWCAP_SPARC_CRYPTO or fails
the CFR_CRC32C checks.

static int __init crc32_sparc_init(void)
{
    unsigned long cfr;

    if (!(sparc64_elf_hwcap & HWCAP_SPARC_CRYPTO))
        return 0; <=== here

    __asm__ __volatile__("rd %%asr26, %0" : "=r" (cfr));
    if (!(cfr & CFR_CRC32C))
        return 0; <=== and here

    static_branch_enable(&have_crc32c_opcode);
    pr_info("Using sparc64 crc32c opcode optimized CRC32C implementation\n");
    return 0;
}
arch_initcall(crc32_sparc_init);

On Mon, May 19, 2025 at 6:24 PM John Paul Adrian Glaubitz
<[email protected]> wrote:
>
> Hi Marcelo,
>
> On Mon, 2025-05-19 at 18:17 +0200, Marcelo Bezerra wrote:
> > Blacklisting that module did indeed fix the issue and the system booted.
>
> Thanks a lot for confirming this!
>
> > Not sure what the ideal fix would be for this. I suspect this should
> > affect other machines lacking that instructions, and not only this
> > ultra45.
>
> Good question. Ideally, the sparc64-specific variant of crc32 should
> probably unload itself if it doesn't find any supported hardware.
>
> Adrian
>
> --
>  .''`.  John Paul Adrian Glaubitz
> : :' :  Debian Developer
> `. `'   Physicist
>   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.