Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerPC and AIX support #10055

Open
bencz opened this issue Mar 28, 2018 · 71 comments
Open

PowerPC and AIX support #10055

bencz opened this issue Mar 28, 2018 · 71 comments
Labels
area-Meta os-unsupported OS which is not officially supported
Milestone

Comments

@bencz
Copy link

bencz commented Mar 28, 2018

After some research, I checked that the .net core has no supported for PowerPC or AIX ... Are there plans to implement support for the Power architecture and the AIX operating system?

@janvorli
Copy link
Member

The largest amount of work is always in adding support for a new architecture to the JIT. We have JIT for arm, arm64, x86 and x64 architectures. There are currently no plans on adding new architectures support, but nothing prevents the community from starting such an effort.

@ghost
Copy link

ghost commented Mar 28, 2018

@janvorli, based on your experience, when aarch and aarch64 support were added, is there any rough checklist to support more architectures like ppc64le, mips64 etc. and generally RISC? There is also https://github.com/NETMF/netmf-interpreter by Microsoft, which has similar spectrum of support, perhaps convergence with that project will yield broader reach for CoreCLR. Not sure how feasible is the convergence with netmf, though.

@janvorli
Copy link
Member

@kasper3 coreclr contains an interpreter too (disabled by default), but it hasn't been turned on or tested for a very long time. I just remember someone made coreclr compile without errors when the FEATURE_INTERPRETER is enabled and there were some attempts to use it by someone from the community.

As for new architectures, a coarse checklist (in an arbitrary order) would be :

  • ASM helpers
  • Thunks (e.g. the shuffle thunk for delegates) generated as machine code
  • Processor context related stuff in stack walking, thread suspension and exception handling.
  • Calling convention related code, like the arg iterator, interop, ... The more complex the calling convention, the more work is needed. Structs passed in registers is an example of such a complexity.
  • JIT - this is the largest amount of work.
  • Unwind info for the new architectures. For the existing ones, we use Windows unwind info format for the JITted code, for architectures that windows don't support, it would need to be designed from scratch.
  • GC info format may need to be updated for the new architectures.
  • If these architectures are big endian, there might be changes needed due to that.
  • Possibly other stuff I've forgotten to mention

As for AIX, it is hard to tell how much surprises it would bring. I have no idea how much it differs from Linux.

@mattwarren
Copy link
Contributor

@kasper3 I wrote a post about the interpreter that you might find useful, see The .NET IL Interpreter.

But as @janvorli mentioned, work was done to make it easier to enable (so you can ignore that part of the post) see dotnet/coreclr#11188 and dotnet/coreclr#11252

@ghost
Copy link

ghost commented Mar 29, 2018

@janvorli, @mattwar, thanks, didn't knew about interpreter feature. For the basic interpreter to work in an antoconfig manner, we could probably integrate coreclr interpreter with the qemu assembly transpilation component https://github.com/qemu/qemu/tree/47d3b60858d90ac8a0cc3a72af7f95c96781125a/target, in order to run some code on non-supported architectures (slow version). Gradually, the full support can be added starting from ASM helpers from Jan's list. I am not sure how feasible is Xassembly-to-Yassembly ops transpilation using qemu? Maybe that component alone can be compiled as an independent libasmconv (named after libiconv) from qemu sources for such experimentations (not for production usage).

@ghuntley
Copy link
Member

I would love see a power on Linux bringup. AIX isn't worth the engineering cycles tho - see my thread on twitter. https://twitter.com/GeoffreyHuntley/status/979453657472053248?s=19

@NattyNarwhal
Copy link
Contributor

for the audience at home, if you want .NET on AIX or i, I maintain the Mono port for that - somewhat of a WIP, but it compiles all the way through and passes more tests than I expected

@afxgroup
Copy link

a Powerpc port would be really great 👍

@turabek
Copy link

turabek commented Mar 20, 2019

We also want to run our Core Banking Application on Power PC Processors PPC64LE. May I know from .net core team is this on your roadmap? When this will be possible?

@ghuntley
Copy link
Member

It's not on their roadmap @turabek

There are currently no plans on adding new architectures support, but nothing prevents the community from starting such an effort.

@bencz
Copy link
Author

bencz commented May 11, 2019

Is it not possible to use the JIT used in the .net of xbox?
Or rather use it as a starter?

@xiangzhai
Copy link
Contributor

Hi @mattwarren

@kasper3 I wrote a post about the interpreter that you might find useful, see The .NET IL Interpreter.

Thanks for your great blog The .NET IL Interpreter.

