Skip to contentSkip to conversation

x86: cpu: Add new Airmont CPU model

PATCH Superseded Rahul Tanwar 3 participants 11 messages Aug 15, 2019 – Aug 16, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover x86: cpu: Add new Airmont CPU model

Intel Atom CPU based Lightning Mountain(LGM) network processor SoC has recently taped out. Although the Atom CPU used in LGM is based upon Airmont uArch but it has a few differences. Its a new variant of Atom Airmont cpu model.

This series of patches adds support for this new CPU model.

Patches are baselined upon Linux 5.3-rc4 at below Git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core

Patch 1 replaces existing direct values usage with constant definitions when access CPU models.

Patch 2 adds a constant definition for the new Atom CPU model.

Patch 3 updates capabilities & vulnerabilities applicable for this new CPU model.

Rahul Tanwar (3):
x86: cpu: Use constant definitions for CPU type
x86: cpu: Add new Intel Atom CPU type
x86: arch: Add arch support for new Intel Atom CPU

 arch/x86/include/asm/intel-family.h | 1 +
 arch/x86/kernel/cpu/common.c        | 1 +
 arch/x86/kernel/cpu/intel.c         | 7 ++++---
 arch/x86/kernel/tsc_msr.c           | 5 +++++
 4 files changed, 11 insertions(+), 3 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/3 x86: cpu: Use constant definitions for CPU type

This patch replaces direct values usage with constant definitions usage when access CPU models.

---
 arch/x86/kernel/cpu/intel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/intel.c +3 -3
