qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Glenn Miles" <milesg@linux.vnet.ibm.com>, <qemu-ppc@nongnu.org>
Cc: qemu-devel@nongnu.org,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v3 2/4] target/ppc: Add recording of taken branches to BHRB
Date: Mon, 05 Feb 2024 18:37:12 +1000	[thread overview]
Message-ID: <CYX0BR3QNAX4.3O5GDHTDLPOOI@wheely> (raw)
In-Reply-To: <20230925174351.617891-3-milesg@linux.vnet.ibm.com>

On Tue Sep 26, 2023 at 3:43 AM AEST, Glenn Miles wrote:
> This commit continues adding support for the Branch History
> Rolling Buffer (BHRB) as is provided starting with the P8
> processor and continuing with its successors.  This commit
> is limited to the recording and filtering of taken branches.
>
> The following changes were made:
>
>   - Enabled functionality on P10 processors only due to
>     performance impact seen with P8 and P9 where it is not
>     disabled for non problem state branches.
>   - Added a BHRB buffer for storing branch instruction and
>     target addresses for taken branches
>   - Renamed gen_update_cfar to gen_update_branch_history and
>     added a 'target' parameter to hold the branch target
>     address and 'inst_type' parameter to use for filtering
>   - Added TCG code to gen_update_branch_history that stores
>     data to the BHRB and updates the BHRB offset.
>   - Added BHRB resource initialization and reset functions
>
> Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
> ---

> +static inline void gen_update_branch_history(DisasContext *ctx,
> +                                             target_ulong nip,
> +                                             TCGv target,
> +                                             target_long inst_type)
>  {
>  #if defined(TARGET_PPC64)
> +    TCGv base;
> +    TCGv tmp;
> +    TCGv offset;
> +    TCGv mask;
> +    TCGLabel *no_update;
> +
>      if (ctx->has_cfar) {
>          tcg_gen_movi_tl(cpu_cfar, nip);
>      }
> +
> +    if (!ctx->has_bhrb ||
> +        !ctx->bhrb_enable ||
> +        inst_type == BHRB_TYPE_NORECORD) {
> +        return;
> +    }

BTW while debugging what turned out to be a mismerge, I removed has_bhrb
because bhrb_enable is always a subset. Shout if you have an objection.

Thanks,
Nick


  reply	other threads:[~2024-02-05  8:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 17:43 [PATCH v3 0/4] Add BHRB Facility Support Glenn Miles
2023-09-25 17:43 ` [PATCH v3 1/4] target/ppc: Add new hflags to support BHRB Glenn Miles
2023-09-25 17:43 ` [PATCH v3 2/4] target/ppc: Add recording of taken branches to BHRB Glenn Miles
2024-02-05  8:37   ` Nicholas Piggin [this message]
2023-09-25 17:43 ` [PATCH v3 3/4] target/ppc: Add clrbhrb and mfbhrbe instructions Glenn Miles
2023-09-25 17:43 ` [PATCH v3 4/4] target/ppc: Add migration support for BHRB Glenn Miles
2023-10-18 15:06 ` [PATCH v3 0/4] Add BHRB Facility Support Nicholas Piggin
2023-10-18 15:59   ` Miles Glenn
2023-11-27 20:51     ` Miles Glenn
2023-11-28  1:50       ` Nicholas Piggin
2024-02-05  8:05 ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CYX0BR3QNAX4.3O5GDHTDLPOOI@wheely \
    --to=npiggin@gmail.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=milesg@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).