But as @janvorli mentioned, work was done to make it easier to enable (so you can ignore that part of the post) see dotnet/coreclr#11188 and dotnet/coreclr#11252

But when I migrated to the master dotnet/coreclr#24513 Interpreter seems not work:

Histogram of method executions:
   # of execs   |   # meths (%)    |   cum % | % cum execs
   -------------------------------------------------------
            0   |       0 ( -nan%) |   -nan% |   -nan%
            1   |       0 ( -nan%) |   -nan% |   -nan%
            2   |       0 ( -nan%) |   -nan% |   -nan%
            3   |       0 ( -nan%) |   -nan% |   -nan%
            4   |       0 ( -nan%) |   -nan% |   -nan%
            5   |       0 ( -nan%) |   -nan% |   -nan%
            6   |       0 ( -nan%) |   -nan% |   -nan%
            7   |       0 ( -nan%) |   -nan% |   -nan%
            8   |       0 ( -nan%) |   -nan% |   -nan%
            9   |       0 ( -nan%) |   -nan% |   -nan%
           10   |       0 ( -nan%) |   -nan% |   -nan%

For methods sorted in ascending # of executions order, cumulative % of executions:

Total number of calls from interpreted code: 0.
    Also, 0 are intrinsics; 0 of these are not currently handled intrinsically.
    Of these, 0 to potential property getters (0 of these dead simple), 0 to setters.
    Of the dead simple getter calls, 0 have been short-circuited.

Token resolutions by category:
Category     |  opportunities  |   calls   |      %
---------------------------------------------------
   Undefined |               0 |         0 |   0.00%
 Constrained |               0 |         0 |   0.00%
      NewObj |               0 |         0 |   0.00%
      NewArr |               0 |         0 |   0.00%
     LdToken |               0 |         0 |   0.00%
       LdFtn |               0 |         0 |   0.00%
   LdVirtFtn |               0 |         0 |   0.00%
    SFldAddr |               0 |         0 |   0.00%
      LdElem |               0 |         0 |   0.00%
        Call |               0 |         0 |   0.00%
       LdObj |               0 |         0 |   0.00%
       StObj |               0 |         0 |   0.00%
       CpObj |               0 |         0 |   0.00%
     InitObj |               0 |         0 |   0.00%
      IsInst |               0 |         0 |   0.00%
   CastClass |               0 |         0 |   0.00%
    MkRefAny |               0 |         0 |   0.00%
   RefAnyVal |               0 |         0 |   0.00%
      Sizeof |               0 |         0 |   0.00%
      StElem |               0 |         0 |   0.00%
         Box |               0 |         0 |   0.00%
       Unbox |               0 |         0 |   0.00%
    UnboxAny |               0 |         0 |   0.00%
       LdFld |               0 |         0 |   0.00%
      LdFldA |               0 |         0 |   0.00%
       StFld |               0 |         0 |   0.00%
   FindClass |               0 |         0 |   0.00%
   Exception |               0 |         0 |   0.00%

No printf in the Interpreter::ExecuteMethod or Interpreter::Terminate:

