qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tom Musta <tommusta@gmail.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 9/9] target-ppc: Introduce Privileged TM Noops
Date: Sat, 20 Dec 2014 15:22:52 -0600	[thread overview]
Message-ID: <5495E8AC.20403@gmail.com> (raw)
In-Reply-To: <20141219102010.GA5569@fam-t430.nay.redhat.com>

On 12/19/2014 4:20 AM, Fam Zheng wrote:
> On Thu, 12/18 10:34, Tom Musta wrote:
>> Add the supervisory Transactional Memory instructions treclaim. and
>> trechkpt.  The implementation is a degenerate one that simply
>> checks privileged state, TM availability and then sets CR[0] to
>> 0b0000, just like the unprivileged noops.
> 
> And also s-o-b for this :)
> 
> Fam
> 
>> ---
>>  target-ppc/translate.c |   38 ++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 38 insertions(+), 0 deletions(-)
>>
>> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
>> index a3c79a6..b4a4297 100644
>> --- a/target-ppc/translate.c
>> +++ b/target-ppc/translate.c
>> @@ -9691,6 +9691,40 @@ static void gen_tcheck(DisasContext *ctx)
>>      tcg_gen_movi_i32(cpu_crf[crfD(ctx->opcode)], 0x8);
>>  }
>>  
>> +#if defined(CONFIG_USER_ONLY)
>> +#define GEN_TM_PRIV_NOOP(name)                                 \
>> +static inline void gen_##name(DisasContext *ctx)               \
>> +{                                                              \
>> +    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);           \
>> +}
>> +
>> +#else
>> +
>> +#define GEN_TM_PRIV_NOOP(name)                                 \
>> +static inline void gen_##name(DisasContext *ctx)               \
>> +{                                                              \
>> +    if (unlikely(ctx->pr)) {                                   \
>> +        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);       \
>> +        return;                                                \
>> +    }                                                          \
>> +    if (unlikely(!ctx->tm_enabled)) {                          \
>> +        gen_exception_err(ctx, POWERPC_EXCP_FU, FSCR_IC_TM);   \
>> +        return;                                                \
>> +    }                                                          \
>> +    /* Because tbegin always fails, the implementation is      \
>> +     * simple:                                                 \
>> +     *                                                         \
>> +     *   CR[0] = 0b0 || MSR[TS] || 0b0                         \
>> +     *         = 0b0 || 0b00 | 0b0                             \
>> +     */                                                        \
>> +    tcg_gen_movi_i32(cpu_crf[0], 0);                           \
>> +}
>> +
>> +#endif
>> +
>> +GEN_TM_PRIV_NOOP(treclaim);
>> +GEN_TM_PRIV_NOOP(trechkpt);
>> +
>>  static opcode_t opcodes[] = {
>>  GEN_HANDLER(invalid, 0x00, 0x00, 0x00, 0xFFFFFFFF, PPC_NONE),
>>  GEN_HANDLER(cmp, 0x1F, 0x00, 0x00, 0x00400000, PPC_INTEGER),
>> @@ -11122,6 +11156,10 @@ GEN_HANDLER2_E(tsr, "tsr", 0x1F, 0x0E, 0x17, 0x03DFF800, \
>>                 PPC_NONE, PPC2_TM),
>>  GEN_HANDLER2_E(tcheck, "tcheck", 0x1F, 0x0E, 0x16, 0x007FF800, \
>>                 PPC_NONE, PPC2_TM),
>> +GEN_HANDLER2_E(treclaim, "treclaim", 0x1F, 0x0E, 0x1D, 0x03E0F800, \
>> +               PPC_NONE, PPC2_TM),
>> +GEN_HANDLER2_E(trechkpt, "trechkpt", 0x1F, 0x0E, 0x1F, 0x03FFF800, \
>> +               PPC_NONE, PPC2_TM),
>>  };
>>  
>>  #include "helper_regs.h"
>> -- 
>> 1.7.1
>>
>>

Signed-off-by: Tom Musta <tommusta@gmail.com>

  reply	other threads:[~2014-12-20 21:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 16:34 [Qemu-devel] [PATCH 0/9] target-ppc: Rudimentary Support for Transactional Memory Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 1/9] target-ppc: Introduce Instruction Type " Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 2/9] target-ppc: Introduce Feature Flag " Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 3/9] target-ppc: Introduce tm_enabled Bit to CPU State Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 4/9] target-ppc: Power8 Supports Transactional Memory Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 5/9] target-ppc: Introduce TEXASRU Bit Fields Tom Musta
2014-12-18 17:02   ` Alexander Graf
2014-12-18 18:10     ` Tom Musta
2014-12-18 18:29       ` Alexander Graf
2014-12-18 18:41         ` Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 6/9] target-ppc: Introduce tbegin Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 7/9] target-ppc: Introduce TM Noops Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 8/9] target-ppc: Introduce tcheck Tom Musta
2014-12-18 16:34 ` [Qemu-devel] [PATCH 9/9] target-ppc: Introduce Privileged TM Noops Tom Musta
2014-12-19 10:20   ` Fam Zheng
2014-12-20 21:22     ` Tom Musta [this message]
2014-12-18 22:52 ` [Qemu-devel] [PATCH 0/9] target-ppc: Rudimentary Support for Transactional Memory Alexander Graf

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=5495E8AC.20403@gmail.com \
    --to=tommusta@gmail.com \
    --cc=agraf@suse.de \
    --cc=famz@redhat.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).