[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 04/13] target/s390x: remove tcg-stub.c
From: |
Claudio Fontana |
Subject: |
Re: [RFC v2 04/13] target/s390x: remove tcg-stub.c |
Date: |
Tue, 20 Apr 2021 15:35:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 4/20/21 3:04 PM, David Hildenbrand wrote:
> On 20.04.21 15:00, Claudio Fontana wrote:
>> On 4/20/21 2:54 PM, David Hildenbrand wrote:
>>> On 20.04.21 12:36, Claudio Fontana wrote:
>>>> now that we protect all calls to the tcg-specific functions
>>>> with if (tcg_enabled()), we do not need the TCG stub anymore.
>>>
>>> You need compile-time checks, not runtime checks. Any calls have to be
>>> protected by #ifdef, otherwise the compiler might bail out.
>>
>> This is not true though, tcg_enabled() is #defined as 0 if tcg is not
>> enabled.
>>
>> #define kvm_enabled() (0)
>>
>> Compiler will elide the code if after the preprocessor pass the code is:
>>
>> if (0) {
>> }
>>
>
> Just that we are talking about the same thing:
>
> The following will fail to compile
>
> void main(void)
> {
> if (0) {
> return hello("Test");
> }
> }
>
> You at least need the prototypes. But I guess we still keep them and
> really only remove the stubs -- which works because the linker will
> never stumble over them.
Yes, thjs is what I am saying.
We have all the prototypes in sight, so we are good, no need to keep the stubs.
Ciao,
Claudio
[RFC v2 05/13] target/s390x: start moving TCG-only code to tcg/, Claudio Fontana, 2021/04/20
[RFC v2 11/13] target/s390x: move kvm files into kvm/, Claudio Fontana, 2021/04/20
[RFC v2 07/13] target/s390x: split cpu-dump from helper.c, Claudio Fontana, 2021/04/20
[RFC v2 08/13] target/s390x: make helper.c sysemu-only, Claudio Fontana, 2021/04/20
[RFC v2 09/13] target/s390x: use kvm_enabled() to wrap call to kvm_s390_get_hpage_1m, Claudio Fontana, 2021/04/20
[RFC v2 06/13] target/s390x: move sysemu-only code out to cpu-sysemu.c, Claudio Fontana, 2021/04/20
[RFC v2 13/13] MAINTAINERS: update s390x directories, Claudio Fontana, 2021/04/20