All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-ppc: Extend HWCAP2 bits for ISA 3.0
@ 2018-09-06  6:57 Sandipan Das
  2018-09-06  7:04 ` Laurent Vivier
  2018-09-07  1:30 ` David Gibson
  0 siblings, 2 replies; 3+ messages in thread
From: Sandipan Das @ 2018-09-06  6:57 UTC (permalink / raw)
  To: david, richard.henderson
  Cc: qemu-devel, laurent, riku.voipio, nikunj, naveen.n.rao

This adds the HWCAP2 bit to detect if a linux user process is
running on an ISA 3.0 compliant cpu like POWER9. This can be
verified using a simple test program that prints the value in
the auxiliary vector for AT_HWCAP2 as shown below.

Before:
  $ qemu-ppc64le -cpu power8 test
  0x8c000000

  $ qemu-ppc64le -cpu power9 test
  0x8c000000

After:
  $ qemu-ppc64le -cpu power8 test
  0x8c000000

  $ qemu-ppc64le -cpu power9 test
  0x8c800000

Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
---
 linux-user/elfload.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 8638612aec..e97c4cde49 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -710,6 +710,7 @@ enum {
     QEMU_PPC_FEATURE2_HAS_EBB = 0x10000000, /* Event Base Branching */
     QEMU_PPC_FEATURE2_HAS_ISEL = 0x08000000, /* Integer Select */
     QEMU_PPC_FEATURE2_HAS_TAR = 0x04000000, /* Target Address Register */
+    QEMU_PPC_FEATURE2_ARCH_3_00 = 0x00800000, /* ISA 3.00 */
 };
 
 #define ELF_HWCAP get_elf_hwcap()
@@ -764,6 +765,7 @@ static uint32_t get_elf_hwcap2(void)
     GET_FEATURE2(PPC2_BCTAR_ISA207, QEMU_PPC_FEATURE2_HAS_TAR);
     GET_FEATURE2((PPC2_BCTAR_ISA207 | PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 |
                   PPC2_ISA207S), QEMU_PPC_FEATURE2_ARCH_2_07);
+    GET_FEATURE2(PPC2_ISA300, QEMU_PPC_FEATURE2_ARCH_3_00);
 
 #undef GET_FEATURE
 #undef GET_FEATURE2
-- 
2.14.4

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

* Re: [Qemu-devel] [PATCH] target-ppc: Extend HWCAP2 bits for ISA 3.0
  2018-09-06  6:57 [Qemu-devel] [PATCH] target-ppc: Extend HWCAP2 bits for ISA 3.0 Sandipan Das
@ 2018-09-06  7:04 ` Laurent Vivier
  2018-09-07  1:30 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2018-09-06  7:04 UTC (permalink / raw)
  To: Sandipan Das, david, richard.henderson
  Cc: qemu-devel, riku.voipio, nikunj, naveen.n.rao

Le 06/09/2018 à 08:57, Sandipan Das a écrit :
> This adds the HWCAP2 bit to detect if a linux user process is
> running on an ISA 3.0 compliant cpu like POWER9. This can be
> verified using a simple test program that prints the value in
> the auxiliary vector for AT_HWCAP2 as shown below.
> 
> Before:
>   $ qemu-ppc64le -cpu power8 test
>   0x8c000000
> 
>   $ qemu-ppc64le -cpu power9 test
>   0x8c000000
> 
> After:
>   $ qemu-ppc64le -cpu power8 test
>   0x8c000000
> 
>   $ qemu-ppc64le -cpu power9 test
>   0x8c800000
> 
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
> ---
>  linux-user/elfload.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

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

* Re: [Qemu-devel] [PATCH] target-ppc: Extend HWCAP2 bits for ISA 3.0
  2018-09-06  6:57 [Qemu-devel] [PATCH] target-ppc: Extend HWCAP2 bits for ISA 3.0 Sandipan Das
  2018-09-06  7:04 ` Laurent Vivier
@ 2018-09-07  1:30 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2018-09-07  1:30 UTC (permalink / raw)
  To: Sandipan Das
  Cc: richard.henderson, qemu-devel, laurent, riku.voipio, nikunj,
	naveen.n.rao

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

On Thu, Sep 06, 2018 at 12:27:29PM +0530, Sandipan Das wrote:
> This adds the HWCAP2 bit to detect if a linux user process is
> running on an ISA 3.0 compliant cpu like POWER9. This can be
> verified using a simple test program that prints the value in
> the auxiliary vector for AT_HWCAP2 as shown below.
> 
> Before:
>   $ qemu-ppc64le -cpu power8 test
>   0x8c000000
> 
>   $ qemu-ppc64le -cpu power9 test
>   0x8c000000
> 
> After:
>   $ qemu-ppc64le -cpu power8 test
>   0x8c000000
> 
>   $ qemu-ppc64le -cpu power9 test
>   0x8c800000
> 
> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>

Applied, thanks.

> ---
>  linux-user/elfload.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 8638612aec..e97c4cde49 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -710,6 +710,7 @@ enum {
>      QEMU_PPC_FEATURE2_HAS_EBB = 0x10000000, /* Event Base Branching */
>      QEMU_PPC_FEATURE2_HAS_ISEL = 0x08000000, /* Integer Select */
>      QEMU_PPC_FEATURE2_HAS_TAR = 0x04000000, /* Target Address Register */
> +    QEMU_PPC_FEATURE2_ARCH_3_00 = 0x00800000, /* ISA 3.00 */
>  };
>  
>  #define ELF_HWCAP get_elf_hwcap()
> @@ -764,6 +765,7 @@ static uint32_t get_elf_hwcap2(void)
>      GET_FEATURE2(PPC2_BCTAR_ISA207, QEMU_PPC_FEATURE2_HAS_TAR);
>      GET_FEATURE2((PPC2_BCTAR_ISA207 | PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 |
>                    PPC2_ISA207S), QEMU_PPC_FEATURE2_ARCH_2_07);
> +    GET_FEATURE2(PPC2_ISA300, QEMU_PPC_FEATURE2_ARCH_3_00);
>  
>  #undef GET_FEATURE
>  #undef GET_FEATURE2

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-09-07  1:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  6:57 [Qemu-devel] [PATCH] target-ppc: Extend HWCAP2 bits for ISA 3.0 Sandipan Das
2018-09-06  7:04 ` Laurent Vivier
2018-09-07  1:30 ` David Gibson

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.