tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Testing Emulation Syscalls



On 2023-08-01 07:04, Valery Ushakov wrote:
> On Tue, Aug 01, 2023 at 12:39:46 +0200, Martin Husemann wrote:
> 
>> On Tue, Aug 01, 2023 at 01:34:54PM +0300, Valery Ushakov wrote:
>>> As for testing emulated syscalls - can we solve this problem with a
>>> bit of elf branding to convince the kernel to start the binary under
>>> emulation directly?  Inventing a whole new backdoor API for that seems
>>> kinda an overkill.
>>
>> That is probably quite easy to do, but we have a toolchain problem then
>> (solvable too).
>>
>> We need build.sh to be able to produce the test binaries (including
>> any needed libs, which don't have to be "native" libs of the emulated
>> system).
> 
> For simple cases - can we get away with tiny'ish freestanding test
> programs that invoke the tested syscalls so that we don't have to pull
> a new cross-compilation setup out of thin air just for that?

I don't think so.  If the binary starts under Linux emulation then the
kernel will expect that the syscall arguments follow Linux's calling
convention.  (Which I guess could be done, but, correct me if I'm wrong,
are we not a native Linux binary at that point?)

Theo(dore)



Home | Main Index | Thread Index | Old Index