* [PULL 0/2] target-arm queue
@ 2023-04-10 14:14 Peter Maydell
2023-04-10 14:14 ` [PULL 1/2] target/arm: PTE bit GP only applies to stage1 Peter Maydell
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2023-04-10 14:14 UTC (permalink / raw)
To: qemu-devel
This bug seemed worth fixing for 8.0 since we need an rc4 anyway:
we were using uninitialized data for the guarded bit when
combining stage 1 and stage 2 attrs.
thanks
-- PMM
The following changes since commit 08dede07030973c1053868bc64de7e10bfa02ad6:
Merge tag 'pull-ppc-20230409' of https://github.com/legoater/qemu into staging (2023-04-10 11:47:52 +0100)
are available in the Git repository at:
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230410
for you to fetch changes up to 8539dc00552e8ea60420856fc1262c8299bc6308:
target/arm: Copy guarded bit in combine_cacheattrs (2023-04-10 14:31:40 +0100)
----------------------------------------------------------------
target-arm: Fix bug where we weren't initializing
guarded bit state when combining S1/S2 attrs
----------------------------------------------------------------
Richard Henderson (2):
target/arm: PTE bit GP only applies to stage1
target/arm: Copy guarded bit in combine_cacheattrs
target/arm/ptw.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread* [PULL 1/2] target/arm: PTE bit GP only applies to stage1 2023-04-10 14:14 [PULL 0/2] target-arm queue Peter Maydell @ 2023-04-10 14:14 ` Peter Maydell 2023-04-10 14:14 ` [PULL 2/2] target/arm: Copy guarded bit in combine_cacheattrs Peter Maydell 2023-04-10 18:45 ` [PULL 0/2] target-arm queue Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2023-04-10 14:14 UTC (permalink / raw) To: qemu-devel From: Richard Henderson <richard.henderson@linaro.org> Only perform the extract of GP during the stage1 walk. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20230407185149.3253946-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- target/arm/ptw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index ec3f51782aa..58a6de09bc9 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1585,11 +1585,6 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, result->f.attrs.secure = false; } - /* When in aarch64 mode, and BTI is enabled, remember GP in the TLB. */ - if (aarch64 && cpu_isar_feature(aa64_bti, cpu)) { - result->f.guarded = extract64(attrs, 50, 1); /* GP */ - } - if (regime_is_stage2(mmu_idx)) { result->cacheattrs.is_s2_format = true; result->cacheattrs.attrs = extract32(attrs, 2, 4); @@ -1600,6 +1595,11 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, assert(attrindx <= 7); result->cacheattrs.is_s2_format = false; result->cacheattrs.attrs = extract64(mair, attrindx * 8, 8); + + /* When in aarch64 mode, and BTI is enabled, remember GP in the TLB. */ + if (aarch64 && cpu_isar_feature(aa64_bti, cpu)) { + result->f.guarded = extract64(attrs, 50, 1); /* GP */ + } } /* -- 2.34.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PULL 2/2] target/arm: Copy guarded bit in combine_cacheattrs 2023-04-10 14:14 [PULL 0/2] target-arm queue Peter Maydell 2023-04-10 14:14 ` [PULL 1/2] target/arm: PTE bit GP only applies to stage1 Peter Maydell @ 2023-04-10 14:14 ` Peter Maydell 2023-04-10 18:45 ` [PULL 0/2] target-arm queue Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2023-04-10 14:14 UTC (permalink / raw) To: qemu-devel From: Richard Henderson <richard.henderson@linaro.org> The guarded bit comes from the stage1 walk. Fixes: Coverity CID 1507929 Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20230407185149.3253946-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- target/arm/ptw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 58a6de09bc9..6d72950a795 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -2576,6 +2576,7 @@ static ARMCacheAttrs combine_cacheattrs(uint64_t hcr, assert(!s1.is_s2_format); ret.is_s2_format = false; + ret.guarded = s1.guarded; if (s1.attrs == 0xf0) { tagged = true; -- 2.34.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PULL 0/2] target-arm queue 2023-04-10 14:14 [PULL 0/2] target-arm queue Peter Maydell 2023-04-10 14:14 ` [PULL 1/2] target/arm: PTE bit GP only applies to stage1 Peter Maydell 2023-04-10 14:14 ` [PULL 2/2] target/arm: Copy guarded bit in combine_cacheattrs Peter Maydell @ 2023-04-10 18:45 ` Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2023-04-10 18:45 UTC (permalink / raw) To: qemu-devel On Mon, 10 Apr 2023 at 15:14, Peter Maydell <peter.maydell@linaro.org> wrote: > > This bug seemed worth fixing for 8.0 since we need an rc4 anyway: > we were using uninitialized data for the guarded bit when > combining stage 1 and stage 2 attrs. > > thanks > -- PMM > > The following changes since commit 08dede07030973c1053868bc64de7e10bfa02ad6: > > Merge tag 'pull-ppc-20230409' of https://github.com/legoater/qemu into staging (2023-04-10 11:47:52 +0100) > > are available in the Git repository at: > > https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230410 > > for you to fetch changes up to 8539dc00552e8ea60420856fc1262c8299bc6308: > > target/arm: Copy guarded bit in combine_cacheattrs (2023-04-10 14:31:40 +0100) > > ---------------------------------------------------------------- > target-arm: Fix bug where we weren't initializing > guarded bit state when combining S1/S2 attrs > > ---------------------------------------------------------------- Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0 for any user-visible changes. -- PMM ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-10 18:47 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-04-10 14:14 [PULL 0/2] target-arm queue Peter Maydell 2023-04-10 14:14 ` [PULL 1/2] target/arm: PTE bit GP only applies to stage1 Peter Maydell 2023-04-10 14:14 ` [PULL 2/2] target/arm: Copy guarded bit in combine_cacheattrs Peter Maydell 2023-04-10 18:45 ` [PULL 0/2] target-arm queue Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).