mbox

[PULL,0/9] Linux user for 8.1 patches

Message ID 20230515083113.107056-1-laurent@vivier.eu (mailing list archive)
State New, archived
Headers show

Pull-request

https://github.com/vivier/qemu.git tags/linux-user-for-8.1-pull-request

Message

Laurent Vivier May 15, 2023, 8:31 a.m. UTC
The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d:

  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 23:07:17 +0100)

are available in the Git repository at:

  https://github.com/vivier/qemu.git tags/linux-user-for-8.1-pull-request

for you to fetch changes up to 015ebc4aaa47612514a5c846b9db0d76b653b75f:

  linux-user: fix getgroups/setgroups allocations (2023-05-14 18:08:04 +0200)

----------------------------------------------------------------
linux-user pull request 20230512-v2

add open_tree(), move_mount()
add /proc/cpuinfo for riscv
fixes and cleanup

----------------------------------------------------------------

Afonso Bordado (1):
  linux-user: Emulate /proc/cpuinfo output for riscv

Daniil Kovalev (1):
  linux-user: Fix mips fp64 executables loading

Michael Tokarev (1):
  linux-user: fix getgroups/setgroups allocations

Thomas Huth (1):
  linux-user/main: Use list_cpus() instead of cpu_list()

Thomas Weißschuh (5):
  linux-user: report ENOTTY for unknown ioctls
  linux-user: Add move_mount() syscall
  linux-user: Add open_tree() syscall
  linux-user: Add new flag VERIFY_NONE
  linux-user: Don't require PROT_READ for mincore

 linux-user/main.c                 |   5 +-
 linux-user/mips/cpu_loop.c        |   5 +-
 linux-user/qemu.h                 |   1 +
 linux-user/syscall.c              | 207 ++++++++++++++++++++++++------
 tests/tcg/riscv64/Makefile.target |   1 +
 tests/tcg/riscv64/cpuinfo.c       |  30 +++++
 6 files changed, 207 insertions(+), 42 deletions(-)
 create mode 100644 tests/tcg/riscv64/cpuinfo.c

Comments

Richard Henderson May 15, 2023, 1:55 p.m. UTC | #1
On 5/15/23 01:31, Laurent Vivier wrote:
> The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d:
> 
>    Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 23:07:17 +0100)
> 
> are available in the Git repository at:
> 
>    https://github.com/vivier/qemu.git tags/linux-user-for-8.1-pull-request
> 
> for you to fetch changes up to 015ebc4aaa47612514a5c846b9db0d76b653b75f:
> 
>    linux-user: fix getgroups/setgroups allocations (2023-05-14 18:08:04 +0200)
> 
> ----------------------------------------------------------------
> linux-user pull request 20230512-v2
> 
> add open_tree(), move_mount()
> add /proc/cpuinfo for riscv
> fixes and cleanup

The new test in patch 1 fails:

https://gitlab.com/qemu-project/qemu/-/jobs/4285710689#L4825

   TEST    cpuinfo on riscv64
cpuinfo: /builds/qemu-project/qemu/tests/tcg/riscv64/cpuinfo.c:20: main: Assertion 
`strcmp(buffer, "isa\t\t: rv64imafdc_zicsr_zifencei\n") == 0' failed.
timeout: the monitored command dumped core
Aborted
make[1]: *** [Makefile:174: run-cpuinfo] Error 134
make: *** [/builds/qemu-project/qemu/tests/Makefile.include:56: 
run-tcg-tests-riscv64-linux-user] Error 2
make: *** Waiting for unfinished jobs....


r~
Laurent Vivier May 15, 2023, 3:50 p.m. UTC | #2
Le 15/05/2023 à 15:55, Richard Henderson a écrit :
> On 5/15/23 01:31, Laurent Vivier wrote:
>> The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d:
>>
>>    Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 23:07:17 
>> +0100)
>>
>> are available in the Git repository at:
>>
>>    https://github.com/vivier/qemu.git tags/linux-user-for-8.1-pull-request
>>
>> for you to fetch changes up to 015ebc4aaa47612514a5c846b9db0d76b653b75f:
>>
>>    linux-user: fix getgroups/setgroups allocations (2023-05-14 18:08:04 +0200)
>>
>> ----------------------------------------------------------------
>> linux-user pull request 20230512-v2
>>
>> add open_tree(), move_mount()
>> add /proc/cpuinfo for riscv
>> fixes and cleanup
> 
> The new test in patch 1 fails:
> 
> https://gitlab.com/qemu-project/qemu/-/jobs/4285710689#L4825
> 
>    TEST    cpuinfo on riscv64
> cpuinfo: /builds/qemu-project/qemu/tests/tcg/riscv64/cpuinfo.c:20: main: Assertion `strcmp(buffer, 
> "isa\t\t: rv64imafdc_zicsr_zifencei\n") == 0' failed.
> timeout: the monitored command dumped core
> Aborted
> make[1]: *** [Makefile:174: run-cpuinfo] Error 134
> make: *** [/builds/qemu-project/qemu/tests/Makefile.include:56: run-tcg-tests-riscv64-linux-user] 
> Error 2
> make: *** Waiting for unfinished jobs....
> 
> 
> r~

