All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
@ 2018-03-14 15:31 James Cowgill
  2018-03-14 15:38 ` no-reply
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: James Cowgill @ 2018-03-14 15:31 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio, Laurent Vivier; +Cc: James Cowgill

Add support for the two currently defined HWCAP bits on MIPS - R6 and
MSA.

Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
Signed-off-by: James Cowgill <james.cowgill@mips.com>
---
This was resent because I think I messed up my email config. Apologies if you
receive this twice.

 linux-user/elfload.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 5fc130cc20..747b0ed10b 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -950,6 +950,30 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE        4096
 
+/* See arch/mips/include/uapi/hwcap.h.  */
+enum {
+    HWCAP_MIPS_R6           = (1 << 0),
+    HWCAP_MIPS_MSA          = (1 << 1),
+};
+
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+    MIPSCPU *cpu = MIPS_CPU(thread_cpu);
+    uint32_t hwcaps = 0;
+
+#define GET_FEATURE(flag, hwcap) \
+    do { if (cpu->env.insn_flags & (flag)) { hwcaps |= hwcap; } } while (0)
+
+    GET_FEATURE(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6);
+    GET_FEATURE(ASE_MSA, HWCAP_MIPS_MSA);
+
+#undef GET_FEATURE
+
+    return hwcaps;
+}
+
 #endif /* TARGET_MIPS */
 
 #ifdef TARGET_MICROBLAZE
-- 
2.16.2

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-14 15:31 [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS James Cowgill
@ 2018-03-14 15:38 ` no-reply
  2018-03-14 16:13 ` Laurent Vivier
  2018-03-15 15:13 ` [Qemu-devel] [PATCH v2] " James Cowgill
  2 siblings, 0 replies; 14+ messages in thread
From: no-reply @ 2018-03-14 15:38 UTC (permalink / raw)
  To: james.cowgill; +Cc: famz, qemu-devel, riku.voipio, laurent

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180314153121.23838-1-james.cowgill@mips.com
Subject: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20180314153121.23838-1-james.cowgill@mips.com -> patchew/20180314153121.23838-1-james.cowgill@mips.com
Switched to a new branch 'test'
4b00115726 linux-user: implement HWCAP bits on MIPS

=== OUTPUT BEGIN ===
Checking PATCH 1/1: linux-user: implement HWCAP bits on MIPS...
ERROR: braces {} are necessary for all arms of this statement
#35: FILE: linux-user/elfload.c:967:
+    do { if (cpu->env.insn_flags & (flag)) { hwcaps |= hwcap; } } while (0)
[...]

