Message ID | 20241219183211.3493974-1-pierrick.bouvier@linaro.org (mailing list archive) |
---|---|
Headers | show |
Series | Change default pointer authentication algorithm on aarch64 to impdef | expand |
On Thu, 19 Dec 2024 at 18:32, Pierrick Bouvier <pierrick.bouvier@linaro.org> wrote: > > qemu-system-aarch64 default pointer authentication (QARMA5) is expensive, we > spent up to 50% of the emulation time running it (when using TCG). > > Switching to pauth-impdef=on is often given as a solution to speed up execution. > Thus we talked about making it the new default. > > The first patch introduce a new property (pauth-qarma5) to allow to select > current default algorithm. > The second one change the default. > The third one updates documentation. > > v2: > - ensure we don't break migration compatibility, by using a specific backward > compatible property. > - added some documentation about migration for arm virt machine model. Other than a minor change to the 3rd docs patch which I'll note there: applied to target-arm.next, thanks. -- PMM
On 1/10/25 08:28, Peter Maydell wrote: > On Thu, 19 Dec 2024 at 18:32, Pierrick Bouvier > <pierrick.bouvier@linaro.org> wrote: >> >> qemu-system-aarch64 default pointer authentication (QARMA5) is expensive, we >> spent up to 50% of the emulation time running it (when using TCG). >> >> Switching to pauth-impdef=on is often given as a solution to speed up execution. >> Thus we talked about making it the new default. >> >> The first patch introduce a new property (pauth-qarma5) to allow to select >> current default algorithm. >> The second one change the default. >> The third one updates documentation. >> >> v2: >> - ensure we don't break migration compatibility, by using a specific backward >> compatible property. >> - added some documentation about migration for arm virt machine model. > > Other than a minor change to the 3rd docs patch which I'll note there: > applied to target-arm.next, thanks. > > -- PMM Thank you Peter. Regards, Pierrick
On Fri, 10 Jan 2025 at 16:28, Peter Maydell <peter.maydell@linaro.org> wrote: > > On Thu, 19 Dec 2024 at 18:32, Pierrick Bouvier > <pierrick.bouvier@linaro.org> wrote: > > > > qemu-system-aarch64 default pointer authentication (QARMA5) is expensive, we > > spent up to 50% of the emulation time running it (when using TCG). > > > > Switching to pauth-impdef=on is often given as a solution to speed up execution. > > Thus we talked about making it the new default. > > > > The first patch introduce a new property (pauth-qarma5) to allow to select > > current default algorithm. > > The second one change the default. > > The third one updates documentation. > > > > v2: > > - ensure we don't break migration compatibility, by using a specific backward > > compatible property. > > - added some documentation about migration for arm virt machine model. > > Other than a minor change to the 3rd docs patch which I'll note there: > applied to target-arm.next, thanks. I just noticed that this series breaks 'make check-tcg', because the pauth-3 test is explicitly checking the output of the pointer-auth operation. I'm going to add in this patch, which goes between patches 1 and 2 of this series: Author: Peter Maydell <peter.maydell@linaro.org> Date: Mon Jan 13 11:42:57 2025 +0000 tests/tcg/aarch64: force qarma5 for pauth-3 test The pauth-3 test explicitly tests that a computation of the pointer-authentication produces the expected result. This means that it must be run with the QARMA5 algorithm. Explicitly set the pauth algorithm when running this test, so that it doesn't break when we change the default algorithm the 'max' CPU uses. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target index d08d9b01ded..9c52475b7ae 100644 --- a/tests/tcg/aarch64/Makefile.softmmu-target +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -91,6 +91,9 @@ EXTRA_RUNS+=run-memory-replay ifneq ($(CROSS_CC_HAS_ARMV8_3),) pauth-3: CFLAGS += $(CROSS_CC_HAS_ARMV8_3) +# This test explicitly checks the output of the pauth operation so we +# must force the use of the QARMA5 algorithm for it. +run-pauth-3: QEMU_BASE_MACHINE=-M virt -cpu max,pauth-qarma5=on -display none else pauth-3: $(call skip-test, "BUILD of $@", "missing compiler support") thanks -- PMM
On 1/13/25 04:34, Peter Maydell wrote: > On Fri, 10 Jan 2025 at 16:28, Peter Maydell <peter.maydell@linaro.org> wrote: >> >> On Thu, 19 Dec 2024 at 18:32, Pierrick Bouvier >> <pierrick.bouvier@linaro.org> wrote: >>> >>> qemu-system-aarch64 default pointer authentication (QARMA5) is expensive, we >>> spent up to 50% of the emulation time running it (when using TCG). >>> >>> Switching to pauth-impdef=on is often given as a solution to speed up execution. >>> Thus we talked about making it the new default. >>> >>> The first patch introduce a new property (pauth-qarma5) to allow to select >>> current default algorithm. >>> The second one change the default. >>> The third one updates documentation. >>> >>> v2: >>> - ensure we don't break migration compatibility, by using a specific backward >>> compatible property. >>> - added some documentation about migration for arm virt machine model. >> >> Other than a minor change to the 3rd docs patch which I'll note there: >> applied to target-arm.next, thanks. > > I just noticed that this series breaks 'make check-tcg', because > the pauth-3 test is explicitly checking the output of the > pointer-auth operation. I'm going to add in this patch, which > goes between patches 1 and 2 of this series: > > Author: Peter Maydell <peter.maydell@linaro.org> > Date: Mon Jan 13 11:42:57 2025 +0000 > > tests/tcg/aarch64: force qarma5 for pauth-3 test > > The pauth-3 test explicitly tests that a computation of the > pointer-authentication produces the expected result. This means that > it must be run with the QARMA5 algorithm. > > Explicitly set the pauth algorithm when running this test, so that it > doesn't break when we change the default algorithm the 'max' CPU > uses. > > Signed-off-by: Peter Maydell <peter.maydell@linaro.org> > > diff --git a/tests/tcg/aarch64/Makefile.softmmu-target > b/tests/tcg/aarch64/Makefile.softmmu-target > index d08d9b01ded..9c52475b7ae 100644 > --- a/tests/tcg/aarch64/Makefile.softmmu-target > +++ b/tests/tcg/aarch64/Makefile.softmmu-target > @@ -91,6 +91,9 @@ EXTRA_RUNS+=run-memory-replay > > ifneq ($(CROSS_CC_HAS_ARMV8_3),) > pauth-3: CFLAGS += $(CROSS_CC_HAS_ARMV8_3) > +# This test explicitly checks the output of the pauth operation so we > +# must force the use of the QARMA5 algorithm for it. > +run-pauth-3: QEMU_BASE_MACHINE=-M virt -cpu max,pauth-qarma5=on -display none > else > pauth-3: > $(call skip-test, "BUILD of $@", "missing compiler support") > > > thanks > -- PMM Thanks Peter. I'm a bit surprised because I ran all tests , and didn't find any failure. I use container 'debian-all-test-cross' and ran 'make check-tcg'. Is the container missing something that doesn't trigger this test?
On 1/13/25 11:32, Pierrick Bouvier wrote: > On 1/13/25 04:34, Peter Maydell wrote: >> On Fri, 10 Jan 2025 at 16:28, Peter Maydell <peter.maydell@linaro.org> wrote: >>> >>> On Thu, 19 Dec 2024 at 18:32, Pierrick Bouvier >>> <pierrick.bouvier@linaro.org> wrote: >>>> >>>> qemu-system-aarch64 default pointer authentication (QARMA5) is expensive, we >>>> spent up to 50% of the emulation time running it (when using TCG). >>>> >>>> Switching to pauth-impdef=on is often given as a solution to speed up execution. >>>> Thus we talked about making it the new default. >>>> >>>> The first patch introduce a new property (pauth-qarma5) to allow to select >>>> current default algorithm. >>>> The second one change the default. >>>> The third one updates documentation. >>>> >>>> v2: >>>> - ensure we don't break migration compatibility, by using a specific backward >>>> compatible property. >>>> - added some documentation about migration for arm virt machine model. >>> >>> Other than a minor change to the 3rd docs patch which I'll note there: >>> applied to target-arm.next, thanks. >> >> I just noticed that this series breaks 'make check-tcg', because >> the pauth-3 test is explicitly checking the output of the >> pointer-auth operation. I'm going to add in this patch, which >> goes between patches 1 and 2 of this series: >> >> Author: Peter Maydell <peter.maydell@linaro.org> >> Date: Mon Jan 13 11:42:57 2025 +0000 >> >> tests/tcg/aarch64: force qarma5 for pauth-3 test >> >> The pauth-3 test explicitly tests that a computation of the >> pointer-authentication produces the expected result. This means that >> it must be run with the QARMA5 algorithm. >> >> Explicitly set the pauth algorithm when running this test, so that it >> doesn't break when we change the default algorithm the 'max' CPU >> uses. >> >> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> >> >> diff --git a/tests/tcg/aarch64/Makefile.softmmu-target >> b/tests/tcg/aarch64/Makefile.softmmu-target >> index d08d9b01ded..9c52475b7ae 100644 >> --- a/tests/tcg/aarch64/Makefile.softmmu-target >> +++ b/tests/tcg/aarch64/Makefile.softmmu-target >> @@ -91,6 +91,9 @@ EXTRA_RUNS+=run-memory-replay >> >> ifneq ($(CROSS_CC_HAS_ARMV8_3),) >> pauth-3: CFLAGS += $(CROSS_CC_HAS_ARMV8_3) >> +# This test explicitly checks the output of the pauth operation so we >> +# must force the use of the QARMA5 algorithm for it. >> +run-pauth-3: QEMU_BASE_MACHINE=-M virt -cpu max,pauth-qarma5=on -display none >> else >> pauth-3: >> $(call skip-test, "BUILD of $@", "missing compiler support") >> >> >> thanks >> -- PMM > > Thanks Peter. > > I'm a bit surprised because I ran all tests , and didn't find any failure. > > I use container 'debian-all-test-cross' and ran 'make check-tcg'. Is the > container missing something that doesn't trigger this test? I found that the build step I was using: - ./configure $QEMU_CONFIGURE_OPTS only builds user targets in this container. But failing test is related to a system target. I updated this on my side, to make sure I won't miss that next time. Thanks again for the fix. Regards, Pierrick
Peter Maydell <peter.maydell@linaro.org> writes: > On Fri, 10 Jan 2025 at 16:28, Peter Maydell <peter.maydell@linaro.org> wrote: >> >> On Thu, 19 Dec 2024 at 18:32, Pierrick Bouvier >> <pierrick.bouvier@linaro.org> wrote: >> > >> > qemu-system-aarch64 default pointer authentication (QARMA5) is expensive, we >> > spent up to 50% of the emulation time running it (when using TCG). >> > >> > Switching to pauth-impdef=on is often given as a solution to speed up execution. >> > Thus we talked about making it the new default. >> > >> > The first patch introduce a new property (pauth-qarma5) to allow to select >> > current default algorithm. >> > The second one change the default. >> > The third one updates documentation. >> > >> > v2: >> > - ensure we don't break migration compatibility, by using a specific backward >> > compatible property. >> > - added some documentation about migration for arm virt machine model. >> >> Other than a minor change to the 3rd docs patch which I'll note there: >> applied to target-arm.next, thanks. > > I just noticed that this series breaks 'make check-tcg', because > the pauth-3 test is explicitly checking the output of the > pointer-auth operation. I'm going to add in this patch, which > goes between patches 1 and 2 of this series: > > Author: Peter Maydell <peter.maydell@linaro.org> > Date: Mon Jan 13 11:42:57 2025 +0000 > > tests/tcg/aarch64: force qarma5 for pauth-3 test > > The pauth-3 test explicitly tests that a computation of the > pointer-authentication produces the expected result. This means that > it must be run with the QARMA5 algorithm. > > Explicitly set the pauth algorithm when running this test, so that it > doesn't break when we change the default algorithm the 'max' CPU > uses. > > Signed-off-by: Peter Maydell <peter.maydell@linaro.org> > > diff --git a/tests/tcg/aarch64/Makefile.softmmu-target > b/tests/tcg/aarch64/Makefile.softmmu-target > index d08d9b01ded..9c52475b7ae 100644 > --- a/tests/tcg/aarch64/Makefile.softmmu-target > +++ b/tests/tcg/aarch64/Makefile.softmmu-target > @@ -91,6 +91,9 @@ EXTRA_RUNS+=run-memory-replay > > ifneq ($(CROSS_CC_HAS_ARMV8_3),) > pauth-3: CFLAGS += $(CROSS_CC_HAS_ARMV8_3) > +# This test explicitly checks the output of the pauth operation so we > +# must force the use of the QARMA5 algorithm for it. > +run-pauth-3: QEMU_BASE_MACHINE=-M virt -cpu max,pauth-qarma5=on -display none > else > pauth-3: > $(call skip-test, "BUILD of $@", "missing compiler support") <snip> Acked-by: Alex Bennée <alex.bennee@linaro.org>