Strange, it worked for me:

https://gitlab.com/laurent_vivier/qemu/-/jobs/4281774977#L4844

Afonso, could you have a look?

Thanks,
Laurent
Laurent Vivier May 16, 2023, 9:11 a.m. UTC | #3
Le 15/05/2023 à 17:50, Laurent Vivier a écrit :
> Le 15/05/2023 à 15:55, Richard Henderson a écrit :
>> On 5/15/23 01:31, Laurent Vivier wrote:
>>> The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d:
>>>
>>>    Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 23:07:17 
>>> +0100)
>>>
>>> are available in the Git repository at:
>>>
>>>    https://github.com/vivier/qemu.git tags/linux-user-for-8.1-pull-request
>>>
>>> for you to fetch changes up to 015ebc4aaa47612514a5c846b9db0d76b653b75f:
>>>
>>>    linux-user: fix getgroups/setgroups allocations (2023-05-14 18:08:04 +0200)
>>>
>>> ----------------------------------------------------------------
>>> linux-user pull request 20230512-v2
>>>
>>> add open_tree(), move_mount()
>>> add /proc/cpuinfo for riscv
>>> fixes and cleanup
>>
>> The new test in patch 1 fails:
>>
>> https://gitlab.com/qemu-project/qemu/-/jobs/4285710689#L4825
>>
>>    TEST    cpuinfo on riscv64
>> cpuinfo: /builds/qemu-project/qemu/tests/tcg/riscv64/cpuinfo.c:20: main: Assertion `strcmp(buffer, 
>> "isa\t\t: rv64imafdc_zicsr_zifencei\n") == 0' failed.
>> timeout: the monitored command dumped core
>> Aborted
>> make[1]: *** [Makefile:174: run-cpuinfo] Error 134
>> make: *** [/builds/qemu-project/qemu/tests/Makefile.include:56: run-tcg-tests-riscv64-linux-user] 
>> Error 2
>> make: *** Waiting for unfinished jobs....
>>
>>
>> r~
> 
> Strange, it worked for me:
> 
> https://gitlab.com/laurent_vivier/qemu/-/jobs/4281774977#L4844
> 

I think if the host has more than 12 processors there is a buffer overflow.

something like this can mitigate avoid the problem:

diff --git a/tests/tcg/riscv64/cpuinfo.c b/tests/tcg/riscv64/cpuinfo.c
index 296abd0a8cf9..5c2b79022e9c 100644
--- a/tests/tcg/riscv64/cpuinfo.c
+++ b/tests/tcg/riscv64/cpuinfo.c
@@ -22,6 +22,7 @@ int main(void)
              assert(strcmp(buffer, "mmu\t\t: sv48\n") == 0);
          } else if (strstr(buffer, "uarch") != NULL) {
              assert(strcmp(buffer, "uarch\t\t: qemu\n") == 0);
+            break;
          }
      }

Thanks,
Laurent
Afonso Bordado May 16, 2023, 10:20 a.m. UTC | #4
Hey Laurent,

I was having some issues reproducing this bug, but that looks like a 
likely explanation!

Should I resubmit the patch with that diff applied?

Thanks!

On 5/16/2023 10:11 AM, Laurent Vivier wrote:
> Le 15/05/2023 à 17:50, Laurent Vivier a écrit :
>> Le 15/05/2023 à 15:55, Richard Henderson a écrit :
>>> On 5/15/23 01:31, Laurent Vivier wrote:
>>>> The following changes since commit 
>>>> 7c18f2d663521f1b31b821a13358ce38075eaf7d:
>>>>
>>>>    Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into 
>>>> staging (2023-04-29 23:07:17 +0100)
>>>>
>>>> are available in the Git repository at:
>>>>
>>>>    https://github.com/vivier/qemu.git 
>>>> tags/linux-user-for-8.1-pull-request
>>>>
>>>> for you to fetch changes up to 
>>>> 015ebc4aaa47612514a5c846b9db0d76b653b75f:
>>>>
>>>>    linux-user: fix getgroups/setgroups allocations (2023-05-14 
>>>> 18:08:04 +0200)
>>>>
>>>> ----------------------------------------------------------------
>>>> linux-user pull request 20230512-v2
>>>>
>>>> add open_tree(), move_mount()
>>>> add /proc/cpuinfo for riscv
>>>> fixes and cleanup
>>>
>>> The new test in patch 1 fails:
>>>
>>> https://gitlab.com/qemu-project/qemu/-/jobs/4285710689#L4825
>>>
>>>    TEST    cpuinfo on riscv64
>>> cpuinfo: /builds/qemu-project/qemu/tests/tcg/riscv64/cpuinfo.c:20: 
>>> main: Assertion `strcmp(buffer, "isa\t\t: 
>>> rv64imafdc_zicsr_zifencei\n") == 0' failed.
>>> timeout: the monitored command dumped core
>>> Aborted
>>> make[1]: *** [Makefile:174: run-cpuinfo] Error 134
>>> make: *** [/builds/qemu-project/qemu/tests/Makefile.include:56: 
>>> run-tcg-tests-riscv64-linux-user] Error 2
>>> make: *** Waiting for unfinished jobs....
>>>
>>>
>>> r~
>>
>> Strange, it worked for me:
>>
>> https://gitlab.com/laurent_vivier/qemu/-/jobs/4281774977#L4844
>>
>
> I think if the host has more than 12 processors there is a buffer 
> overflow.
>
> something like this can mitigate avoid the problem:
>
> diff --git a/tests/tcg/riscv64/cpuinfo.c b/tests/tcg/riscv64/cpuinfo.c
> index 296abd0a8cf9..5c2b79022e9c 100644
> --- a/tests/tcg/riscv64/cpuinfo.c
> +++ b/tests/tcg/riscv64/cpuinfo.c
> @@ -22,6 +22,7 @@ int main(void)
>              assert(strcmp(buffer, "mmu\t\t: sv48\n") == 0);
>          } else if (strstr(buffer, "uarch") != NULL) {
>              assert(strcmp(buffer, "uarch\t\t: qemu\n") == 0);
> +            break;
>          }
>      }
>
> Thanks,
> Laurent
>
Laurent Vivier May 16, 2023, 10:46 a.m. UTC | #5
Le 16/05/2023 à 12:20, Afonso Bordado a écrit :
> Hey Laurent,
> 
> I was having some issues reproducing this bug, but that looks like a likely explanation!
> 
> Should I resubmit the patch with that diff applied?

