[PATCH] arm: make it one-personality arch

Denys Vlasenko dvlasenk at redhat.com
Thu Feb 21 09:24:09 UTC 2013


On 02/21/2013 12:16 AM, Dmitry V. Levin wrote:
>> This patch is another alternative: "move" 0x000f00nn syscalls
>> down to the entries just above last ordinary syscall,
>> by manipulating scno if it falls into the 0x000f00xx range.
>>
>> Yet another alternative is to simply treat all 0x000f00nn syscalls
>> as "undefined" - print them as "syscall_nnn" as we do now
>> for undefined syscalls.
>> This alternative can be realized by removing from this patch
>> the code block below "//TODO: why bother?" comment.
>> This would be almost as good as what we have now:
>> all these "special syscalls" are printargs anyway.
>> The _ONLY_ thing we do for them now is we supply
>> somewhat meaningful names for them.
>>
>> Please review and let me know what you think.
> 
> I'm not quite comfortable with remapping "odd" syscall numbers from
> (ARM_NUM_ORDINARY_SYSCALLS1; ARM_NUM_ORDINARY_SYSCALLS + ARM_LAST_SPECIAL_SYSCALL]
> interval to
> (0x000f0000; 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL] interval
> because they would be displayed as "syscall_nnn" with "nnn" different
> from their real values.

Yes, that's a not-nice part of this idea.

I have another idea: drop ARM special syscalls handling entirely,
make them use printargs.
In order to preserve syscall *names*, change this code:

                printleader(tcp);
                if (scno_good != 1)
                        tprints("????" /* anti-trigraph gap */ "(");
                else if (!SCNO_IS_VALID(tcp->scno))
                        tprintf("syscall_%lu(", tcp->scno);
                else
                        tprintf("%s(", sysent[tcp->scno].sys_name);

to

                else if (!SCNO_IS_VALID(tcp->scno))
                        print_undefined_scno(tcp->scno);

where print_undefined_scno() can have arch-specific #defines.

The downside is that we'll lose possibility to do
an actual custom decoding of ARM special syscalls.

By combining my patch and print_undefined_scno()
we can have both: remapping will give us decoding,
and print_undefined_scno() can do *reverse* remapping
before it prints "syscall_NN()" thing.

-- 
vda





More information about the Strace-devel mailing list