index 8d6d92ebeb54..0419fba1ea56 100644
@@ -265,9 +265,9 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
 	if (c->x86 == 6) {
 		switch (c->x86_model) {
-		case 0x27:	/* Penwell */
-		case 0x35:	/* Cloverview */
-		case 0x4a:	/* Merrifield */
+		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
+		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
+		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */
 			set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
 			break;
 		default:
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 1/3] x86: cpu: Use constant definitions for CPU type

Rahul,

On Thu, 15 Aug 2019, Rahul Tanwar wrote:

Please use the proper prefix for your patches. x86 uses

x86/subsystem: not x86: subsystem:

Quoted 2 lines

This patch replaces direct values usage with constant definitions usage when access CPU models.

Please do not use 'This patch'. We already know that this is a patch otherwise you wouldn't have sent it with [PATCH] on the subject line, right?

See Documentation/process/submitting-patches.rst and search for 'This patch'.

Quoted 11 lines
---
 arch/x86/kernel/cpu/intel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/intel.c +0 -0
index 8d6d92ebeb54..0419fba1ea56 100644

arch/x86/kernel/cpu/intel.c static void early_init_intel(struct cpuinfo_x86 *c) · line 270

Quoted 9 lines
arch/x86/kernel/cpu/intel.c +3 -3
@@ -265,9 +265,9 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
 	if (c->x86 == 6) {
 		switch (c->x86_model) {
-		case 0x27:	/* Penwell */
-		case 0x35:	/* Cloverview */
-		case 0x4a:	/* Merrifield */
+		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
+		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
+		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */

Are these comments really still useful now that the defines are used? I don't think so.

Thanks,

tglx

#3 lore raw

Re: [PATCH 1/3] x86: cpu: Use constant definitions for CPU type

Hi Thomas,

Thanks for your comments.

Quoted 7 lines · Thomas Gleixner

Rahul,

On Thu, 15 Aug 2019, Rahul Tanwar wrote:

Please use the proper prefix for your patches. x86 uses

x86/subsystem: not x86: subsystem:

Well noted.

Quoted 8 lines
Quoted 2 lines

This patch replaces direct values usage with constant definitions usage when access CPU models.

Please do not use 'This patch'. We already know that this is a patch otherwise you wouldn't have sent it with [PATCH] on the subject line, right?

See Documentation/process/submitting-patches.rst and search for 'This patch'.

Well noted.

Quoted 6 lines
Quoted 6 lines
---
  arch/x86/kernel/cpu/intel.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 16 lines
Quoted 5 lines
arch/x86/kernel/cpu/intel.c +0 -0
index 8d6d92ebeb54..0419fba1ea56 100644

arch/x86/kernel/cpu/intel.c static void early_init_intel(struct cpuinfo_x86 *c) · line 270

Quoted 9 lines
arch/x86/kernel/cpu/intel.c +3 -3
@@ -265,9 +265,9 @@ static void early_init_intel(struct cpuinfo_x86 *c)
  	/* Penwell and Cloverview have the TSC which doesn't sleep on S3 */
  	if (c->x86 == 6) {
  		switch (c->x86_model) {
-		case 0x27:	/* Penwell */
-		case 0x35:	/* Cloverview */
-		case 0x4a:	/* Merrifield */
+		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
+		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
+		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */

Are these comments really still useful now that the defines are used? I don't think so.

Agree that these comments can be removed here. These comments are useful to

associate the CPU model with the product name. But, i think, the right place to have

these comments is intel-family.h. I will remove these comments from here in V2.

Regards,

Rahul

#4 lore raw

PATCH 2/3 x86: cpu: Add new Intel Atom CPU type

In reply to Rahul Tanwar

This patch adds a new variant of Intel Atom Airmont CPU model used in a network processor SoC named Lightning Mountain.

---
 arch/x86/include/asm/intel-family.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/intel-family.h +1 -0
index 0278aa66ef62..cbbb8250370f 100644
@@ -73,6 +73,7 @@
 
 #define INTEL_FAM6_ATOM_AIRMONT		0x4C /* Cherry Trail, Braswell */
 #define INTEL_FAM6_ATOM_AIRMONT_MID	0x5A /* Moorefield */
+#define INTEL_FAM6_ATOM_AIRMONT_NP	0x75 /* Lightning Mountain */
 
 #define INTEL_FAM6_ATOM_GOLDMONT	0x5C /* Apollo Lake */
 #define INTEL_FAM6_ATOM_GOLDMONT_X	0x5F /* Denverton */
Signature · 1 line
2.11.0
maintainer
#5 lore raw

Re: [PATCH 2/3] x86: cpu: Add new Intel Atom CPU type

Quoted 14 lines · Rahul Tanwar

This patch adds a new variant of Intel Atom Airmont CPU model used in a network processor SoC named Lightning Mountain.

---
 arch/x86/include/asm/intel-family.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/intel-family.h +0 -0
index 0278aa66ef62..cbbb8250370f 100644

arch/x86/include/asm/intel-family.h line 79

Quoted 7 lines
arch/x86/include/asm/intel-family.h +1 -0
@@ -73,6 +73,7 @@
 
 #define INTEL_FAM6_ATOM_AIRMONT		0x4C /* Cherry Trail, Braswell */
 #define INTEL_FAM6_ATOM_AIRMONT_MID	0x5A /* Moorefield */
+#define INTEL_FAM6_ATOM_AIRMONT_NP	0x75 /* Lightning Mountain */
 
 #define INTEL_FAM6_ATOM_GOLDMONT	0x5C /* Apollo Lake */
 #define INTEL_FAM6_ATOM_GOLDMONT_X	0x5F /* Denverton */

Also, in addition to what Thomas said, due to the fact that all the different groups within Intel are sending patches with model names, please synchronize that model naming and patch sending with Tony from now on:

https://git.kernel.org/tip/5ed1c835ed8b522ce25071cc2d56a9a09bd5b59e

He'll document the naming scheme and pay attention to what goes where so make sure you CC him, talk to him or have him in the loop, in general.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#6 lore raw

Re: [PATCH 2/3] x86: cpu: Add new Intel Atom CPU type

Hi Boris,

Well noted, will have Tony in loop from now on. Thanks.

Regards,

Rahul

Quoted 34 lines · Borislav Petkov
Quoted 14 lines · Rahul Tanwar

This patch adds a new variant of Intel Atom Airmont CPU model used in a network processor SoC named Lightning Mountain.

---
  arch/x86/include/asm/intel-family.h | 1 +
  1 file changed, 1 insertion(+)
arch/x86/include/asm/intel-family.h +0 -0
index 0278aa66ef62..cbbb8250370f 100644

arch/x86/include/asm/intel-family.h line 79

Quoted 7 lines
arch/x86/include/asm/intel-family.h +1 -0
@@ -73,6 +73,7 @@
 
  #define INTEL_FAM6_ATOM_AIRMONT		0x4C /* Cherry Trail, Braswell */
  #define INTEL_FAM6_ATOM_AIRMONT_MID	0x5A /* Moorefield */
+#define INTEL_FAM6_ATOM_AIRMONT_NP	0x75 /* Lightning Mountain */
 
  #define INTEL_FAM6_ATOM_GOLDMONT	0x5C /* Apollo Lake */
  #define INTEL_FAM6_ATOM_GOLDMONT_X	0x5F /* Denverton */

Also, in addition to what Thomas said, due to the fact that all the different groups within Intel are sending patches with model names, please synchronize that model naming and patch sending with Tony from now on:

https://git.kernel.org/tip/5ed1c835ed8b522ce25071cc2d56a9a09bd5b59e

He'll document the naming scheme and pay attention to what goes where so make sure you CC him, talk to him or have him in the loop, in general.

Thx.

maintainer
#7 lore raw

Re: [PATCH 2/3] x86: cpu: Add new Intel Atom CPU type

Quoted 4 lines · Rahul

Hi Boris,

Well noted, will have Tony in loop from now on. Thanks.

Ok.

Now to another question: you see how I put my reply to the previous mail *below* the quoted text. Why is yours ontop? Why not put it after mine since you're replying to it, like it is usually done on the mailing lists and thus not confuse the reading order?

All I'm trying to say is, please do not top-post.

Thanks!

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#8 lore raw

Re: [PATCH 2/3] x86: cpu: Add new Intel Atom CPU type

Quoted 6 lines · Borislav Petkov

Now to another question: you see how I put my reply to the previous mail *below* the quoted text. Why is yours ontop? Why not put it after mine since you're replying to it, like it is usually done on the mailing lists and thus not confuse the reading order?

All I'm trying to say is, please do not top-post.

So sorry for missing out on this point. Will always keep in mind from now on.

Regards,

Rahul

maintainer
#9 lore raw

Re: [PATCH 2/3] x86: cpu: Add new Intel Atom CPU type

Quoted 11 lines · Rahul
Quoted 6 lines · Borislav Petkov

Now to another question: you see how I put my reply to the previous mail *below* the quoted text. Why is yours ontop? Why not put it after mine since you're replying to it, like it is usually done on the mailing lists and thus not confuse the reading order?

All I'm trying to say is, please do not top-post.

So sorry for missing out on this point. Will always keep in mind from now on.

Thanks!

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#10 lore raw

PATCH 3/3 x86: arch: Add arch support for new Intel Atom CPU

In reply to Rahul Tanwar

This patch adds basic arch support for a new variant of Intel Atom CPU model used in a network processor SoC named Lightning Mountain.

---
 arch/x86/kernel/cpu/common.c | 1 +
 arch/x86/kernel/cpu/intel.c  | 1 +
 arch/x86/kernel/tsc_msr.c    | 5 +++++
 3 files changed, 7 insertions(+)
arch/x86/kernel/cpu/common.c +1 -0
index 5cc2d51cc25e..c6b4a578b280 100644
@@ -1059,6 +1059,7 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
 	VULNWL_INTEL(CORE_YONAH,		NO_SSB),
 
 	VULNWL_INTEL(ATOM_AIRMONT_MID,		NO_L1TF | MSBDS_ONLY | NO_SWAPGS),
+	VULNWL_INTEL(ATOM_AIRMONT_NP,		NO_L1TF | NO_SWAPGS),
 
 	VULNWL_INTEL(ATOM_GOLDMONT,		NO_MDS | NO_L1TF | NO_SWAPGS),
 	VULNWL_INTEL(ATOM_GOLDMONT_X,		NO_MDS | NO_L1TF | NO_SWAPGS),
arch/x86/kernel/cpu/intel.c +1 -0
index 0419fba1ea56..e989a8429390 100644
@@ -268,6 +268,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 		case INTEL_FAM6_ATOM_SALTWELL_MID:	/* Penwell */
 		case INTEL_FAM6_ATOM_SALTWELL_TABLET:	/* Cloverview */
 		case INTEL_FAM6_ATOM_SILVERMONT_MID:	/* Merrifield */
+		case INTEL_FAM6_ATOM_AIRMONT_NP:	/* Lightning Mountain */
 			set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC_S3);
 			break;
 		default:
arch/x86/kernel/tsc_msr.c +5 -0
index 067858fe4db8..e0cbe4f2af49 100644
@@ -58,6 +58,10 @@ static const struct freq_desc freq_desc_ann = {
 	1, { 83300, 100000, 133300, 100000, 0, 0, 0, 0 }
 };
 
+static const struct freq_desc freq_desc_lgm = {
+	1, { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 }
+};
+
 static const struct x86_cpu_id tsc_msr_cpu_ids[] = {
 	INTEL_CPU_FAM6(ATOM_SALTWELL_MID,	freq_desc_pnw),
 	INTEL_CPU_FAM6(ATOM_SALTWELL_TABLET,	freq_desc_clv),
@@ -65,6 +69,7 @@ static const struct x86_cpu_id tsc_msr_cpu_ids[] = {
 	INTEL_CPU_FAM6(ATOM_SILVERMONT_MID,	freq_desc_tng),
 	INTEL_CPU_FAM6(ATOM_AIRMONT,		freq_desc_cht),
 	INTEL_CPU_FAM6(ATOM_AIRMONT_MID,	freq_desc_ann),
+	INTEL_CPU_FAM6(ATOM_AIRMONT_NP,		freq_desc_lgm),
 	{}
 };
 
Signature · 1 line
2.11.0