Re: [RFC] UBUNTU: [Config] y2038: Disable COMPAT and COMPAT_32BIT_TIME on ppc64le
On Fri, 24 Nov 2023 at 04:59, Michael Ellerman wrote: > > Dimitri John Ledkov writes: > > BugLink: https://bugs.launchpad.net/bugs/2038587 > > > > ppc64le is exclusively little endian and 64-bit, thus there is no need > > for COMPAT_32BIT_TIME, nor COMPAT. > > To be pedantic, the ppc64le kernel does support running 32-bit little > endian userspace in compat mode (CONFIG_COMPAT=y). It's a distro choice > as to whether you support COMPAT. Notably there are two other major > distros that don't support COMPAT for ppc64le, and the set of 32-bit LE > software is effectively empty. 🤯 > > > diffconfig result of these changes is: > > > > -ARCH_MMAP_RND_COMPAT_BITS 13 > > -ARCH_WANT_COMPAT_IPC_PARSE_VERSION y > > -ARCH_WANT_OLD_COMPAT_IPC y > > -COMPAT_BINFMT_ELF y > > -COMPAT_NETLINK_MESSAGES y > > -COMPAT_OLD_SIGACTION y > > -HAVE_ARCH_MMAP_RND_COMPAT_BITS y > > -KVM_COMPAT y > > -NETFILTER_XTABLES_COMPAT y > > -SYSVIPC_COMPAT y > > -VDSO32 y > > COMPAT y -> n > > COMPAT_32BIT_TIME y -> n > > +ARCH_HAS_SYSCALL_WRAPPER y > > +INTERRUPT_SANITIZE_REGISTERS y > > > > What confused me, if the above combination is even valid or just pure > > dead code. > > I don't entirely understand what that diff is saying, but I'll try and > answer anyway. This is output from diffconfig, lines with "y -> n" are changes to a key that is available as a choice. Lines prefixed with minus ('-') become unavailable. Lines prefixed with plus ('+') are NEW options that become available. So the effect of turning COMPAT off removes lots of compat things in other places, and makes INTERRUPT_SANITIZE_REGISTERS available. > > > Is it really possible to run 32bit big-endian KVM on a 64bit > > little-endian POWER? > > Are you referring to KVM_COMPAT being disabled? > > That's nothing to do with big-endian. It's just controlling whether the > KVM ioctls (which qemu calls) support compat handling, ie. whether you > can run a 32-bit qemu under a 64-bit kernel. > Thank you for the explanation. And also "no thank you, do not want 32-bit qemu". > It's entirely expected that when COMPAT is turned off KVM_COMPAT also > gets turned off. > > > Or is Kconfig slightly buggy and should be fixed up to prevent > > offering COMPAT options when little-endian 64bit POWER kernel is being > > configured? > > No. Like I said at the top, the kernel does support 32-bit LE compat, > eventhough it's not very widely used. > Thank you for explaining all of this. -- okurrr, Dimitri
Re: [RFC] UBUNTU: [Config] y2038: Disable COMPAT and COMPAT_32BIT_TIME on ppc64le
On Fri, 24 Nov 2023 at 08:25, Michal Suchánek wrote: > > On Fri, Nov 24, 2023 at 03:59:04PM +1100, Michael Ellerman wrote: > > Dimitri John Ledkov writes: > > > BugLink: https://bugs.launchpad.net/bugs/2038587 > > > > > > ppc64le is exclusively little endian and 64-bit, thus there is no need > > > for COMPAT_32BIT_TIME, nor COMPAT. > > > > To be pedantic, the ppc64le kernel does support running 32-bit little > > endian userspace in compat mode (CONFIG_COMPAT=y). It's a distro choice > > as to whether you support COMPAT. Notably there are two other major > > distros that don't support COMPAT for ppc64le, and the set of 32-bit LE > > software is effectively empty. > > I have seen software that does not work when compiled 64bit so it would > build 32bit binary even on ppc64le and abuse the compat layer to run. > > It quite rare, though. Thank you! And yes, do not want =) -- okurrr, Dimitri
Re: [RFC] UBUNTU: [Config] y2038: Disable COMPAT and COMPAT_32BIT_TIME on ppc64le
On Fri, Nov 24, 2023 at 03:59:04PM +1100, Michael Ellerman wrote: > Dimitri John Ledkov writes: > > BugLink: https://bugs.launchpad.net/bugs/2038587 > > > > ppc64le is exclusively little endian and 64-bit, thus there is no need > > for COMPAT_32BIT_TIME, nor COMPAT. > > To be pedantic, the ppc64le kernel does support running 32-bit little > endian userspace in compat mode (CONFIG_COMPAT=y). It's a distro choice > as to whether you support COMPAT. Notably there are two other major > distros that don't support COMPAT for ppc64le, and the set of 32-bit LE > software is effectively empty. I have seen software that does not work when compiled 64bit so it would build 32bit binary even on ppc64le and abuse the compat layer to run. It quite rare, though. Thanks Michal
Re: [RFC] UBUNTU: [Config] y2038: Disable COMPAT and COMPAT_32BIT_TIME on ppc64le
Dimitri John Ledkov writes: > BugLink: https://bugs.launchpad.net/bugs/2038587 > > ppc64le is exclusively little endian and 64-bit, thus there is no need > for COMPAT_32BIT_TIME, nor COMPAT. To be pedantic, the ppc64le kernel does support running 32-bit little endian userspace in compat mode (CONFIG_COMPAT=y). It's a distro choice as to whether you support COMPAT. Notably there are two other major distros that don't support COMPAT for ppc64le, and the set of 32-bit LE software is effectively empty. > diffconfig result of these changes is: > > -ARCH_MMAP_RND_COMPAT_BITS 13 > -ARCH_WANT_COMPAT_IPC_PARSE_VERSION y > -ARCH_WANT_OLD_COMPAT_IPC y > -COMPAT_BINFMT_ELF y > -COMPAT_NETLINK_MESSAGES y > -COMPAT_OLD_SIGACTION y > -HAVE_ARCH_MMAP_RND_COMPAT_BITS y > -KVM_COMPAT y > -NETFILTER_XTABLES_COMPAT y > -SYSVIPC_COMPAT y > -VDSO32 y > COMPAT y -> n > COMPAT_32BIT_TIME y -> n > +ARCH_HAS_SYSCALL_WRAPPER y > +INTERRUPT_SANITIZE_REGISTERS y > > What confused me, if the above combination is even valid or just pure > dead code. I don't entirely understand what that diff is saying, but I'll try and answer anyway. > Is it really possible to run 32bit big-endian KVM on a 64bit > little-endian POWER? Are you referring to KVM_COMPAT being disabled? That's nothing to do with big-endian. It's just controlling whether the KVM ioctls (which qemu calls) support compat handling, ie. whether you can run a 32-bit qemu under a 64-bit kernel. It's entirely expected that when COMPAT is turned off KVM_COMPAT also gets turned off. > Or is Kconfig slightly buggy and should be fixed up to prevent > offering COMPAT options when little-endian 64bit POWER kernel is being > configured? No. Like I said at the top, the kernel does support 32-bit LE compat, eventhough it's not very widely used. cheers
[RFC] UBUNTU: [Config] y2038: Disable COMPAT and COMPAT_32BIT_TIME on ppc64le
BugLink: https://bugs.launchpad.net/bugs/2038587 ppc64le is exclusively little endian and 64-bit, thus there is no need for COMPAT_32BIT_TIME, nor COMPAT. diffconfig result of these changes is: -ARCH_MMAP_RND_COMPAT_BITS 13 -ARCH_WANT_COMPAT_IPC_PARSE_VERSION y -ARCH_WANT_OLD_COMPAT_IPC y -COMPAT_BINFMT_ELF y -COMPAT_NETLINK_MESSAGES y -COMPAT_OLD_SIGACTION y -HAVE_ARCH_MMAP_RND_COMPAT_BITS y -KVM_COMPAT y -NETFILTER_XTABLES_COMPAT y -SYSVIPC_COMPAT y -VDSO32 y COMPAT y -> n COMPAT_32BIT_TIME y -> n +ARCH_HAS_SYSCALL_WRAPPER y +INTERRUPT_SANITIZE_REGISTERS y What confused me, if the above combination is even valid or just pure dead code. Is it really possible to run 32bit big-endian KVM on a 64bit little-endian POWER? Or is Kconfig slightly buggy and should be fixed up to prevent offering COMPAT options when little-endian 64bit POWER kernel is being configured? Signed-off-by: Dimitri John Ledkov --- debian.master/config/annotations | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/debian.master/config/annotations b/debian.master/config/annotations index 2fc37c961d..e962e5 100644 --- a/debian.master/config/annotations +++ b/debian.master/config/annotations @@ -15,7 +15,7 @@ CONFIG_AGP note<'not autoloadable'> CONFIG_ARCH_MMAP_RND_BITS policy<{'amd64': '32', 'arm64': '33', 'arm64-generic-64k': '29', 'armhf': '16', 'ppc64el': '29', 'riscv64': '24'}> CONFIG_ARCH_MMAP_RND_BITS note<'LP: #1983357'> -CONFIG_ARCH_MMAP_RND_COMPAT_BITSpolicy<{'amd64': '16', 'arm64': '16', 'ppc64el': '13', 'riscv64': '-'}> +CONFIG_ARCH_MMAP_RND_COMPAT_BITSpolicy<{'amd64': '16', 'arm64': '16', 'ppc64el': '-', 'riscv64': '-'}> CONFIG_ARCH_MMAP_RND_COMPAT_BITSnote<'LP: #1983357'> CONFIG_ARCH_ROCKCHIPpolicy<{'arm64': 'y', 'armhf': 'y'}> @@ -1230,7 +1230,7 @@ CONFIG_ARCH_HAS_SUBPAGE_FAULTS policy<{'arm64': 'y'}> CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE policy<{'amd64': 'y'}> CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPUpolicy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'y'}> CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE policy<{'arm64': 'y', 'armhf': 'y', 'riscv64': 'y'}> -CONFIG_ARCH_HAS_SYSCALL_WRAPPER policy<{'amd64': 'y', 'arm64': 'y', 'riscv64': 'y', 's390x': 'y'}> +CONFIG_ARCH_HAS_SYSCALL_WRAPPER policy<{'amd64': 'y', 'arm64': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}> CONFIG_ARCH_HAS_TEARDOWN_DMA_OPSpolicy<{'arm64': 'y', 'armhf': 'y'}> CONFIG_ARCH_HAS_TICK_BROADCAST policy<{'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y'}> CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE policy<{'amd64': 'y', 'arm64': 'y', 'ppc64el': 'y'}> @@ -1463,7 +1463,7 @@ CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT policy<{'amd64': 'y', 's390x': ' CONFIG_ARCH_WANTS_NO_INSTR policy<{'amd64': 'y', 'arm64': 'y', 's390x': 'y'}> CONFIG_ARCH_WANTS_THP_SWAP policy<{'amd64': 'y', 'arm64': 'y', 'arm64-generic-64k': '-', 'riscv64': 'y'}> CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSHpolicy<{'amd64': 'y', 'arm64': 'y'}> -CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION policy<{'amd64': 'y', 'arm64': 'y', 'ppc64el': 'y', 's390x': 'y'}> +CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION policy<{'amd64': 'y', 'arm64': 'y', 'ppc64el': '-', 's390x': 'y'}> CONFIG_ARCH_WANT_DEFAULT_BPF_JITpolicy<{'amd64': 'y', 'arm64': 'y', 'ppc64el': 'y', 's390x': 'y'}> CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUTpolicy<{'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y'}> CONFIG_ARCH_WANT_FLAT_DTB_INSTALL policy<{'armhf': 'y'}> @@ -1474,7 +1474,7 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION policy<{'armhf': 'y', 'ppc64el': CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM policy<{'ppc64el': 'y'}> CONFIG_ARCH_WANT_KERNEL_PMD_MKWRITE policy<{'s390x': 'y'}> CONFIG_ARCH_WANT_LD_ORPHAN_WARN policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y'}> -CONFIG_ARCH_WANT_OLD_COMPAT_IPC policy<{'amd64': 'y', 'ppc64el': 'y', 's390x': 'y'}> +CONFIG_ARCH_WANT_OLD_COMPAT_IPC policy<{'amd64': 'y', 'ppc64el': '-', 's390x': 'y'}> CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP policy<{'amd64': 'y', 'ppc64el': 'y'}> CONFIG_ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP policy<{'amd64': 'y', 'riscv64': 'y', 's390x': 'y'}> CONFIG_ARCH_WANT_PMD_MKWRITEpolicy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}> @@ -3145,14 +3145,14 @@ CONFIG_COMMON_RESET_HI6220 policy<{'arm64': 'm', 'armhf': ' CONFIG_COMPACTION policy<{'amd64': 'y', 'arm64': 'y',