* Re: [PATCH] powerpc/boot: Fix build of dts/fsl
From: Masahiro Yamada @ 2020-12-16 5:23 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <87zh2exyjp.fsf@mpe.ellerman.id.au>
On Wed, Dec 16, 2020 at 11:41 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Masahiro Yamada <masahiroy@kernel.org> writes:
> > On Tue, Dec 15, 2020 at 12:29 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
> >>
> >> The lkp robot reported that some configs fail to build, for example
> >> mpc85xx_smp_defconfig, with:
> >>
> >> cc1: fatal error: opening output file arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory
> >>
> >> This bisects to:
> >> cc8a51ca6f05 ("kbuild: always create directories of targets")
> >>
> >> Although that commit claims to be about in-tree builds, it somehow
> >> breaks out-of-tree builds. But presumably it's just exposing a latent
> >> bug in our Makefiles.
> >>
> >> We can fix it by adding to targets for dts/fsl in the same way that we
> >> do for dts.
> >>
> >> Fixes: cc8a51ca6f05 ("kbuild: always create directories of targets")
> >> Reported-by: kernel test robot <lkp@intel.com>
> >> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> >> ---
> >> arch/powerpc/boot/Makefile | 2 ++
> >> 1 file changed, 2 insertions(+)
> >>
> >> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> >> index 68a7534454cd..c3e084cceaed 100644
> >> --- a/arch/powerpc/boot/Makefile
> >> +++ b/arch/powerpc/boot/Makefile
> >> @@ -372,6 +372,8 @@ initrd-y := $(filter-out $(image-y), $(initrd-y))
> >> targets += $(image-y) $(initrd-y)
> >> targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
> >> $(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y))))
> >> +targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
> >> + $(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%, $(image-y))))
> >>
> >> $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
> >>
> >
> >
> > Some freescale dts files are right under arch/powerpc/boot/dts/,
> > but some are in the fsl/ subdirectory.
> > I do not understand the policy.
>
> There isn't a policy. Best I can tell Kumar felt like it would be
> cleaner to have a separate directory for (some of) the Freescale DTS
> files, when he initially submitted them ~9 years ago.
>
>
> > If "fsl/" is a very special case,
> > I just thought we could add a new syntax, fslimage-y,
> > but I do not mind either way.
>
> OK. If you don't mind I'll merge my patch as a quick fix for now.
>
> Then we can probably move all the fsl/ files up one level and avoid the
> problem entirely in future.
Yes. I think it is OK.
As for PPC, most of the DT files are freescale.
Even if you separated DT files in vendor directories,
the majority would go into fsl/.
> > fslimage-$(CONFIG_MPC8540_ADS) += cuImage.mpc8540ads
> >
> > targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
> > $(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%,
> > $(fslimage-y))))
> >
> >
> > This Makefile is wrong over-all anyway.
>
> Excellent.
You can pass V=2 to see why targets under arch/powerpc/boot/
are needlessly rebuilt.
This Makefile is already too cluttered, and I do not have
much time to look into it.
--
Best Regards
Masahiro Yamada
^ permalink raw reply
* Re: [PATCH v2 07/13] powerpc: Increase NR_IRQS range to support more KVM guests
From: Michael Ellerman @ 2020-12-16 2:49 UTC (permalink / raw)
To: Cédric Le Goater, linuxppc-dev; +Cc: Greg Kurz
In-Reply-To: <9fca102b-b1b2-84b0-085f-96965f126e58@kaod.org>
Cédric Le Goater <clg@kaod.org> writes:
> On 12/11/20 12:51 AM, Michael Ellerman wrote:
>> Cédric Le Goater <clg@kaod.org> writes:
>>> PowerNV systems can handle up to 4K guests and 1M interrupt numbers
>>> per chip. Increase the range of allowed interrupts to support a larger
>>> number of guests.
>>>
>>> Reviewed-by: Greg Kurz <groug@kaod.org>
>>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>>> ---
>>> arch/powerpc/Kconfig | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index 5181872f9452..c250fbd430d1 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -66,7 +66,7 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK
>>>
>>> config NR_IRQS
>>> int "Number of virtual interrupt numbers"
>>> - range 32 32768
>>> + range 32 1048576
>>> default "512"
>>> help
>>> This defines the number of virtual interrupt numbers the kernel
>>
>> We should really do what other arches do, and size this appropriately
>> based on the config, rather than asking users to guess what size they
>> need.
>>
>> But I guess I'll take this for now, and we can do something fancier
>> later.
>
> I was thinking on adding a property to OPAL to size the HW interrupt
> number space. Is that it ?
That's a separate issue. NR_IRQS is about the maximum number of Linux
interrupts, and it's a compile time limit.
In the old days there was an array of irq_desc[NR_IRQS] in .data, so you
didn't want NR_IRQS to be too big. These days we don't do that, because
of the sparse IRQ support, but I don't know if it's completely free to
make NR_IRQS arbitrarily large at build time.
> That would be good because it's increasing from 20bits on P9 to 24bits
> on P10.
That's probably still helpful, it might mean we can shrink some
structures at runtime.
> I am checking other arches.
Thanks.
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/boot: Fix build of dts/fsl
From: Michael Ellerman @ 2020-12-16 2:41 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: linuxppc-dev
In-Reply-To: <CAK7LNASJcp=U9sKo9FVdkGNWXu7TGDL2zE-hFQymtfvUhY5+wA@mail.gmail.com>
Masahiro Yamada <masahiroy@kernel.org> writes:
> On Tue, Dec 15, 2020 at 12:29 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> The lkp robot reported that some configs fail to build, for example
>> mpc85xx_smp_defconfig, with:
>>
>> cc1: fatal error: opening output file arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory
>>
>> This bisects to:
>> cc8a51ca6f05 ("kbuild: always create directories of targets")
>>
>> Although that commit claims to be about in-tree builds, it somehow
>> breaks out-of-tree builds. But presumably it's just exposing a latent
>> bug in our Makefiles.
>>
>> We can fix it by adding to targets for dts/fsl in the same way that we
>> do for dts.
>>
>> Fixes: cc8a51ca6f05 ("kbuild: always create directories of targets")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>> ---
>> arch/powerpc/boot/Makefile | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
>> index 68a7534454cd..c3e084cceaed 100644
>> --- a/arch/powerpc/boot/Makefile
>> +++ b/arch/powerpc/boot/Makefile
>> @@ -372,6 +372,8 @@ initrd-y := $(filter-out $(image-y), $(initrd-y))
>> targets += $(image-y) $(initrd-y)
>> targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
>> $(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y))))
>> +targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
>> + $(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%, $(image-y))))
>>
>> $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
>>
>
>
> Some freescale dts files are right under arch/powerpc/boot/dts/,
> but some are in the fsl/ subdirectory.
> I do not understand the policy.
There isn't a policy. Best I can tell Kumar felt like it would be
cleaner to have a separate directory for (some of) the Freescale DTS
files, when he initially submitted them ~9 years ago.
> If "fsl/" is a very special case,
> I just thought we could add a new syntax, fslimage-y,
> but I do not mind either way.
OK. If you don't mind I'll merge my patch as a quick fix for now.
Then we can probably move all the fsl/ files up one level and avoid the
problem entirely in future.
> fslimage-$(CONFIG_MPC8540_ADS) += cuImage.mpc8540ads
>
> targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
> $(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%,
> $(fslimage-y))))
>
>
> This Makefile is wrong over-all anyway.
Excellent.
cheers
^ permalink raw reply
* [powerpc:merge] BUILD SUCCESS a1d4aa500bfb93c4ea6eb9a3c5c9cb6720ed8f46
From: kernel test robot @ 2020-12-16 1:13 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge
branch HEAD: a1d4aa500bfb93c4ea6eb9a3c5c9cb6720ed8f46 Automatic merge of 'next' into merge (2020-12-15 23:50)
elapsed time: 727m
configs tested: 134
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
gcc tested configs:
arm defconfig
arm64 allyesconfig
arm64 defconfig
arm allyesconfig
arm allmodconfig
arc nsimosci_hs_smp_defconfig
riscv allyesconfig
mips bmips_stb_defconfig
arm realview_defconfig
mips decstation_defconfig
arm64 alldefconfig
powerpc holly_defconfig
powerpc mpc837x_mds_defconfig
arm shmobile_defconfig
sh ecovec24-romimage_defconfig
arm pxa255-idp_defconfig
h8300 h8s-sim_defconfig
powerpc powernv_defconfig
arm assabet_defconfig
ia64 gensparse_defconfig
openrisc simple_smp_defconfig
powerpc mpc836x_mds_defconfig
arm vt8500_v6_v7_defconfig
riscv nommu_k210_defconfig
mips ar7_defconfig
powerpc ppc64_defconfig
arm ep93xx_defconfig
powerpc warp_defconfig
nios2 10m50_defconfig
mips bmips_be_defconfig
xtensa xip_kc705_defconfig
sh se7724_defconfig
arm lart_defconfig
um i386_defconfig
ia64 bigsur_defconfig
powerpc mpc85xx_cds_defconfig
arm clps711x_defconfig
powerpc ep8248e_defconfig
arm netwinder_defconfig
arm h5000_defconfig
powerpc kmeter1_defconfig
arm integrator_defconfig
powerpc pq2fads_defconfig
powerpc tqm5200_defconfig
sh sh7763rdp_defconfig
arm collie_defconfig
arm jornada720_defconfig
arm davinci_all_defconfig
powerpc linkstation_defconfig
m68k mac_defconfig
powerpc64 alldefconfig
arm sunxi_defconfig
arm zeus_defconfig
mips tb0287_defconfig
powerpc sequoia_defconfig
mips decstation_64_defconfig
arm omap2plus_defconfig
powerpc mpc834x_itx_defconfig
xtensa iss_defconfig
sh sh2007_defconfig
sh dreamcast_defconfig
arm corgi_defconfig
parisc alldefconfig
mips pic32mzda_defconfig
mips xway_defconfig
arm mv78xx0_defconfig
ia64 allmodconfig
ia64 defconfig
ia64 allyesconfig
m68k allmodconfig
m68k defconfig
m68k allyesconfig
nios2 defconfig
arc allyesconfig
nds32 allnoconfig
c6x allyesconfig
nds32 defconfig
nios2 allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allyesconfig
arc defconfig
sh allmodconfig
parisc defconfig
s390 allyesconfig
parisc allyesconfig
s390 defconfig
i386 allyesconfig
sparc allyesconfig
sparc defconfig
i386 tinyconfig
i386 defconfig
mips allyesconfig
mips allmodconfig
powerpc allyesconfig
powerpc allmodconfig
powerpc allnoconfig
x86_64 randconfig-a003-20201215
x86_64 randconfig-a006-20201215
x86_64 randconfig-a002-20201215
x86_64 randconfig-a005-20201215
x86_64 randconfig-a004-20201215
x86_64 randconfig-a001-20201215
i386 randconfig-a001-20201215
i386 randconfig-a004-20201215
i386 randconfig-a003-20201215
i386 randconfig-a002-20201215
i386 randconfig-a006-20201215
i386 randconfig-a005-20201215
i386 randconfig-a014-20201215
i386 randconfig-a013-20201215
i386 randconfig-a012-20201215
i386 randconfig-a011-20201215
i386 randconfig-a015-20201215
i386 randconfig-a016-20201215
riscv nommu_virt_defconfig
riscv allnoconfig
riscv defconfig
riscv rv32_defconfig
riscv allmodconfig
x86_64 rhel
x86_64 allyesconfig
x86_64 rhel-7.6-kselftests
x86_64 defconfig
x86_64 rhel-8.3
x86_64 kexec
clang tested configs:
x86_64 randconfig-a016-20201215
x86_64 randconfig-a012-20201215
x86_64 randconfig-a013-20201215
x86_64 randconfig-a015-20201215
x86_64 randconfig-a014-20201215
x86_64 randconfig-a011-20201215
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [powerpc:next] BUILD SUCCESS c15d1f9d03a0f4f68bf52dffdd541c8054e6de35
From: kernel test robot @ 2020-12-16 1:13 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
branch HEAD: c15d1f9d03a0f4f68bf52dffdd541c8054e6de35 powerpc: Add config fragment for disabling -Werror
elapsed time: 724m
configs tested: 175
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
gcc tested configs:
arm defconfig
arm64 allyesconfig
arm64 defconfig
arm allyesconfig
arm allmodconfig
sh defconfig
ia64 generic_defconfig
arm ezx_defconfig
mips sb1250_swarm_defconfig
mips decstation_defconfig
arm64 alldefconfig
powerpc holly_defconfig
powerpc mpc837x_mds_defconfig
sh microdev_defconfig
sh se7712_defconfig
powerpc bamboo_defconfig
m68k m5275evb_defconfig
powerpc iss476-smp_defconfig
powerpc allnoconfig
arm efm32_defconfig
powerpc mpc885_ads_defconfig
powerpc mpc834x_itxgp_defconfig
arc tb10x_defconfig
powerpc ksi8560_defconfig
h8300 h8s-sim_defconfig
powerpc powernv_defconfig
arm assabet_defconfig
ia64 gensparse_defconfig
openrisc simple_smp_defconfig
powerpc mpc836x_mds_defconfig
arm vt8500_v6_v7_defconfig
riscv nommu_k210_defconfig
mips ar7_defconfig
powerpc ppc64_defconfig
arm ep93xx_defconfig
powerpc warp_defconfig
mips cu1830-neo_defconfig
powerpc ebony_defconfig
riscv alldefconfig
powerpc tqm8540_defconfig
c6x evmc6457_defconfig
powerpc fsp2_defconfig
h8300 h8300h-sim_defconfig
xtensa common_defconfig
arm shannon_defconfig
m68k hp300_defconfig
m68k apollo_defconfig
powerpc walnut_defconfig
arm footbridge_defconfig
arm cerfcube_defconfig
xtensa xip_kc705_defconfig
sh se7724_defconfig
arm lart_defconfig
ia64 bigsur_defconfig
um i386_defconfig
powerpc mpc85xx_cds_defconfig
arm clps711x_defconfig
powerpc ep8248e_defconfig
arm netwinder_defconfig
arm h5000_defconfig
powerpc kmeter1_defconfig
arm integrator_defconfig
h8300 edosk2674_defconfig
arm moxart_defconfig
arc defconfig
powerpc mpc8315_rdb_defconfig
mips tb0219_defconfig
powerpc adder875_defconfig
c6x evmc6678_defconfig
arm xcep_defconfig
arm multi_v7_defconfig
powerpc maple_defconfig
mips ip27_defconfig
mips bcm47xx_defconfig
arm davinci_all_defconfig
powerpc linkstation_defconfig
m68k mac_defconfig
powerpc64 alldefconfig
arm sunxi_defconfig
arm zeus_defconfig
mips tb0287_defconfig
powerpc sequoia_defconfig
mips decstation_64_defconfig
x86_64 allyesconfig
powerpc ppc64e_defconfig
arm colibri_pxa270_defconfig
arm mps2_defconfig
arm omap2plus_defconfig
powerpc mpc834x_itx_defconfig
sh sh7763rdp_defconfig
xtensa iss_defconfig
sh sh2007_defconfig
arm mainstone_defconfig
m68k atari_defconfig
m68k m5272c3_defconfig
arm neponset_defconfig
sh dreamcast_defconfig
parisc defconfig
s390 allyesconfig
m68k m5407c3_defconfig
sh j2_defconfig
parisc generic-32bit_defconfig
mips tb0226_defconfig
arm corgi_defconfig
parisc alldefconfig
mips pic32mzda_defconfig
mips xway_defconfig
arm mv78xx0_defconfig
powerpc mpc832x_mds_defconfig
arm u8500_defconfig
powerpc tqm8560_defconfig
ia64 allmodconfig
ia64 defconfig
ia64 allyesconfig
m68k allmodconfig
m68k defconfig
m68k allyesconfig
nios2 defconfig
arc allyesconfig
nds32 allnoconfig
c6x allyesconfig
nds32 defconfig
nios2 allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allyesconfig
sh allmodconfig
parisc allyesconfig
s390 defconfig
i386 allyesconfig
sparc allyesconfig
i386 tinyconfig
i386 defconfig
sparc defconfig
mips allyesconfig
mips allmodconfig
powerpc allyesconfig
powerpc allmodconfig
x86_64 randconfig-a003-20201215
x86_64 randconfig-a006-20201215
x86_64 randconfig-a002-20201215
x86_64 randconfig-a005-20201215
x86_64 randconfig-a004-20201215
x86_64 randconfig-a001-20201215
i386 randconfig-a001-20201215
i386 randconfig-a004-20201215
i386 randconfig-a003-20201215
i386 randconfig-a002-20201215
i386 randconfig-a006-20201215
i386 randconfig-a005-20201215
i386 randconfig-a014-20201215
i386 randconfig-a013-20201215
i386 randconfig-a012-20201215
i386 randconfig-a011-20201215
i386 randconfig-a015-20201215
i386 randconfig-a016-20201215
riscv allyesconfig
riscv nommu_virt_defconfig
riscv allnoconfig
riscv defconfig
riscv rv32_defconfig
riscv allmodconfig
x86_64 defconfig
x86_64 rhel-8.3
x86_64 rhel
x86_64 rhel-7.6-kselftests
x86_64 kexec
clang tested configs:
x86_64 randconfig-a016-20201215
x86_64 randconfig-a012-20201215
x86_64 randconfig-a013-20201215
x86_64 randconfig-a015-20201215
x86_64 randconfig-a014-20201215
x86_64 randconfig-a011-20201215
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* Re: [RFC PATCH] treewide: remove bzip2 compression support
From: Alex Xu (Hello71) @ 2020-12-15 23:39 UTC (permalink / raw)
To: linux-kernel, linux-kbuild, linux-arm-kernel, linux-aspeed,
linux-mips, openrisc, linux-parisc, linuxppc-dev, linux-riscv,
linux-s390, linux-sh, linux-xtensa
In-Reply-To: <20201215190315.8681-1-alex_y_xu@yahoo.ca>
Excerpts from Alex Xu (Hello71)'s message of December 15, 2020 2:03 pm:
> bzip2 is either slower or larger than every other supported algorithm,
> according to benchmarks at [0]. It is far slower to decompress than any
> other algorithm, and still larger than lzma, xz, and zstd.
>
> [0] https://lore.kernel.org/lkml/1588791882.08g1378g67.none@localhost/
>
> Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Upon further research, I found that bzip2 removal was already
implemented as part of zstd addition, but were apparently abandoned in
an effort to get zstd in. I will check those patches and try sending
those instead. Thanks to all reviewers for comments on this patch.
^ permalink raw reply
* Re: [PATCH] arch: fix 'unexpected IRQ trap at vector' warnings
From: Thomas Gleixner @ 2020-12-15 22:12 UTC (permalink / raw)
To: Enrico Weigelt, metux IT consult, Michael Ellerman,
Enrico Weigelt, metux IT consult, linux-kernel
Cc: linux-s390, hpa, linux-parisc, deller, x86, linux-um,
James.Bottomley, mingo, paulus, richard, bp, linuxppc-dev, jdike,
anton.ivanov
In-Reply-To: <33001e60-cbfc-f114-55bf-f347f21fee9b@metux.net>
On Tue, Dec 15 2020 at 21:12, Enrico Weigelt wrote:
> On 09.12.20 00:01, Thomas Gleixner wrote:
>> 3) It's invoked from __handle_domain_irq() when the 'hwirq' which is
>> handed in by the caller does not resolve to a mapped Linux
>> interrupt which is pretty much the same as the x86 situation above
>> in #1, but it prints useless data.
>>
>> It prints 'irq' which is invalid but it does not print the really
>> interesting 'hwirq' which was handed in by the caller and did
>> not resolve.
>
> I wouldn't say the irq-nr isn't interesting. In my particular case it
> was quite what I've been looking for. But you're right, hwirq should
> also be printed.
The number is _not_ interesting in this case. It's useless because the
function does:
irq = hwirq;
if (lookup)
irq = find_mapping(hwirq);
if (!irq || irq >= nr_irqs)
-> BAD
So irq is completely useless because find_mapping() returns 0 if there
is no mapping and if irq >= nr_irqs then there was no lookup and the
hwirq number is bogus.
In both cases the only interesting information is that hwirq does not
resolve to a valid Linux interrupt number and which hwirq number caused
that.
>> In this case the Linux irq number is uninteresting as it is known
>> to be invalid and simply is not mapped and therefore does not
>> exist.
>
> In my case it came in from generic_handle_irq(), and in this case this
> irq number (IMHO) has been valid, but nobody handled it, so it went to
> ack_bad_irq.
generic_handle_irq() _is_ a different function which is only invoked
when there is a valid Linux interrupt number and then the ack_bad_irq()
is invoked from a different place. See below.
> Of course, if this function is meant as a fallback to ack some not
> otherwise handled IRQ on the hw, the linux irq number indeed isn't quite
> helpful (unless we expect that code to do a lookup to the hw irq).
If there is no valid linux irq number then there is no lookup. And you
can't look it up from the hardware either.
If you look really then you find out that there is exactly _ONE_
architecture which does anything else than incrementing a counter and/or
printing stuff: X86, which has a big fat comment explaining why. The
only way to ack an interrupt on X86 is to issue EOI on the local APIC,
i.e. it does _not_ need any further information.
> ... rethinking this further ... shouldn't we also pass in even more data
> (eg. irq_desc, irqchip, ...), so this function can check which hw to
> actually talk to ?
There are 3 ways to get there:
1) via dummy chip which obviously has no hardware associated
2) via handle_bad_irq() which prints the info already
3) __handle_domain_irq() which cannot print anything and obviously
cannot figure out the hw to talk to because there is no irq
descriptor associated.
>> 4) It's invoked from the dummy irq chip which is installed for a
>> couple of truly virtual interrupts where the invocation of
>> dummy_irq_chip::irq_ack() is indicating wreckage.
>>
>> In that case the Linux irq number is the thing which is printed.
>>
>> So no. It's not just inconsistent it's in some places outright
>> wrong. What we really want is:
>>
>> ack_bad_irq(int hwirq, int virq)
>
> is 'int' correct here ?
This was just for illustration.
> BTW: I also wonder why the virq is unsigned int, while hwirq (eg. in
> struct irq_data) is unsigned long. shouldn't the virtual number space
> be at least as big (or even bigger) than the hw one ?
Only if there are no irqdomain mappings and the virq space is 1:1 mapped
to the hwirq space. Systems with > 4G interrupts are pretty unlikely.
Also hwirq can be completely artificial and encode information about
interrupts which are composed, i.e. PCI/MSI. See pci_msi_domain_calc_hwirq().
> {
>> if (hwirq >= 0)
>> print_useful_info(hwirq);
>> if (virq > 0)
>> print_useful_info(virq);
>> arch_try_to_ack(hwirq, virq);
>> }
>>
>> for this to make sense. Just fixing the existing printk() to be less
>> wrong is not really an improvement.
>
> Okay, makes sense.
>
> OTOH: since both callers (dummychip.c, handle.c) already dump out before
> ack_bad_irq(), do we need to print out anything at all ?
Not all callers print something, but yes this could do with some general
cleanup.
> I've also seen that many archs increase a counter (some use long, others
> atomic_t) - should we also consolidate this in an arch-independent way
> in handle.c (or does kstat_incr_irqs_this_cpu already do this) ?
kstat_incr_irqs_this_cpu(desc) operates on the irq descriptor which
requires that an irq descriptor exists in the first place.
The error counter is independent of that, but yes there is room for
consolidation.
Thanks,
tglx
^ permalink raw reply
* Re: [RFC PATCH] treewide: remove bzip2 compression support
From: Michal Suchánek @ 2020-12-15 21:51 UTC (permalink / raw)
To: Alex Xu (Hello71)
Cc: linux-s390, linux-parisc, linux-aspeed, linux-kbuild, torvalds,
linux-xtensa, linux-sh, linux-mips, linux-kernel, openrisc,
linux-riscv, linuxppc-dev, linux-arm-kernel
In-Reply-To: <20201215190315.8681-1-alex_y_xu@yahoo.ca>
Hello,
On Tue, Dec 15, 2020 at 02:03:15PM -0500, Alex Xu (Hello71) wrote:
> bzip2 is either slower or larger than every other supported algorithm,
> according to benchmarks at [0]. It is far slower to decompress than any
> other algorithm, and still larger than lzma, xz, and zstd.
>
> [0] https://lore.kernel.org/lkml/1588791882.08g1378g67.none@localhost/
Sounds cool. I wonder how many people will complain that their
distribution migrated to bzip2 but got stuck there and now new kernels
won't work on there with some odd tool or another :p
> @@ -212,11 +209,6 @@ choice
> Compression speed is only relevant when building a kernel.
> Decompression speed is relevant at each boot.
>
> - If you have any problems with bzip2 or lzma compressed
> - kernels, mail me (Alain Knaff) <alain@knaff.lu>. (An older
> - version of this functionality (bzip2 only), for 2.4, was
> - supplied by Christian Ludwig)
> -
Shouldn't the LZMA part be preserved here?
Thanks
Michal
^ permalink raw reply
* Re: [PATCH] arch: fix 'unexpected IRQ trap at vector' warnings
From: Enrico Weigelt, metux IT consult @ 2020-12-15 20:12 UTC (permalink / raw)
To: Thomas Gleixner, Michael Ellerman,
Enrico Weigelt, metux IT consult, linux-kernel
Cc: linux-s390, hpa, linux-parisc, deller, x86, linux-um,
James.Bottomley, mingo, paulus, richard, bp, linuxppc-dev, jdike,
anton.ivanov
In-Reply-To: <87y2i7298s.fsf@nanos.tec.linutronix.de>
On 09.12.20 00:01, Thomas Gleixner wrote:
> There are a few situations why it is invoked or not:
>
> 1) The original x86 usage is not longer using it because it complains
> rightfully about a vector being raised which has no interrupt
> descriptor associated to it. So the original reason for naming it
> vector is gone long ago. It emits:
>
> pr_emerg_ratelimited("%s: %d.%u No irq handler for vector\n",
> __func__, smp_processor_id(), vector);
>
> Directly from the x86 C entry point without ever invoking that
> function. Pretty popular error message due to some AMD BIOS
> wreckage. :)
Of course, the term "vector" should be replaced by something like
"irqnr" or "virq", but I didn't have name changes within scope - just
wanted to fix the printing of that number, as i've stupled over it while
working on something different and wondered why the number differed from
what I had expected, until I seen that it prints hex instead of decimal.
But if you prefer a more complete cleanup, I'll be happy to do it.
> 3) It's invoked from __handle_domain_irq() when the 'hwirq' which is
> handed in by the caller does not resolve to a mapped Linux
> interrupt which is pretty much the same as the x86 situation above
> in #1, but it prints useless data.
>
> It prints 'irq' which is invalid but it does not print the really
> interesting 'hwirq' which was handed in by the caller and did
> not resolve.
I wouldn't say the irq-nr isn't interesting. In my particular case it
was quite what I've been looking for. But you're right, hwirq should
also be printed.
> In this case the Linux irq number is uninteresting as it is known
> to be invalid and simply is not mapped and therefore does not
> exist.
In my case it came in from generic_handle_irq(), and in this case this
irq number (IMHO) has been valid, but nobody handled it, so it went to
ack_bad_irq.
Of course, if this function is meant as a fallback to ack some not
otherwise handled IRQ on the hw, the linux irq number indeed isn't quite
helpful (unless we expect that code to do a lookup to the hw irq).
... rethinking this further ... shouldn't we also pass in even more data
(eg. irq_desc, irqchip, ...), so this function can check which hw to
actually talk to ?
> 4) It's invoked from the dummy irq chip which is installed for a
> couple of truly virtual interrupts where the invocation of
> dummy_irq_chip::irq_ack() is indicating wreckage.
>
> In that case the Linux irq number is the thing which is printed.
>
> So no. It's not just inconsistent it's in some places outright
> wrong. What we really want is:
>
> ack_bad_irq(int hwirq, int virq)
is 'int' correct here ?
BTW: I also wonder why the virq is unsigned int, while hwirq (eg. in
struct irq_data) is unsigned long. shouldn't the virtual number space
be at least as big (or even bigger) than the hw one ?
{
> if (hwirq >= 0)
> print_useful_info(hwirq);
> if (virq > 0)
> print_useful_info(virq);
> arch_try_to_ack(hwirq, virq);
> }
>
> for this to make sense. Just fixing the existing printk() to be less
> wrong is not really an improvement.
Okay, makes sense.
OTOH: since both callers (dummychip.c, handle.c) already dump out before
ack_bad_irq(), do we need to print out anything at all ?
I've also seen that many archs increase a counter (some use long, others
atomic_t) - should we also consolidate this in an arch-independent way
in handle.c (or does kstat_incr_irqs_this_cpu already do this) ?
--mtx
--
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287
^ permalink raw reply
* [RFC PATCH] treewide: remove bzip2 compression support
From: Alex Xu (Hello71) @ 2020-12-15 19:03 UTC (permalink / raw)
To: linux-kernel, linux-kbuild, linux-arm-kernel, linux-aspeed,
linux-mips, openrisc, linux-parisc, linuxppc-dev, linux-riscv,
linux-s390, linux-sh, linux-xtensa
Cc: torvalds, Alex Xu (Hello71)
In-Reply-To: <20201215190315.8681-1-alex_y_xu.ref@yahoo.ca>
bzip2 is either slower or larger than every other supported algorithm,
according to benchmarks at [0]. It is far slower to decompress than any
other algorithm, and still larger than lzma, xz, and zstd.
[0] https://lore.kernel.org/lkml/1588791882.08g1378g67.none@localhost/
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
---
Documentation/x86/boot.rst | 8 +-
arch/arm/configs/aspeed_g4_defconfig | 1 -
arch/arm/configs/aspeed_g5_defconfig | 1 -
arch/arm/configs/ezx_defconfig | 1 -
arch/arm/configs/imote2_defconfig | 1 -
arch/arm/configs/lpc18xx_defconfig | 1 -
arch/arm/configs/vf610m4_defconfig | 1 -
arch/arm64/boot/Makefile | 5 +-
arch/mips/Kconfig | 1 -
arch/mips/Makefile | 3 -
arch/mips/boot/Makefile | 14 -
arch/mips/boot/compressed/Makefile | 1 -
arch/mips/boot/compressed/decompress.c | 4 -
arch/mips/configs/ath25_defconfig | 1 -
arch/mips/configs/pistachio_defconfig | 1 -
arch/openrisc/configs/simple_smp_defconfig | 1 -
arch/parisc/Kconfig | 1 -
arch/parisc/boot/compressed/Makefile | 5 +-
arch/parisc/boot/compressed/misc.c | 4 -
arch/powerpc/configs/skiroot_defconfig | 1 -
arch/riscv/boot/Makefile | 3 -
arch/riscv/configs/nommu_k210_defconfig | 1 -
arch/riscv/configs/nommu_virt_defconfig | 1 -
arch/s390/Kconfig | 1 -
arch/s390/boot/compressed/Makefile | 5 +-
arch/s390/boot/compressed/decompressor.c | 8 -
arch/sh/Kconfig | 1 -
arch/sh/Makefile | 3 +-
arch/sh/boot/Makefile | 11 +-
arch/sh/boot/compressed/Makefile | 5 +-
arch/sh/boot/compressed/misc.c | 8 -
arch/sh/configs/sdk7786_defconfig | 1 -
arch/x86/Kconfig | 1 -
arch/x86/boot/compressed/Makefile | 9 +-
arch/x86/boot/compressed/misc.c | 4 -
arch/x86/include/asm/boot.h | 4 +-
arch/xtensa/configs/cadence_csp_defconfig | 1 -
arch/xtensa/configs/nommu_kc705_defconfig | 1 -
include/linux/decompress/bunzip2.h | 11 -
init/Kconfig | 22 +-
init/do_mounts_rd.c | 1 -
kernel/configs/tiny.config | 1 -
lib/Kconfig | 3 -
lib/Makefile | 1 -
lib/decompress.c | 5 -
lib/decompress_bunzip2.c | 756 ---------------------
scripts/Makefile.lib | 8 +-
scripts/Makefile.package | 1 -
scripts/package/buildtar | 2 +-
usr/Kconfig | 26 +-
usr/Makefile | 3 +-
51 files changed, 22 insertions(+), 942 deletions(-)
delete mode 100644 include/linux/decompress/bunzip2.h
delete mode 100644 lib/decompress_bunzip2.c
diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst
index abb9fc164657..741eebc10140 100644
--- a/Documentation/x86/boot.rst
+++ b/Documentation/x86/boot.rst
@@ -781,10 +781,10 @@ Protocol: 2.08+
The payload may be compressed. The format of both the compressed and
uncompressed data should be determined using the standard magic
numbers. The currently supported compression formats are gzip
- (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA
- (magic number 5D 00), XZ (magic number FD 37), LZ4 (magic number
- 02 21) and ZSTD (magic number 28 B5). The uncompressed payload is
- currently always ELF (magic number 7F 45 4C 46).
+ (magic numbers 1F 8B or 1F 9E), LZMA (magic number 5D 00), XZ (magic
+ number FD 37), LZ4 (magic number 02 21) and ZSTD (magic number 28 B5).
+ Formerly supported was bzip2 (magic number 42 5A). The uncompressed
+ payload is currently always ELF (magic number 7F 45 4C 46).
============ ==============
Field name: payload_length
diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig
index 58d293b63581..f2f5dcd0e59c 100644
--- a/arch/arm/configs/aspeed_g4_defconfig
+++ b/arch/arm/configs/aspeed_g4_defconfig
@@ -8,7 +8,6 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_CGROUPS=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
# CONFIG_UID16 is not set
diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/aspeed_g5_defconfig
index 047975eccefb..5d045b2902d6 100644
--- a/arch/arm/configs/aspeed_g5_defconfig
+++ b/arch/arm/configs/aspeed_g5_defconfig
@@ -8,7 +8,6 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_CGROUPS=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
# CONFIG_UID16 is not set
diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
index 81665b7abf83..422592786e01 100644
--- a/arch/arm/configs/ezx_defconfig
+++ b/arch/arm/configs/ezx_defconfig
@@ -4,7 +4,6 @@ CONFIG_SYSVIPC=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_BLK_DEV_INITRD=y
-CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_EXPERT=y
# CONFIG_COMPAT_BRK is not set
diff --git a/arch/arm/configs/imote2_defconfig b/arch/arm/configs/imote2_defconfig
index ae15a2a33802..04e23ec01af6 100644
--- a/arch/arm/configs/imote2_defconfig
+++ b/arch/arm/configs/imote2_defconfig
@@ -3,7 +3,6 @@ CONFIG_SYSVIPC=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_BLK_DEV_INITRD=y
-CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_EXPERT=y
# CONFIG_COMPAT_BRK is not set
diff --git a/arch/arm/configs/lpc18xx_defconfig b/arch/arm/configs/lpc18xx_defconfig
index be882ea0eee4..12e69dfa18dc 100644
--- a/arch/arm/configs/lpc18xx_defconfig
+++ b/arch/arm/configs/lpc18xx_defconfig
@@ -1,7 +1,6 @@
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
diff --git a/arch/arm/configs/vf610m4_defconfig b/arch/arm/configs/vf610m4_defconfig
index a89f035c3b01..02c7acc7cd09 100644
--- a/arch/arm/configs/vf610m4_defconfig
+++ b/arch/arm/configs/vf610m4_defconfig
@@ -1,6 +1,5 @@
CONFIG_NAMESPACES=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZ4 is not set
diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
index cd3414898d10..d3207561c078 100644
--- a/arch/arm64/boot/Makefile
+++ b/arch/arm64/boot/Makefile
@@ -16,14 +16,11 @@
OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
-targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo
+targets := Image Image.gz Image.lz4 Image.lzma Image.lzo
$(obj)/Image: vmlinux FORCE
$(call if_changed,objcopy)
-$(obj)/Image.bz2: $(obj)/Image FORCE
- $(call if_changed,bzip2)
-
$(obj)/Image.gz: $(obj)/Image FORCE
$(call if_changed,gzip)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 6b762bebff33..d25d900294bb 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1880,7 +1880,6 @@ endif # CPU_LOONGSON2F
config SYS_SUPPORTS_ZBOOT
bool
select HAVE_KERNEL_GZIP
- select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA
select HAVE_KERNEL_LZO
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 0d0f29d662c9..2dd53daf6fbb 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -328,14 +328,12 @@ boot-y += vmlinux.srec
ifeq ($(shell expr $(load-y) \< 0xffffffff80000000 2> /dev/null), 0)
boot-y += uImage
boot-y += uImage.bin
-boot-y += uImage.bz2
boot-y += uImage.gz
boot-y += uImage.lzma
boot-y += uImage.lzo
endif
boot-y += vmlinux.itb
boot-y += vmlinux.gz.itb
-boot-y += vmlinux.bz2.itb
boot-y += vmlinux.lzma.itb
boot-y += vmlinux.lzo.itb
@@ -429,7 +427,6 @@ define archhelp
echo ' vmlinuz.srec - SREC zboot image'
echo ' uImage - U-Boot image'
echo ' uImage.bin - U-Boot image (uncompressed)'
- echo ' uImage.bz2 - U-Boot image (bz2)'
echo ' uImage.gz - U-Boot image (gzip)'
echo ' uImage.lzma - U-Boot image (lzma)'
echo ' uImage.lzo - U-Boot image (lzo)'
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index a3da2c5d63c2..78f70e3576cd 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -24,7 +24,6 @@ strip-flags := $(addprefix --remove-section=,$(drop-sections))
hostprogs := elf2ecoff
suffix-y := bin
-suffix-$(CONFIG_KERNEL_BZIP2) := bz2
suffix-$(CONFIG_KERNEL_GZIP) := gz
suffix-$(CONFIG_KERNEL_LZMA) := lzma
suffix-$(CONFIG_KERNEL_LZO) := lzo
@@ -54,14 +53,10 @@ UIMAGE_ENTRYADDR = $(VMLINUX_ENTRY_ADDRESS)
# Compressed vmlinux images
#
-extra-y += vmlinux.bin.bz2
extra-y += vmlinux.bin.gz
extra-y += vmlinux.bin.lzma
extra-y += vmlinux.bin.lzo
-$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
- $(call if_changed,bzip2)
-
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
@@ -77,7 +72,6 @@ $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
targets += uImage
targets += uImage.bin
-targets += uImage.bz2
targets += uImage.gz
targets += uImage.lzma
targets += uImage.lzo
@@ -85,9 +79,6 @@ targets += uImage.lzo
$(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
$(call if_changed,uimage,none)
-$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE
- $(call if_changed,uimage,bzip2)
-
$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,uimage,gzip)
@@ -122,7 +113,6 @@ $(obj)/vmlinux.its.S: $(addprefix $(srctree)/arch/mips/$(PLATFORM)/,$(ITS_INPUTS
targets += vmlinux.its
targets += vmlinux.gz.its
-targets += vmlinux.bz2.its
targets += vmlinux.lzma.its
targets += vmlinux.lzo.its
@@ -142,9 +132,6 @@ $(obj)/vmlinux.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE
$(obj)/vmlinux.gz.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE
$(call if_changed,cpp_its_S,gzip,vmlinux.bin.gz)
-$(obj)/vmlinux.bz2.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE
- $(call if_changed,cpp_its_S,bzip2,vmlinux.bin.bz2)
-
$(obj)/vmlinux.lzma.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE
$(call if_changed,cpp_its_S,lzma,vmlinux.bin.lzma)
@@ -153,7 +140,6 @@ $(obj)/vmlinux.lzo.its: $(obj)/vmlinux.its.S $(VMLINUX) FORCE
targets += vmlinux.itb
targets += vmlinux.gz.itb
-targets += vmlinux.bz2.itb
targets += vmlinux.lzma.itb
targets += vmlinux.lzo.itb
diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index d66511825fe1..8fbd72b466e6 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -70,7 +70,6 @@ $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE
$(call if_changed,objcopy)
tool_$(CONFIG_KERNEL_GZIP) = gzip
-tool_$(CONFIG_KERNEL_BZIP2) = bzip2
tool_$(CONFIG_KERNEL_LZ4) = lz4
tool_$(CONFIG_KERNEL_LZMA) = lzma
tool_$(CONFIG_KERNEL_LZO) = lzo
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index c61c641674e6..ac7ccab2bb52 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -52,10 +52,6 @@ void error(char *x)
#include "../../../../lib/decompress_inflate.c"
#endif
-#ifdef CONFIG_KERNEL_BZIP2
-#include "../../../../lib/decompress_bunzip2.c"
-#endif
-
#ifdef CONFIG_KERNEL_LZ4
#include "../../../../lib/decompress_unlz4.c"
#endif
diff --git a/arch/mips/configs/ath25_defconfig b/arch/mips/configs/ath25_defconfig
index 7143441f5476..1e12d3018c15 100644
--- a/arch/mips/configs/ath25_defconfig
+++ b/arch/mips/configs/ath25_defconfig
@@ -4,7 +4,6 @@ CONFIG_SYSVIPC=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_GZIP is not set
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
diff --git a/arch/mips/configs/pistachio_defconfig b/arch/mips/configs/pistachio_defconfig
index b9adf15ebbec..ad31439400c6 100644
--- a/arch/mips/configs/pistachio_defconfig
+++ b/arch/mips/configs/pistachio_defconfig
@@ -14,7 +14,6 @@ CONFIG_CGROUP_FREEZER=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
diff --git a/arch/openrisc/configs/simple_smp_defconfig b/arch/openrisc/configs/simple_smp_defconfig
index ff49d868e040..74a5fe83aa17 100644
--- a/arch/openrisc/configs/simple_smp_defconfig
+++ b/arch/openrisc/configs/simple_smp_defconfig
@@ -3,7 +3,6 @@ CONFIG_NO_HZ=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_GZIP is not set
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index b234e8154cbd..4eee43c1e7d9 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -22,7 +22,6 @@ config PARISC
select BUILDTIME_TABLE_SORT
select HAVE_PCI
select HAVE_PERF_EVENTS
- select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA
diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compressed/Makefile
index dff453687530..2c9403ebb96a 100644
--- a/arch/parisc/boot/compressed/Makefile
+++ b/arch/parisc/boot/compressed/Makefile
@@ -9,7 +9,7 @@ KCOV_INSTRUMENT := n
GCOV_PROFILE := n
UBSAN_SANITIZE := n
-targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
+targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz
targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
targets += misc.o piggy.o sizes.h head.o real2.o firmware.o
targets += real2.S firmware.c
@@ -64,7 +64,6 @@ $(obj)/vmlinux.bin: vmlinux FORCE
vmlinux.bin.all-y := $(obj)/vmlinux.bin
suffix-$(CONFIG_KERNEL_GZIP) := gz
-suffix-$(CONFIG_KERNEL_BZIP2) := bz2
suffix-$(CONFIG_KERNEL_LZ4) := lz4
suffix-$(CONFIG_KERNEL_LZMA) := lzma
suffix-$(CONFIG_KERNEL_LZO) := lzo
@@ -72,8 +71,6 @@ suffix-$(CONFIG_KERNEL_XZ) := xz
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
$(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
- $(call if_changed,bzip2)
$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
$(call if_changed,lz4)
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
diff --git a/arch/parisc/boot/compressed/misc.c b/arch/parisc/boot/compressed/misc.c
index 2d395998f524..247a0b138cb1 100644
--- a/arch/parisc/boot/compressed/misc.c
+++ b/arch/parisc/boot/compressed/misc.c
@@ -42,10 +42,6 @@ static unsigned long free_mem_end_ptr;
#include "../../../../lib/decompress_inflate.c"
#endif
-#ifdef CONFIG_KERNEL_BZIP2
-#include "../../../../lib/decompress_bunzip2.c"
-#endif
-
#ifdef CONFIG_KERNEL_LZ4
#include "../../../../lib/decompress_unlz4.c"
#endif
diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig
index b806a5d3a695..28139c0294e9 100644
--- a/arch/powerpc/configs/skiroot_defconfig
+++ b/arch/powerpc/configs/skiroot_defconfig
@@ -11,7 +11,6 @@ CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=20
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_GZIP is not set
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
diff --git a/arch/riscv/boot/Makefile b/arch/riscv/boot/Makefile
index c59fca695f9d..944ea5165225 100644
--- a/arch/riscv/boot/Makefile
+++ b/arch/riscv/boot/Makefile
@@ -31,9 +31,6 @@ $(obj)/loader.o: $(src)/loader.S $(obj)/Image
$(obj)/loader: $(obj)/loader.o $(obj)/Image $(obj)/loader.lds FORCE
$(Q)$(LD) -T $(obj)/loader.lds -o $@ $(obj)/loader.o
-$(obj)/Image.bz2: $(obj)/Image FORCE
- $(call if_changed,bzip2)
-
$(obj)/Image.lz4: $(obj)/Image FORCE
$(call if_changed,lz4)
diff --git a/arch/riscv/configs/nommu_k210_defconfig b/arch/riscv/configs/nommu_k210_defconfig
index cd1df62b13c7..a71b615fa1b1 100644
--- a/arch/riscv/configs/nommu_k210_defconfig
+++ b/arch/riscv/configs/nommu_k210_defconfig
@@ -3,7 +3,6 @@ CONFIG_LOG_BUF_SHIFT=15
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=12
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_FORCE=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
diff --git a/arch/riscv/configs/nommu_virt_defconfig b/arch/riscv/configs/nommu_virt_defconfig
index e046a0babde4..fb72b5d6c0ec 100644
--- a/arch/riscv/configs/nommu_virt_defconfig
+++ b/arch/riscv/configs/nommu_virt_defconfig
@@ -2,7 +2,6 @@
CONFIG_LOG_BUF_SHIFT=16
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=12
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index a60cc523d810..4bdfe1d64836 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -153,7 +153,6 @@ config S390
select HAVE_FUTEX_CMPXCHG if FUTEX
select HAVE_GCC_PLUGINS
select HAVE_GENERIC_VDSO
- select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA
diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
index de18dab518bb..db11dc6264aa 100644
--- a/arch/s390/boot/compressed/Makefile
+++ b/arch/s390/boot/compressed/Makefile
@@ -12,7 +12,7 @@ KASAN_SANITIZE := n
obj-y := $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) info.o
obj-all := $(obj-y) piggy.o syms.o
-targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
+targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz
targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
targets += info.bin syms.bin vmlinux.syms $(obj-all)
@@ -58,7 +58,6 @@ $(obj)/vmlinux.bin: vmlinux FORCE
vmlinux.bin.all-y := $(obj)/vmlinux.bin
suffix-$(CONFIG_KERNEL_GZIP) := .gz
-suffix-$(CONFIG_KERNEL_BZIP2) := .bz2
suffix-$(CONFIG_KERNEL_LZ4) := .lz4
suffix-$(CONFIG_KERNEL_LZMA) := .lzma
suffix-$(CONFIG_KERNEL_LZO) := .lzo
@@ -66,8 +65,6 @@ suffix-$(CONFIG_KERNEL_XZ) := .xz
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
$(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
- $(call if_changed,bzip2)
$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
$(call if_changed,lz4)
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
diff --git a/arch/s390/boot/compressed/decompressor.c b/arch/s390/boot/compressed/decompressor.c
index 3061b11c4d27..87395950cc69 100644
--- a/arch/s390/boot/compressed/decompressor.c
+++ b/arch/s390/boot/compressed/decompressor.c
@@ -28,11 +28,7 @@ extern char _end[];
extern unsigned char _compressed_start[];
extern unsigned char _compressed_end[];
-#ifdef CONFIG_HAVE_KERNEL_BZIP2
-#define BOOT_HEAP_SIZE 0x400000
-#else
#define BOOT_HEAP_SIZE 0x10000
-#endif
static unsigned long free_mem_ptr = (unsigned long) _end;
static unsigned long free_mem_end_ptr = (unsigned long) _end + BOOT_HEAP_SIZE;
@@ -41,10 +37,6 @@ static unsigned long free_mem_end_ptr = (unsigned long) _end + BOOT_HEAP_SIZE;
#include "../../../../lib/decompress_inflate.c"
#endif
-#ifdef CONFIG_KERNEL_BZIP2
-#include "../../../../lib/decompress_bunzip2.c"
-#endif
-
#ifdef CONFIG_KERNEL_LZ4
#include "../../../../lib/decompress_unlz4.c"
#endif
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 159da4ed578f..df4113457afd 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -42,7 +42,6 @@ config SUPERH
select HAVE_HW_BREAKPOINT
select HAVE_IDE if HAS_IOPORT_MAP
select HAVE_IOREMAP_PROT if MMU && !X2TLB
- select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZMA
select HAVE_KERNEL_LZO
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 2faebfd72eca..6fdaa8d2d835 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -189,7 +189,7 @@ endif
libs-y := arch/sh/lib/ $(libs-y)
-BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \
+BOOT_TARGETS = uImage uImage.gz uImage.lzma uImage.xz uImage.lzo \
uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
romImage
PHONY += $(BOOT_TARGETS)
@@ -220,7 +220,6 @@ define archhelp
@echo ' uImage.srec - Create an S-record for U-Boot'
@echo ' uImage.bin - Kernel-only image for U-Boot (bin)'
@echo '* uImage.gz - Kernel-only image for U-Boot (gzip)'
- @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)'
@echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)'
@echo ' uImage.xz - Kernel-only image for U-Boot (xz)'
@echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)'
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
index 58592dfa5cb6..8f742b8285a5 100644
--- a/arch/sh/boot/Makefile
+++ b/arch/sh/boot/Makefile
@@ -21,14 +21,13 @@ CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
suffix-y := bin
suffix-$(CONFIG_KERNEL_GZIP) := gz
-suffix-$(CONFIG_KERNEL_BZIP2) := bz2
suffix-$(CONFIG_KERNEL_LZMA) := lzma
suffix-$(CONFIG_KERNEL_XZ) := xz
suffix-$(CONFIG_KERNEL_LZO) := lzo
targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
- uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
-extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
+ uImage.lzma uImage.xz uImage.lzo uImage.bin
+extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.lzma \
vmlinux.bin.xz vmlinux.bin.lzo
subdir- := compressed romimage
@@ -68,9 +67,6 @@ $(obj)/vmlinux.bin: vmlinux FORCE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
- $(call if_changed,bzip2)
-
$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
$(call if_changed,lzma)
@@ -80,9 +76,6 @@ $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
$(call if_changed,lzo)
-$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
- $(call if_changed,uimage,bzip2)
-
$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
$(call if_changed,uimage,gzip)
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
index 589d2d8a573d..641b16826383 100644
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -6,8 +6,7 @@
#
targets := vmlinux vmlinux.bin vmlinux.bin.gz \
- vmlinux.bin.bz2 vmlinux.bin.lzma \
- vmlinux.bin.xz vmlinux.bin.lzo \
+ vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo \
head_32.o misc.o piggy.o
OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o
@@ -57,8 +56,6 @@ vmlinux.bin.all-y := $(obj)/vmlinux.bin
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
$(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
- $(call if_changed,bzip2)
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
$(call if_changed,lzma)
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c
index a03b6680a9d9..bf0d4446f7a6 100644
--- a/arch/sh/boot/compressed/misc.c
+++ b/arch/sh/boot/compressed/misc.c
@@ -44,20 +44,12 @@ extern int _end;
static unsigned long free_mem_ptr;
static unsigned long free_mem_end_ptr;
-#ifdef CONFIG_HAVE_KERNEL_BZIP2
-#define HEAP_SIZE 0x400000
-#else
#define HEAP_SIZE 0x10000
-#endif
#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
#endif
-#ifdef CONFIG_KERNEL_BZIP2
-#include "../../../../lib/decompress_bunzip2.c"
-#endif
-
#ifdef CONFIG_KERNEL_LZMA
#include "../../../../lib/decompress_unlzma.c"
#endif
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
index 61bec46ebd66..486e8762cc44 100644
--- a/arch/sh/configs/sdk7786_defconfig
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -29,7 +29,6 @@ CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_BLK_DEV_INITRD=y
-CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_LZO=y
# CONFIG_COMPAT_BRK is not set
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index eeb87fce9c6f..177a84c2f822 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -186,7 +186,6 @@ config X86
select HAVE_IDE
select HAVE_IOREMAP_PROT
select HAVE_IRQ_TIME_ACCOUNTING
- select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZ4
select HAVE_KERNEL_LZMA
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 40b8fd375d52..868c61b6d692 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -7,13 +7,13 @@
# vmlinuz is:
# decompression code (*.o)
# asm globals (piggy.S), including:
-# vmlinux.bin.(gz|bz2|lzma|...)
+# vmlinux.bin.(gz|lzma|...)
#
# vmlinux.bin is:
# vmlinux stripped of debugging and comments
# vmlinux.bin.all is:
# vmlinux.bin + vmlinux.relocs
-# vmlinux.bin.(gz|bz2|lzma|...) is:
+# vmlinux.bin.(gz|lzma|...) is:
# (see scripts/Makefile.lib size_append)
# compressed vmlinux.bin.all + u32 size of vmlinux.bin.all
@@ -25,7 +25,7 @@ OBJECT_FILES_NON_STANDARD := y
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
KCOV_INSTRUMENT := n
-targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
+targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.lzma \
vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 vmlinux.bin.zst
KBUILD_CFLAGS := -m$(BITS) -O2
@@ -120,8 +120,6 @@ vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
$(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
- $(call if_changed,bzip2)
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
$(call if_changed,lzma)
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
@@ -134,7 +132,6 @@ $(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE
$(call if_changed,zstd22)
suffix-$(CONFIG_KERNEL_GZIP) := gz
-suffix-$(CONFIG_KERNEL_BZIP2) := bz2
suffix-$(CONFIG_KERNEL_LZMA) := lzma
suffix-$(CONFIG_KERNEL_XZ) := xz
suffix-$(CONFIG_KERNEL_LZO) := lzo
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 267e7f93050e..b8ef48b240cd 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -55,10 +55,6 @@ static int lines, cols;
#include "../../../../lib/decompress_inflate.c"
#endif
-#ifdef CONFIG_KERNEL_BZIP2
-#include "../../../../lib/decompress_bunzip2.c"
-#endif
-
#ifdef CONFIG_KERNEL_LZMA
#include "../../../../lib/decompress_unlzma.c"
#endif
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
index 9191280d9ea3..460243445b13 100644
--- a/arch/x86/include/asm/boot.h
+++ b/arch/x86/include/asm/boot.h
@@ -24,9 +24,7 @@
# error "Invalid value for CONFIG_PHYSICAL_ALIGN"
#endif
-#if defined(CONFIG_KERNEL_BZIP2)
-# define BOOT_HEAP_SIZE 0x400000
-#elif defined(CONFIG_KERNEL_ZSTD)
+#if defined(CONFIG_KERNEL_ZSTD)
/*
* Zstd needs to allocate the ZSTD_DCtx in order to decompress the kernel.
* The ZSTD_DCtx is ~160KB, so set the heap size to 192KB because it is a
diff --git a/arch/xtensa/configs/cadence_csp_defconfig b/arch/xtensa/configs/cadence_csp_defconfig
index fc240737b14d..fb069d8a7c83 100644
--- a/arch/xtensa/configs/cadence_csp_defconfig
+++ b/arch/xtensa/configs/cadence_csp_defconfig
@@ -15,7 +15,6 @@ CONFIG_SCHED_AUTOGROUP=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="$$KERNEL_INITRAMFS_SOURCE"
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
diff --git a/arch/xtensa/configs/nommu_kc705_defconfig b/arch/xtensa/configs/nommu_kc705_defconfig
index 88b2e222d4bf..b78b404f4f8f 100644
--- a/arch/xtensa/configs/nommu_kc705_defconfig
+++ b/arch/xtensa/configs/nommu_kc705_defconfig
@@ -15,7 +15,6 @@ CONFIG_NAMESPACES=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
diff --git a/include/linux/decompress/bunzip2.h b/include/linux/decompress/bunzip2.h
deleted file mode 100644
index 5860163942a4..000000000000
--- a/include/linux/decompress/bunzip2.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef DECOMPRESS_BUNZIP2_H
-#define DECOMPRESS_BUNZIP2_H
-
-int bunzip2(unsigned char *inbuf, long len,
- long (*fill)(void*, unsigned long),
- long (*flush)(void*, unsigned long),
- unsigned char *output,
- long *pos,
- void(*error)(char *x));
-#endif
diff --git a/init/Kconfig b/init/Kconfig
index b77c60f8b963..fdb50763ec50 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -180,9 +180,6 @@ config BUILD_SALT
config HAVE_KERNEL_GZIP
bool
-config HAVE_KERNEL_BZIP2
- bool
-
config HAVE_KERNEL_LZMA
bool
@@ -204,7 +201,7 @@ config HAVE_KERNEL_UNCOMPRESSED
choice
prompt "Kernel compression mode"
default KERNEL_GZIP
- depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_ZSTD || HAVE_KERNEL_UNCOMPRESSED
+ depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_ZSTD || HAVE_KERNEL_UNCOMPRESSED
help
The linux kernel is a kind of self-extracting executable.
Several compression algorithms are available, which differ
@@ -212,11 +209,6 @@ choice
Compression speed is only relevant when building a kernel.
Decompression speed is relevant at each boot.
- If you have any problems with bzip2 or lzma compressed
- kernels, mail me (Alain Knaff) <alain@knaff.lu>. (An older
- version of this functionality (bzip2 only), for 2.4, was
- supplied by Christian Ludwig)
-
High compression options are mostly useful for users, who
are low on disk space (embedded systems), but for whom ram
size matters less.
@@ -230,22 +222,12 @@ config KERNEL_GZIP
The old and tried gzip compression. It provides a good balance
between compression ratio and decompression speed.
-config KERNEL_BZIP2
- bool "Bzip2"
- depends on HAVE_KERNEL_BZIP2
- help
- Its compression ratio and speed is intermediate.
- Decompression speed is slowest among the choices. The kernel
- size is about 10% smaller with bzip2, in comparison to gzip.
- Bzip2 uses a large amount of memory. For modern kernels you
- will need at least 8MB RAM or more for booting.
-
config KERNEL_LZMA
bool "LZMA"
depends on HAVE_KERNEL_LZMA
help
This compression algorithm's ratio is best. Decompression speed
- is between gzip and bzip2. Compression is slowest.
+ is similar to XZ. Compression is slowest.
The kernel size is about 33% smaller with LZMA in comparison to gzip.
config KERNEL_XZ
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index ac021ae6e6fa..5b7114743c9a 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -48,7 +48,6 @@ static int __init crd_load(decompress_fn deco);
* cramfs
* squashfs
* gzip
- * bzip2
* lzma
* xz
* lzo
diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config
index 8a44b93da0f3..2ca3fb830ca7 100644
--- a/kernel/configs/tiny.config
+++ b/kernel/configs/tiny.config
@@ -1,7 +1,6 @@
# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_KERNEL_GZIP is not set
-# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
CONFIG_KERNEL_XZ=y
# CONFIG_KERNEL_LZO is not set
diff --git a/lib/Kconfig b/lib/Kconfig
index b46a9fd122c8..1d33e5e70f0e 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -324,9 +324,6 @@ config DECOMPRESS_GZIP
select ZLIB_INFLATE
tristate
-config DECOMPRESS_BZIP2
- tristate
-
config DECOMPRESS_LZMA
tristate
diff --git a/lib/Makefile b/lib/Makefile
index d415fc7067c5..c50f3f0111c2 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -193,7 +193,6 @@ obj-$(CONFIG_XZ_DEC) += xz/
obj-$(CONFIG_RAID6_PQ) += raid6/
lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
-lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o
lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o
lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
diff --git a/lib/decompress.c b/lib/decompress.c
index ab3fc90ffc64..7e272d7fd27a 100644
--- a/lib/decompress.c
+++ b/lib/decompress.c
@@ -7,7 +7,6 @@
#include <linux/decompress/generic.h>
-#include <linux/decompress/bunzip2.h>
#include <linux/decompress/unlzma.h>
#include <linux/decompress/unxz.h>
#include <linux/decompress/inflate.h>
@@ -23,9 +22,6 @@
#ifndef CONFIG_DECOMPRESS_GZIP
# define gunzip NULL
#endif
-#ifndef CONFIG_DECOMPRESS_BZIP2
-# define bunzip2 NULL
-#endif
#ifndef CONFIG_DECOMPRESS_LZMA
# define unlzma NULL
#endif
@@ -51,7 +47,6 @@ struct compress_format {
static const struct compress_format compressed_formats[] __initconst = {
{ {0x1f, 0x8b}, "gzip", gunzip },
{ {0x1f, 0x9e}, "gzip", gunzip },
- { {0x42, 0x5a}, "bzip2", bunzip2 },
{ {0x5d, 0x00}, "lzma", unlzma },
{ {0xfd, 0x37}, "xz", unxz },
{ {0x89, 0x4c}, "lzo", unlzo },
diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c
deleted file mode 100644
index c72c865032fa..000000000000
--- a/lib/decompress_bunzip2.c
+++ /dev/null
@@ -1,756 +0,0 @@
-/* Small bzip2 deflate implementation, by Rob Landley (rob@landley.net).
-
- Based on bzip2 decompression code by Julian R Seward (jseward@acm.org),
- which also acknowledges contributions by Mike Burrows, David Wheeler,
- Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,
- Robert Sedgewick, and Jon L. Bentley.
-
- This code is licensed under the LGPLv2:
- LGPL (http://www.gnu.org/copyleft/lgpl.html
-*/
-
-/*
- Size and speed optimizations by Manuel Novoa III (mjn3@codepoet.org).
-
- More efficient reading of Huffman codes, a streamlined read_bunzip()
- function, and various other tweaks. In (limited) tests, approximately
- 20% faster than bzcat on x86 and about 10% faster on arm.
-
- Note that about 2/3 of the time is spent in read_unzip() reversing
- the Burrows-Wheeler transformation. Much of that time is delay
- resulting from cache misses.
-
- I would ask that anyone benefiting from this work, especially those
- using it in commercial products, consider making a donation to my local
- non-profit hospice organization in the name of the woman I loved, who
- passed away Feb. 12, 2003.
-
- In memory of Toni W. Hagan
-
- Hospice of Acadiana, Inc.
- 2600 Johnston St., Suite 200
- Lafayette, LA 70503-3240
-
- Phone (337) 232-1234 or 1-800-738-2226
- Fax (337) 232-1297
-
- https://www.hospiceacadiana.com/
-
- Manuel
- */
-
-/*
- Made it fit for running in Linux Kernel by Alain Knaff (alain@knaff.lu)
-*/
-
-
-#ifdef STATIC
-#define PREBOOT
-#else
-#include <linux/decompress/bunzip2.h>
-#endif /* STATIC */
-
-#include <linux/decompress/mm.h>
-#include <linux/crc32poly.h>
-
-#ifndef INT_MAX
-#define INT_MAX 0x7fffffff
-#endif
-
-/* Constants for Huffman coding */
-#define MAX_GROUPS 6
-#define GROUP_SIZE 50 /* 64 would have been more efficient */
-#define MAX_HUFCODE_BITS 20 /* Longest Huffman code allowed */
-#define MAX_SYMBOLS 258 /* 256 literals + RUNA + RUNB */
-#define SYMBOL_RUNA 0
-#define SYMBOL_RUNB 1
-
-/* Status return values */
-#define RETVAL_OK 0
-#define RETVAL_LAST_BLOCK (-1)
-#define RETVAL_NOT_BZIP_DATA (-2)
-#define RETVAL_UNEXPECTED_INPUT_EOF (-3)
-#define RETVAL_UNEXPECTED_OUTPUT_EOF (-4)
-#define RETVAL_DATA_ERROR (-5)
-#define RETVAL_OUT_OF_MEMORY (-6)
-#define RETVAL_OBSOLETE_INPUT (-7)
-
-/* Other housekeeping constants */
-#define BZIP2_IOBUF_SIZE 4096
-
-/* This is what we know about each Huffman coding group */
-struct group_data {
- /* We have an extra slot at the end of limit[] for a sentinal value. */
- int limit[MAX_HUFCODE_BITS+1];
- int base[MAX_HUFCODE_BITS];
- int permute[MAX_SYMBOLS];
- int minLen, maxLen;
-};
-
-/* Structure holding all the housekeeping data, including IO buffers and
- memory that persists between calls to bunzip */
-struct bunzip_data {
- /* State for interrupting output loop */
- int writeCopies, writePos, writeRunCountdown, writeCount, writeCurrent;
- /* I/O tracking data (file handles, buffers, positions, etc.) */
- long (*fill)(void*, unsigned long);
- long inbufCount, inbufPos /*, outbufPos*/;
- unsigned char *inbuf /*,*outbuf*/;
- unsigned int inbufBitCount, inbufBits;
- /* The CRC values stored in the block header and calculated from the
- data */
- unsigned int crc32Table[256], headerCRC, totalCRC, writeCRC;
- /* Intermediate buffer and its size (in bytes) */
- unsigned int *dbuf, dbufSize;
- /* These things are a bit too big to go on the stack */
- unsigned char selectors[32768]; /* nSelectors = 15 bits */
- struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
- int io_error; /* non-zero if we have IO error */
- int byteCount[256];
- unsigned char symToByte[256], mtfSymbol[256];
-};
-
-
-/* Return the next nnn bits of input. All reads from the compressed input
- are done through this function. All reads are big endian */
-static unsigned int INIT get_bits(struct bunzip_data *bd, char bits_wanted)
-{
- unsigned int bits = 0;
-
- /* If we need to get more data from the byte buffer, do so.
- (Loop getting one byte at a time to enforce endianness and avoid
- unaligned access.) */
- while (bd->inbufBitCount < bits_wanted) {
- /* If we need to read more data from file into byte buffer, do
- so */
- if (bd->inbufPos == bd->inbufCount) {
- if (bd->io_error)
- return 0;
- bd->inbufCount = bd->fill(bd->inbuf, BZIP2_IOBUF_SIZE);
- if (bd->inbufCount <= 0) {
- bd->io_error = RETVAL_UNEXPECTED_INPUT_EOF;
- return 0;
- }
- bd->inbufPos = 0;
- }
- /* Avoid 32-bit overflow (dump bit buffer to top of output) */
- if (bd->inbufBitCount >= 24) {
- bits = bd->inbufBits&((1 << bd->inbufBitCount)-1);
- bits_wanted -= bd->inbufBitCount;
- bits <<= bits_wanted;
- bd->inbufBitCount = 0;
- }
- /* Grab next 8 bits of input from buffer. */
- bd->inbufBits = (bd->inbufBits << 8)|bd->inbuf[bd->inbufPos++];
- bd->inbufBitCount += 8;
- }
- /* Calculate result */
- bd->inbufBitCount -= bits_wanted;
- bits |= (bd->inbufBits >> bd->inbufBitCount)&((1 << bits_wanted)-1);
-
- return bits;
-}
-
-/* Unpacks the next block and sets up for the inverse burrows-wheeler step. */
-
-static int INIT get_next_block(struct bunzip_data *bd)
-{
- struct group_data *hufGroup = NULL;
- int *base = NULL;
- int *limit = NULL;
- int dbufCount, nextSym, dbufSize, groupCount, selector,
- i, j, k, t, runPos, symCount, symTotal, nSelectors, *byteCount;
- unsigned char uc, *symToByte, *mtfSymbol, *selectors;
- unsigned int *dbuf, origPtr;
-
- dbuf = bd->dbuf;
- dbufSize = bd->dbufSize;
- selectors = bd->selectors;
- byteCount = bd->byteCount;
- symToByte = bd->symToByte;
- mtfSymbol = bd->mtfSymbol;
-
- /* Read in header signature and CRC, then validate signature.
- (last block signature means CRC is for whole file, return now) */
- i = get_bits(bd, 24);
- j = get_bits(bd, 24);
- bd->headerCRC = get_bits(bd, 32);
- if ((i == 0x177245) && (j == 0x385090))
- return RETVAL_LAST_BLOCK;
- if ((i != 0x314159) || (j != 0x265359))
- return RETVAL_NOT_BZIP_DATA;
- /* We can add support for blockRandomised if anybody complains.
- There was some code for this in busybox 1.0.0-pre3, but nobody ever
- noticed that it didn't actually work. */
- if (get_bits(bd, 1))
- return RETVAL_OBSOLETE_INPUT;
- origPtr = get_bits(bd, 24);
- if (origPtr >= dbufSize)
- return RETVAL_DATA_ERROR;
- /* mapping table: if some byte values are never used (encoding things
- like ascii text), the compression code removes the gaps to have fewer
- symbols to deal with, and writes a sparse bitfield indicating which
- values were present. We make a translation table to convert the
- symbols back to the corresponding bytes. */
- t = get_bits(bd, 16);
- symTotal = 0;
- for (i = 0; i < 16; i++) {
- if (t&(1 << (15-i))) {
- k = get_bits(bd, 16);
- for (j = 0; j < 16; j++)
- if (k&(1 << (15-j)))
- symToByte[symTotal++] = (16*i)+j;
- }
- }
- /* How many different Huffman coding groups does this block use? */
- groupCount = get_bits(bd, 3);
- if (groupCount < 2 || groupCount > MAX_GROUPS)
- return RETVAL_DATA_ERROR;
- /* nSelectors: Every GROUP_SIZE many symbols we select a new
- Huffman coding group. Read in the group selector list,
- which is stored as MTF encoded bit runs. (MTF = Move To
- Front, as each value is used it's moved to the start of the
- list.) */
- nSelectors = get_bits(bd, 15);
- if (!nSelectors)
- return RETVAL_DATA_ERROR;
- for (i = 0; i < groupCount; i++)
- mtfSymbol[i] = i;
- for (i = 0; i < nSelectors; i++) {
- /* Get next value */
- for (j = 0; get_bits(bd, 1); j++)
- if (j >= groupCount)
- return RETVAL_DATA_ERROR;
- /* Decode MTF to get the next selector */
- uc = mtfSymbol[j];
- for (; j; j--)
- mtfSymbol[j] = mtfSymbol[j-1];
- mtfSymbol[0] = selectors[i] = uc;
- }
- /* Read the Huffman coding tables for each group, which code
- for symTotal literal symbols, plus two run symbols (RUNA,
- RUNB) */
- symCount = symTotal+2;
- for (j = 0; j < groupCount; j++) {
- unsigned char length[MAX_SYMBOLS], temp[MAX_HUFCODE_BITS+1];
- int minLen, maxLen, pp;
- /* Read Huffman code lengths for each symbol. They're
- stored in a way similar to mtf; record a starting
- value for the first symbol, and an offset from the
- previous value for everys symbol after that.
- (Subtracting 1 before the loop and then adding it
- back at the end is an optimization that makes the
- test inside the loop simpler: symbol length 0
- becomes negative, so an unsigned inequality catches
- it.) */
- t = get_bits(bd, 5)-1;
- for (i = 0; i < symCount; i++) {
- for (;;) {
- if (((unsigned)t) > (MAX_HUFCODE_BITS-1))
- return RETVAL_DATA_ERROR;
-
- /* If first bit is 0, stop. Else
- second bit indicates whether to
- increment or decrement the value.
- Optimization: grab 2 bits and unget
- the second if the first was 0. */
-
- k = get_bits(bd, 2);
- if (k < 2) {
- bd->inbufBitCount++;
- break;
- }
- /* Add one if second bit 1, else
- * subtract 1. Avoids if/else */
- t += (((k+1)&2)-1);
- }
- /* Correct for the initial -1, to get the
- * final symbol length */
- length[i] = t+1;
- }
- /* Find largest and smallest lengths in this group */
- minLen = maxLen = length[0];
-
- for (i = 1; i < symCount; i++) {
- if (length[i] > maxLen)
- maxLen = length[i];
- else if (length[i] < minLen)
- minLen = length[i];
- }
-
- /* Calculate permute[], base[], and limit[] tables from
- * length[].
- *
- * permute[] is the lookup table for converting
- * Huffman coded symbols into decoded symbols. base[]
- * is the amount to subtract from the value of a
- * Huffman symbol of a given length when using
- * permute[].
- *
- * limit[] indicates the largest numerical value a
- * symbol with a given number of bits can have. This
- * is how the Huffman codes can vary in length: each
- * code with a value > limit[length] needs another
- * bit.
- */
- hufGroup = bd->groups+j;
- hufGroup->minLen = minLen;
- hufGroup->maxLen = maxLen;
- /* Note that minLen can't be smaller than 1, so we
- adjust the base and limit array pointers so we're
- not always wasting the first entry. We do this
- again when using them (during symbol decoding).*/
- base = hufGroup->base-1;
- limit = hufGroup->limit-1;
- /* Calculate permute[]. Concurrently, initialize
- * temp[] and limit[]. */
- pp = 0;
- for (i = minLen; i <= maxLen; i++) {
- temp[i] = limit[i] = 0;
- for (t = 0; t < symCount; t++)
- if (length[t] == i)
- hufGroup->permute[pp++] = t;
- }
- /* Count symbols coded for at each bit length */
- for (i = 0; i < symCount; i++)
- temp[length[i]]++;
- /* Calculate limit[] (the largest symbol-coding value
- *at each bit length, which is (previous limit <<
- *1)+symbols at this level), and base[] (number of
- *symbols to ignore at each bit length, which is limit
- *minus the cumulative count of symbols coded for
- *already). */
- pp = t = 0;
- for (i = minLen; i < maxLen; i++) {
- pp += temp[i];
- /* We read the largest possible symbol size
- and then unget bits after determining how
- many we need, and those extra bits could be
- set to anything. (They're noise from
- future symbols.) At each level we're
- really only interested in the first few
- bits, so here we set all the trailing
- to-be-ignored bits to 1 so they don't
- affect the value > limit[length]
- comparison. */
- limit[i] = (pp << (maxLen - i)) - 1;
- pp <<= 1;
- base[i+1] = pp-(t += temp[i]);
- }
- limit[maxLen+1] = INT_MAX; /* Sentinal value for
- * reading next sym. */
- limit[maxLen] = pp+temp[maxLen]-1;
- base[minLen] = 0;
- }
- /* We've finished reading and digesting the block header. Now
- read this block's Huffman coded symbols from the file and
- undo the Huffman coding and run length encoding, saving the
- result into dbuf[dbufCount++] = uc */
-
- /* Initialize symbol occurrence counters and symbol Move To
- * Front table */
- for (i = 0; i < 256; i++) {
- byteCount[i] = 0;
- mtfSymbol[i] = (unsigned char)i;
- }
- /* Loop through compressed symbols. */
- runPos = dbufCount = symCount = selector = 0;
- for (;;) {
- /* Determine which Huffman coding group to use. */
- if (!(symCount--)) {
- symCount = GROUP_SIZE-1;
- if (selector >= nSelectors)
- return RETVAL_DATA_ERROR;
- hufGroup = bd->groups+selectors[selector++];
- base = hufGroup->base-1;
- limit = hufGroup->limit-1;
- }
- /* Read next Huffman-coded symbol. */
- /* Note: It is far cheaper to read maxLen bits and
- back up than it is to read minLen bits and then an
- additional bit at a time, testing as we go.
- Because there is a trailing last block (with file
- CRC), there is no danger of the overread causing an
- unexpected EOF for a valid compressed file. As a
- further optimization, we do the read inline
- (falling back to a call to get_bits if the buffer
- runs dry). The following (up to got_huff_bits:) is
- equivalent to j = get_bits(bd, hufGroup->maxLen);
- */
- while (bd->inbufBitCount < hufGroup->maxLen) {
- if (bd->inbufPos == bd->inbufCount) {
- j = get_bits(bd, hufGroup->maxLen);
- goto got_huff_bits;
- }
- bd->inbufBits =
- (bd->inbufBits << 8)|bd->inbuf[bd->inbufPos++];
- bd->inbufBitCount += 8;
- };
- bd->inbufBitCount -= hufGroup->maxLen;
- j = (bd->inbufBits >> bd->inbufBitCount)&
- ((1 << hufGroup->maxLen)-1);
-got_huff_bits:
- /* Figure how many bits are in next symbol and
- * unget extras */
- i = hufGroup->minLen;
- while (j > limit[i])
- ++i;
- bd->inbufBitCount += (hufGroup->maxLen - i);
- /* Huffman decode value to get nextSym (with bounds checking) */
- if ((i > hufGroup->maxLen)
- || (((unsigned)(j = (j>>(hufGroup->maxLen-i))-base[i]))
- >= MAX_SYMBOLS))
- return RETVAL_DATA_ERROR;
- nextSym = hufGroup->permute[j];
- /* We have now decoded the symbol, which indicates
- either a new literal byte, or a repeated run of the
- most recent literal byte. First, check if nextSym
- indicates a repeated run, and if so loop collecting
- how many times to repeat the last literal. */
- if (((unsigned)nextSym) <= SYMBOL_RUNB) { /* RUNA or RUNB */
- /* If this is the start of a new run, zero out
- * counter */
- if (!runPos) {
- runPos = 1;
- t = 0;
- }
- /* Neat trick that saves 1 symbol: instead of
- or-ing 0 or 1 at each bit position, add 1
- or 2 instead. For example, 1011 is 1 << 0
- + 1 << 1 + 2 << 2. 1010 is 2 << 0 + 2 << 1
- + 1 << 2. You can make any bit pattern
- that way using 1 less symbol than the basic
- or 0/1 method (except all bits 0, which
- would use no symbols, but a run of length 0
- doesn't mean anything in this context).
- Thus space is saved. */
- t += (runPos << nextSym);
- /* +runPos if RUNA; +2*runPos if RUNB */
-
- runPos <<= 1;
- continue;
- }
- /* When we hit the first non-run symbol after a run,
- we now know how many times to repeat the last
- literal, so append that many copies to our buffer
- of decoded symbols (dbuf) now. (The last literal
- used is the one at the head of the mtfSymbol
- array.) */
- if (runPos) {
- runPos = 0;
- if (dbufCount+t >= dbufSize)
- return RETVAL_DATA_ERROR;
-
- uc = symToByte[mtfSymbol[0]];
- byteCount[uc] += t;
- while (t--)
- dbuf[dbufCount++] = uc;
- }
- /* Is this the terminating symbol? */
- if (nextSym > symTotal)
- break;
- /* At this point, nextSym indicates a new literal
- character. Subtract one to get the position in the
- MTF array at which this literal is currently to be
- found. (Note that the result can't be -1 or 0,
- because 0 and 1 are RUNA and RUNB. But another
- instance of the first symbol in the mtf array,
- position 0, would have been handled as part of a
- run above. Therefore 1 unused mtf position minus 2
- non-literal nextSym values equals -1.) */
- if (dbufCount >= dbufSize)
- return RETVAL_DATA_ERROR;
- i = nextSym - 1;
- uc = mtfSymbol[i];
- /* Adjust the MTF array. Since we typically expect to
- *move only a small number of symbols, and are bound
- *by 256 in any case, using memmove here would
- *typically be bigger and slower due to function call
- *overhead and other assorted setup costs. */
- do {
- mtfSymbol[i] = mtfSymbol[i-1];
- } while (--i);
- mtfSymbol[0] = uc;
- uc = symToByte[uc];
- /* We have our literal byte. Save it into dbuf. */
- byteCount[uc]++;
- dbuf[dbufCount++] = (unsigned int)uc;
- }
- /* At this point, we've read all the Huffman-coded symbols
- (and repeated runs) for this block from the input stream,
- and decoded them into the intermediate buffer. There are
- dbufCount many decoded bytes in dbuf[]. Now undo the
- Burrows-Wheeler transform on dbuf. See
- http://dogma.net/markn/articles/bwt/bwt.htm
- */
- /* Turn byteCount into cumulative occurrence counts of 0 to n-1. */
- j = 0;
- for (i = 0; i < 256; i++) {
- k = j+byteCount[i];
- byteCount[i] = j;
- j = k;
- }
- /* Figure out what order dbuf would be in if we sorted it. */
- for (i = 0; i < dbufCount; i++) {
- uc = (unsigned char)(dbuf[i] & 0xff);
- dbuf[byteCount[uc]] |= (i << 8);
- byteCount[uc]++;
- }
- /* Decode first byte by hand to initialize "previous" byte.
- Note that it doesn't get output, and if the first three
- characters are identical it doesn't qualify as a run (hence
- writeRunCountdown = 5). */
- if (dbufCount) {
- if (origPtr >= dbufCount)
- return RETVAL_DATA_ERROR;
- bd->writePos = dbuf[origPtr];
- bd->writeCurrent = (unsigned char)(bd->writePos&0xff);
- bd->writePos >>= 8;
- bd->writeRunCountdown = 5;
- }
- bd->writeCount = dbufCount;
-
- return RETVAL_OK;
-}
-
-/* Undo burrows-wheeler transform on intermediate buffer to produce output.
- If start_bunzip was initialized with out_fd =-1, then up to len bytes of
- data are written to outbuf. Return value is number of bytes written or
- error (all errors are negative numbers). If out_fd!=-1, outbuf and len
- are ignored, data is written to out_fd and return is RETVAL_OK or error.
-*/
-
-static int INIT read_bunzip(struct bunzip_data *bd, char *outbuf, int len)
-{
- const unsigned int *dbuf;
- int pos, xcurrent, previous, gotcount;
-
- /* If last read was short due to end of file, return last block now */
- if (bd->writeCount < 0)
- return bd->writeCount;
-
- gotcount = 0;
- dbuf = bd->dbuf;
- pos = bd->writePos;
- xcurrent = bd->writeCurrent;
-
- /* We will always have pending decoded data to write into the output
- buffer unless this is the very first call (in which case we haven't
- Huffman-decoded a block into the intermediate buffer yet). */
-
- if (bd->writeCopies) {
- /* Inside the loop, writeCopies means extra copies (beyond 1) */
- --bd->writeCopies;
- /* Loop outputting bytes */
- for (;;) {
- /* If the output buffer is full, snapshot
- * state and return */
- if (gotcount >= len) {
- bd->writePos = pos;
- bd->writeCurrent = xcurrent;
- bd->writeCopies++;
- return len;
- }
- /* Write next byte into output buffer, updating CRC */
- outbuf[gotcount++] = xcurrent;
- bd->writeCRC = (((bd->writeCRC) << 8)
- ^bd->crc32Table[((bd->writeCRC) >> 24)
- ^xcurrent]);
- /* Loop now if we're outputting multiple
- * copies of this byte */
- if (bd->writeCopies) {
- --bd->writeCopies;
- continue;
- }
-decode_next_byte:
- if (!bd->writeCount--)
- break;
- /* Follow sequence vector to undo
- * Burrows-Wheeler transform */
- previous = xcurrent;
- pos = dbuf[pos];
- xcurrent = pos&0xff;
- pos >>= 8;
- /* After 3 consecutive copies of the same
- byte, the 4th is a repeat count. We count
- down from 4 instead *of counting up because
- testing for non-zero is faster */
- if (--bd->writeRunCountdown) {
- if (xcurrent != previous)
- bd->writeRunCountdown = 4;
- } else {
- /* We have a repeated run, this byte
- * indicates the count */
- bd->writeCopies = xcurrent;
- xcurrent = previous;
- bd->writeRunCountdown = 5;
- /* Sometimes there are just 3 bytes
- * (run length 0) */
- if (!bd->writeCopies)
- goto decode_next_byte;
- /* Subtract the 1 copy we'd output
- * anyway to get extras */
- --bd->writeCopies;
- }
- }
- /* Decompression of this block completed successfully */
- bd->writeCRC = ~bd->writeCRC;
- bd->totalCRC = ((bd->totalCRC << 1) |
- (bd->totalCRC >> 31)) ^ bd->writeCRC;
- /* If this block had a CRC error, force file level CRC error. */
- if (bd->writeCRC != bd->headerCRC) {
- bd->totalCRC = bd->headerCRC+1;
- return RETVAL_LAST_BLOCK;
- }
- }
-
- /* Refill the intermediate buffer by Huffman-decoding next
- * block of input */
- /* (previous is just a convenient unused temp variable here) */
- previous = get_next_block(bd);
- if (previous) {
- bd->writeCount = previous;
- return (previous != RETVAL_LAST_BLOCK) ? previous : gotcount;
- }
- bd->writeCRC = 0xffffffffUL;
- pos = bd->writePos;
- xcurrent = bd->writeCurrent;
- goto decode_next_byte;
-}
-
-static long INIT nofill(void *buf, unsigned long len)
-{
- return -1;
-}
-
-/* Allocate the structure, read file header. If in_fd ==-1, inbuf must contain
- a complete bunzip file (len bytes long). If in_fd!=-1, inbuf and len are
- ignored, and data is read from file handle into temporary buffer. */
-static int INIT start_bunzip(struct bunzip_data **bdp, void *inbuf, long len,
- long (*fill)(void*, unsigned long))
-{
- struct bunzip_data *bd;
- unsigned int i, j, c;
- const unsigned int BZh0 =
- (((unsigned int)'B') << 24)+(((unsigned int)'Z') << 16)
- +(((unsigned int)'h') << 8)+(unsigned int)'0';
-
- /* Figure out how much data to allocate */
- i = sizeof(struct bunzip_data);
-
- /* Allocate bunzip_data. Most fields initialize to zero. */
- bd = *bdp = malloc(i);
- if (!bd)
- return RETVAL_OUT_OF_MEMORY;
- memset(bd, 0, sizeof(struct bunzip_data));
- /* Setup input buffer */
- bd->inbuf = inbuf;
- bd->inbufCount = len;
- if (fill != NULL)
- bd->fill = fill;
- else
- bd->fill = nofill;
-
- /* Init the CRC32 table (big endian) */
- for (i = 0; i < 256; i++) {
- c = i << 24;
- for (j = 8; j; j--)
- c = c&0x80000000 ? (c << 1)^(CRC32_POLY_BE) : (c << 1);
- bd->crc32Table[i] = c;
- }
-
- /* Ensure that file starts with "BZh['1'-'9']." */
- i = get_bits(bd, 32);
- if (((unsigned int)(i-BZh0-1)) >= 9)
- return RETVAL_NOT_BZIP_DATA;
-
- /* Fourth byte (ascii '1'-'9'), indicates block size in units of 100k of
- uncompressed data. Allocate intermediate buffer for block. */
- bd->dbufSize = 100000*(i-BZh0);
-
- bd->dbuf = large_malloc(bd->dbufSize * sizeof(int));
- if (!bd->dbuf)
- return RETVAL_OUT_OF_MEMORY;
- return RETVAL_OK;
-}
-
-/* Example usage: decompress src_fd to dst_fd. (Stops at end of bzip2 data,
- not end of file.) */
-STATIC int INIT bunzip2(unsigned char *buf, long len,
- long (*fill)(void*, unsigned long),
- long (*flush)(void*, unsigned long),
- unsigned char *outbuf,
- long *pos,
- void(*error)(char *x))
-{
- struct bunzip_data *bd;
- int i = -1;
- unsigned char *inbuf;
-
- if (flush)
- outbuf = malloc(BZIP2_IOBUF_SIZE);
-
- if (!outbuf) {
- error("Could not allocate output buffer");
- return RETVAL_OUT_OF_MEMORY;
- }
- if (buf)
- inbuf = buf;
- else
- inbuf = malloc(BZIP2_IOBUF_SIZE);
- if (!inbuf) {
- error("Could not allocate input buffer");
- i = RETVAL_OUT_OF_MEMORY;
- goto exit_0;
- }
- i = start_bunzip(&bd, inbuf, len, fill);
- if (!i) {
- for (;;) {
- i = read_bunzip(bd, outbuf, BZIP2_IOBUF_SIZE);
- if (i <= 0)
- break;
- if (!flush)
- outbuf += i;
- else
- if (i != flush(outbuf, i)) {
- i = RETVAL_UNEXPECTED_OUTPUT_EOF;
- break;
- }
- }
- }
- /* Check CRC and release memory */
- if (i == RETVAL_LAST_BLOCK) {
- if (bd->headerCRC != bd->totalCRC)
- error("Data integrity error when decompressing.");
- else
- i = RETVAL_OK;
- } else if (i == RETVAL_UNEXPECTED_OUTPUT_EOF) {
- error("Compressed file ends unexpectedly");
- }
- if (!bd)
- goto exit_1;
- if (bd->dbuf)
- large_free(bd->dbuf);
- if (pos)
- *pos = bd->inbufPos;
- free(bd);
-exit_1:
- if (!buf)
- free(inbuf);
-exit_0:
- if (flush)
- free(outbuf);
- return i;
-}
-
-#ifdef PREBOOT
-STATIC int INIT __decompress(unsigned char *buf, long len,
- long (*fill)(void*, unsigned long),
- long (*flush)(void*, unsigned long),
- unsigned char *outbuf, long olen,
- long *pos,
- void (*error)(char *x))
-{
- return bunzip2(buf, len - 4, fill, flush, outbuf, pos, error);
-}
-#endif
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 94133708889d..f05111c59a3b 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -343,10 +343,7 @@ $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
-# Bzip2
-# ---------------------------------------------------------------------------
-
-# Bzip2 and LZMA do not include size in file... so we have to fake that;
+# LZMA does not include size in file... so we have to fake that;
# append the size as a 32-bit littleendian number as gzip does.
size_append = printf $(shell \
dec_size=0; \
@@ -363,9 +360,6 @@ printf "%08x\n" $$dec_size | \
} \
)
-quiet_cmd_bzip2 = BZIP2 $@
- cmd_bzip2 = { cat $(real-prereqs) | $(KBZIP2) -9; $(size_append); } > $@
-
# Lzma
# ---------------------------------------------------------------------------
diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index f952fb64789d..2c4a9dbc7e6e 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -127,7 +127,6 @@ util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \
tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
rm -r $(perf-tar); \
$(if $(findstring tar-src,$@),, \
-$(if $(findstring bz2,$@),$(KBZIP2), \
$(if $(findstring gz,$@),$(KGZIP), \
$(if $(findstring xz,$@),$(XZ), \
$(error unknown target $@)))) \
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 936198a90477..91bcb50579c7 100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -118,7 +118,7 @@ case "${ARCH}" in
fi
;;
arm64)
- for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo ; do
+ for i in Image.gz Image.lz4 Image.lzma Image.lzo ; do
if [ -f "${objtree}/arch/arm64/boot/${i}" ] ; then
cp -v -- "${objtree}/arch/arm64/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
break
diff --git a/usr/Kconfig b/usr/Kconfig
index 2599bc21c1b2..ba5ecb054df5 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -60,14 +60,6 @@ config RD_GZIP
Support loading of a gzip encoded initial ramdisk or cpio buffer.
If unsure, say Y.
-config RD_BZIP2
- bool "Support initial ramdisk/ramfs compressed using bzip2"
- default y
- select DECOMPRESS_BZIP2
- help
- Support loading of a bzip2 encoded initial ramdisk or cpio buffer
- If unsure, say N.
-
config RD_LZMA
bool "Support initial ramdisk/ramfs compressed using LZMA"
default y
@@ -143,19 +135,6 @@ config INITRAMFS_COMPRESSION_GZIP
supported by your build system as the gzip tool is present by default
on most distros.
-config INITRAMFS_COMPRESSION_BZIP2
- bool "Bzip2"
- depends on RD_BZIP2
- help
- It's compression ratio and speed is intermediate. Decompression speed
- is slowest among the choices. The initramfs size is about 10% smaller
- with bzip2, in comparison to gzip. Bzip2 uses a large amount of
- memory. For modern kernels you will need at least 8MB RAM or more for
- booting.
-
- If you choose this, keep in mind that you need to have the bzip2 tool
- available to be able to compress the initram.
-
config INITRAMFS_COMPRESSION_LZMA
bool "LZMA"
depends on RD_LZMA
@@ -175,9 +154,8 @@ config INITRAMFS_COMPRESSION_XZ
help
XZ uses the LZMA2 algorithm and has a large dictionary which may cause
problems on memory constrained systems. The initramfs size is about
- 30% smaller with XZ in comparison to gzip. Decompression speed is
- better than that of bzip2 but worse than gzip and LZO. Compression is
- slow.
+ 30% smaller with XZ in comparison to gzip. Compression and
+ decompression are slowest.
If you choose this, keep in mind that you may need to install the xz
tool to be able to compress the initram.
diff --git a/usr/Makefile b/usr/Makefile
index b1a81a40eab1..367bc5d4c759 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -3,14 +3,13 @@
# kbuild file for usr/ - including initramfs image
#
-# cmd_bzip2, cmd_lzma, cmd_lzo, cmd_lz4 from scripts/Makefile.lib appends the
+# cmd_lzma, cmd_lzo, cmd_lz4 from scripts/Makefile.lib appends the
# size at the end of the compressed file, which unfortunately does not work
# with unpack_to_rootfs(). Make size_append no-op.
override size_append := :
compress-y := shipped
compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip
-compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2
compress-$(CONFIG_INITRAMFS_COMPRESSION_LZMA) := lzma
compress-$(CONFIG_INITRAMFS_COMPRESSION_XZ) := xzmisc
compress-$(CONFIG_INITRAMFS_COMPRESSION_LZO) := lzo
--
2.29.2
^ permalink raw reply related
* Re: [PATCH] powerpc/boot: Fix build of dts/fsl
From: Masahiro Yamada @ 2020-12-15 18:02 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <20201215032906.473460-1-mpe@ellerman.id.au>
On Tue, Dec 15, 2020 at 12:29 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> The lkp robot reported that some configs fail to build, for example
> mpc85xx_smp_defconfig, with:
>
> cc1: fatal error: opening output file arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory
>
> This bisects to:
> cc8a51ca6f05 ("kbuild: always create directories of targets")
>
> Although that commit claims to be about in-tree builds, it somehow
> breaks out-of-tree builds. But presumably it's just exposing a latent
> bug in our Makefiles.
>
> We can fix it by adding to targets for dts/fsl in the same way that we
> do for dts.
>
> Fixes: cc8a51ca6f05 ("kbuild: always create directories of targets")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/boot/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 68a7534454cd..c3e084cceaed 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -372,6 +372,8 @@ initrd-y := $(filter-out $(image-y), $(initrd-y))
> targets += $(image-y) $(initrd-y)
> targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
> $(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y))))
> +targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
> + $(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%, $(image-y))))
>
> $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
>
> --
> 2.25.1
>
Some freescale dts files are right under arch/powerpc/boot/dts/,
but some are in the fsl/ subdirectory.
I do not understand the policy.
If "fsl/" is a very special case,
I just thought we could add a new syntax, fslimage-y,
but I do not mind either way.
fslimage-$(CONFIG_MPC8540_ADS) += cuImage.mpc8540ads
targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
$(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%,
$(fslimage-y))))
This Makefile is wrong over-all anyway.
--
Best Regards
Masahiro Yamada
^ permalink raw reply
* Re: [PATCH] powerpc/vas: Fix IRQ name allocation
From: Cédric Le Goater @ 2020-12-15 12:33 UTC (permalink / raw)
To: Haren Myneni, linuxppc-dev; +Cc: Sukadev Bhattiprolu
In-Reply-To: <facf50fec946b5ee85f8151c4e539acf60cc149e.camel@linux.ibm.com>
On 12/15/20 11:56 AM, Haren Myneni wrote:
> On Sat, 2020-12-12 at 15:27 +0100, Cédric Le Goater wrote:
>> The VAS device allocates a generic interrupt to handle page faults
>> but
>> the IRQ name doesn't show under /proc. This is because it's on
>> stack. Allocate the name.
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>
> Thanks for fixing.
I was wondering where those ^B interrupt numbers were coming from.
/proc/interrupts looks better now:
36: ... 0 XIVE-IRQ 50331732 Edge vas-6
40: ... 0 XIVE-IRQ 33554504 Edge vas-4
72: ... 0 XIVE-IRQ 16777304 Edge vas-2
124: ... 0 XIVE-IRQ 124 Edge vas-0
>
> Acked-by: Haren Myneni <haren@linux.ibm.com>
>
>> ---
>>
>> I didn't understand this part in init_vas_instance() :
>>
>> if (vinst->virq) {
>> rc = vas_irq_fault_window_setup(vinst);
>> /*
>> * Fault window is used only for user space send
>> windows.
>> * So if vinst->virq is NULL, tx_win_open returns
>> -ENODEV
>> * for user space.
>> */
>> if (rc)
>> vinst->virq = 0;
>> }
>>
>> If the IRQ cannot be requested, the device probing should fail but
>> it's not today. The use of 'vinst->virq' is suspicious.
>
> VAS raises an interrupt only when NX sees fault on request buffers and
> faults can happen only for user space requests. So Fault window setup
> is needed for user space requests. For kernel requests, continue even
> if IRQ / fault_window_setup is failed.
>
> When window open request is issued from user space, kernel returns
> -ENODEV if vinst->virq = 0 (means fault window setup is failed).
It looks ok to deactivate a feature (page faulting for user space
requests) if vas_setup_fault_window() fails but if the IRQ layer
routine request_threaded_irq() fails, something is really wrong
in the system and we should stop probing IMO.
We should probably move the IRQ request after allocating/mapping
the XIVE IPI IRQ.
this test is always true :
if (vinst->virq) {
rc = vas_irq_fault_window_setup(vinst);
since above, we did :
vinst->virq = irq_create_mapping(NULL, hwirq);
if (!vinst->virq) {
pr_err("Inst%d: Unable to map global irq %d\n",
vinst->vas_id, hwirq);
return -EINVAL;
}
Cheers,
C.
>
>
>>
>> arch/powerpc/platforms/powernv/vas.h | 1 +
>> arch/powerpc/platforms/powernv/vas.c | 11 ++++++++---
>> 2 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/powernv/vas.h
>> b/arch/powerpc/platforms/powernv/vas.h
>> index 70f793e8f6cc..c7db3190baca 100644
>> --- a/arch/powerpc/platforms/powernv/vas.h
>> +++ b/arch/powerpc/platforms/powernv/vas.h
>> @@ -340,6 +340,7 @@ struct vas_instance {
>> struct vas_window *rxwin[VAS_COP_TYPE_MAX];
>> struct vas_window *windows[VAS_WINDOWS_PER_CHIP];
>>
>> + char *name;
>> char *dbgname;
>> struct dentry *dbgdir;
>> };
>> diff --git a/arch/powerpc/platforms/powernv/vas.c
>> b/arch/powerpc/platforms/powernv/vas.c
>> index 598e4cd563fb..b65256a63e87 100644
>> --- a/arch/powerpc/platforms/powernv/vas.c
>> +++ b/arch/powerpc/platforms/powernv/vas.c
>> @@ -28,12 +28,10 @@ static DEFINE_PER_CPU(int, cpu_vas_id);
>>
>> static int vas_irq_fault_window_setup(struct vas_instance *vinst)
>> {
>> - char devname[64];
>> int rc = 0;
>>
>> - snprintf(devname, sizeof(devname), "vas-%d", vinst->vas_id);
>> rc = request_threaded_irq(vinst->virq, vas_fault_handler,
>> - vas_fault_thread_fn, 0, devname,
>> vinst);
>> + vas_fault_thread_fn, 0, vinst->name,
>> vinst);
>>
>> if (rc) {
>> pr_err("VAS[%d]: Request IRQ(%d) failed with %d\n",
>> @@ -80,6 +78,12 @@ static int init_vas_instance(struct
>> platform_device *pdev)
>> if (!vinst)
>> return -ENOMEM;
>>
>> + vinst->name = kasprintf(GFP_KERNEL, "vas-%d", vasid);
>> + if (!vinst->name) {
>> + kfree(vinst);
>> + return -ENOMEM;
>> + }
>> +
>> INIT_LIST_HEAD(&vinst->node);
>> ida_init(&vinst->ida);
>> mutex_init(&vinst->mutex);
>> @@ -162,6 +166,7 @@ static int init_vas_instance(struct
>> platform_device *pdev)
>> return 0;
>>
>> free_vinst:
>> + kfree(vinst->name);
>> kfree(vinst);
>> return -ENODEV;
>>
>
^ permalink raw reply
* Re: [PATCH 2/3] kbuild: LD_VERSION redenomination
From: Thomas Bogendoerfer @ 2020-12-15 13:48 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Dominique Martinet, linuxppc-dev, linux-kernel,
Jiaxun Yang, linux-mips, Paul Mackerras, Catalin Marinas,
Huacai Chen, Will Deacon, linux-arm-kernel
In-Reply-To: <20201212165431.150750-2-masahiroy@kernel.org>
On Sun, Dec 13, 2020 at 01:54:30AM +0900, Masahiro Yamada wrote:
> Commit ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion
> macros") introduced scripts/ld-version.sh for GCC LTO.
>
> At that time, this script handled 5 version fields because GCC LTO
> needed the downstream binutils. (https://lkml.org/lkml/2014/4/8/272)
>
> The code snippet from the submitted patch was as follows:
>
> # We need HJ Lu's Linux binutils because mainline binutils does not
> # support mixing assembler and LTO code in the same ld -r object.
> # XXX check if the gcc plugin ld is the expected one too
> # XXX some Fedora binutils should also support it. How to check for that?
> ifeq ($(call ld-ifversion,-ge,22710001,y),y)
> ...
>
> However, GCC LTO was not merged into the mainline after all.
> (https://lkml.org/lkml/2014/4/8/272)
>
> So, the 4th and 5th fields were never used, and finally removed by
> commit 0d61ed17dd30 ("ld-version: Drop the 4th and 5th version
> components").
>
> Since then, the last 4-digits returned by this script is always zeros.
>
> Remove the meaningless last 4-digits. This makes the version format
> consistent with GCC_VERSION, CLANG_VERSION, LLD_VERSION.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> arch/mips/loongson64/Platform | 2 +-
> arch/mips/vdso/Kconfig | 2 +-
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply
* Re: [PATCH v7 updated 21/22 ] powerpc/book3s64/kup: Check max key supported before enabling kup
From: Michael Ellerman @ 2020-12-15 11:19 UTC (permalink / raw)
To: linuxppc-dev, mpe, Aneesh Kumar K.V
In-Reply-To: <20201202043854.76406-1-aneesh.kumar@linux.ibm.com>
On Fri, 27 Nov 2020 10:14:02 +0530, Aneesh Kumar K.V wrote:
> Don't enable KUEP/KUAP if we support less than or equal to 3 keys.
>
> [...]
Applied to powerpc/next.
[21/22] powerpc/book3s64/kup: Check max key supported before enabling kup
https://git.kernel.org/powerpc/c/61130e203dca3ba1f0c510eb12f7a4294e31a834
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/book3s64/kuap: Improve error reporting with KUAP
From: Michael Ellerman @ 2020-12-15 11:09 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev, Aneesh Kumar K.V
In-Reply-To: <160756607519.1313423.7828205073526616704.b4-ty@ellerman.id.au>
Michael Ellerman <patch-notifications@ellerman.id.au> writes:
> On Tue, 8 Dec 2020 08:45:39 +0530, Aneesh Kumar K.V wrote:
>> This partially reverts commit eb232b162446 ("powerpc/book3s64/kuap: Improve
>> error reporting with KUAP") and update the fault handler to print
>>
>> [ 55.022514] Kernel attempted to access user page (7e6725b70000) - exploit attempt? (uid: 0)
>> [ 55.022528] BUG: Unable to handle kernel data access on read at 0x7e6725b70000
>> [ 55.022533] Faulting instruction address: 0xc000000000e8b9bc
>> [ 55.022540] Oops: Kernel access of bad area, sig: 11 [#1]
>> ....
>>
>> [...]
>
> Applied to powerpc/next.
>
> [1/1] powerpc/book3s64/kuap: Improve error reporting with KUAP
> https://git.kernel.org/powerpc/c/eb232b1624462752dc916d9015b31ecdac0a01f1
This is wrong, the script was confused by two patches with the exact
same subject. See the other mail.
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/book3s64/kuap: Improve error reporting with KUAP
From: Michael Ellerman @ 2020-12-15 11:05 UTC (permalink / raw)
To: mpe, Aneesh Kumar K.V, linuxppc-dev
In-Reply-To: <20201208031539.84878-1-aneesh.kumar@linux.ibm.com>
On Tue, 8 Dec 2020 08:45:39 +0530, Aneesh Kumar K.V wrote:
> This partially reverts commit eb232b162446 ("powerpc/book3s64/kuap: Improve
> error reporting with KUAP") and update the fault handler to print
>
> [ 55.022514] Kernel attempted to access user page (7e6725b70000) - exploit attempt? (uid: 0)
> [ 55.022528] BUG: Unable to handle kernel data access on read at 0x7e6725b70000
> [ 55.022533] Faulting instruction address: 0xc000000000e8b9bc
> [ 55.022540] Oops: Kernel access of bad area, sig: 11 [#1]
> ....
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/book3s64/kuap: Improve error reporting with KUAP
https://git.kernel.org/powerpc/c/475c8749d9542392d7e0855097d29ed14877ad0a
cheers
^ permalink raw reply
* Re: [PATCH 0/3] powerpc: convert to use ARCH_ATOMIC
From: Michael Ellerman @ 2020-12-15 11:01 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev
Cc: Christophe Leroy, linux-arch, Arnd Bergmann, Alexey Kardashevskiy,
Boqun Feng, linux-kernel, Peter Zijlstra, Will Deacon
In-Reply-To: <20201111110723.3148665-1-npiggin@gmail.com>
On Wed, 11 Nov 2020 21:07:20 +1000, Nicholas Piggin wrote:
> This conversion seems to require generic atomic64 changes, looks
> like nothing else uses ARCH_ATOMIC and GENERIC_ATOMIC64 yet.
>
> Thanks,
> Nick
>
> Nicholas Piggin (3):
> asm-generic/atomic64: Add support for ARCH_ATOMIC
> powerpc/64s/iommu: don't use atomic_ function on atomic64_t type
> powerpc: rewrite atomics to use ARCH_ATOMIC
>
> [...]
Patch 2 applied to powerpc/next.
[2/3] powerpc/64s/iommu: Don't use atomic_ function on atomic64_t type
https://git.kernel.org/powerpc/c/c33cd1ed60013ec2ae50f91fed260def5f1d9851
cheers
^ permalink raw reply
* Re: [PATCH v4 1/6] powerpc/book3s64/kuap: Improve error reporting with KUAP
From: Michael Ellerman @ 2020-12-15 10:58 UTC (permalink / raw)
To: Paul Mackerras, Christophe Leroy, Michael Ellerman, npiggin,
aneesh.kumar, Benjamin Herrenschmidt
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <0d37490a067840f53fc5b118869917c0aec9ab87.1607491747.git.christophe.leroy@csgroup.eu>
On Wed, 9 Dec 2020 05:29:20 +0000 (UTC), Christophe Leroy wrote:
> This partially reverts commit eb232b162446 ("powerpc/book3s64/kuap: Improve
> error reporting with KUAP") and update the fault handler to print
>
> [ 55.022514] Kernel attempted to access user page (7e6725b70000) - exploit attempt? (uid: 0)
> [ 55.022528] BUG: Unable to handle kernel data access on read at 0x7e6725b70000
> [ 55.022533] Faulting instruction address: 0xc000000000e8b9bc
> [ 55.022540] Oops: Kernel access of bad area, sig: 11 [#1]
> ....
>
> [...]
Patches 2-6 applied to powerpc/next.
[2/6] powerpc/mm: sanity_check_fault() should work for all, not only BOOK3S
https://git.kernel.org/powerpc/c/7ceb40027e19567a0a066e3b380cc034cdd9a124
[3/6] powerpc/fault: Unnest definition of page_fault_is_write() and page_fault_is_bad()
https://git.kernel.org/powerpc/c/5250d026d241febfaf226d26cabe528fc478e225
[4/6] powerpc/mm: Move the WARN() out of bad_kuap_fault()
https://git.kernel.org/powerpc/c/3dc12dfe74300febc568c3b530c0f9bee01f2821
[5/6] powerpc/fault: Avoid heavy search_exception_tables() verification
https://git.kernel.org/powerpc/c/cbd7e6ca0210db05c315a27bb5db5a482f2772ce
[6/6] powerpc/fault: Perform exception fixup in do_page_fault()
https://git.kernel.org/powerpc/c/5f1888a077069988218805534f56b983b6d5710c
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/vas: Fix IRQ name allocation
From: Haren Myneni @ 2020-12-15 10:56 UTC (permalink / raw)
To: Cédric Le Goater, linuxppc-dev; +Cc: Sukadev Bhattiprolu
In-Reply-To: <20201212142707.2102141-1-clg@kaod.org>
On Sat, 2020-12-12 at 15:27 +0100, Cédric Le Goater wrote:
> The VAS device allocates a generic interrupt to handle page faults
> but
> the IRQ name doesn't show under /proc. This is because it's on
> stack. Allocate the name.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Thanks for fixing.
Acked-by: Haren Myneni <haren@linux.ibm.com>
> ---
>
> I didn't understand this part in init_vas_instance() :
>
> if (vinst->virq) {
> rc = vas_irq_fault_window_setup(vinst);
> /*
> * Fault window is used only for user space send
> windows.
> * So if vinst->virq is NULL, tx_win_open returns
> -ENODEV
> * for user space.
> */
> if (rc)
> vinst->virq = 0;
> }
>
> If the IRQ cannot be requested, the device probing should fail but
> it's not today. The use of 'vinst->virq' is suspicious.
VAS raises an interrupt only when NX sees fault on request buffers and
faults can happen only for user space requests. So Fault window setup
is needed for user space requests. For kernel requests, continue even
if IRQ / fault_window_setup is failed.
When window open request is issued from user space, kernel returns
-ENODEV if vinst->virq = 0 (means fault window setup is failed).
>
> arch/powerpc/platforms/powernv/vas.h | 1 +
> arch/powerpc/platforms/powernv/vas.c | 11 ++++++++---
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/vas.h
> b/arch/powerpc/platforms/powernv/vas.h
> index 70f793e8f6cc..c7db3190baca 100644
> --- a/arch/powerpc/platforms/powernv/vas.h
> +++ b/arch/powerpc/platforms/powernv/vas.h
> @@ -340,6 +340,7 @@ struct vas_instance {
> struct vas_window *rxwin[VAS_COP_TYPE_MAX];
> struct vas_window *windows[VAS_WINDOWS_PER_CHIP];
>
> + char *name;
> char *dbgname;
> struct dentry *dbgdir;
> };
> diff --git a/arch/powerpc/platforms/powernv/vas.c
> b/arch/powerpc/platforms/powernv/vas.c
> index 598e4cd563fb..b65256a63e87 100644
> --- a/arch/powerpc/platforms/powernv/vas.c
> +++ b/arch/powerpc/platforms/powernv/vas.c
> @@ -28,12 +28,10 @@ static DEFINE_PER_CPU(int, cpu_vas_id);
>
> static int vas_irq_fault_window_setup(struct vas_instance *vinst)
> {
> - char devname[64];
> int rc = 0;
>
> - snprintf(devname, sizeof(devname), "vas-%d", vinst->vas_id);
> rc = request_threaded_irq(vinst->virq, vas_fault_handler,
> - vas_fault_thread_fn, 0, devname,
> vinst);
> + vas_fault_thread_fn, 0, vinst->name,
> vinst);
>
> if (rc) {
> pr_err("VAS[%d]: Request IRQ(%d) failed with %d\n",
> @@ -80,6 +78,12 @@ static int init_vas_instance(struct
> platform_device *pdev)
> if (!vinst)
> return -ENOMEM;
>
> + vinst->name = kasprintf(GFP_KERNEL, "vas-%d", vasid);
> + if (!vinst->name) {
> + kfree(vinst);
> + return -ENOMEM;
> + }
> +
> INIT_LIST_HEAD(&vinst->node);
> ida_init(&vinst->ida);
> mutex_init(&vinst->mutex);
> @@ -162,6 +166,7 @@ static int init_vas_instance(struct
> platform_device *pdev)
> return 0;
>
> free_vinst:
> + kfree(vinst->name);
> kfree(vinst);
> return -ENODEV;
>
^ permalink raw reply
* Re: [PATCH v1 01/20] powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
From: Michael Ellerman @ 2020-12-15 10:53 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Christophe Leroy, Paul Mackerras,
Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <648e2448e938d52d0b5887445e018ca584edc06d.1603348103.git.christophe.leroy@csgroup.eu>
On Thu, 22 Oct 2020 06:29:26 +0000 (UTC), Christophe Leroy wrote:
> On 8xx, we get the following features:
>
> [ 0.000000] cpu_features = 0x0000000000000100
> [ 0.000000] possible = 0x0000000000000120
> [ 0.000000] always = 0x0000000000000000
>
> This is not correct. As CONFIG_PPC_8xx is mutually exclusive with all
> other configurations, the three lines should be equal.
>
> [...]
Patches 1-19 applied to powerpc/next.
[01/20] powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
https://git.kernel.org/powerpc/c/78665179e569c7e1fe102fb6c21d0f5b6951f084
[02/20] powerpc/mm: Add mask of always present MMU features
https://git.kernel.org/powerpc/c/f9158d58a4e1d91f21741e4e8ebe67f770b84e12
[03/20] powerpc/mm: Remove flush_tlb_page_nohash() prototype.
https://git.kernel.org/powerpc/c/a54d310856b9c1fe15ad67a2f8ee9edc02965a3a
[04/20] powerpc/32s: Make bat_addrs[] static
https://git.kernel.org/powerpc/c/03d5b19c7243d6e605d360972dd7b701e2b1ba72
[05/20] powerpc/32s: Use mmu_has_feature(MMU_FTR_HPTE_TABLE) instead of checking Hash var
https://git.kernel.org/powerpc/c/4cc445b4ff456f3a3997c321d7a353360feea04f
[06/20] powerpc/32s: Make Hash var static
https://git.kernel.org/powerpc/c/4b74a35fc7e9b8efd9067b8a365bab0fefe889ff
[07/20] powerpc/32s: Declare Hash related vars as __initdata
https://git.kernel.org/powerpc/c/6e980b5c56a266de479fcd022a03e094574e9a03
[08/20] powerpc/32s: Move _tlbie() and _tlbia() prototypes to tlbflush.h
https://git.kernel.org/powerpc/c/cfe32ad0b3dc74df34ab6fea38ccb1e53f904a10
[09/20] powerpc/32s: Inline _tlbie() on non SMP
https://git.kernel.org/powerpc/c/b91280f3f36d64cc6f8022893af00935c99de197
[10/20] powerpc/32s: Move _tlbie() and _tlbia() in a new file
https://git.kernel.org/powerpc/c/f265512582a047e09390b1b41384f365d7dc806f
[11/20] powerpc/32s: Split and inline flush_tlb_mm() and flush_tlb_page()
https://git.kernel.org/powerpc/c/fd1b4b7f51d0d75b73eeda41ef459ea7791aaab2
[12/20] powerpc/32s: Inline flush_tlb_range() and flush_tlb_kernel_range()
https://git.kernel.org/powerpc/c/1e83396f29d75aae8a1d365f597996fec87ca4d0
[13/20] powerpc/32s: Split and inline flush_range()
https://git.kernel.org/powerpc/c/91ec450f8d8c1e599a943c526ab1d2a4acf73c22
[14/20] powerpc/32s: Inline tlb_flush()
https://git.kernel.org/powerpc/c/ef08d95546ccea540f6a592b89822bb085bf09c6
[15/20] powerpc/32s: Inline flush_hash_entry()
https://git.kernel.org/powerpc/c/80007a17fc59bc2766f7d5cb2f79b4c65651504b
[16/20] powerpc/32s: Move early_mmu_init() into mmu.c
https://git.kernel.org/powerpc/c/068fdba10ea54b6ebc12c2b2d85020b2137316d1
[17/20] powerpc/32s: Remove CONFIG_PPC_BOOK3S_6xx
https://git.kernel.org/powerpc/c/a6a50d8495d098b6459166c3707ab251d3dc9e06
[18/20] powerpc/32s: Regroup 603 based CPUs in cputable
https://git.kernel.org/powerpc/c/ad510e37e4b48f7da462650946aeaa078b977277
[19/20] powerpc/32s: Make support for 603 and 604+ selectable
https://git.kernel.org/powerpc/c/44e9754d63c7b419874e4c18c0b5e7a770e058c6
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/rtas: fix typo of ibm, open-errinjct in rtas filter
From: Michael Ellerman @ 2020-12-15 10:49 UTC (permalink / raw)
To: Tyrel Datwyler, mpe; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20201208195434.8289-1-tyreld@linux.ibm.com>
On Tue, 8 Dec 2020 13:54:34 -0600, Tyrel Datwyler wrote:
> Commit bd59380c5ba4 ("powerpc/rtas: Restrict RTAS requests from userspace")
> introduced the following error when invoking the errinjct userspace
> tool.
>
> [root@ltcalpine2-lp5 librtas]# errinjct open
> [327884.071171] sys_rtas: RTAS call blocked - exploit attempt?
> [327884.071186] sys_rtas: token=0x26, nargs=0 (called by errinjct)
> errinjct: Could not open RTAS error injection facility
> errinjct: librtas: open: Unexpected I/O error
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/rtas: Fix typo of ibm,open-errinjct in RTAS filter
https://git.kernel.org/powerpc/c/f10881a46f8914428110d110140a455c66bdf27b
cheers
^ permalink raw reply
* Re: [PATCH v5 0/5] powerpc/sstep: VSX 32-byte vector paired load/store instructions
From: Michael Ellerman @ 2020-12-15 10:49 UTC (permalink / raw)
To: mpe, Ravi Bangoria
Cc: jniethe5, bala24, paulus, sandipan, naveen.n.rao, linuxppc-dev
In-Reply-To: <20201011050908.72173-1-ravi.bangoria@linux.ibm.com>
On Sun, 11 Oct 2020 10:39:03 +0530, Ravi Bangoria wrote:
> VSX vector paired instructions operates with octword (32-byte)
> operand for loads and stores between storage and a pair of two
> sequential Vector-Scalar Registers (VSRs). There are 4 word
> instructions and 2 prefixed instructions that provides this
> 32-byte storage access operations - lxvp, lxvpx, stxvp, stxvpx,
> plxvp, pstxvp.
>
> [...]
Applied to powerpc/next.
[1/5] powerpc/sstep: Emulate prefixed instructions only when CPU_FTR_ARCH_31 is set
https://git.kernel.org/powerpc/c/ef6879f8c8053cc3b493f400a06d452d7fb13650
[2/5] powerpc/sstep: Cover new VSX instructions under CONFIG_VSX
https://git.kernel.org/powerpc/c/1817de2f141c718f1a0ae59927ec003e9b144349
[3/5] powerpc/sstep: Support VSX vector paired storage access instructions
https://git.kernel.org/powerpc/c/af99da74333b06d97ea6a9a2cd8906244da4bb26
[4/5] powerpc/ppc-opcode: Add encoding macros for VSX vector paired instructions
https://git.kernel.org/powerpc/c/6ce73ba7691555fd182bc68529dc03cbd4378f72
[5/5] powerpc/sstep: Add testcases for VSX vector paired load/store instructions
https://git.kernel.org/powerpc/c/35785b293da0070a8df19b0193f0e7de6c9eaecb
cheers
^ permalink raw reply
* Re: [PATCH v3] powerpc/watchpoint: Workaround P10 DD1 issue with VSX-32 byte instructions
From: Michael Ellerman @ 2020-12-15 10:49 UTC (permalink / raw)
To: mpe, Ravi Bangoria
Cc: christophe.leroy, mikey, jniethe5, npiggin, maddy, paulus,
naveen.n.rao, linuxppc-dev
In-Reply-To: <20201106045650.278987-1-ravi.bangoria@linux.ibm.com>
On Fri, 6 Nov 2020 10:26:50 +0530, Ravi Bangoria wrote:
> POWER10 DD1 has an issue where it generates watchpoint exceptions when
> it shouldn't. The conditions where this occur are:
>
> - octword op
> - ending address of DAWR range is less than starting address of op
> - those addresses need to be in the same or in two consecutive 512B
> blocks
> - 'op address + 64B' generates an address that has a carry into bit
> 52 (crosses 2K boundary)
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/watchpoint: Workaround P10 DD1 issue with VSX-32 byte instructions
https://git.kernel.org/powerpc/c/3d2ffcdd2a982e8bbe65fa0f94fb21bf304c281e
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc/64: irq replay remove decrementer overflow check
From: Michael Ellerman @ 2020-12-15 10:49 UTC (permalink / raw)
To: linuxppc-dev, Nicholas Piggin
In-Reply-To: <20201107014336.2337337-1-npiggin@gmail.com>
On Sat, 7 Nov 2020 11:43:36 +1000, Nicholas Piggin wrote:
> This is way to catch some cases of decrementer overflow, when the
> decrementer has underflowed an odd number of times, while MSR[EE] was
> disabled.
>
> With a typical small decrementer, a timer that fires when MSR[EE] is
> disabled will be "lost" if MSR[EE] remains disabled for between 4.3 and
> 8.6 seconds after the timer expires. In any case, the decrementer
> interrupt would be taken at 8.6 seconds and the timer would be found at
> that point.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/64: irq replay remove decrementer overflow check
https://git.kernel.org/powerpc/c/59d512e4374b2d8a6ad341475dc94c4a4bdec7d3
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/64s: Remove MSR[ISF] bit
From: Michael Ellerman @ 2020-12-15 10:49 UTC (permalink / raw)
To: linuxppc-dev, Nicholas Piggin
In-Reply-To: <20201106045340.1935841-1-npiggin@gmail.com>
On Fri, 6 Nov 2020 14:53:40 +1000, Nicholas Piggin wrote:
> No supported processor implements this mode. Setting the bit in
> MSR values can be a bit confusing (and would prevent the bit from
> ever being reused). Remove it.
Applied to powerpc/next.
[1/1] powerpc/64s: Remove MSR[ISF] bit
https://git.kernel.org/powerpc/c/e89a8ca94bf583f2577fe722483f0304b3390aa2
cheers
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox