All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
@ 2023-11-23  9:36 ` Zhao Ke
  0 siblings, 0 replies; 11+ messages in thread
From: Zhao Ke @ 2023-11-23  9:36 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy, fbarrat, ajd, arnd, gregkh
  Cc: linuxppc-dev, linux-kernel, kvm, shenghui.qu, luming.yu,
	dawei.li, Zhao Ke

HeXin Tech Co. has applied for a new PVN from the OpenPower Community
for its new processor C2000. The OpenPower has assigned a new PVN
and this newly assigned PVN is 0x0066, add pvr register related
support for this PVN.

Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
---
	v0 -> v1:
	- Fix .cpu_name with the correct description
---
---
 arch/powerpc/include/asm/reg.h            |  1 +
 arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
 arch/powerpc/kvm/book3s_pr.c              |  1 +
 arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
 arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
 drivers/misc/cxl/cxl.h                    |  3 ++-
 6 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 4ae4ab9090a2..7fd09f25452d 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1361,6 +1361,7 @@
 #define PVR_POWER8E	0x004B
 #define PVR_POWER8NVL	0x004C
 #define PVR_POWER8	0x004D
+#define PVR_HX_C2000	0x0066
 #define PVR_POWER9	0x004E
 #define PVR_POWER10	0x0080
 #define PVR_BE		0x0070
diff --git a/arch/powerpc/kernel/cpu_specs_book3s_64.h b/arch/powerpc/kernel/cpu_specs_book3s_64.h
index c370c1b804a9..367c9f6d9be5 100644
--- a/arch/powerpc/kernel/cpu_specs_book3s_64.h
+++ b/arch/powerpc/kernel/cpu_specs_book3s_64.h
@@ -238,6 +238,21 @@ static struct cpu_spec cpu_specs[] __initdata = {
 		.machine_check_early	= __machine_check_early_realmode_p8,
 		.platform		= "power8",
 	},
+	{	/* 2.07-compliant processor, HeXin C2000 processor */
+		.pvr_mask		= 0xffffffff,
+		.pvr_value		= 0x00660000,
+		.cpu_name		= "POWER8 (raw)",
+		.cpu_features		= CPU_FTRS_POWER8,
+		.cpu_user_features	= COMMON_USER_POWER8,
+		.cpu_user_features2	= COMMON_USER2_POWER8,
+		.mmu_features		= MMU_FTRS_POWER8,
+		.icache_bsize		= 128,
+		.dcache_bsize		= 128,
+		.cpu_setup		= __setup_cpu_power8,
+		.cpu_restore		= __restore_cpu_power8,
+		.machine_check_early	= __machine_check_early_realmode_p8,
+		.platform		= "power8",
+	},
 	{	/* 3.00-compliant processor, i.e. Power9 "architected" mode */
 		.pvr_mask		= 0xffffffff,
 		.pvr_value		= 0x0f000005,
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 9118242063fb..5b92619a05fd 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -604,6 +604,7 @@ static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr)
 	case PVR_POWER8:
 	case PVR_POWER8E:
 	case PVR_POWER8NVL:
+	case PVR_HX_C2000:
 	case PVR_POWER9:
 		vcpu->arch.hflags |= BOOK3S_HFLAG_MULTI_PGSIZE |
 			BOOK3S_HFLAG_NEW_TLBIE;
diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c
index 125733962033..c38f378e1942 100644
--- a/arch/powerpc/mm/book3s64/pkeys.c
+++ b/arch/powerpc/mm/book3s64/pkeys.c
@@ -89,7 +89,8 @@ static int __init scan_pkey_feature(void)
 			unsigned long pvr = mfspr(SPRN_PVR);
 
 			if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
-			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9)
+			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9 ||
+				PVR_VER(pvr) == PVR_HX_C2000)
 				pkeys_total = 32;
 		}
 	}
diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
index 191424468f10..58e7331e1e7e 100644
--- a/arch/powerpc/platforms/powernv/subcore.c
+++ b/arch/powerpc/platforms/powernv/subcore.c
@@ -425,7 +425,8 @@ static int subcore_init(void)
 
 	if (pvr_ver != PVR_POWER8 &&
 	    pvr_ver != PVR_POWER8E &&
-	    pvr_ver != PVR_POWER8NVL)
+	    pvr_ver != PVR_POWER8NVL &&
+		pvr_ver != PVR_HX_C2000)
 		return 0;
 
 	/*
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index 0562071cdd4a..9ac2991b29c7 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -836,7 +836,8 @@ static inline bool cxl_is_power8(void)
 {
 	if ((pvr_version_is(PVR_POWER8E)) ||
 	    (pvr_version_is(PVR_POWER8NVL)) ||
-	    (pvr_version_is(PVR_POWER8)))
+	    (pvr_version_is(PVR_POWER8)) ||
+		(pvr_version_is(PVR_HX_C2000)))
 		return true;
 	return false;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
@ 2023-11-23  9:36 ` Zhao Ke
  0 siblings, 0 replies; 11+ messages in thread
From: Zhao Ke @ 2023-11-23  9:36 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy, fbarrat, ajd, arnd, gregkh
  Cc: luming.yu, Zhao Ke, kvm, dawei.li, linux-kernel, shenghui.qu,
	linuxppc-dev

HeXin Tech Co. has applied for a new PVN from the OpenPower Community
for its new processor C2000. The OpenPower has assigned a new PVN
and this newly assigned PVN is 0x0066, add pvr register related
support for this PVN.

Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
---
	v0 -> v1:
	- Fix .cpu_name with the correct description
---
---
 arch/powerpc/include/asm/reg.h            |  1 +
 arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
 arch/powerpc/kvm/book3s_pr.c              |  1 +
 arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
 arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
 drivers/misc/cxl/cxl.h                    |  3 ++-
 6 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 4ae4ab9090a2..7fd09f25452d 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1361,6 +1361,7 @@
 #define PVR_POWER8E	0x004B
 #define PVR_POWER8NVL	0x004C
 #define PVR_POWER8	0x004D
+#define PVR_HX_C2000	0x0066
 #define PVR_POWER9	0x004E
 #define PVR_POWER10	0x0080
 #define PVR_BE		0x0070
diff --git a/arch/powerpc/kernel/cpu_specs_book3s_64.h b/arch/powerpc/kernel/cpu_specs_book3s_64.h
index c370c1b804a9..367c9f6d9be5 100644
--- a/arch/powerpc/kernel/cpu_specs_book3s_64.h
+++ b/arch/powerpc/kernel/cpu_specs_book3s_64.h
@@ -238,6 +238,21 @@ static struct cpu_spec cpu_specs[] __initdata = {
 		.machine_check_early	= __machine_check_early_realmode_p8,
 		.platform		= "power8",
 	},
+	{	/* 2.07-compliant processor, HeXin C2000 processor */
+		.pvr_mask		= 0xffffffff,
+		.pvr_value		= 0x00660000,
+		.cpu_name		= "POWER8 (raw)",
+		.cpu_features		= CPU_FTRS_POWER8,
+		.cpu_user_features	= COMMON_USER_POWER8,
+		.cpu_user_features2	= COMMON_USER2_POWER8,
+		.mmu_features		= MMU_FTRS_POWER8,
+		.icache_bsize		= 128,
+		.dcache_bsize		= 128,
+		.cpu_setup		= __setup_cpu_power8,
+		.cpu_restore		= __restore_cpu_power8,
+		.machine_check_early	= __machine_check_early_realmode_p8,
+		.platform		= "power8",
+	},
 	{	/* 3.00-compliant processor, i.e. Power9 "architected" mode */
 		.pvr_mask		= 0xffffffff,
 		.pvr_value		= 0x0f000005,
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 9118242063fb..5b92619a05fd 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -604,6 +604,7 @@ static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr)
 	case PVR_POWER8:
 	case PVR_POWER8E:
 	case PVR_POWER8NVL:
+	case PVR_HX_C2000:
 	case PVR_POWER9:
 		vcpu->arch.hflags |= BOOK3S_HFLAG_MULTI_PGSIZE |
 			BOOK3S_HFLAG_NEW_TLBIE;
diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c
index 125733962033..c38f378e1942 100644
--- a/arch/powerpc/mm/book3s64/pkeys.c
+++ b/arch/powerpc/mm/book3s64/pkeys.c
@@ -89,7 +89,8 @@ static int __init scan_pkey_feature(void)
 			unsigned long pvr = mfspr(SPRN_PVR);
 
 			if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
-			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9)
+			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9 ||
+				PVR_VER(pvr) == PVR_HX_C2000)
 				pkeys_total = 32;
 		}
 	}
diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
index 191424468f10..58e7331e1e7e 100644
--- a/arch/powerpc/platforms/powernv/subcore.c
+++ b/arch/powerpc/platforms/powernv/subcore.c
@@ -425,7 +425,8 @@ static int subcore_init(void)
 
 	if (pvr_ver != PVR_POWER8 &&
 	    pvr_ver != PVR_POWER8E &&
-	    pvr_ver != PVR_POWER8NVL)
+	    pvr_ver != PVR_POWER8NVL &&
+		pvr_ver != PVR_HX_C2000)
 		return 0;
 
 	/*
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index 0562071cdd4a..9ac2991b29c7 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -836,7 +836,8 @@ static inline bool cxl_is_power8(void)
 {
 	if ((pvr_version_is(PVR_POWER8E)) ||
 	    (pvr_version_is(PVR_POWER8NVL)) ||
-	    (pvr_version_is(PVR_POWER8)))
+	    (pvr_version_is(PVR_POWER8)) ||
+		(pvr_version_is(PVR_HX_C2000)))
 		return true;
 	return false;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
  2023-11-23  9:36 ` Zhao Ke
@ 2023-11-23  9:43   ` Greg KH
  -1 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2023-11-23  9:43 UTC (permalink / raw)
  To: Zhao Ke
  Cc: mpe, npiggin, christophe.leroy, fbarrat, ajd, arnd, linuxppc-dev,
	linux-kernel, kvm, shenghui.qu, luming.yu, dawei.li

On Thu, Nov 23, 2023 at 05:36:11PM +0800, Zhao Ke wrote:
> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
> for its new processor C2000. The OpenPower has assigned a new PVN
> and this newly assigned PVN is 0x0066, add pvr register related
> support for this PVN.
> 
> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
> ---
> 	v0 -> v1:
> 	- Fix .cpu_name with the correct description
> ---
> ---
>  arch/powerpc/include/asm/reg.h            |  1 +
>  arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>  arch/powerpc/kvm/book3s_pr.c              |  1 +
>  arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>  arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>  drivers/misc/cxl/cxl.h                    |  3 ++-
>  6 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index 4ae4ab9090a2..7fd09f25452d 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -1361,6 +1361,7 @@
>  #define PVR_POWER8E	0x004B
>  #define PVR_POWER8NVL	0x004C
>  #define PVR_POWER8	0x004D
> +#define PVR_HX_C2000	0x0066
>  #define PVR_POWER9	0x004E
>  #define PVR_POWER10	0x0080
>  #define PVR_BE		0x0070

Why is this not in sorted order?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
@ 2023-11-23  9:43   ` Greg KH
  0 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2023-11-23  9:43 UTC (permalink / raw)
  To: Zhao Ke
  Cc: luming.yu, ajd, arnd, dawei.li, linux-kernel, shenghui.qu,
	npiggin, kvm, fbarrat, linuxppc-dev

On Thu, Nov 23, 2023 at 05:36:11PM +0800, Zhao Ke wrote:
> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
> for its new processor C2000. The OpenPower has assigned a new PVN
> and this newly assigned PVN is 0x0066, add pvr register related
> support for this PVN.
> 
> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
> ---
> 	v0 -> v1:
> 	- Fix .cpu_name with the correct description
> ---
> ---
>  arch/powerpc/include/asm/reg.h            |  1 +
>  arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>  arch/powerpc/kvm/book3s_pr.c              |  1 +
>  arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>  arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>  drivers/misc/cxl/cxl.h                    |  3 ++-
>  6 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index 4ae4ab9090a2..7fd09f25452d 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -1361,6 +1361,7 @@
>  #define PVR_POWER8E	0x004B
>  #define PVR_POWER8NVL	0x004C
>  #define PVR_POWER8	0x004D
> +#define PVR_HX_C2000	0x0066
>  #define PVR_POWER9	0x004E
>  #define PVR_POWER10	0x0080
>  #define PVR_BE		0x0070

Why is this not in sorted order?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
  2023-11-23  9:43   ` Greg KH
@ 2023-11-23 11:02     ` Michael Ellerman
  -1 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2023-11-23 11:02 UTC (permalink / raw)
  To: Greg KH, Zhao Ke
  Cc: npiggin, christophe.leroy, fbarrat, ajd, arnd, linuxppc-dev,
	linux-kernel, kvm, shenghui.qu, luming.yu, dawei.li

Greg KH <gregkh@linuxfoundation.org> writes:
> On Thu, Nov 23, 2023 at 05:36:11PM +0800, Zhao Ke wrote:
>> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
>> for its new processor C2000. The OpenPower has assigned a new PVN
>> and this newly assigned PVN is 0x0066, add pvr register related
>> support for this PVN.
>> 
>> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
>> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
>> ---
>> 	v0 -> v1:
>> 	- Fix .cpu_name with the correct description
>> ---
>> ---
>>  arch/powerpc/include/asm/reg.h            |  1 +
>>  arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>>  arch/powerpc/kvm/book3s_pr.c              |  1 +
>>  arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>>  arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>>  drivers/misc/cxl/cxl.h                    |  3 ++-
>>  6 files changed, 23 insertions(+), 3 deletions(-)
>> 
>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>> index 4ae4ab9090a2..7fd09f25452d 100644
>> --- a/arch/powerpc/include/asm/reg.h
>> +++ b/arch/powerpc/include/asm/reg.h
>> @@ -1361,6 +1361,7 @@
>>  #define PVR_POWER8E	0x004B
>>  #define PVR_POWER8NVL	0x004C
>>  #define PVR_POWER8	0x004D
>> +#define PVR_HX_C2000	0x0066
>>  #define PVR_POWER9	0x004E
>>  #define PVR_POWER10	0x0080
>>  #define PVR_BE		0x0070
>
> Why is this not in sorted order?

It's semantically sorted :D

ie. HX_C2000 is most similar to POWER8, but is newer than it.

PVR_BE is out of place, I'll fix that.

cheers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
@ 2023-11-23 11:02     ` Michael Ellerman
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2023-11-23 11:02 UTC (permalink / raw)
  To: Greg KH, Zhao Ke
  Cc: luming.yu, ajd, arnd, dawei.li, linux-kernel, shenghui.qu,
	npiggin, kvm, fbarrat, linuxppc-dev

Greg KH <gregkh@linuxfoundation.org> writes:
> On Thu, Nov 23, 2023 at 05:36:11PM +0800, Zhao Ke wrote:
>> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
>> for its new processor C2000. The OpenPower has assigned a new PVN
>> and this newly assigned PVN is 0x0066, add pvr register related
>> support for this PVN.
>> 
>> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
>> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
>> ---
>> 	v0 -> v1:
>> 	- Fix .cpu_name with the correct description
>> ---
>> ---
>>  arch/powerpc/include/asm/reg.h            |  1 +
>>  arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>>  arch/powerpc/kvm/book3s_pr.c              |  1 +
>>  arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>>  arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>>  drivers/misc/cxl/cxl.h                    |  3 ++-
>>  6 files changed, 23 insertions(+), 3 deletions(-)
>> 
>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>> index 4ae4ab9090a2..7fd09f25452d 100644
>> --- a/arch/powerpc/include/asm/reg.h
>> +++ b/arch/powerpc/include/asm/reg.h
>> @@ -1361,6 +1361,7 @@
>>  #define PVR_POWER8E	0x004B
>>  #define PVR_POWER8NVL	0x004C
>>  #define PVR_POWER8	0x004D
>> +#define PVR_HX_C2000	0x0066
>>  #define PVR_POWER9	0x004E
>>  #define PVR_POWER10	0x0080
>>  #define PVR_BE		0x0070
>
> Why is this not in sorted order?

It's semantically sorted :D

ie. HX_C2000 is most similar to POWER8, but is newer than it.

PVR_BE is out of place, I'll fix that.

cheers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
  2023-11-23 11:02     ` Michael Ellerman
@ 2023-11-24  8:39       ` Zhao Ke 赵 可
  -1 siblings, 0 replies; 11+ messages in thread
From: Zhao Ke 赵 可 @ 2023-11-24  8:39 UTC (permalink / raw)
  To: Michael Ellerman, gregkh
  Cc: npiggin, christophe.leroy, fbarrat, ajd, arnd, linuxppc-dev,
	linux-kernel, kvm, shenghui.qu, luming.yu, dawei.li

Hi Michael and Greg,

On 2023/11/23 19:02, Michael Ellerman wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
>> On Thu, Nov 23, 2023 at 05:36:11PM +0800, Zhao Ke wrote:
>>> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
>>> for its new processor C2000. The OpenPower has assigned a new PVN
>>> and this newly assigned PVN is 0x0066, add pvr register related
>>> support for this PVN.
>>>
>>> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
>>> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
>>> ---
>>> 	v0 -> v1:
>>> 	- Fix .cpu_name with the correct description
>>> ---
>>> ---
>>>   arch/powerpc/include/asm/reg.h            |  1 +
>>>   arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>>>   arch/powerpc/kvm/book3s_pr.c              |  1 +
>>>   arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>>>   arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>>>   drivers/misc/cxl/cxl.h                    |  3 ++-
>>>   6 files changed, 23 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>>> index 4ae4ab9090a2..7fd09f25452d 100644
>>> --- a/arch/powerpc/include/asm/reg.h
>>> +++ b/arch/powerpc/include/asm/reg.h
>>> @@ -1361,6 +1361,7 @@
>>>   #define PVR_POWER8E	0x004B
>>>   #define PVR_POWER8NVL	0x004C
>>>   #define PVR_POWER8	0x004D
>>> +#define PVR_HX_C2000	0x0066
>>>   #define PVR_POWER9	0x004E
>>>   #define PVR_POWER10	0x0080
>>>   #define PVR_BE		0x0070
>> Why is this not in sorted order?
> It's semantically sorted :D
> ie. HX_C2000 is most similar to POWER8, but is newer than it.
Yes. This is what I mean. If you prefer to sort in another order, please 
tell me and I will update this.
>
> PVR_BE is out of place, I'll fix that.
>
> cheers
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
@ 2023-11-24  8:39       ` Zhao Ke 赵 可
  0 siblings, 0 replies; 11+ messages in thread
From: Zhao Ke 赵 可 @ 2023-11-24  8:39 UTC (permalink / raw)
  To: Michael Ellerman, gregkh
  Cc: luming.yu, ajd, arnd, dawei.li, linux-kernel, shenghui.qu,
	npiggin, kvm, fbarrat, linuxppc-dev

Hi Michael and Greg,

On 2023/11/23 19:02, Michael Ellerman wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
>> On Thu, Nov 23, 2023 at 05:36:11PM +0800, Zhao Ke wrote:
>>> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
>>> for its new processor C2000. The OpenPower has assigned a new PVN
>>> and this newly assigned PVN is 0x0066, add pvr register related
>>> support for this PVN.
>>>
>>> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
>>> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
>>> ---
>>> 	v0 -> v1:
>>> 	- Fix .cpu_name with the correct description
>>> ---
>>> ---
>>>   arch/powerpc/include/asm/reg.h            |  1 +
>>>   arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>>>   arch/powerpc/kvm/book3s_pr.c              |  1 +
>>>   arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>>>   arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>>>   drivers/misc/cxl/cxl.h                    |  3 ++-
>>>   6 files changed, 23 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>>> index 4ae4ab9090a2..7fd09f25452d 100644
>>> --- a/arch/powerpc/include/asm/reg.h
>>> +++ b/arch/powerpc/include/asm/reg.h
>>> @@ -1361,6 +1361,7 @@
>>>   #define PVR_POWER8E	0x004B
>>>   #define PVR_POWER8NVL	0x004C
>>>   #define PVR_POWER8	0x004D
>>> +#define PVR_HX_C2000	0x0066
>>>   #define PVR_POWER9	0x004E
>>>   #define PVR_POWER10	0x0080
>>>   #define PVR_BE		0x0070
>> Why is this not in sorted order?
> It's semantically sorted :D
> ie. HX_C2000 is most similar to POWER8, but is newer than it.
Yes. This is what I mean. If you prefer to sort in another order, please 
tell me and I will update this.
>
> PVR_BE is out of place, I'll fix that.
>
> cheers
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
  2023-11-23  9:36 ` Zhao Ke
@ 2023-11-24 23:35   ` Nicholas Piggin
  -1 siblings, 0 replies; 11+ messages in thread
From: Nicholas Piggin @ 2023-11-24 23:35 UTC (permalink / raw)
  To: Zhao Ke, mpe, christophe.leroy, fbarrat, ajd, arnd, gregkh
  Cc: linuxppc-dev, linux-kernel, kvm, shenghui.qu, luming.yu, dawei.li

On Thu Nov 23, 2023 at 7:36 PM AEST, Zhao Ke wrote:
> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
> for its new processor C2000. The OpenPower has assigned a new PVN
> and this newly assigned PVN is 0x0066, add pvr register related
> support for this PVN.
>
> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
> ---
> 	v0 -> v1:
> 	- Fix .cpu_name with the correct description
> ---
> ---
>  arch/powerpc/include/asm/reg.h            |  1 +
>  arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>  arch/powerpc/kvm/book3s_pr.c              |  1 +
>  arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>  arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>  drivers/misc/cxl/cxl.h                    |  3 ++-
>  6 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index 4ae4ab9090a2..7fd09f25452d 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -1361,6 +1361,7 @@
>  #define PVR_POWER8E	0x004B
>  #define PVR_POWER8NVL	0x004C
>  #define PVR_POWER8	0x004D
> +#define PVR_HX_C2000	0x0066
>  #define PVR_POWER9	0x004E
>  #define PVR_POWER10	0x0080
>  #define PVR_BE		0x0070
> diff --git a/arch/powerpc/kernel/cpu_specs_book3s_64.h b/arch/powerpc/kernel/cpu_specs_book3s_64.h
> index c370c1b804a9..367c9f6d9be5 100644
> --- a/arch/powerpc/kernel/cpu_specs_book3s_64.h
> +++ b/arch/powerpc/kernel/cpu_specs_book3s_64.h
> @@ -238,6 +238,21 @@ static struct cpu_spec cpu_specs[] __initdata = {
>  		.machine_check_early	= __machine_check_early_realmode_p8,
>  		.platform		= "power8",
>  	},
> +	{	/* 2.07-compliant processor, HeXin C2000 processor */
> +		.pvr_mask		= 0xffffffff,
> +		.pvr_value		= 0x00660000,
> +		.cpu_name		= "POWER8 (raw)",

If this is a raw mode, it should go with the raw POWER8 entry.
The raw vs architected entries are already out of order with
POWER6, but we should fix that too.

You may want your PVR mask to follow the other raw examples too,
but it depends on how you foresee PVR being used. Using 0xffff0000
allows you to increment the low part of the PVR and existing
kernels will continue to match it. You can then add a specific
match for the older version if you need to add special handling
for it (e.g., see how POWER9 is handled).

Do you want .cpu_name to be "POWER8 (raw)"? You could call it
"HX-C2000", as Michael suggested earlier.

> +		.cpu_features		= CPU_FTRS_POWER8,
> +		.cpu_user_features	= COMMON_USER_POWER8,
> +		.cpu_user_features2	= COMMON_USER2_POWER8,
> +		.mmu_features		= MMU_FTRS_POWER8,
> +		.icache_bsize		= 128,
> +		.dcache_bsize		= 128,
> +		.cpu_setup		= __setup_cpu_power8,
> +		.cpu_restore		= __restore_cpu_power8,
> +		.machine_check_early	= __machine_check_early_realmode_p8,
> +		.platform		= "power8",
> +	},
>  	{	/* 3.00-compliant processor, i.e. Power9 "architected" mode */
>  		.pvr_mask		= 0xffffffff,
>  		.pvr_value		= 0x0f000005,
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index 9118242063fb..5b92619a05fd 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -604,6 +604,7 @@ static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr)
>  	case PVR_POWER8:
>  	case PVR_POWER8E:
>  	case PVR_POWER8NVL:
> +	case PVR_HX_C2000:
>  	case PVR_POWER9:
>  		vcpu->arch.hflags |= BOOK3S_HFLAG_MULTI_PGSIZE |
>  			BOOK3S_HFLAG_NEW_TLBIE;
> diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c
> index 125733962033..c38f378e1942 100644
> --- a/arch/powerpc/mm/book3s64/pkeys.c
> +++ b/arch/powerpc/mm/book3s64/pkeys.c
> @@ -89,7 +89,8 @@ static int __init scan_pkey_feature(void)
>  			unsigned long pvr = mfspr(SPRN_PVR);
>  
>  			if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
> -			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9)
> +			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9 ||
> +				PVR_VER(pvr) == PVR_HX_C2000)
>  				pkeys_total = 32;
>  		}
>  	}
> diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
> index 191424468f10..58e7331e1e7e 100644
> --- a/arch/powerpc/platforms/powernv/subcore.c
> +++ b/arch/powerpc/platforms/powernv/subcore.c
> @@ -425,7 +425,8 @@ static int subcore_init(void)
>  
>  	if (pvr_ver != PVR_POWER8 &&
>  	    pvr_ver != PVR_POWER8E &&
> -	    pvr_ver != PVR_POWER8NVL)
> +	    pvr_ver != PVR_POWER8NVL &&
> +		pvr_ver != PVR_HX_C2000)
>  		return 0;
>  
>  	/*
> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
> index 0562071cdd4a..9ac2991b29c7 100644
> --- a/drivers/misc/cxl/cxl.h
> +++ b/drivers/misc/cxl/cxl.h
> @@ -836,7 +836,8 @@ static inline bool cxl_is_power8(void)
>  {
>  	if ((pvr_version_is(PVR_POWER8E)) ||
>  	    (pvr_version_is(PVR_POWER8NVL)) ||
> -	    (pvr_version_is(PVR_POWER8)))
> +	    (pvr_version_is(PVR_POWER8)) ||
> +		(pvr_version_is(PVR_HX_C2000)))
>  		return true;
>  	return false;
>  }

These should follow the same alignment pattern as the other lines.

Thanks,
Nick


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
@ 2023-11-24 23:35   ` Nicholas Piggin
  0 siblings, 0 replies; 11+ messages in thread
From: Nicholas Piggin @ 2023-11-24 23:35 UTC (permalink / raw)
  To: Zhao Ke, mpe, christophe.leroy, fbarrat, ajd, arnd, gregkh
  Cc: luming.yu, kvm, dawei.li, linux-kernel, shenghui.qu, linuxppc-dev

On Thu Nov 23, 2023 at 7:36 PM AEST, Zhao Ke wrote:
> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
> for its new processor C2000. The OpenPower has assigned a new PVN
> and this newly assigned PVN is 0x0066, add pvr register related
> support for this PVN.
>
> Signed-off-by: Zhao Ke <ke.zhao@shingroup.cn>
> Link: https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
> ---
> 	v0 -> v1:
> 	- Fix .cpu_name with the correct description
> ---
> ---
>  arch/powerpc/include/asm/reg.h            |  1 +
>  arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>  arch/powerpc/kvm/book3s_pr.c              |  1 +
>  arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>  arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>  drivers/misc/cxl/cxl.h                    |  3 ++-
>  6 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
> index 4ae4ab9090a2..7fd09f25452d 100644
> --- a/arch/powerpc/include/asm/reg.h
> +++ b/arch/powerpc/include/asm/reg.h
> @@ -1361,6 +1361,7 @@
>  #define PVR_POWER8E	0x004B
>  #define PVR_POWER8NVL	0x004C
>  #define PVR_POWER8	0x004D
> +#define PVR_HX_C2000	0x0066
>  #define PVR_POWER9	0x004E
>  #define PVR_POWER10	0x0080
>  #define PVR_BE		0x0070
> diff --git a/arch/powerpc/kernel/cpu_specs_book3s_64.h b/arch/powerpc/kernel/cpu_specs_book3s_64.h
> index c370c1b804a9..367c9f6d9be5 100644
> --- a/arch/powerpc/kernel/cpu_specs_book3s_64.h
> +++ b/arch/powerpc/kernel/cpu_specs_book3s_64.h
> @@ -238,6 +238,21 @@ static struct cpu_spec cpu_specs[] __initdata = {
>  		.machine_check_early	= __machine_check_early_realmode_p8,
>  		.platform		= "power8",
>  	},
> +	{	/* 2.07-compliant processor, HeXin C2000 processor */
> +		.pvr_mask		= 0xffffffff,
> +		.pvr_value		= 0x00660000,
> +		.cpu_name		= "POWER8 (raw)",

If this is a raw mode, it should go with the raw POWER8 entry.
The raw vs architected entries are already out of order with
POWER6, but we should fix that too.

You may want your PVR mask to follow the other raw examples too,
but it depends on how you foresee PVR being used. Using 0xffff0000
allows you to increment the low part of the PVR and existing
kernels will continue to match it. You can then add a specific
match for the older version if you need to add special handling
for it (e.g., see how POWER9 is handled).

Do you want .cpu_name to be "POWER8 (raw)"? You could call it
"HX-C2000", as Michael suggested earlier.

> +		.cpu_features		= CPU_FTRS_POWER8,
> +		.cpu_user_features	= COMMON_USER_POWER8,
> +		.cpu_user_features2	= COMMON_USER2_POWER8,
> +		.mmu_features		= MMU_FTRS_POWER8,
> +		.icache_bsize		= 128,
> +		.dcache_bsize		= 128,
> +		.cpu_setup		= __setup_cpu_power8,
> +		.cpu_restore		= __restore_cpu_power8,
> +		.machine_check_early	= __machine_check_early_realmode_p8,
> +		.platform		= "power8",
> +	},
>  	{	/* 3.00-compliant processor, i.e. Power9 "architected" mode */
>  		.pvr_mask		= 0xffffffff,
>  		.pvr_value		= 0x0f000005,
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index 9118242063fb..5b92619a05fd 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -604,6 +604,7 @@ static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr)
>  	case PVR_POWER8:
>  	case PVR_POWER8E:
>  	case PVR_POWER8NVL:
> +	case PVR_HX_C2000:
>  	case PVR_POWER9:
>  		vcpu->arch.hflags |= BOOK3S_HFLAG_MULTI_PGSIZE |
>  			BOOK3S_HFLAG_NEW_TLBIE;
> diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c
> index 125733962033..c38f378e1942 100644
> --- a/arch/powerpc/mm/book3s64/pkeys.c
> +++ b/arch/powerpc/mm/book3s64/pkeys.c
> @@ -89,7 +89,8 @@ static int __init scan_pkey_feature(void)
>  			unsigned long pvr = mfspr(SPRN_PVR);
>  
>  			if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
> -			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9)
> +			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9 ||
> +				PVR_VER(pvr) == PVR_HX_C2000)
>  				pkeys_total = 32;
>  		}
>  	}
> diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
> index 191424468f10..58e7331e1e7e 100644
> --- a/arch/powerpc/platforms/powernv/subcore.c
> +++ b/arch/powerpc/platforms/powernv/subcore.c
> @@ -425,7 +425,8 @@ static int subcore_init(void)
>  
>  	if (pvr_ver != PVR_POWER8 &&
>  	    pvr_ver != PVR_POWER8E &&
> -	    pvr_ver != PVR_POWER8NVL)
> +	    pvr_ver != PVR_POWER8NVL &&
> +		pvr_ver != PVR_HX_C2000)
>  		return 0;
>  
>  	/*
> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
> index 0562071cdd4a..9ac2991b29c7 100644
> --- a/drivers/misc/cxl/cxl.h
> +++ b/drivers/misc/cxl/cxl.h
> @@ -836,7 +836,8 @@ static inline bool cxl_is_power8(void)
>  {
>  	if ((pvr_version_is(PVR_POWER8E)) ||
>  	    (pvr_version_is(PVR_POWER8NVL)) ||
> -	    (pvr_version_is(PVR_POWER8)))
> +	    (pvr_version_is(PVR_POWER8)) ||
> +		(pvr_version_is(PVR_HX_C2000)))
>  		return true;
>  	return false;
>  }

These should follow the same alignment pattern as the other lines.

Thanks,
Nick


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor
  2023-11-24 23:35   ` Nicholas Piggin
  (?)
@ 2023-11-29  3:11   ` Qu Shenghui 瞿盛辉
  -1 siblings, 0 replies; 11+ messages in thread
From: Qu Shenghui 瞿盛辉 @ 2023-11-29  3:11 UTC (permalink / raw)
  To: Nicholas Piggin, Zhao Ke, mpe, christophe.leroy, fbarrat, ajd,
	arnd, gregkh
  Cc: dawei.li, luming.yu, linuxppc-dev, linux-kernel, kvm

[-- Attachment #1: Type: text/plain, Size: 5611 bytes --]

Hi, Nick

Thanks for your comments.

On 2023/11/25 7:35, Nicholas Piggin wrote:
> On Thu Nov 23, 2023 at 7:36 PM AEST, Zhao Ke wrote:
>> HeXin Tech Co. has applied for a new PVN from the OpenPower Community
>> for its new processor C2000. The OpenPower has assigned a new PVN
>> and this newly assigned PVN is 0x0066, add pvr register related
>> support for this PVN.
>>
>> Signed-off-by: Zhao Ke<ke.zhao@shingroup.cn>
>> Link:https://discuss.openpower.foundation/t/how-to-get-a-new-pvr-for-processors-follow-power-isa/477/10
>> ---
>> 	v0 -> v1:
>> 	- Fix .cpu_name with the correct description
>> ---
>> ---
>>   arch/powerpc/include/asm/reg.h            |  1 +
>>   arch/powerpc/kernel/cpu_specs_book3s_64.h | 15 +++++++++++++++
>>   arch/powerpc/kvm/book3s_pr.c              |  1 +
>>   arch/powerpc/mm/book3s64/pkeys.c          |  3 ++-
>>   arch/powerpc/platforms/powernv/subcore.c  |  3 ++-
>>   drivers/misc/cxl/cxl.h                    |  3 ++-
>>   6 files changed, 23 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
>> index 4ae4ab9090a2..7fd09f25452d 100644
>> --- a/arch/powerpc/include/asm/reg.h
>> +++ b/arch/powerpc/include/asm/reg.h
>> @@ -1361,6 +1361,7 @@
>>   #define PVR_POWER8E	0x004B
>>   #define PVR_POWER8NVL	0x004C
>>   #define PVR_POWER8	0x004D
>> +#define PVR_HX_C2000	0x0066
>>   #define PVR_POWER9	0x004E
>>   #define PVR_POWER10	0x0080
>>   #define PVR_BE		0x0070
>> diff --git a/arch/powerpc/kernel/cpu_specs_book3s_64.h b/arch/powerpc/kernel/cpu_specs_book3s_64.h
>> index c370c1b804a9..367c9f6d9be5 100644
>> --- a/arch/powerpc/kernel/cpu_specs_book3s_64.h
>> +++ b/arch/powerpc/kernel/cpu_specs_book3s_64.h
>> @@ -238,6 +238,21 @@ static struct cpu_spec cpu_specs[] __initdata = {
>>   		.machine_check_early	= __machine_check_early_realmode_p8,
>>   		.platform		= "power8",
>>   	},
>> +	{	/* 2.07-compliant processor, HeXin C2000 processor */
>> +		.pvr_mask		= 0xffffffff,
>> +		.pvr_value		= 0x00660000,
>> +		.cpu_name		= "POWER8 (raw)",
> If this is a raw mode, it should go with the raw POWER8 entry.
> The raw vs architected entries are already out of order with
> POWER6, but we should fix that too.
>
> You may want your PVR mask to follow the other raw examples too,
> but it depends on how you foresee PVR being used. Using 0xffff0000
> allows you to increment the low part of the PVR and existing
> kernels will continue to match it. You can then add a specific
> match for the older version if you need to add special handling
> for it (e.g., see how POWER9 is handled).
>
> Do you want .cpu_name to be "POWER8 (raw)"? You could call it
> "HX-C2000", as Michael suggested earlier.

