[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [kvm-unit-tests PATCH 2/5] s390x: Switch to z/Arch if n
From: |
David Hildenbrand |
Subject: |
Re: [qemu-s390x] [kvm-unit-tests PATCH 2/5] s390x: Switch to z/Arch if needed |
Date: |
Wed, 5 Dec 2018 11:22:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
>>
>>> + /* Switch to z/Architecture mode (64-bit) */
>>> + slr %r0, %r0 # set cpuid to zero
>>> + lhi %r1, 2 # mode 2 = esame
>>> + sigp %r1, %r0, 0x12 # sigp set arch
>>> + bras %r13,0f
>>> + .fill 16,4,0x0
>>> +0: lmh %r0,%r15,0(%r13) # clear high-order half of gprs
>>
>> This is just what the kernel does. The ".fill" part is confusing at
>> first, but it is just the data loaded into the high-order halfs (all 0s)
>>
>> (I was told mixing code and data is bad practice, but for some reason
>> people in Linux decided to do it like that (maybe because of some
>> relocation thingy? or because of instruction set restrictions?))
>
> Honestly I wouldn't even have considered clearing if I haven't seen it
> in the kernel. I could define a zero area at the end of the file or do
> an lm targeting the cleared bss right before jumping into setup. Or we
> could do 16 xc register to register :)
Or we'll just stick to what the kernel did here ... at least that way we
can be pretty sure we don't make mistakes. Whatever you prefer ;)
>
>>
>> Should we introduce defines for SIGPs? We might have more once we
>> support multiple CPUs eiher way.
>
> We also have sigp stop so why not.
> How about making the indent patch a cleanup patch and adding all
> commands there?
Sure, fine with me!
--
Thanks,
David / dhildenb
[qemu-s390x] [kvm-unit-tests PATCH 2/5] s390x: Switch to z/Arch if needed, Janosch Frank, 2018/12/04
[qemu-s390x] [kvm-unit-tests PATCH 3/5] s390x: Add BSS clearing for non ELF boot, Janosch Frank, 2018/12/04
[qemu-s390x] [kvm-unit-tests PATCH 4/5] s390x: Use interrupts in SCLP and add line mode, Janosch Frank, 2018/12/04
[qemu-s390x] [kvm-unit-tests PATCH 5/5] s390x: Fix sclp-ascii.c indents, Janosch Frank, 2018/12/04