Missing ARMv6 instructions?
Hello list,
Running an ARM application in user mode emulation (qemu CVS version of 3-15-2006), my code crashes at an SMMUL instruction (this is part of the ARMv6 instruction set). A brief glance at translate.c and op.c seems to suggest that qemu does not emulate that instruction (yet). Before I dig any deeper, could somebody in the know (Paul?) confirm or reject this suspicion?
Thanks much,
--
Wolfgang Schildbach, Senior Research Engineer
Coding Technologies GmbH
Quoted 8 lines · Wolfgang Schildbach
Hello list,
Running an ARM application in user mode emulation (qemu CVS version of 3-15-2006), my code crashes at an SMMUL instruction (this is part of the ARMv6 instruction set). A brief glance at
translate.candop.cseems to suggest that qemu does not emulate that instruction (yet). Before I dig any deeper, could somebody in the know (Paul?) confirm or reject this suspicion?
qemu cvs only supports ARMv5TE.
The ARMv6 architecture is released under a more restrictive licence than ARMv5. The Arm licencing department have explicitly prohibited the distribution of open source ARMv6/v7 emulators.
We're trying to get this restriction lifted, but so far to no avail.
Paul
Thanks, Paul. That explains it...
I find it strange that ARM would restrict emulation of their architecture -- that could hardly pose a threat to their business, I would say.
Anyhow, thanks for the note.
- Wolfgang
Paul Brook <[email protected]> wrote on 29.03.2006 16:39:12:
Quoted 5 lines · Wolfgang Schildbach
Quoted 4 lines
Hello list,
Running an ARM application in user mode emulation (qemu CVS version of 3-15-2006), my code crashes at an SMMUL instruction (this is part of
the
Quoted 1 line
Quoted 1 line
ARMv6 instruction set). A brief glance at
translate.candop.cseems
to
Quoted 1 line
Quoted 1 line
suggest that qemu does not emulate that instruction (yet). Before I
dig
Quoted 5 lines
Quoted 2 lines
any deeper, could somebody in the know (Paul?) confirm or reject this suspicion?
qemu cvs only supports ARMv5TE.
Quoted 8 lines
The ARMv6 architecture is released under a more restrictive licence than
ARMv5. The Arm licencing department have explicitly prohibited the distribution of open source ARMv6/v7 emulators.
We're trying to get this restriction lifted, but so far to no avail.
Paul
--
Wolfgang Schildbach, Senior Research Engineer
Coding Technologies GmbH
Quoted 5 lines · Paul Brook
The ARMv6 architecture is released under a more restrictive licence than ARMv5. The Arm licencing department have explicitly prohibited the distribution of open source ARMv6/v7 emulators.
We're trying to get this restriction lifted, but so far to no avail.
One more thing: how about adding the above to the QEMU FAQ?
-- Jamie
Quoted 7 lines · Paul Brook
Quoted 7 lines
qemu cvs only supports ARMv5TE.
The ARMv6 architecture is released under a more restrictive licence than ARMv5. The Arm licencing department have explicitly prohibited the distribution of open source ARMv6/v7 emulators.
Quoted 1 line
We're trying to get this restriction lifted, but so far to no avail.
Quoted 3 lines · Wolfgang Schildbach
Thanks, Paul. That explains it...
I find it strange that ARM would restrict emulation of their architecture -- that could hardly pose a threat to their business, I would say.
I find it strange that they can restrict emulation, if they can.
Perhaps they can't, and maybe they like to send threatening letters to frighten people away from doing it?
That's not so surprising for ARM. They halted the development of an open source ARM-compatible FPGA design too.
What claim does ARM have over software that they don't write and whose only resemblance is that it speaks the same protocol?
It looks, and smells, like an attempt at "interface copyright". I.e. to copyright something just for offering a similar interface.
E.g. much the same as Microsoft attempting to stop people implementing a "task bar". Yet, Microsoft can't do that, and nobody is afraid of writing window managers with task bars.
I could understand a claim if someone acquired ARM's documentation under an agreement to not produce an emulator. But I don't see how someone who has no connection with ARM can be restricted by ARM in that way.
Has ARM ever actually followed through on their threats and _won_ a case to ban compatible software from being distributed?
And if there is a possibility of that - in which countries do they have any weight? Dare I suggest encouraging the development of patches they don't like to countries where they have no legal weight?
-- Jamie
Quoted 2 lines
I could understand a claim if someone acquired ARM's documentation under an agreement to not produce an emulator.
That's exactly where the restriction comes from.
Theoretically it may be possible to reverse engineer a good proportion of ARMv6 from other sources (eg. gcc). However if that were done it would mean anyone with access to the real ARM documentation (i.e. me and probably anyone else with any professional/commercial interest in ARM emulation) would be unable to contribute to qemu.
Quoted 3 lines
And if there is a possibility of that - in which countries do they have any weight? Dare I suggest encouraging the development of patches they don't like to countries where they have no legal weight?
I don't think that's particularly helpful or practical suggestion. Better would be to lobby ARM to allow open source emulators. "I'd like to use ARM hardware for <big project>, but qemu doesn't support ARMv7 so I'm thinking of using PowerPC instead" is a particularly good argument ;-)
Paul
So it's a purely contractual issue as opposed to an IP issue.
Is a party to this contract allowed to write a disassembler? I can imagine a very nice disassembler feature that would explain in detail how each instruction it decodes works...
Of course no matter how such documentation were to escape, you're still used up by your contractual obligations as far as implementing an emulator, I guess.
-- John.
Quoted 4 lines · Paul Brook
Better would be to lobby ARM to allow open source emulators. "I'd like to use ARM hardware for <big project>, but qemu doesn't support ARMv7 so I'm thinking of using PowerPC instead" is a particularly good argument ;-)
I suspect ARM's business model - dependent wholly on licensing the ARM architecture in various forms - would make it very difficult for them to agree to that argument even if it would gain them one customer.
It'll be interesting when someone develops a compiler that uses very detailed machine descriptions - with enough detail to describe an architecture well enough that the description can also be used (by a different program) to emulate it to a significant degree.
They need good compilers to support the architrecture. But a very detailed machine description is also their business nightmare: the basis for software, and later hardware, implementations of their architecture. I wonder if people such as yourself will be able to contribute to the development of the machine description for such a compiler.
-- Jamie
The way I understand this is that anyone who got ARM documentation with the license that Paul mentioned, could not contribute patches that implement v6 emulation. If, however, someone else (who has not signed such a license) were to buy documentation about the ARMv6 architecture that comes without a license (for example, the "ARM System Developer's Guide", by Sloss, Symes, and Wright, Elsevier 2004), that someone should be able to contribute (at least in those aspects of the ARM that are disclosed by the book). In that case, ARM should not have any legal hooks except copyright, and since at that point you are not using any of their code, there is no case. However, I am not a lawyer, so don't take my word for it.
As to the threats to ARM's business model, I could see them threatened if someone emulated the ARM on hardware of similar performance (without licensing ARM IP) -- that would undermine sales of the real ARM cores, depending on the price/performance point of the replacement. Software emulation of an ARM core on a 4 GHz Pentium is hardly an alternative to buying the real thing, though... I also find it hard to believe that building a product competitive to an ARM is possible using a description of the instruction set alone.
That said, I agree with Paul that lobbying ARM to change their license is probably a better route to go. I believe software emulators like qemu are really in ARMs best interest since they support ARM development and thereby increase the availability of software for ARM cores.
- Wolfgang
Disclaimer: The views stated above are entirely mine, and do not necessarily reflect the views of my employer.
Paul wrote on 30.03.2006 00:01:41:
Quoted 6 lines
Quoted 2 lines
I could understand a claim if someone acquired ARM's documentation under an agreement to not produce an emulator.
That's exactly where the restriction comes from.
Theoretically it may be possible to reverse engineer a good proportion
of
Quoted 1 line
ARMv6 from other sources (eg. gcc). However if that were done it would
mean
Quoted 1 line
anyone with access to the real ARM documentation (i.e. me and probably
anyone
Quoted 1 line
else with any professional/commercial interest in ARM emulation) would
be
Quoted 9 lines
unable to contribute to qemu.
Quoted 3 lines
And if there is a possibility of that - in which countries do they have any weight? Dare I suggest encouraging the development of patches they don't like to countries where they have no legal weight?
I don't think that's particularly helpful or practical suggestion. Better would be to lobby ARM to allow open source emulators. "I'd like to use ARM hardware for <big project>, but qemu doesn't
support
Quoted 10 lines
ARMv7 so I'm thinking of using PowerPC instead" is a particularly good argument ;-)
Paul
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
--
Wolfgang Schildbach, Senior Research Engineer
Coding Technologies GmbH
Quoted 11 lines · Wolfgang Schildbach
The way I understand this is that anyone who got ARM documentation with the license that Paul mentioned, could not contribute patches that implement v6 emulation. If, however, someone else (who has not signed such a license) were to buy documentation about the ARMv6 architecture that comes without a license (for example, the "ARM System Developer's Guide", by Sloss, Symes, and Wright, Elsevier 2004), that someone should be able to contribute (at least in those aspects of the ARM that are disclosed by the book). In that case, ARM should not have any legal hooks except copyright, and since at that point you are not using any of their code, there is no case. However, I am not a lawyer, so don't take my word for it.
I wonder about patents (and their validity).
A MIPS hardware implementation that I worked with had all the basic MIPS integer instructions except one small group, on the ground that those instructions were covered by a MIPS patent and so they dared not include it. It was the instruction used for unaligned memory word access. For that reason, we used a modified GCC specially for that chip.
Quoted 2 lines
I also find it hard to believe that building a product competitive to an ARM is possible using a description of the instruction set alone.
(I meant a description of the architectural behaviour... not just the instruction set. Compilers are moving beyond merely implementing "user space" code, to optimising paths between security levels, analysing memory orderings between threads, etc. And for that matter, so are decompilers.)
It's not possible.. yet. Believe me, there are people working on it.
And it doesn't have to be competitive for ARM to have a reaction... as we're seeing with software emulatation.
Quoted 4 lines
That said, I agree with Paul that lobbying ARM to change their license is probably a better route to go. I believe software emulators like qemu are really in ARMs best interest since they support ARM development and thereby increase the availability of software for ARM cores.
That makes sense to me.
-- Jamie
Quoted 8 lines · Jamie Lokier
I wonder about patents (and their validity).
A MIPS hardware implementation that I worked with had all the basic MIPS integer instructions except one small group, on the ground that those instructions were covered by a MIPS patent and so they dared not include it. It was the instruction used for unaligned memory word access. For that reason, we used a modified GCC specially for that chip.
Note that the new ARM ABI being pushed by ARM ltd, which is called EABI, mandates using a thumb-related instruction (bx) in the function exit path.
In other words, if the arm-compatible core that you wrote for your FPGA board to play with does not implement that instruction (possibly because you want to avoid infringing on ARM patents), you won't be able to run any EABI-using ARM distros on it.
--L
Quoted 3 lines
Note that the new ARM ABI being pushed by ARM ltd, which is called EABI, mandates using a thumb-related instruction (bx) in the function exit path.
No it doesn't. The EABI mandates that code be interworking safe. It's possible to implement this is an way that only uses bx when actually returning to Thumb code, ie when you already know your hardware supports bx.
In practice many distros may assume Thumb capable hardware in the same way many x86 distros assume at least i486 or i686, but that's an entirely different issue.
Paul
Hi all,
Quoted 2 lines · Wolfgang Schildbach
I find it strange that ARM would restrict emulation of their architecture -- that could hardly pose a threat to their business, I would say.
Unfortunately, I don't. ARM probably makes quite a lot of money from their development tools (compilers, debuggers, simulators) as well as actual chips, and they have been an extensive user of software patents, even in the EU where they are probably not valid.
How about we target OpenCores instead of ARM?
Cheers, Chris.
Signature · 4 lines
___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |
Quoted 1 line · Chris Wilson
and they have been an extensive user of software patents,
And how:
http://www.patent.gov.uk/patent/legal/summaries/2004/o29204.htm
"The invention in this case involves locating all of the input registers in one data storage area, and all of the output registers in another data storage area. Then the simulator only has to switch the two storage areas around (eg. by exchanging two pointer values) in order to effectively COPY all of the output registers to the corresponding input registers of the next stage in a single operation. The Hearing Officer concluded that this invention did involve a technical contribution — not simply because it produced a faster simulator, but because the fundamental construction of the simulator had been modified."
So yes, using
struct registers *a, *b;
a = b;
instead of
struct registers a, b;
memcpy(&a,&b,sizeof(b));
has been patented by ARM in the UK. In fact, wouldn't surprise me if Qemu violates this patent.
Jonas
Quoted 7 lines · On Sat, 1 Apr 2006 23:06:07 +0300 Jonas Maebe <[email protected]> wrote:
Quoted 1 line · Chris Wilson
and they have been an extensive user of software patents,
And how:
http://www.patent.gov.uk/patent/legal/summaries/2004/o29204.htm
Quoted 10 lines
"The invention in this case involves locating all of the input registers in one data storage area, and all of the output registers in another data storage area. Then the simulator only has to switch the two storage areas around (eg. by exchanging two pointer values) in order to effectively COPY all of the output registers to the corresponding input registers of the next stage in a single operation. The Hearing Officer concluded that this invention did involve a technical contribution — not simply because it produced a faster simulator, but because the fundamental construction of the simulator had been modified."
I've got a better idea. In an imaginary 3-stage pipeline, instead of doing:
i1[*] -> <stage1> -> o1[*]
i2[*] -> <stage2> -> o2[*]
i3[*] -> <stage3> -> o3[*]
i2[*] = o1[*]
i3[*] = o2[*]
<commit o3[*]>
which the patent optimises to:
i1[*] -> <stage1> -> o1[*]
i2[*] -> <stage2> -> o2[*]
i3[*] -> <stage3> -> o3[*]
i2,o1 = o1,i2
i3,o2 = o2,i3
<commit o3[*]>
how about this:
o2i3[*] -> <stage3> -> o3[*]
o1i2[*] -> <stage2> -> o2i3[*]
i1[*] -> <stage1> -> o1i2[*]
<commit o3[*]>
which saves mucking around with pointers completely (requires the stages are implemented sequentially not in pararllel, but since we're talking about a software simulation that's likely to be the case).
Doesn't break the patent (well, the summary at least) and is a fraction quicker :)
To be honest both optimisations are clearly obvious to anyone sufficiently skilled in the field - maybe not so much to hardware engineers who tend to think in parallel but certainly to software engineers who tend to think in series.
Quoted 1 line
In fact, wouldn't surprise me if Qemu violates this patent.
Qemu doesn't simulate the pipeline as such as it emulates each instruction completely before starting the next one. Makes things much simpler - if you don't simulate the pipeline, you don't have to simulate flushing it etc :). The patent is talking about much deeper simulation, probably for use in simulating the core in relation to other components, or for use in accurate timing simulations.
Signature · 1 line
Kevin F. Quinn
Quoted 9 lines · Chris Wilson
Quoted 2 lines
I find it strange that ARM would restrict emulation of their architecture -- that could hardly pose a threat to their business, I would say.
Unfortunately, I don't. ARM probably makes quite a lot of money from their development tools (compilers, debuggers, simulators) as well as actual chips, and they have been an extensive user of software patents, even in the EU where they are probably not valid.
How about we target OpenCores instead of ARM?
I like the idea, but do you know of anyone using OpenCores devices implemented in silicon? It seems to me the motivation for ARM emulation is to be able to simulate embedded devices that people may feasibly end up using.
-- Jamie
Hi Jamie,
Quoted 4 lines
I like the idea, but do you know of anyone using OpenCores devices implemented in silicon? It seems to me the motivation for ARM emulation is to be able to simulate embedded devices that people may feasibly end up using.
I'm no expert, but it appears that OpenCores have a working core that runs most of the MIPS instruction set. MIPS is a very well known, tried and trusted architecture. My cable modem has a MIPS-compatible processor made by Toshiba. It seems to me that MIPS is just as realistic and usable platform as ARM. But I would be very interested to hear from anyone who knows better.
Now, I wonder when Qemu will support MIPS emulation? :-)
Cheers, Chris.
Signature · 4 lines
___ __ _ / __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK | / (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer | \ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |
Quoted 7 lines · Chris Wilson
Hi Jamie,
Quoted 4 lines
I like the idea, but do you know of anyone using OpenCores devices implemented in silicon? It seems to me the motivation for ARM emulation is to be able to simulate embedded devices that people may feasibly end up using.
Quoted 8 lines
I'm no expert, but it appears that OpenCores have a working core that runs most of the MIPS instruction set. MIPS is a very well known, tried and trusted architecture. My cable modem has a MIPS-compatible processor made by Toshiba. It seems to me that MIPS is just as realistic and usable platform as ARM. But I would be very interested to hear from anyone who knows better.
Now, I wonder when Qemu will support MIPS emulation? :-)
Good question. How about... last year?
Signature · 2 lines
Daniel Jacobowitz CodeSourcery
Quoted 7 lines · Chris Wilson
Hi Jamie,
Quoted 4 lines
I like the idea, but do you know of anyone using OpenCores devices implemented in silicon? It seems to me the motivation for ARM emulation is to be able to simulate embedded devices that people may feasibly end up using.
Quoted 8 lines
I'm no expert, but it appears that OpenCores have a working core that runs most of the MIPS instruction set. MIPS is a very well known, tried and trusted architecture. My cable modem has a MIPS-compatible processor made by Toshiba. It seems to me that MIPS is just as realistic and usable platform as ARM. But I would be very interested to hear from anyone who knows better.
Now, I wonder when Qemu will support MIPS emulation? :-)
When somebody implements more of the necessary support. The specs are available from mips.com (free registration needed).
Thiemo
Quoted 9 lines · Jamie Lokier
Quoted 8 lines · Chris Wilson
Quoted 2 lines
I find it strange that ARM would restrict emulation of their architecture -- that could hardly pose a threat to their business, I would say.
Unfortunately, I don't. ARM probably makes quite a lot of money from their development tools (compilers, debuggers, simulators) as well as actual chips, and they have been an extensive user of software patents, even in the EU where they are probably not valid.
Quoted 6 lines
Quoted 1 line
How about we target OpenCores instead of ARM?
I like the idea, but do you know of anyone using OpenCores devices implemented in silicon? It seems to me the motivation for ARM emulation is to be able to simulate embedded devices that people may feasibly end up using.
IMHO majority of embedded devices is still ARM7TDMI based and this instruction set (ARMv4 IIRC) should be emulated well in Qemu. Also please have a look at www.skyeye.org project to see how other projects do emulation for actual embedded devices.
Cheers,
Karel
--
Karel Gardas [email protected]
ObjectSecurity Ltd. http://www.objectsecurity.com
In message: <[email protected]>
Karel Gardas <[email protected]> writes:
: On Sun, 2 Apr 2006, Jamie Lokier wrote:
:
: > Chris Wilson wrote:
: >>> I find it strange that ARM would restrict emulation of their architecture : >>> -- that could hardly pose a threat to their business, I would say. : >>
: >> Unfortunately, I don't. ARM probably makes quite a lot of money from : >> their development tools (compilers, debuggers, simulators) as well as : >> actual chips, and they have been an extensive user of software patents, : >> even in the EU where they are probably not valid.
: >>
: >> How about we target OpenCores instead of ARM?
: >
: > I like the idea, but do you know of anyone using OpenCores devices : > implemented in silicon? It seems to me the motivation for ARM : > emulation is to be able to simulate embedded devices that people may : > feasibly end up using.
:
: IMHO majority of embedded devices is still ARM7TDMI based and this : instruction set (ARMv4 IIRC) should be emulated well in Qemu. Also please : have a look at www.skyeye.org project to see how other projects do : emulation for actual embedded devices.
You mean badly emulate the embedded devices, and only few of them to boot?
Warner
Quoted 2 lines
IMHO majority of embedded devices is still ARM7TDMI based and this instruction set (ARMv4 IIRC) should be emulated well in Qemu.
Depends which market segments you're aiming at.
If you're aiming at well established legacy or cheap, low-end hardware then yes armv4t is fine.
If you want to use qemu for development/prototyping of new products then you need an emulator that knows about modern systems, not something two generations out of date.
Paul