No, I'm going to update it.

Thanks,
Laurent

> 
> Thanks!
> 
> On 5/16/2023 10:11 AM, Laurent Vivier wrote:
>> Le 15/05/2023 à 17:50, Laurent Vivier a écrit :
>>> Le 15/05/2023 à 15:55, Richard Henderson a écrit :
>>>> On 5/15/23 01:31, Laurent Vivier wrote:
>>>>> The following changes since commit 7c18f2d663521f1b31b821a13358ce38075eaf7d:
>>>>>
>>>>>    Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-04-29 
>>>>> 23:07:17 +0100)
>>>>>
>>>>> are available in the Git repository at:
>>>>>
>>>>>    https://github.com/vivier/qemu.git tags/linux-user-for-8.1-pull-request
>>>>>
>>>>> for you to fetch changes up to 015ebc4aaa47612514a5c846b9db0d76b653b75f:
>>>>>
>>>>>    linux-user: fix getgroups/setgroups allocations (2023-05-14 18:08:04 +0200)
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> linux-user pull request 20230512-v2
>>>>>
>>>>> add open_tree(), move_mount()
>>>>> add /proc/cpuinfo for riscv
>>>>> fixes and cleanup
>>>>
>>>> The new test in patch 1 fails:
>>>>
>>>> https://gitlab.com/qemu-project/qemu/-/jobs/4285710689#L4825
>>>>
>>>>    TEST    cpuinfo on riscv64
>>>> cpuinfo: /builds/qemu-project/qemu/tests/tcg/riscv64/cpuinfo.c:20: main: Assertion 
>>>> `strcmp(buffer, "isa\t\t: rv64imafdc_zicsr_zifencei\n") == 0' failed.
>>>> timeout: the monitored command dumped core
>>>> Aborted
>>>> make[1]: *** [Makefile:174: run-cpuinfo] Error 134
>>>> make: *** [/builds/qemu-project/qemu/tests/Makefile.include:56: 
>>>> run-tcg-tests-riscv64-linux-user] Error 2
>>>> make: *** Waiting for unfinished jobs....
>>>>
>>>>
>>>> r~
>>>
>>> Strange, it worked for me:
>>>
>>> https://gitlab.com/laurent_vivier/qemu/-/jobs/4281774977#L4844
>>>
>>
>> I think if the host has more than 12 processors there is a buffer overflow.
>>
>> something like this can mitigate avoid the problem:
>>
>> diff --git a/tests/tcg/riscv64/cpuinfo.c b/tests/tcg/riscv64/cpuinfo.c
>> index 296abd0a8cf9..5c2b79022e9c 100644
>> --- a/tests/tcg/riscv64/cpuinfo.c
>> +++ b/tests/tcg/riscv64/cpuinfo.c
>> @@ -22,6 +22,7 @@ int main(void)
>>              assert(strcmp(buffer, "mmu\t\t: sv48\n") == 0);
>>          } else if (strstr(buffer, "uarch") != NULL) {
>>              assert(strcmp(buffer, "uarch\t\t: qemu\n") == 0);
>> +            break;
>>          }
>>      }
>>
>> Thanks,
>> Laurent
>>