All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Daniel Axtens <dja@axtens.net>,
	linuxppc-dev@lists.ozlabs.org,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: ajd@linux.ibm.com
Subject: Re: [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems
Date: Sat, 14 Mar 2020 13:37:15 +1000	[thread overview]
Message-ID: <1584156888.f924kplz26.astroid@bobo.none> (raw)
In-Reply-To: <87lfo7q0cb.fsf@dja-thinkpad.axtens.net>

Daniel Axtens's on March 11, 2020 9:03 am:
>>>> So:
>>>>  - change the test when setting up a PACA to consider the actual value of
>>>>    the MSR rather than the CPU feature.
>>>> 
>>>>  - move the PACA setup to before the cpu feature parsing.
>>>
>>> Hmm. Problem is that equally we want PACA to be sane before we call too
>>> far into the rest of the kernel ("generic dt parsing code").
>>
>> But currently we call into that code with no paca at all. Or rather,
>> with r13 pointing somewhere random that will be interpreted as being a
>> paca.
>>
>> This took a while for Daniel to debug because depending on how you boot
>> r13 contains a different junk value. That junk value may not point to
>> memory at all, or if it does the memory it points to may or may not send
>> you down the wrong path, depending on which exact bit you're looking at
>> in some random location.
>>
>> So this is really not about kcov from my POV, that's just how we
>> discovered it.
> 
> Ah, yes. I agree with mpe, and reading back over my commit message I
> think I did a pretty poor job of explaining it. How about this for a
> commit message:

Sorry yeah I'm not quite sure what I was thinking there, because
you actually are moving the paca setup earlier. Hmm. Anyway it seems
okay to me. I would suggest putting a comment in the mfmsr() & MSR_HV
test so it doesn't get used elsewhere. Maybe include CPU_FTR_HVMODE
in the comment so grep shows it up.

Thanks,
Nick

      reply	other threads:[~2020-03-14  3:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  7:30 [PATCH v3] powerpc: setup_64: set up PACA earlier to avoid kcov problems Daniel Axtens
2020-03-06  7:59 ` Andrew Donnellan
2020-03-06 13:30   ` Daniel Axtens
2020-03-07  1:32 ` Nicholas Piggin
2020-03-10 11:41   ` Michael Ellerman
2020-03-10 23:03     ` Daniel Axtens
2020-03-14  3:37       ` Nicholas Piggin [this message]

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=1584156888.f924kplz26.astroid@bobo.none \
    --to=npiggin@gmail.com \
    --cc=ajd@linux.ibm.com \
    --cc=dja@axtens.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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.