total: 1 errors, 0 warnings, 30 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-14 15:31 [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS James Cowgill
  2018-03-14 15:38 ` no-reply
@ 2018-03-14 16:13 ` Laurent Vivier
  2018-03-15 10:52   ` James Cowgill
  2018-03-15 15:13 ` [Qemu-devel] [PATCH v2] " James Cowgill
  2 siblings, 1 reply; 14+ messages in thread
From: Laurent Vivier @ 2018-03-14 16:13 UTC (permalink / raw)
  To: James Cowgill, Richard Henderson; +Cc: qemu-devel, Riku Voipio

Le 14/03/2018 à 16:31, James Cowgill a écrit :
> Add support for the two currently defined HWCAP bits on MIPS - R6 and
> MSA.
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
> Signed-off-by: James Cowgill <james.cowgill@mips.com>
> ---
> This was resent because I think I messed up my email config. Apologies if you
> receive this twice.
> 
>  linux-user/elfload.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 5fc130cc20..747b0ed10b 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -950,6 +950,30 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
>  #define USE_ELF_CORE_DUMP
>  #define ELF_EXEC_PAGESIZE        4096
>  
> +/* See arch/mips/include/uapi/hwcap.h.  */

in fact arch/mips/include/uapi/asm/hwcap.h

> +enum {
> +    HWCAP_MIPS_R6           = (1 << 0),
> +    HWCAP_MIPS_MSA          = (1 << 1),
> +};

We have this for ARM only in elfload.c since:

    afce2927aa Arm AT_HWCAP AUXV entry (Paul Brook) [2005]

but they have been added in include/elf.h since:

    41d9ea80ac tcg-arm: Use qemu_getauxval [Richard Henderson, 2013]

and I think we should remove them (they are prefixed by ARM_)

So the MIPS ones should be in include/elf.h (with the #define form).

Richard, any comment?

Thanks,
Laurent

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-14 16:13 ` Laurent Vivier
@ 2018-03-15 10:52   ` James Cowgill
  2018-03-15 13:00     ` Laurent Vivier
  0 siblings, 1 reply; 14+ messages in thread
From: James Cowgill @ 2018-03-15 10:52 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Richard Henderson, qemu-devel, Riku Voipio

Hi,

On 14/03/18 16:13, Laurent Vivier wrote:
> Le 14/03/2018 à 16:31, James Cowgill a écrit :
>> Add support for the two currently defined HWCAP bits on MIPS - R6 and
>> MSA.
>>
>> Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
>> Signed-off-by: James Cowgill <james.cowgill@mips.com>
>> ---
>> This was resent because I think I messed up my email config. Apologies if you
>> receive this twice.
>>
>>  linux-user/elfload.c | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
>> index 5fc130cc20..747b0ed10b 100644
>> --- a/linux-user/elfload.c
>> +++ b/linux-user/elfload.c
>> @@ -950,6 +950,30 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
>>  #define USE_ELF_CORE_DUMP
>>  #define ELF_EXEC_PAGESIZE        4096
>>  
>> +/* See arch/mips/include/uapi/hwcap.h.  */
> 
> in fact arch/mips/include/uapi/asm/hwcap.h

Woops.

>> +enum {
>> +    HWCAP_MIPS_R6           = (1 << 0),
>> +    HWCAP_MIPS_MSA          = (1 << 1),
>> +};
> 
> We have this for ARM only in elfload.c since:
> 
>     afce2927aa Arm AT_HWCAP AUXV entry (Paul Brook) [2005]
> 
> but they have been added in include/elf.h since:
> 
>     41d9ea80ac tcg-arm: Use qemu_getauxval [Richard Henderson, 2013]
> 
> and I think we should remove them (they are prefixed by ARM_)
> 
> So the MIPS ones should be in include/elf.h (with the #define form).

I can do that, although I think it's a bit unusual. The HWCAP bits are
specific to the Linux kernel and not to "the MIPS ELF format" so it
doesn't make sense to me to put them in elf.h.

James

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-15 10:52   ` James Cowgill
@ 2018-03-15 13:00     ` Laurent Vivier
  2018-03-15 14:19       ` James Cowgill
  0 siblings, 1 reply; 14+ messages in thread
From: Laurent Vivier @ 2018-03-15 13:00 UTC (permalink / raw)
  To: James Cowgill; +Cc: Richard Henderson, qemu-devel, Riku Voipio

Le 15/03/2018 à 11:52, James Cowgill a écrit :
> Hi,
> 
> On 14/03/18 16:13, Laurent Vivier wrote:
>> Le 14/03/2018 à 16:31, James Cowgill a écrit :
>>> Add support for the two currently defined HWCAP bits on MIPS - R6 and
>>> MSA.
>>>
>>> Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
>>> Signed-off-by: James Cowgill <james.cowgill@mips.com>
>>> ---
>>> This was resent because I think I messed up my email config. Apologies if you
>>> receive this twice.
>>>
>>>  linux-user/elfload.c | 24 ++++++++++++++++++++++++
>>>  1 file changed, 24 insertions(+)
>>>
>>> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
>>> index 5fc130cc20..747b0ed10b 100644
>>> --- a/linux-user/elfload.c
>>> +++ b/linux-user/elfload.c
>>> @@ -950,6 +950,30 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
>>>  #define USE_ELF_CORE_DUMP
>>>  #define ELF_EXEC_PAGESIZE        4096
>>>  
>>> +/* See arch/mips/include/uapi/hwcap.h.  */
>>
>> in fact arch/mips/include/uapi/asm/hwcap.h
> 
> Woops.
> 
>>> +enum {
>>> +    HWCAP_MIPS_R6           = (1 << 0),
>>> +    HWCAP_MIPS_MSA          = (1 << 1),
>>> +};
>>
>> We have this for ARM only in elfload.c since:
>>
>>     afce2927aa Arm AT_HWCAP AUXV entry (Paul Brook) [2005]
>>
>> but they have been added in include/elf.h since:
>>
>>     41d9ea80ac tcg-arm: Use qemu_getauxval [Richard Henderson, 2013]
>>
>> and I think we should remove them (they are prefixed by ARM_)
>>
>> So the MIPS ones should be in include/elf.h (with the #define form).
> 
> I can do that, although I think it's a bit unusual. The HWCAP bits are
> specific to the Linux kernel and not to "the MIPS ELF format" so it
> doesn't make sense to me to put them in elf.h.

In fact, in a system, they come with the glibc <sys/auxv.h>. auxv.h
includes <elf.h> and <bits/hwcap.h>. They are both part of glibc.

They can be used with qemu_getauxval() so it's better to have them in a
header file. elfoad.c or elf.h, it's in both cases an ELF file.

Thanks,
Laurent

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-15 13:00     ` Laurent Vivier
@ 2018-03-15 14:19       ` James Cowgill
  2018-03-15 14:35         ` Laurent Vivier
  0 siblings, 1 reply; 14+ messages in thread
From: James Cowgill @ 2018-03-15 14:19 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Richard Henderson, qemu-devel, Riku Voipio

Hi,

On 15/03/18 13:00, Laurent Vivier wrote:
> Le 15/03/2018 à 11:52, James Cowgill a écrit :
>> Hi,
>>
>> On 14/03/18 16:13, Laurent Vivier wrote:
>>> Le 14/03/2018 à 16:31, James Cowgill a écrit :
>>>> +enum {
>>>> +    HWCAP_MIPS_R6           = (1 << 0),
>>>> +    HWCAP_MIPS_MSA          = (1 << 1),
>>>> +};
>>>
>>> We have this for ARM only in elfload.c since:
>>>
>>>     afce2927aa Arm AT_HWCAP AUXV entry (Paul Brook) [2005]
>>>
>>> but they have been added in include/elf.h since:
>>>
>>>     41d9ea80ac tcg-arm: Use qemu_getauxval [Richard Henderson, 2013]
>>>
>>> and I think we should remove them (they are prefixed by ARM_)
>>>
>>> So the MIPS ones should be in include/elf.h (with the #define form).
>>
>> I can do that, although I think it's a bit unusual. The HWCAP bits are
>> specific to the Linux kernel and not to "the MIPS ELF format" so it
>> doesn't make sense to me to put them in elf.h.
> 
> In fact, in a system, they come with the glibc <sys/auxv.h>. auxv.h
> includes <elf.h> and <bits/hwcap.h>. They are both part of glibc.

None of the headers you mention contain hwcap bits. They are usually
provided in an arch specific kernel header - on MIPS they are in
<asm/hwcap.h> which must be included separately.

> They can be used with qemu_getauxval() so it's better to have them in a
> header file. elfoad.c or elf.h, it's in both cases an ELF file.

I agree with that.

I tried to move them to elf.h but hit a slight problem. In elfload.c,
elf.h is included after all the target specific stuff so the
get_elf_hwcap function cannot use anything from elf.h. I think this has
lead to all architectures replicating the list of hwcap bits in both
elf.h and elfload.c. You mentioned arm before, but I can also see
aarch64, powerpc and sh4 do this. Some of these architectures also have
their bits (with different constant names) in elf.h and some do not.

James

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-15 14:19       ` James Cowgill
@ 2018-03-15 14:35         ` Laurent Vivier
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2018-03-15 14:35 UTC (permalink / raw)
  To: James Cowgill; +Cc: Richard Henderson, qemu-devel, Riku Voipio

Le 15/03/2018 à 15:19, James Cowgill a écrit :
> Hi,
> 
> On 15/03/18 13:00, Laurent Vivier wrote:
>> Le 15/03/2018 à 11:52, James Cowgill a écrit :
>>> Hi,
>>>
>>> On 14/03/18 16:13, Laurent Vivier wrote:
>>>> Le 14/03/2018 à 16:31, James Cowgill a écrit :
>>>>> +enum {
>>>>> +    HWCAP_MIPS_R6           = (1 << 0),
>>>>> +    HWCAP_MIPS_MSA          = (1 << 1),
>>>>> +};
>>>>
>>>> We have this for ARM only in elfload.c since:
>>>>
>>>>     afce2927aa Arm AT_HWCAP AUXV entry (Paul Brook) [2005]
>>>>
>>>> but they have been added in include/elf.h since:
>>>>
>>>>     41d9ea80ac tcg-arm: Use qemu_getauxval [Richard Henderson, 2013]
>>>>
>>>> and I think we should remove them (they are prefixed by ARM_)
>>>>
>>>> So the MIPS ones should be in include/elf.h (with the #define form).
>>>
>>> I can do that, although I think it's a bit unusual. The HWCAP bits are
>>> specific to the Linux kernel and not to "the MIPS ELF format" so it
>>> doesn't make sense to me to put them in elf.h.
>>
>> In fact, in a system, they come with the glibc <sys/auxv.h>. auxv.h
>> includes <elf.h> and <bits/hwcap.h>. They are both part of glibc.
> 
> None of the headers you mention contain hwcap bits. They are usually
> provided in an arch specific kernel header - on MIPS they are in
> <asm/hwcap.h> which must be included separately.
> 
>> They can be used with qemu_getauxval() so it's better to have them in a
>> header file. elfoad.c or elf.h, it's in both cases an ELF file.
> 
> I agree with that.
> 
> I tried to move them to elf.h but hit a slight problem. In elfload.c,
> elf.h is included after all the target specific stuff so the
> get_elf_hwcap function cannot use anything from elf.h. I think this has
> lead to all architectures replicating the list of hwcap bits in both
> elf.h and elfload.c. You mentioned arm before, but I can also see
> aarch64, powerpc and sh4 do this. Some of these architectures also have
> their bits (with different constant names) in elf.h and some do not.

OK, you're right. That's sad to have duplicated values...

So your patch is correct. Perhaps just fix the typo in the path name for
hwcap.h.

Thanks,
Laurent

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

* [Qemu-devel] [PATCH v2] linux-user: implement HWCAP bits on MIPS
  2018-03-14 15:31 [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS James Cowgill
  2018-03-14 15:38 ` no-reply
  2018-03-14 16:13 ` Laurent Vivier
@ 2018-03-15 15:13 ` James Cowgill
  2018-03-15 15:19   ` no-reply
  2018-03-15 15:25   ` Laurent Vivier
  2 siblings, 2 replies; 14+ messages in thread
From: James Cowgill @ 2018-03-15 15:13 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio, Laurent Vivier; +Cc: Richard Henderson, James Cowgill

Add support for the two currently defined HWCAP bits on MIPS - R6 and
MSA.

Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
Signed-off-by: James Cowgill <james.cowgill@mips.com>
---
v2 changes:
 - Fix kernel hwcap.h path.

 linux-user/elfload.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 5fc130cc20..318c124712 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -950,6 +950,30 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE        4096
 
+/* See arch/mips/include/uapi/asm/hwcap.h.  */
+enum {
+    HWCAP_MIPS_R6           = (1 << 0),
+    HWCAP_MIPS_MSA          = (1 << 1),
+};
+
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+    MIPSCPU *cpu = MIPS_CPU(thread_cpu);
+    uint32_t hwcaps = 0;
+
+#define GET_FEATURE(flag, hwcap) \
+    do { if (cpu->env.insn_flags & (flag)) { hwcaps |= hwcap; } } while (0)
+
+    GET_FEATURE(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6);
+    GET_FEATURE(ASE_MSA, HWCAP_MIPS_MSA);
+
+#undef GET_FEATURE
+
+    return hwcaps;
+}
+
 #endif /* TARGET_MIPS */
 
 #ifdef TARGET_MICROBLAZE
-- 
2.16.2

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

* Re: [Qemu-devel] [PATCH v2] linux-user: implement HWCAP bits on MIPS
  2018-03-15 15:13 ` [Qemu-devel] [PATCH v2] " James Cowgill
@ 2018-03-15 15:19   ` no-reply
  2018-03-15 15:25   ` Laurent Vivier
  1 sibling, 0 replies; 14+ messages in thread
From: no-reply @ 2018-03-15 15:19 UTC (permalink / raw)
  To: james.cowgill; +Cc: famz, qemu-devel, riku.voipio, laurent, richard.henderson

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180315151348.6451-1-james.cowgill@mips.com
Subject: [Qemu-devel] [PATCH v2] linux-user: implement HWCAP bits on MIPS

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
   6265e23b1c..56e8698ffa  master     -> master
 t [tag update]            patchew/20180315115144.801202-1-eblake@redhat.com -> patchew/20180315115144.801202-1-eblake@redhat.com
 * [new tag]               patchew/20180315151348.6451-1-james.cowgill@mips.com -> patchew/20180315151348.6451-1-james.cowgill@mips.com
Switched to a new branch 'test'
31ed3b34df linux-user: implement HWCAP bits on MIPS

=== OUTPUT BEGIN ===
Checking PATCH 1/1: linux-user: implement HWCAP bits on MIPS...
ERROR: braces {} are necessary for all arms of this statement
#35: FILE: linux-user/elfload.c:967:
+    do { if (cpu->env.insn_flags & (flag)) { hwcaps |= hwcap; } } while (0)
[...]

total: 1 errors, 0 warnings, 30 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

* Re: [Qemu-devel] [PATCH v2] linux-user: implement HWCAP bits on MIPS
  2018-03-15 15:13 ` [Qemu-devel] [PATCH v2] " James Cowgill
  2018-03-15 15:19   ` no-reply
@ 2018-03-15 15:25   ` Laurent Vivier
  2018-04-10 13:53     ` Peter Maydell
  1 sibling, 1 reply; 14+ messages in thread
From: Laurent Vivier @ 2018-03-15 15:25 UTC (permalink / raw)
  To: James Cowgill, qemu-devel, Riku Voipio; +Cc: Richard Henderson

Le 15/03/2018 à 16:13, James Cowgill a écrit :
> Add support for the two currently defined HWCAP bits on MIPS - R6 and
> MSA.
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
> Signed-off-by: James Cowgill <james.cowgill@mips.com>
> ---
> v2 changes:
>  - Fix kernel hwcap.h path.
> 
>  linux-user/elfload.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 

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

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

* Re: [Qemu-devel] [PATCH v2] linux-user: implement HWCAP bits on MIPS
  2018-03-15 15:25   ` Laurent Vivier
@ 2018-04-10 13:53     ` Peter Maydell
  2018-04-10 15:34       ` Laurent Vivier
  0 siblings, 1 reply; 14+ messages in thread
From: Peter Maydell @ 2018-04-10 13:53 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: James Cowgill, QEMU Developers, Riku Voipio, Richard Henderson

On 15 March 2018 at 15:25, Laurent Vivier <laurent@vivier.eu> wrote:
> Le 15/03/2018 à 16:13, James Cowgill a écrit :
>> Add support for the two currently defined HWCAP bits on MIPS - R6 and
>> MSA.
>>
>> Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
>> Signed-off-by: James Cowgill <james.cowgill@mips.com>
>> ---
>> v2 changes:
>>  - Fix kernel hwcap.h path.
>>
>>  linux-user/elfload.c | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Hi Laurent -- did this MIPS HWCAP fix get lost somewhere? I can't
see it in master or your latest pullreq.

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH v2] linux-user: implement HWCAP bits on MIPS
  2018-04-10 13:53     ` Peter Maydell
@ 2018-04-10 15:34       ` Laurent Vivier
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Vivier @ 2018-04-10 15:34 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Riku Voipio, James Cowgill, Richard Henderson, QEMU Developers

Le 10/04/2018 à 15:53, Peter Maydell a écrit :
> On 15 March 2018 at 15:25, Laurent Vivier <laurent@vivier.eu> wrote:
>> Le 15/03/2018 à 16:13, James Cowgill a écrit :
>>> Add support for the two currently defined HWCAP bits on MIPS - R6 and
>>> MSA.
>>>
>>> Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
>>> Signed-off-by: James Cowgill <james.cowgill@mips.com>
>>> ---
>>> v2 changes:
>>>  - Fix kernel hwcap.h path.
>>>
>>>  linux-user/elfload.c | 24 ++++++++++++++++++++++++
>>>  1 file changed, 24 insertions(+)
>>>
>>
>> Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Hi Peter,

> Hi Laurent -- did this MIPS HWCAP fix get lost somewhere? I can't
> see it in master or your latest pullreq.

yes, I've missed it. I add it to my pull request.

Thank you,
Laurent

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

* Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
  2018-03-14 14:20 [Qemu-devel] [PATCH] " James Cowgill
@ 2018-03-14 15:32 ` no-reply
  0 siblings, 0 replies; 14+ messages in thread
From: no-reply @ 2018-03-14 15:32 UTC (permalink / raw)
  To: james.cowgill; +Cc: famz, qemu-devel, riku.voipio, laurent

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180314142018.13612-1-james.cowgill@mips.com
Subject: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]            patchew/20180312220753.20096-1-farosas@linux.vnet.ibm.com -> patchew/20180312220753.20096-1-farosas@linux.vnet.ibm.com
 * [new tag]               patchew/20180314142018.13612-1-james.cowgill@mips.com -> patchew/20180314142018.13612-1-james.cowgill@mips.com
 t [tag update]            patchew/20180314142133.14166-1-drjones@redhat.com -> patchew/20180314142133.14166-1-drjones@redhat.com
Switched to a new branch 'test'
6270103e8e linux-user: implement HWCAP bits on MIPS

=== OUTPUT BEGIN ===
Checking PATCH 1/1: linux-user: implement HWCAP bits on MIPS...
ERROR: braces {} are necessary for all arms of this statement
#35: FILE: linux-user/elfload.c:967:
+    do { if (cpu->env.insn_flags & (flag)) { hwcaps |= hwcap; } } while (0)
[...]

total: 1 errors, 0 warnings, 30 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

* [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
@ 2018-03-14 14:20 James Cowgill
  2018-03-14 15:32 ` no-reply
  0 siblings, 1 reply; 14+ messages in thread
From: James Cowgill @ 2018-03-14 14:20 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio, Laurent Vivier; +Cc: James Cowgill

Add support for the two currently defined HWCAP bits on MIPS - R6 and
MSA.

Buglink: https://bugs.launchpad.net/qemu/+bug/1754372
Signed-off-by: James Cowgill <james.cowgill@mips.com>
---
 linux-user/elfload.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 5fc130cc20..747b0ed10b 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -950,6 +950,30 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE        4096
 
+/* See arch/mips/include/uapi/hwcap.h.  */
+enum {
+    HWCAP_MIPS_R6           = (1 << 0),
+    HWCAP_MIPS_MSA          = (1 << 1),
+};
+
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+    MIPSCPU *cpu = MIPS_CPU(thread_cpu);
+    uint32_t hwcaps = 0;
+
+#define GET_FEATURE(flag, hwcap) \
+    do { if (cpu->env.insn_flags & (flag)) { hwcaps |= hwcap; } } while (0)
+
+    GET_FEATURE(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6);
+    GET_FEATURE(ASE_MSA, HWCAP_MIPS_MSA);
+
+#undef GET_FEATURE
+
+    return hwcaps;
+}
+
 #endif /* TARGET_MIPS */
 
 #ifdef TARGET_MICROBLAZE
-- 
2.16.2

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

end of thread, other threads:[~2018-04-10 15:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 15:31 [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS James Cowgill
2018-03-14 15:38 ` no-reply
2018-03-14 16:13 ` Laurent Vivier
2018-03-15 10:52   ` James Cowgill
2018-03-15 13:00     ` Laurent Vivier
2018-03-15 14:19       ` James Cowgill
2018-03-15 14:35         ` Laurent Vivier
2018-03-15 15:13 ` [Qemu-devel] [PATCH v2] " James Cowgill
2018-03-15 15:19   ` no-reply
2018-03-15 15:25   ` Laurent Vivier
2018-04-10 13:53     ` Peter Maydell
2018-04-10 15:34       ` Laurent Vivier
  -- strict thread matches above, loose matches on Subject: below --
2018-03-14 14:20 [Qemu-devel] [PATCH] " James Cowgill
2018-03-14 15:32 ` no-reply

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.