All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@linux.ibm.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: danielhb413@gmail.com, richard.henderson@linaro.org,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org,
	david@gibson.dropbear.id.au
Subject: Re: [PATCH 4/8] squash target/ppc: Introduce powerpc_excp_40x
Date: Mon, 10 Jan 2022 16:00:50 -0300	[thread overview]
Message-ID: <875yqra00t.fsf@linux.ibm.com> (raw)
In-Reply-To: <17495cce-79f1-1483-aab3-86ffcde7492e@eik.bme.hu>

BALATON Zoltan <balaton@eik.bme.hu> writes:

> On Mon, 10 Jan 2022, Fabiano Rosas wrote:
>> Introduce a new exception dispatcher for 40x CPUs.
>>
>> Differences from the generic powerpc_excp code:
>>
>> - Not BookE, so some MSR bits are cleared at interrupt dispatch;
>> - No MSR_HV or MSR_LE;
>> - No power saving states;
>> - No Hypervisor Emulation Assistance;
>> - Not 64 bits;
>> - No System call vectored;
>> - No Interrupts Little Endian;
>> - No Alternate Interrupt Location.
>>
>> Exceptions used:
>>
>> POWERPC_EXCP_ALIGN
>> POWERPC_EXCP_APU
>> POWERPC_EXCP_CRITICAL
>> POWERPC_EXCP_DEBUG
>> POWERPC_EXCP_DSI
>> POWERPC_EXCP_DTLB
>> POWERPC_EXCP_EXTERNAL
>> POWERPC_EXCP_FIT
>> POWERPC_EXCP_FPU
>> POWERPC_EXCP_ISI
>> POWERPC_EXCP_ITLB
>> POWERPC_EXCP_MCHECK
>> POWERPC_EXCP_PIT
>> POWERPC_EXCP_PROGRAM
>> POWERPC_EXCP_SYSCALL
>> POWERPC_EXCP_WDT
>>
>> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
>> ---
>> target/ppc/excp_helper.c | 165 +++------------------------------------
>> 1 file changed, 13 insertions(+), 152 deletions(-)
>>
>> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
>> index 12ab5e1b34..1d997c4d6b 100644
>> --- a/target/ppc/excp_helper.c
>> +++ b/target/ppc/excp_helper.c
>> @@ -409,54 +409,18 @@ static void powerpc_excp_40x(PowerPCCPU *cpu, int excp)
>>                   excp, env->error_code);
>>
>>     /* new srr1 value excluding must-be-zero bits */
>> -    if (excp_model == POWERPC_EXCP_BOOKE) {
>> -        msr = env->msr;
>> -    } else {
>> -        msr = env->msr & ~0x783f0000ULL;
>> -    }
>> +    msr = env->msr & ~0x783f0000ULL;
>>
>>     /*
>> -     * new interrupt handler msr preserves existing HV and ME unless
>> -     * explicitly overriden
>> +     * new interrupt handler msr preserves existing ME unless
>> +     * explicitly overriden.
>>      */
>> -    new_msr = env->msr & (((target_ulong)1 << MSR_ME) | MSR_HVB);
>> +    new_msr = env->msr & (((target_ulong)1 << MSR_ME));
>>
>>     /* target registers */
>>     srr0 = SPR_SRR0;
>>     srr1 = SPR_SRR1;
>>
>> -    /*
>> -     * check for special resume at 0x100 from doze/nap/sleep/winkle on
>> -     * P7/P8/P9
>> -     */
>> -    if (env->resume_as_sreset) {
>> -        excp = powerpc_reset_wakeup(cs, env, excp, &msr);
>> -    }
>> -
>> -    /*
>> -     * Hypervisor emulation assistance interrupt only exists on server
>> -     * arch 2.05 server or later. We also don't want to generate it if
>> -     * we don't have HVB in msr_mask (PAPR mode).
>> -     */
>> -    if (excp == POWERPC_EXCP_HV_EMU
>> -#if defined(TARGET_PPC64)
>> -        && !(mmu_is_64bit(env->mmu_model) && (env->msr_mask & MSR_HVB))
>> -#endif /* defined(TARGET_PPC64) */
>> -
>> -    ) {
>> -        excp = POWERPC_EXCP_PROGRAM;
>> -    }
>> -
>> -#ifdef TARGET_PPC64
>> -    /*
>> -     * SPEU and VPU share the same IVOR but they exist in different
>> -     * processors. SPEU is e500v1/2 only and VPU is e6500 only.
>> -     */
>> -    if (excp_model == POWERPC_EXCP_BOOKE && excp == POWERPC_EXCP_VPU) {
>> -        excp = POWERPC_EXCP_SPEU;
>> -    }
>> -#endif
>> -
>>     vector = env->excp_vectors[excp];
>>     if (vector == (target_ulong)-1ULL) {
>>         cpu_abort(cs, "Raised an exception without defined vector %d\n",
>> @@ -581,6 +545,11 @@ static void powerpc_excp_40x(PowerPCCPU *cpu, int excp)
>>          */
>>         env->spr[SPR_DSISR] |= (env->error_code & 0x03FF0000) >> 16;
>>         break;
>> +    case POWERPC_EXCP_HV_EMU:
>> +        /*
>> +         * Hypervisor emulation assistance interrupt only exists on server
>> +         * arch 2.05 server or later.
>> +         */
>>     case POWERPC_EXCP_PROGRAM:   /* Program exception                        */
>>         switch (env->error_code & ~0xF) {
>>         case POWERPC_EXCP_FP:
>> @@ -645,22 +614,8 @@ static void powerpc_excp_40x(PowerPCCPU *cpu, int excp)
>>             new_msr |= (target_ulong)MSR_HVB;
>>         }
>>         break;
>> -    case POWERPC_EXCP_SYSCALL_VECTORED: /* scv exception                     */
>> -        lev = env->error_code;
>> -        dump_syscall(env);
>> -        env->nip += 4;
>> -        new_msr |= env->msr & ((target_ulong)1 << MSR_EE);
>> -        new_msr |= env->msr & ((target_ulong)1 << MSR_RI);
>> -
>> -        vector += lev * 0x20;
>> -
>> -        env->lr = env->nip;
>> -        env->ctr = msr;
>> -        break;
>>     case POWERPC_EXCP_FPU:       /* Floating-point unavailable exception     */
>>     case POWERPC_EXCP_APU:       /* Auxiliary processor unavailable          */
>> -    case POWERPC_EXCP_DECR:      /* Decrementer exception                    */
>> -        break;
>
> Removing the break here makes FPU and APU fall through to FIT. Is that 
> intentional?

No, that is a mistake indeed. Thanks.


  reply	other threads:[~2022-01-10 19:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 18:15 [PATCH 0/8] target/ppc: powerpc_excp improvements [40x] (3/n) Fabiano Rosas
2022-01-10 18:15 ` [PATCH 1/8] target/ppc: 405: Add missing MSR bits to msr_mask Fabiano Rosas
2022-01-11  2:04   ` David Gibson
2022-01-11  2:07     ` David Gibson
2022-01-17 21:12   ` Fabiano Rosas
2022-01-18  8:40     ` David Gibson
2022-01-10 18:15 ` [PATCH 2/8] target/ppc: 405: Add missing exception handlers Fabiano Rosas
2022-01-11  2:10   ` David Gibson
2022-01-14 21:46     ` Fabiano Rosas
2022-01-15  7:05       ` David Gibson
2022-01-10 18:15 ` [PATCH 3/8] target/ppc: Introduce powerpc_excp_40x Fabiano Rosas
2022-01-11  2:20   ` David Gibson
2022-01-10 18:15 ` [PATCH 4/8] squash " Fabiano Rosas
2022-01-10 18:51   ` BALATON Zoltan
2022-01-10 19:00     ` Fabiano Rosas [this message]
2022-01-10 18:15 ` [PATCH 5/8] target/ppc: 405: Critical exceptions cleanup Fabiano Rosas
2022-01-11  2:26   ` David Gibson
2022-01-10 18:15 ` [PATCH 6/8] target/ppc: 405: Machine check exception cleanup Fabiano Rosas
2022-01-11  2:26   ` David Gibson
2022-01-10 18:15 ` [PATCH 7/8] target/ppc: 405: External " Fabiano Rosas
2022-01-11  2:28   ` David Gibson
2022-01-10 18:15 ` [PATCH 8/8] target/ppc: 405: System call " Fabiano Rosas
2022-01-11  2:31   ` David Gibson
2022-01-11 12:48     ` Fabiano Rosas
2022-01-11  8:37 ` [PATCH 0/8] target/ppc: powerpc_excp improvements [40x] (3/n) Cédric Le Goater

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=875yqra00t.fsf@linux.ibm.com \
    --to=farosas@linux.ibm.com \
    --cc=balaton@eik.bme.hu \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.