linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: christophe.leroy@c-s.fr,
	Ravi Bangoria <ravi.bangoria@linux.ibm.com>,
	mikey@linux.ibm.com, jniethe5@gmail.com, npiggin@gmail.com,
	maddy@linux.ibm.com, paulus@samba.org,
	naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/2] powerpc: Introduce POWER10_DD1 feature
Date: Mon, 26 Oct 2020 15:28:36 +0530	[thread overview]
Message-ID: <911f16ea-352f-2764-d11b-474f9e8ebffa@linux.ibm.com> (raw)
In-Reply-To: <87ft66xzm7.fsf@mpe.ellerman.id.au>

Hi Michael,

>> +static void __init fixup_cpu_features(void)
>> +{
>> +	unsigned long version = mfspr(SPRN_PVR);
>> +
>> +	if ((version & 0xffffffff) == 0x00800100)
>> +		cur_cpu_spec->cpu_features |= CPU_FTR_POWER10_DD1;
>> +}
>> +
>>   static int __init early_init_dt_scan_cpus(unsigned long node,
>>   					  const char *uname, int depth,
>>   					  void *data)
>> @@ -378,6 +386,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
>>   
>>   		check_cpu_feature_properties(node);
>>   		check_cpu_pa_features(node);
>> +		fixup_cpu_features();
>>   	}
> 
> This is not the way we normally do CPU features.
> 
> In the past we have always added a raw entry in cputable.c, see eg. the
> Power9 DD 2.0, 2.1 entries.

True. But that won't work PowerVM guests because kernel overwrites "raw"
mode cpu_features with "architected" mode cpu_features.

> 
> Doing it here is not really safe, if you're running with an architected
> PVR (via cpu-version property), you can't set the DD1 feature, because
> you might be migrated to a future CPU that doesn't have the DD1 quirks.

Okay.. I suppose, that mean kernel need to check real PVR every time when it
encounters spurious exception. i.e. instead of using

   if (cpu_has_feature(CPU_FTR_POWER10_DD1) && ...)

it need to use

   if (mfspr(SPRN_PVR) == 0x800100 && ...)

in patch 2. Right?

Thanks,
Ravi

      reply	other threads:[~2020-10-26 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20  5:44 [PATCH 1/2] powerpc: Introduce POWER10_DD1 feature Ravi Bangoria
2020-10-20  5:44 ` [PATCH 2/2] powerpc/watchpoint: Workaround P10 DD1 issue with VSX-32 byte instructions Ravi Bangoria
2020-10-20  7:53   ` kernel test robot
2020-10-22 11:35 ` [PATCH 1/2] powerpc: Introduce POWER10_DD1 feature Michael Ellerman
2020-10-26  9:58   ` Ravi Bangoria [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=911f16ea-352f-2764-d11b-474f9e8ebffa@linux.ibm.com \
    --to=ravi.bangoria@linux.ibm.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mikey@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.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).