**Following your suggestion, we have discussed internally and decided to 
modify the cpu_name and pvr_mask.

>
>> +		.cpu_features		= CPU_FTRS_POWER8,
>> +		.cpu_user_features	= COMMON_USER_POWER8,
>> +		.cpu_user_features2	= COMMON_USER2_POWER8,
>> +		.mmu_features		= MMU_FTRS_POWER8,
>> +		.icache_bsize		= 128,
>> +		.dcache_bsize		= 128,
>> +		.cpu_setup		= __setup_cpu_power8,
>> +		.cpu_restore		= __restore_cpu_power8,
>> +		.machine_check_early	= __machine_check_early_realmode_p8,
>> +		.platform		= "power8",
>> +	},
>>   	{	/* 3.00-compliant processor, i.e. Power9 "architected" mode */
>>   		.pvr_mask		= 0xffffffff,
>>   		.pvr_value		= 0x0f000005,
>> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
>> index 9118242063fb..5b92619a05fd 100644
>> --- a/arch/powerpc/kvm/book3s_pr.c
>> +++ b/arch/powerpc/kvm/book3s_pr.c
>> @@ -604,6 +604,7 @@ static void kvmppc_set_pvr_pr(struct kvm_vcpu *vcpu, u32 pvr)
>>   	case PVR_POWER8:
>>   	case PVR_POWER8E:
>>   	case PVR_POWER8NVL:
>> +	case PVR_HX_C2000:
>>   	case PVR_POWER9:
>>   		vcpu->arch.hflags |= BOOK3S_HFLAG_MULTI_PGSIZE |
>>   			BOOK3S_HFLAG_NEW_TLBIE;
>> diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c
>> index 125733962033..c38f378e1942 100644
>> --- a/arch/powerpc/mm/book3s64/pkeys.c
>> +++ b/arch/powerpc/mm/book3s64/pkeys.c
>> @@ -89,7 +89,8 @@ static int __init scan_pkey_feature(void)
>>   			unsigned long pvr = mfspr(SPRN_PVR);
>>   
>>   			if (PVR_VER(pvr) == PVR_POWER8 || PVR_VER(pvr) == PVR_POWER8E ||
>> -			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9)
>> +			    PVR_VER(pvr) == PVR_POWER8NVL || PVR_VER(pvr) == PVR_POWER9 ||
>> +				PVR_VER(pvr) == PVR_HX_C2000)
>>   				pkeys_total = 32;
>>   		}
>>   	}
>> diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
>> index 191424468f10..58e7331e1e7e 100644
>> --- a/arch/powerpc/platforms/powernv/subcore.c
>> +++ b/arch/powerpc/platforms/powernv/subcore.c
>> @@ -425,7 +425,8 @@ static int subcore_init(void)
>>   
>>   	if (pvr_ver != PVR_POWER8 &&
>>   	    pvr_ver != PVR_POWER8E &&
>> -	    pvr_ver != PVR_POWER8NVL)
>> +	    pvr_ver != PVR_POWER8NVL &&
>> +		pvr_ver != PVR_HX_C2000)
>>   		return 0;
>>   
>>   	/*
>> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
>> index 0562071cdd4a..9ac2991b29c7 100644
>> --- a/drivers/misc/cxl/cxl.h
>> +++ b/drivers/misc/cxl/cxl.h
>> @@ -836,7 +836,8 @@ static inline bool cxl_is_power8(void)
>>   {
>>   	if ((pvr_version_is(PVR_POWER8E)) ||
>>   	    (pvr_version_is(PVR_POWER8NVL)) ||
>> -	    (pvr_version_is(PVR_POWER8)))
>> +	    (pvr_version_is(PVR_POWER8)) ||
>> +		(pvr_version_is(PVR_HX_C2000)))
>>   		return true;
>>   	return false;
>>   }
> These should follow the same alignment pattern as the other lines.
I agree with you, this is a low-level mistake.

> Thanks,
> Nick
>

[-- Attachment #2: Type: text/html, Size: 6479 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-29  5:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23  9:36 [PATCH v1] powerpc: Add PVN support for HeXin C2000 processor Zhao Ke
2023-11-23  9:36 ` Zhao Ke
2023-11-23  9:43 ` Greg KH
2023-11-23  9:43   ` Greg KH
2023-11-23 11:02   ` Michael Ellerman
2023-11-23 11:02     ` Michael Ellerman
2023-11-24  8:39     ` Zhao Ke 赵 可
2023-11-24  8:39       ` Zhao Ke 赵 可
2023-11-24 23:35 ` Nicholas Piggin
2023-11-24 23:35   ` Nicholas Piggin
2023-11-29  3:11   ` Qu Shenghui 瞿盛辉

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.