---------- Forwarded message ----------
From: 王昊然 <msl0000023...@gmail.com>
Date: Thu, 20 Oct 2022 00:18:35 +0800
Subject: Re: Bug#1022049: libnettle8: Illegal instruction on IBM POWER7
To: Niels Möller <ni...@lysator.liu.se>

> The ppc specification says "vmrgow is treated as a Vector
> instruction in terms of resource availability.", it's not entirely clear
> to me what that means, and if checking for altivec support should be enough.
>
> The fat setup for ppc is intended to enable the crashing code path only
> if the feature bits PPC_FEATURE_HAS_ALTIVEC and PPC_FEATURE_HAS_VSX are
> both set in the status word returned from
> ...

Thanks for the hint, I guess this issue is likely caused by my kernel which
wasn't have CONFIG_VSX enabled. But in my understanding, this feature is an
extension to AltiVec, not the AltiVec itself, so nettle shouldn't assume VSX
to be available if they seen AltiVec available.


> You can get some diagnostics from the initialization process by setting
> the NETTLE_FAT_VERBOSE environment variable, and override the automatic
> detection with the NETTLE_FAT_OVERRIDE environment variable.

$ NETTLE_FAT_VERBOSE=1 test-program
libnettle: cpu features:
libnettle: enabling altivec code.
Illegal instruction


> Can you check what getauxval(AT_HWCAP) returns on your system?

whr@debian:~/src$ cat cpu-feature-test.c
#include <sys/auxv.h>
#include <stdio.h>

int main() {
        unsigned long int hwcap = getauxval(AT_HWCAP);
        printf("hwcap = 0x%lx\n", hwcap);
        return 0;
}
whr@debian:~/src$ gcc -Wall cpu-feature-test.c
whr@debian:~/src$ ./a.out
hwcap = 0xdc0065c2


> Is the program that crashes running under a vm, or is the kernel running
> on the bare metal? Each layer of vm tends to be ian opportunity to introduce
> errors in the list of available processor features.

Operating systems on this machine are always running on the Power Hypervisor,
which is a part of the server firmware.

Reply via email to