]> www.infradead.org Git - users/dwmw2/qemu.git/commit
target/ppc: Add new hflags to support BHRB
authorGlenn Miles <milesg@linux.vnet.ibm.com>
Thu, 28 Mar 2024 10:41:29 +0000 (20:41 +1000)
committerNicholas Piggin <npiggin@gmail.com>
Thu, 23 May 2024 22:57:50 +0000 (08:57 +1000)
commita7138e28a242680ae25b52ed44842cde235103f0
tree3ca7ed0394c42a060da908997646a7a99bb4dd5a
parent687a30ad3c0f219bb372d806575eb47fae0cd27c
target/ppc: Add new hflags to support BHRB

This commit is preparatory to the addition of Branch History
Rolling Buffer (BHRB) functionality, which is being provided
today starting with the P8 processor.

BHRB uses several SPR register fields to control whether or not
a branch instruction's address (and sometimes target address)
should be recorded.  Checking each of these fields with each
branch instruction using jitted code would lead to a significant
decrease in performance.

Therefore, it was decided that BHRB configuration bits that are
not expected to change frequently should have their state summarized
in an hflag so that the amount of checking done by jitted code can
be reduced.

This commit contains the changes for summarizing the state of the
following register fields in the HFLAGS_BHRB_ENABLE hflag:

MMCR0[FCP] - Determines if BHRB recording is frozen in the
                     problem state

MMCR0[FCPC] - A modifier for MMCR0[FCP]

MMCRA[BHRBRD] - Disables all BHRB recording for a thread

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
target/ppc/cpu.h
target/ppc/cpu_init.c
target/ppc/helper.h
target/ppc/helper_regs.c
target/ppc/machine.c
target/ppc/power8-pmu-regs.c.inc
target/ppc/power8-pmu.c
target/ppc/power8-pmu.h
target/ppc/spr_common.h
target/ppc/translate.c