diff --git a/src/vm/interpreter.cpp b/src/vm/interpreter.cpp
index b4b18cb..53ae5c2 100644
--- a/src/vm/interpreter.cpp
+++ b/src/vm/interpreter.cpp
@@ -1878,6 +1878,7 @@ void Interpreter::DoMonitorExitWork()
 
 void Interpreter::ExecuteMethod(ARG_SLOT* retVal, __out bool* pDoJmpCall, __out unsigned* pJmpCallToken)
 {
+    printf("DEBUG: %s:%d\n", __FILE__, __LINE__);
 #if INTERP_DYNAMIC_CONTRACTS
     CONTRACTL {
         THROWS;
@@ -6511,6 +6512,7 @@ CORINFO_CLASS_HANDLE Interpreter::GetTypedRefClsHnd(CEEInfo* info)
 
 void Interpreter::Initialize()
 {
+    printf("DEBUG: %s:%d\n", __FILE__, __LINE__);
     assert(!s_initialized);
 
     s_InterpretMeths.ensureInit(CLRConfig::INTERNAL_Interpret);
@@ -6553,6 +6555,7 @@ void Interpreter::InitializeCompilerStatics(CEEInfo* info)
 
 void Interpreter::Terminate()
 {
+    printf("DEBUG: %s:%d\n", __FILE__, __LINE__);
     if (s_initialized)
     {
         s_methodCacheLock.Destroy();

As comment mentioned:

// If we failed to jit, then fall back to the primary Jit.

AltJIT just fall back to primary JIT, but not Interpreter?
How to force fall back to interpreter? By hacking set ret to CORJIT_SKIPPED:

diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 502b5ad..0be76f6 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -12145,6 +12145,7 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
 
     bool isInterpreterStub   = false;
     bool interpreterFallback = (s_InterpreterFallback.val(CLRConfig::INTERNAL_InterpreterFallback) != 0);
+    printf("DEBUG: interpreterFallback: %d\n", interpreterFallback);
 
     if (interpreterFallback == false)
     {
@@ -12169,6 +12170,8 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
                                           nativeSizeOfCode);
     }
 
+    // Force fall back to interpreter
+    //ret = CORJIT_SKIPPED;
     if (interpreterFallback == true)
     {
         // If we're doing an "import_only" compilation, it's for verification, so don't interpret.

And I found that AArch64 Remove unnecessary interpreter fallback dotnet/coreclr#20470 So is it able to enable Interpreter at master now?

Thanks,
Leslie Zhai

@mattwarren
Copy link
Contributor

I've not used the Interpreter since I wrote that post, so my memory is a bit hazy! But which (if any) environment variables have you set? See https://mattwarren.org/2017/03/30/The-.NET-IL-Interpreter/#Enabling%20the%20Interpreter and scroll down to the table of 'Host Configuration Knobs' for a bit more info. Or see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/clr-configuration-knobs.md#interpreter-configuration-knobs.

From what I remember, you need to at least set the Interpret value to the method(s) you want to have interpreted

@xiangzhai
Copy link
Contributor

I've not used the Interpreter since I wrote that post, so my memory is a bit hazy! But which (if any) environment variables have you set? See https://mattwarren.org/2017/03/30/The-.NET-IL-Interpreter/#Enabling%20the%20Interpreter and scroll down to the table of 'Host Configuration Knobs' for a bit more info. Or see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/clr-configuration-knobs.md#interpreter-configuration-knobs.

From what I remember, you need to at least set the Interpret value to the method(s) you want to have interpreted

Set:

$ export | grep COMPlus
declare -x COMPlus_DumpInterpreterStubs="1"
declare -x COMPlus_Interpret="Main"
declare -x COMPlus_InterpreterFallback="1"
declare -x COMPlus_InterpreterPrintPostMortem="1"
declare -x COMPlus_TraceInterpreterEntries="1"
declare -x COMPlus_TraceInterpreterIL="1"
declare -x COMPlus_TraceInterpreterVerbose="1"

HHH, perhaps because this dotnet/coreclr#11252

@to11mtm
Copy link

to11mtm commented Aug 29, 2019

Another Upvote, but I want to speak very specifically;

POWER Architecture would be huge for .NET for a number of reasons, including the existence of open, auditable platforms and the open-sourcing of the ISA and reference designs.

But really, the security angle is where I see a big win.

@YohanSciubukgian
Copy link

Do you also plan to support PPC 32 bits ?

@aix1
Copy link

aix1 commented Sep 19, 2019

Upvote; applications that uses .NET is restricted to our x86 only and for their high demands on Performance and RAS we need the .NET core parts on ppc64le.

@rickswah
Copy link

One more Upvote! there is a lot of PPC64LE and PPC64 server around the world using just Java or PHP for the main systems.. the world need .net for PowerPC!!! @NattyNarwhal do a really good job on Mono Project... but, there is some diffs. from .net core

@Tustra
Copy link

Tustra commented Sep 23, 2019

upvote

@mihaimyh
Copy link

Any plans for AIX support? Lots of us are using AIX servers.

@neosaldina
Copy link

Is there any plan to start implementing the JIT for ppc, ppc64 or ppc64el ?

@llebout
Copy link

llebout commented Dec 24, 2019

I also would like to run .NET Core on ppc64le. My workstation system runs Fedora with Linux.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 26, 2020
@danmoseley danmoseley added os-unsupported OS which is not officially supported and removed untriaged New issue has not been triaged by the area owner labels Feb 28, 2020
@danmoseley
Copy link
Member

There remains no plan for Microsoft support of AIX, but community work is welcome - FreeBSD has made contributions in this way.

@neosaldina
Copy link

Okay, Microsoft may not have plans to support AIX, but what about PowerPC ( ppc, ppc64 and ppc64le ) ?

@neosaldina
Copy link

I know that the Mono project has a system to host sites made in ASP.Net and ASP.Net MVC, if I'm not mistaken this project is called XSP ... the last time I tested it on ppc64, an error occurred when I tried to open the site...
@NattyNarwhal you are supporting Mono for ppc, can you tell if XSP is working correctly on ppc64 for ASP.Net MVC?

@Sapana-Khemkar
Copy link
Contributor

@Sapana-Khemkar Cool!!! Did you perform any tests on support for ppc64be?

yes we are running runtime library tests. You can find the azure pipeline here Currently two test cases are failing. For which issue has been already raised #71080 and #71079

I don't understand, will this port work on ppc64be?

Sorry. I thought you are asking about ppc64le tests.
ppc64be we are not testing

@archanox
Copy link

To avoid confusion

ppc64 = big endian
ppc64el = little endian

Please avoid using non-standard nomenclature

@aix1
Copy link

aix1 commented Aug 12, 2022 via email

@tappehl
Copy link

tappehl commented Aug 12, 2022

Please avoid using non-standard nomenclature

Yeah, it was a bit irony "Please avoid using non-standard nomenclature" and then using the wrong nomenclature :-D

@aix1
Copy link

aix1 commented Aug 12, 2022 via email

@archanox
Copy link

Please avoid using non-standard nomenclature

Yeah, it was a bit irony "Please avoid using non-standard nomenclature" and then using the wrong nomenclature :-D

You guys are terrible at this. It's ppc64el, mips64el, armel...

@Roman-Blinkov
Copy link

Roman-Blinkov commented Aug 12, 2022

Anyone want to edit Wikipedia?
https://en.m.wikipedia.org/wiki/Ppc64
ppc64le is a pure little-endian mode that has been introduced with the POWER8

Update: our hero must update not Wikipedia only but IBM pages similar to this: https://www.ibm.com/docs/en/cloud-private/3.1.1?topic=requirements-supported-operating-systems-platforms

@tappehl
Copy link

tappehl commented Aug 12, 2022

Please avoid using non-standard nomenclature

Yeah, it was a bit irony "Please avoid using non-standard nomenclature" and then using the wrong nomenclature :-D

You guys are terrible at this. It's ppc64el, mips64el, armel...

Not terrible, but I'll give you that both are accepted. In the IBM Power world LE is the most common expression though (as in Little Endian and not Endian Little (?)
https://www.ibm.com/support/pages/just-faqs-about-little-endian
"by Jeff Scheel, IBM Linux on Power Chief Engineer
As promised, here is my first blog post on little endian or "LE" as we call it."

But let's focus on the cool thing, .NET IS COMING TO POWER!!

@afxgroup
Copy link

Ok.. but why is it impossible to port .NET to PPC32BE? It is so hard?

@bencz
Copy link
Author

bencz commented Aug 14, 2022

Ok.. but why is it impossible to port .NET to PPC32BE? It is so hard?

I believe it is a problem of interests, IBM has already "killed" the Power64 B.E, the 32-bit version, IBM has buried it a long time ago and has even "decomposed"....

@afxgroup
Copy link

afxgroup commented Aug 14, 2022

But there are some different alive PPC BE platforms in the world. Not only IBM. I don't know the effort to implement the changes to see the big endian version alive but if someone points the main files to change we can give it a try. And even Mono is working on PPC32

@bkeys
Copy link

bkeys commented Aug 28, 2022

Please avoid using non-standard nomenclature

Yeah, it was a bit irony "Please avoid using non-standard nomenclature" and then using the wrong nomenclature :-D

You guys are terrible at this. It's ppc64el, mips64el, armel...

Not terrible, but I'll give you that both are accepted. In the IBM Power world LE is the most common expression though (as in Little Endian and not Endian Little (?) https://www.ibm.com/support/pages/just-faqs-about-little-endian "by Jeff Scheel, IBM Linux on Power Chief Engineer As promised, here is my first blog post on little endian or "LE" as we call it."

But let's focus on the cool thing, .NET IS COMING TO POWER!!

@tappehl Could you expound on the last part of this post? Is there any efforts on the part of IBM to get .NET working on ppc64le?

@tappehl
Copy link

tappehl commented Aug 29, 2022

Yes @bkeys as you can see above, Sapana is involved in the project... It was ported to IBM Mainframe last year, and I did some magic behind the scenes when I heard Power was not involve in that project. Now there is another project going on :)

@bkeys
Copy link

bkeys commented Sep 2, 2022

@tappehl is there a loose timeline/broad estimate you think it will take until we have initial .NET support for POWER? I looked at the pull requests and it's really good news.

@tappehl
Copy link

tappehl commented Sep 3, 2022

@tappehl is there a loose timeline/broad estimate you think it will take until we have initial .NET support for POWER? I looked at the pull requests and it's really good news.

I cannot tell, but for s390 it was released with the last version of .NET..

@kevincrans
Copy link

kevincrans commented Sep 8, 2022

Some years ago NXP was still creating powerpc, but I don't know if they still make them and the 68k based coldfire, they indirectly bought a piece Motorola from the AIM: Apple IBM Motorola alliance, if u didn't know.

@kevincrans
Copy link

I learned more, NXP stopped support (I like this Philips related company, but disappointing), meaning our hope lays with libre-soc and IBM. I do have to say, I like AIX support, but since macOS is already supported, only the arch has to be ported first.

@tappehl
Copy link

tappehl commented Sep 23, 2022

We also want to run our Core Banking Application on Power PC Processors PPC64LE. May I know from .net core team is this on your roadmap? When this will be possible?

Please reach out to me at torbjorn.appehl@ibm.com or torbjorn@builtonpower.com

@janani66
Copy link

Enablement for ppc64le is in the upstream .NET7 and .NET8 ( main ) branches -- this is for the mono runtime engine and not CoreCLR. Testing continues. CI/CD pipelines are being run on ppc64le machines too.

@bkeys
Copy link

bkeys commented Sep 23, 2022

Enablement for ppc64le is in the upstream .NET7 and .NET8 ( main ) branches -- this is for the mono runtime engine and not CoreCLR. Testing continues. CI/CD pipelines are being run on ppc64le machines too.

That is great news! But mono has been available in the Fedora repositories for some time now with ppc64le architecture:
https://koji.fedoraproject.org/koji/rpminfo?rpmID=25347685
I know mono joined the .net foundation but can you explain to those less informed such as myself what this means for ppc64le users?
Is there plans to have ppc64le in the coreclr at some point?

@janani66
Copy link

The current work is to get the mono engine in .NET7 working on ppc64le. CoreCLR will be targeted after the current .NET7 enablement for ppc64le is complete.

@bencz
Copy link
Author

bencz commented Jan 10, 2023

Now that IBM has released .net core 7, with support for ppc64le, how to install it on an Ubuntu or Debian server?

@Sapana-Khemkar
Copy link
Contributor

Now that IBM has released .net core 7, with support for ppc64le, how to install it on an Ubuntu or Debian server?

We have to cross build tarball on Ubuntu 18.04/20.04 x86. I am working on blog for the same. I will link once it is published.

@lehrbua
Copy link

lehrbua commented Jan 10, 2023

Now that IBM has released .net core 7, with support for ppc64le, how to install it on an Ubuntu or Debian server?

What about AIX ?

@bkeys
Copy link

bkeys commented Jan 10, 2023

Now that IBM has released .net core 7, with support for ppc64le, how to install it on an Ubuntu or Debian server?

Where does it say that .NET has ppc64le support?

@nealef
Copy link
Contributor

nealef commented Jan 10, 2023

Now that IBM has released .net core 7, with support for ppc64le, how to install it on an Ubuntu or Debian server?

Where does it say that .NET has ppc64le support?

https://www.itjungle.com/2022/11/09/ibm-and-microsoft-bring-net-to-power-after-all/

@janani66
Copy link

janani66 commented Jan 10, 2023

Enablement for ppc64le is in the upstream .NET7 and .NET8 ( main ) branches -- this is for the mono runtime engine and not CoreCLR. Testing continues. CI/CD pipelines are being run on ppc64le machines too.

That is great news! But mono has been available in the Fedora repositories for some time now with ppc64le architecture: https://koji.fedoraproject.org/koji/rpminfo?rpmID=25347685 I know mono joined the .net foundation but can you explain to those less informed such as myself what this means for ppc64le users? Is there plans to have ppc64le in the coreclr at some point?

Differences between the previous available mono and the .NET7 based mono on ppc64le are explained by this post: https://www.linkedin.com/pulse/whats-difference-net-7-mono-paul-chapman/

@Sapana-Khemkar
Copy link
Contributor

Blog on how to cross compile .NET7 for ppc64le https://community.ibm.com/community/user/powerdeveloper/blogs/sapana-khemkar/2023/01/13/cross-build-dotnet7-on-x86-ibm-power

@neosaldina
Copy link

Well, looks nice!!
This port is for ppc64le...

How complex would it be to make it compatible with ppc64?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Meta os-unsupported OS which is not officially supported
Projects
No open projects
Status: Untriaged
Development

No branches or pull requests