SlideShare a Scribd company logo
Enabling Java:
Windows on Arm64
– A Success Story!
@mon_beck
By: Monica Beckwith
Agenda Introduction to OpenJDK & Arm64
About Our Port
 Background
 Windows and Arm64 Nuances
 Timeline
Testing and Benchmarking
Next Steps
It’s Demo Time!
Introduction to
OpenJDK & Arm64
What is The OpenJDK Project?
Open Java Development Kit
• Free and open source reference implementation of Java SE (Standard Edition)
• Licensed under GNU GPL version 2 with Classpath Exception
2006
OpenJDK Timeline
Java
HotSpot
Virtual
Machine
2007
Almost all
the Java
Development
Kit
2010
100% of the
Java
Development
Kit
The OpenJDK Community
Getting Involved Is Caring
2006
OpenJDK Timeline
Java
HotSpot
Virtual
Machine
2007
Almost all
the Java
Development
Kit
2010
100% of the
Java
Development
Kit
RedHat signs the
Sun/Oracle
Contributor
Agreement and
TCK License
Agreement
Porters Group created
to extend OpenJDK on
different processor
architectures and
OSes
IBM, Apple SAP join
the OpenJDK
Community
Microsoft
2013 +
What is Arm?
RISC-y Business? 
• Reduced Instruction Set Computer
• Highly optimized instruction set
• Large number of registers
• Load/Store architecture:
Memory
Data Processing
Instructions
Memory Access
Instructions
What is Arm?
RISC-y Business? 
• Reduced Instruction Set Computer
• Highly optimized instruction set
• Large number of registers
• Load/Store architecture:
• Memory accessed via specific instructions
• E.g. LDR Rt, <addr>
where Rt is the integer register
Processor
Register
Memory
What is Arm64 aka AArch64?
What's in a Name? 
• 64-bit ISA
• 64-bit wide int registers,
data and pointers
• Weak Memory Model with
Multiple Copy Atomicity
• Barriers/fences are needed
for access ordering
• E.g. ISBs – instruction
flushes the CPU pipeline, etc
• E.g. One-way barriers
(LDARs, etc)
inline void OrderAccess::loadload() { acquire(); }
inline void OrderAccess::storestore() { release(); }
inline void OrderAccess::loadstore() { acquire(); }
inline void OrderAccess::storeload() { fence(); }
#define READ_MEM_BARRIER atomic_thread_fence(std::memory_order_acquire);
#define WRITE_MEM_BARRIER atomic_thread_fence(std::memory_order_release);
#define FULL_MEM_BARRIER atomic_thread_fence(std::memory_order_seq_cst);
inline void OrderAccess::acquire() {
READ_MEM_BARRIER;
}
inline void OrderAccess::release() {
WRITE_MEM_BARRIER;
}
inline void OrderAccess::fence() {
FULL_MEM_BARRIER;
}
Arm64 ISA and Third-Party Systems
The More, The Merrier
Arm64 ISA Timeline
Arm v8
eMAG system
Arm v8.1
ThunderX2
system
Arm v8.2
Surface Pro X
system
Arm v8.3 ….
Ampere
Computing’s
product. Also
known as Applied
Micro’s XGene3
and Skylark
Cavium Inc.’s
product. Now
owned by
Marvell
Technology
Group
Microsoft and
Qualcomm’s
collaboration –
SQ1&2 processors
…
About Our Port
 Background
 Windows & Arm64
Nuances
 Timeline
What is an OpenJDK Port?
Write Once Run Anywhere... ?
• Windows on Arm64 is a new platform for OpenJDK
• In order to be able to develop in Java, we need to
get the JDK to work on the new platform
• In-order to run Java applications on this new
platform, we need to get the Java Runtime
Environment (JRE) to work on it.
• A JDK is a superset of a JRE as it includes tools and
utilities for development and debugging
Java
HotSpot VM
A JRE
Class
Libraries
Runtime
Execution
Engine
UI Toolkits
Base, Lang,
Util Libs
Quick Overview of HotSpot
What’s in a VM?
• Most of the code is non-OS and non-Arch specific
• E.g. Memory Management, Compilers,
Metadata, etc
• Rest is organized as follows:
• Architecture specific code
• E.g. AArch64, x86 …
• OS specific code
• E.g. Windows, Linux …
• OS and Architecture specific code
• E.g. Windows_AArch64, Linux_AArch64 …
HotSpot Source Repo
Share
CPU
OS
OS_CPU
What is a Runtime?
Bytecode to Native Code
• Classloading, Interpretation, Bytecode
verification, Exception Handling, Thread
Management, Synchronization
• Our changes: JDK Launcher for JVM creation,
destruction to use structured exception
handling on Windows
Java
HotSpot VM
Runtime
Execution
Engine
Execution
Engine
What is an Execution Engine?
A Smart, Adaptive, Profile Guided Orchestrator…
• Compilation and Heap Management
• Most of our changes were in the execution
engine to enable Arm64 architecture
specific changes for Windows and adding
Windows-Arm64 specific changes for
HotSpot in general
Java
HotSpot VM
Runtime
Execution
Engine
Runtime
Windows and AArch64 Specific Learnings
What’s in a Register?
• Register R18 is a platform register and has
special meanings for kernel and user mode
• We need to avoid using it for HotSpot
purposes and treat is as “Reserved”
• Invalidating instruction cache
R18 =
non_allocatable_reg
Flushing a range of
bytes in ICache
// Interface for updating the instruction cache. Whenever the VM modifies code, part of the processor // instruction cache potentially has to
be flushed.
class ICache : public AbstractICache {
<snip>
static void invalidate_range(address start, int nbytes) {
FlushInstructionCache((HANDLE)GetCurrentProcess(), start, (SIZE_T)(nbytes));
}
};
Windows and AArch64 Specific Learnings
Features, features, everywhere!
• Cache line size optimized assembly stubs for
copying
• CPU features detection such as AES, CRC32, etc
void VM_Version::get_os_cpu_info() {
if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) _features |= CPU_CRC32;
if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) _features |= CPU_AES | CPU_SHA1 | CPU_SHA2;
if (IsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE)) _features |= CPU_ASIMD;
…
CPU features detection
Platform optimized byte
swaps and copy stubs
Windows and MSVC Specific Learnings
Intrinsics Fun
• Atomic Read-Write barriers and functions such
as CompareExchange
• MSVC offers various intrinsics and we
employed those
• E.g. __nop()
MSVC Intrinsics
#ifdef __GNUC__
// __nop needs volatile so that compiler doesn't optimize it away
#define NOP() asm volatile ("nop");
#elif defined(_MSC_VER)
// Use MSVC instrinsic: https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=vs-2019#I
#define NOP() __nop();
#endif
Platform friendly
Intrinsics for Atomic
functions
Windows and MSVC Specific Learnings
Would the real 64-bit please stand up!?
LP64 vs LLP64 issues:
Extending 64-bit long integers and pointers to
the long-long integers and pointers needed
by the 64-bit Windows platform
• Most Unix-like systems (Linux, macOS, etc)
follow the LP64 data model
• Windows follows the LLP64 model
LP64 vs LLP64 data
models
LP64 LLP64
short 16 16
int 32 32
long 64 32
long long 64 64
size_t, pointers 64 64
Meet Us and Our Port
The Trifecta 
Feb 2020
Port Timeline
$ bin/java.exe –version
works!
# Java VM: OpenJDK 64-
Bit Server VM
(fastdebug 15-
internal+… windows-
aarch64)
Mar 2020
Core Dump 
Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020
eMAG system
Meet Us and Our Port
The Trifecta 
Feb 2020
Port Timeline
Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020
Great Collaboration
with the MSVC team
eMAG system
ThunderX2 system
Surface Pro X system
JTReg tier 1 testing, JMH
subset runs and JVM2008 +
JBB2015 subset runs
Meet Us and Our Port
The Trifecta 
Feb 2020
Port Timeline
Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020
eMAG system
Parts of SPEC SERT
work with C1 and
Parallel GC
Benchmark mods needed
for JNI and >64 cores
identification on Windows
C2 is functional
SPEC SERT
changes made
Full scale testing
underway
ThunderX2 system
Surface Pro X system
Meet Us and Our Port
The Trifecta 
Feb 2020
Port Timeline
Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020
eMAG system
Start discussions with
RedHat on the patches
ThunderX2 system
Surface Pro X system
Fixed G1 GC – Introduced
a workaround Patches surfaced on
OpenJDK and first EA
build released
Exception handling bug
fixed for Swing and Java
2D + Surface Pro X
Meet Us and Our Port
The Trifecta 
Feb 2020
Port Timeline
Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020
eMAG system
ThunderX2 system
Surface Pro X system
JEP drafted
JEP became
a Candidate
SPEC SERT
changes
approved
All three of us
became
Committers to
OpenJDK
AArch64
Project
All GCs enabled and
heap + JVM scaling
tests completed
JDK 16
targeted
We are
OpenJDK!

Testing and
Benchmarking
Testing Setup & CI
• We divided our changes into incremental
patch sets and made sure that they cleanly
apply to tip.
• We tested the patches incrementally on
Linux/AArch64, Windows/AArch64,
Windows/x64, and, only for functional
testing, Linux/x64.
• We enabled CI for JTReg tests on our
patches on the test platforms
Phases
Windows +
AArch64
Linux +
AArch64
Windows
+ X86-64
(VMs OK)
Linux +
X86-64
(VMs OK)
Phase 1
hotspot:tier
1, jdk:tier1
and
langtools
hotspot:tier
1, jdk:tier1
and
langtools
hotspot:tier
1, jdk:tier1
and
langtools
hotspot:tier1
, jdk:tier1
and
langtools
Phase 2 -
hotspot:all,
jdk:all and
langtools
hotspot:all,
jdk:all and
langtools
hotspot:all,
jdk:all and
langtools
Phase 3
hotspot:all,
jdk:all and
langtools
- - -
Phase 4
JTReg +
GTests +
Adopt QA
tests
JTReg +
GTests +
Adopt QA
tests
JTReg +
GTests +
Adopt QA
tests
JTReg +
GTests +
Adopt QA
tests
Testing Setup & CI
• We divided our changes into incremental
patch sets and made sure that they cleanly
apply to tip.
• We tested the patches incrementally on
Linux/AArch64, Windows/AArch64,
Windows/x64, and, only for functional
testing, Linux/x64.
• We enabled CI for JTReg tests on our
patches on the test platforms
Test
system
Hardware
Patch
combo
hbIR
max
hbIR
settled
max-
JOPS
critical-
JOPS
linux-
aarch64
TX2 P1 100% 98% 94% 49%
linux-
aarch64
TX2
P1 +
P2
100% 97% 94% 50%
windows
-aarch64
TX2
P1 +
P2
100% 88% 83% 40%
windows
-x86-64
Skylake P1 100% 90% 85% 27%
windows
-x86-64
Skylake
P1 +
P2
100% 90% 85% 27%
Our Workload Status and Benchmark Matrix
Workload Tests Arm64
Status
Comments
Java Regression Testing
Framework (JTREG)
hotspot:all, jdk:all and langtools o* We will soon include Gtests and Adopt QA tests
Java Micro Benchmark
Harness (JMH)
many microbenchmarks used for
performance and implementation
testing
o* we ran the 'jmh-jdk-microbenchmarks' suite on
our test platforms and found no significant
issues
SPEC JBB2015 o* Performance studies with newer GCs still WIP
SPEC JBB2005 o* Performance studies with newer GCs still WIP
SPEC JVM2008 crypto, xml, derby, compress, etc o* startup doesn't work on JDK8+
SPEC SERT o
Benchmark changes made to accommodate the
new platform combo, up-streamed to SPEC
DaCapo Benchmark avrora fop h2 jython luindex
lusearch lusearch-fix pmd sunflow
tomcat xalan
o*
one benchmark utilizes an x86-64 dll. A few
others don't work on JDK8+. Lower priority
VSCode o
Minecraft Server o
Legend Status
o Complete
o* Almost there, see notes
x Incomplete
Next Steps
Next Steps
The journey has just started …
• macOS + AppleSi port
• Collaboration with Azul
• Learnings from Windows port: R18, CPU feature detection, etc.
• RFE: https://github.com/openjdk/aarch64-port/pull/2
• JVMCI and AOT in HotSpot
• RFE: https://github.com/openjdk/jdk/pull/685
• Backport to JDK11 for Windows and macOS
• RFE: https://github.com/openjdk/aarch64-port/tree/jdk11-windows
Keep the port up-to-
date
Working closely with the
Windows Memory
Management team
Working closely with the
MSVC team
It’s Demo*
Time!
https://github.com/microsoft/
openjdk-aarch64/releases
Download and
Take it for a Spin
*https://spring.io/guides/gs/spring-boot/
Enabling Java: Windows on Arm64 - A Success Story!
Thank You!
https://github.com/microsoft/
openjdk-aarch64/releases
Download and
Take it for a Spin
Our GitHub Repo: https://github.com/microsoft/openjdk-aarch64
Our OpenJDK PR: https://github.com/openjdk/jdk/pull/212
A few announcements: https://devblogs.microsoft.com/java/announcing-openjdk-windows-arm/
https://www.infoq.com/news/2020/08/openjdk-win10-arm/
https://www.infoq.com/news/2020/09/microsoft-windows-mac-arm/

More Related Content

What's hot (20)

PDF
GC Tuning Confessions Of A Performance Engineer - Improved :)
Monica Beckwith
 
PDF
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Jimin Hsieh
 
PPTX
OpenJDK Concurrent Collectors
Monica Beckwith
 
PDF
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Monica Beckwith
 
PDF
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
Monica Beckwith
 
PDF
HKG15-110: ODP Project Update
Linaro
 
PPT
Performance tuning jvm
Prem Kuppumani
 
PDF
Learn more about the tremendous value Open Data Plane brings to NFV
Ghodhbane Mohamed Amine
 
PDF
KubeCon US 2021 - Recap - DCMeetup
Faheem Memon
 
PDF
SFO15-110: Toolchain Collaboration
Linaro
 
PDF
OpenStack Load Balancing Use Cases and Requirements
John Gruber
 
PDF
LCA14: LCA14-209: ODP Project Update
Linaro
 
PDF
Java Performance Tuning
Ender Aydin Orak
 
PPTX
Open stack HA - Theory to Reality
Sriram Subramanian
 
PPTX
Python Streaming Pipelines with Beam on Flink
Aljoscha Krettek
 
PPTX
Ruby Under The Hood
craig lehmann
 
ODP
CentOS NFV SIG Introduction and Update
Tom Herbert
 
PDF
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
Taro L. Saito
 
PDF
High availability and fault tolerance of openstack
Deepak Mane
 
PDF
High Availability in OpenStack Cloud
Qiming Teng
 
GC Tuning Confessions Of A Performance Engineer - Improved :)
Monica Beckwith
 
Scala & Spark(1.6) in Performance Aspect for Scala Taiwan
Jimin Hsieh
 
OpenJDK Concurrent Collectors
Monica Beckwith
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Monica Beckwith
 
The Performance Engineer's Guide to Java (HotSpot) Virtual Machine
Monica Beckwith
 
HKG15-110: ODP Project Update
Linaro
 
Performance tuning jvm
Prem Kuppumani
 
Learn more about the tremendous value Open Data Plane brings to NFV
Ghodhbane Mohamed Amine
 
KubeCon US 2021 - Recap - DCMeetup
Faheem Memon
 
SFO15-110: Toolchain Collaboration
Linaro
 
OpenStack Load Balancing Use Cases and Requirements
John Gruber
 
LCA14: LCA14-209: ODP Project Update
Linaro
 
Java Performance Tuning
Ender Aydin Orak
 
Open stack HA - Theory to Reality
Sriram Subramanian
 
Python Streaming Pipelines with Beam on Flink
Aljoscha Krettek
 
Ruby Under The Hood
craig lehmann
 
CentOS NFV SIG Introduction and Update
Tom Herbert
 
Airframe: Lightweight Building Blocks for Scala @ TD Tech Talk 2018-10-17
Taro L. Saito
 
High availability and fault tolerance of openstack
Deepak Mane
 
High Availability in OpenStack Cloud
Qiming Teng
 

Similar to Enabling Java: Windows on Arm64 - A Success Story! (20)

PDF
20141111_SOS3_Gallo
Andrea Gallo
 
PDF
Java-light-speed NebraskaCode.pdf
RichHagarty
 
PPTX
EclipseOMRBuildingBlocks4Polyglot_TURBO18
Xiaoli Liang
 
PPTX
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
InfinIT - Innovationsnetværket for it
 
PPT
Java script anywhere. What Nombas was doing pre-acquisition.
Brent Noorda
 
PPTX
Debugging Numerical Simulations on Accelerated Architectures - TotalView fo...
Rogue Wave Software
 
PDF
A2O Core implementation on FPGA
Ganesan Narayanasamy
 
PDF
Linxu conj2016 96boards
LF Events
 
PPTX
Tech Days 2015: Embedded Product Update
AdaCore
 
PPTX
TIVA_Workshop_Session I.pptx Embedded system design using TIVA
ece04abhishek
 
PPTX
The sunsparc architecture
Taha Malampatti
 
PPTX
JVM++: The Graal VM
Martin Toshev
 
PDF
Java Programming - 01 intro to java
Danairat Thanabodithammachari
 
PPT
Java2020 programming basics and fundamentals
swecsaleem
 
PDF
LCU14 310- Cisco ODP v2
Linaro
 
PPTX
Værktøjer udviklet på AAU til analyse af SCJ programmer
InfinIT - Innovationsnetværket for it
 
PDF
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward
 
PPTX
Java performance tuning
Jerry Kurian
 
DOCX
Introduction to java programming tutorial
jackschitze
 
PDF
Javantura v4 - JVM++ The GraalVM - Martin Toshev
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
20141111_SOS3_Gallo
Andrea Gallo
 
Java-light-speed NebraskaCode.pdf
RichHagarty
 
EclipseOMRBuildingBlocks4Polyglot_TURBO18
Xiaoli Liang
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
InfinIT - Innovationsnetværket for it
 
Java script anywhere. What Nombas was doing pre-acquisition.
Brent Noorda
 
Debugging Numerical Simulations on Accelerated Architectures - TotalView fo...
Rogue Wave Software
 
A2O Core implementation on FPGA
Ganesan Narayanasamy
 
Linxu conj2016 96boards
LF Events
 
Tech Days 2015: Embedded Product Update
AdaCore
 
TIVA_Workshop_Session I.pptx Embedded system design using TIVA
ece04abhishek
 
The sunsparc architecture
Taha Malampatti
 
JVM++: The Graal VM
Martin Toshev
 
Java Programming - 01 intro to java
Danairat Thanabodithammachari
 
Java2020 programming basics and fundamentals
swecsaleem
 
LCU14 310- Cisco ODP v2
Linaro
 
Værktøjer udviklet på AAU til analyse af SCJ programmer
InfinIT - Innovationsnetværket for it
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward
 
Java performance tuning
Jerry Kurian
 
Introduction to java programming tutorial
jackschitze
 
Javantura v4 - JVM++ The GraalVM - Martin Toshev
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Ad

More from Monica Beckwith (9)

PPTX
The ilities of software engineering.pptx
Monica Beckwith
 
PPTX
A G1GC Saga-KCJUG.pptx
Monica Beckwith
 
PDF
ZGC-SnowOne.pdf
Monica Beckwith
 
PDF
QCon London.pdf
Monica Beckwith
 
PPTX
Intro to Garbage Collection
Monica Beckwith
 
PDF
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
Monica Beckwith
 
PDF
Java 9: The (G1) GC Awakens!
Monica Beckwith
 
PPTX
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Monica Beckwith
 
PPTX
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Monica Beckwith
 
The ilities of software engineering.pptx
Monica Beckwith
 
A G1GC Saga-KCJUG.pptx
Monica Beckwith
 
ZGC-SnowOne.pdf
Monica Beckwith
 
QCon London.pdf
Monica Beckwith
 
Intro to Garbage Collection
Monica Beckwith
 
The Performance Engineer's Guide To (OpenJDK) HotSpot Garbage Collection - Th...
Monica Beckwith
 
Java 9: The (G1) GC Awakens!
Monica Beckwith
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Monica Beckwith
 
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
Monica Beckwith
 
Ad

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 

Enabling Java: Windows on Arm64 - A Success Story!

  • 1. Enabling Java: Windows on Arm64 – A Success Story! @mon_beck By: Monica Beckwith
  • 2. Agenda Introduction to OpenJDK & Arm64 About Our Port  Background  Windows and Arm64 Nuances  Timeline Testing and Benchmarking Next Steps It’s Demo Time!
  • 4. What is The OpenJDK Project? Open Java Development Kit • Free and open source reference implementation of Java SE (Standard Edition) • Licensed under GNU GPL version 2 with Classpath Exception 2006 OpenJDK Timeline Java HotSpot Virtual Machine 2007 Almost all the Java Development Kit 2010 100% of the Java Development Kit
  • 5. The OpenJDK Community Getting Involved Is Caring 2006 OpenJDK Timeline Java HotSpot Virtual Machine 2007 Almost all the Java Development Kit 2010 100% of the Java Development Kit RedHat signs the Sun/Oracle Contributor Agreement and TCK License Agreement Porters Group created to extend OpenJDK on different processor architectures and OSes IBM, Apple SAP join the OpenJDK Community Microsoft 2013 +
  • 6. What is Arm? RISC-y Business?  • Reduced Instruction Set Computer • Highly optimized instruction set • Large number of registers • Load/Store architecture: Memory Data Processing Instructions
  • 7. Memory Access Instructions What is Arm? RISC-y Business?  • Reduced Instruction Set Computer • Highly optimized instruction set • Large number of registers • Load/Store architecture: • Memory accessed via specific instructions • E.g. LDR Rt, <addr> where Rt is the integer register Processor Register Memory
  • 8. What is Arm64 aka AArch64? What's in a Name?  • 64-bit ISA • 64-bit wide int registers, data and pointers • Weak Memory Model with Multiple Copy Atomicity • Barriers/fences are needed for access ordering • E.g. ISBs – instruction flushes the CPU pipeline, etc • E.g. One-way barriers (LDARs, etc) inline void OrderAccess::loadload() { acquire(); } inline void OrderAccess::storestore() { release(); } inline void OrderAccess::loadstore() { acquire(); } inline void OrderAccess::storeload() { fence(); } #define READ_MEM_BARRIER atomic_thread_fence(std::memory_order_acquire); #define WRITE_MEM_BARRIER atomic_thread_fence(std::memory_order_release); #define FULL_MEM_BARRIER atomic_thread_fence(std::memory_order_seq_cst); inline void OrderAccess::acquire() { READ_MEM_BARRIER; } inline void OrderAccess::release() { WRITE_MEM_BARRIER; } inline void OrderAccess::fence() { FULL_MEM_BARRIER; }
  • 9. Arm64 ISA and Third-Party Systems The More, The Merrier Arm64 ISA Timeline Arm v8 eMAG system Arm v8.1 ThunderX2 system Arm v8.2 Surface Pro X system Arm v8.3 …. Ampere Computing’s product. Also known as Applied Micro’s XGene3 and Skylark Cavium Inc.’s product. Now owned by Marvell Technology Group Microsoft and Qualcomm’s collaboration – SQ1&2 processors …
  • 10. About Our Port  Background  Windows & Arm64 Nuances  Timeline
  • 11. What is an OpenJDK Port? Write Once Run Anywhere... ? • Windows on Arm64 is a new platform for OpenJDK • In order to be able to develop in Java, we need to get the JDK to work on the new platform • In-order to run Java applications on this new platform, we need to get the Java Runtime Environment (JRE) to work on it. • A JDK is a superset of a JRE as it includes tools and utilities for development and debugging Java HotSpot VM A JRE Class Libraries Runtime Execution Engine UI Toolkits Base, Lang, Util Libs
  • 12. Quick Overview of HotSpot What’s in a VM? • Most of the code is non-OS and non-Arch specific • E.g. Memory Management, Compilers, Metadata, etc • Rest is organized as follows: • Architecture specific code • E.g. AArch64, x86 … • OS specific code • E.g. Windows, Linux … • OS and Architecture specific code • E.g. Windows_AArch64, Linux_AArch64 … HotSpot Source Repo Share CPU OS OS_CPU
  • 13. What is a Runtime? Bytecode to Native Code • Classloading, Interpretation, Bytecode verification, Exception Handling, Thread Management, Synchronization • Our changes: JDK Launcher for JVM creation, destruction to use structured exception handling on Windows Java HotSpot VM Runtime Execution Engine Execution Engine
  • 14. What is an Execution Engine? A Smart, Adaptive, Profile Guided Orchestrator… • Compilation and Heap Management • Most of our changes were in the execution engine to enable Arm64 architecture specific changes for Windows and adding Windows-Arm64 specific changes for HotSpot in general Java HotSpot VM Runtime Execution Engine Runtime
  • 15. Windows and AArch64 Specific Learnings What’s in a Register? • Register R18 is a platform register and has special meanings for kernel and user mode • We need to avoid using it for HotSpot purposes and treat is as “Reserved” • Invalidating instruction cache R18 = non_allocatable_reg Flushing a range of bytes in ICache // Interface for updating the instruction cache. Whenever the VM modifies code, part of the processor // instruction cache potentially has to be flushed. class ICache : public AbstractICache { <snip> static void invalidate_range(address start, int nbytes) { FlushInstructionCache((HANDLE)GetCurrentProcess(), start, (SIZE_T)(nbytes)); } };
  • 16. Windows and AArch64 Specific Learnings Features, features, everywhere! • Cache line size optimized assembly stubs for copying • CPU features detection such as AES, CRC32, etc void VM_Version::get_os_cpu_info() { if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) _features |= CPU_CRC32; if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) _features |= CPU_AES | CPU_SHA1 | CPU_SHA2; if (IsProcessorFeaturePresent(PF_ARM_VFP_32_REGISTERS_AVAILABLE)) _features |= CPU_ASIMD; … CPU features detection Platform optimized byte swaps and copy stubs
  • 17. Windows and MSVC Specific Learnings Intrinsics Fun • Atomic Read-Write barriers and functions such as CompareExchange • MSVC offers various intrinsics and we employed those • E.g. __nop() MSVC Intrinsics #ifdef __GNUC__ // __nop needs volatile so that compiler doesn't optimize it away #define NOP() asm volatile ("nop"); #elif defined(_MSC_VER) // Use MSVC instrinsic: https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=vs-2019#I #define NOP() __nop(); #endif Platform friendly Intrinsics for Atomic functions
  • 18. Windows and MSVC Specific Learnings Would the real 64-bit please stand up!? LP64 vs LLP64 issues: Extending 64-bit long integers and pointers to the long-long integers and pointers needed by the 64-bit Windows platform • Most Unix-like systems (Linux, macOS, etc) follow the LP64 data model • Windows follows the LLP64 model LP64 vs LLP64 data models LP64 LLP64 short 16 16 int 32 32 long 64 32 long long 64 64 size_t, pointers 64 64
  • 19. Meet Us and Our Port The Trifecta  Feb 2020 Port Timeline $ bin/java.exe –version works! # Java VM: OpenJDK 64- Bit Server VM (fastdebug 15- internal+… windows- aarch64) Mar 2020 Core Dump  Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020 eMAG system
  • 20. Meet Us and Our Port The Trifecta  Feb 2020 Port Timeline Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020 Great Collaboration with the MSVC team eMAG system ThunderX2 system Surface Pro X system JTReg tier 1 testing, JMH subset runs and JVM2008 + JBB2015 subset runs
  • 21. Meet Us and Our Port The Trifecta  Feb 2020 Port Timeline Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020 eMAG system Parts of SPEC SERT work with C1 and Parallel GC Benchmark mods needed for JNI and >64 cores identification on Windows C2 is functional SPEC SERT changes made Full scale testing underway ThunderX2 system Surface Pro X system
  • 22. Meet Us and Our Port The Trifecta  Feb 2020 Port Timeline Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020 eMAG system Start discussions with RedHat on the patches ThunderX2 system Surface Pro X system Fixed G1 GC – Introduced a workaround Patches surfaced on OpenJDK and first EA build released Exception handling bug fixed for Swing and Java 2D + Surface Pro X
  • 23. Meet Us and Our Port The Trifecta  Feb 2020 Port Timeline Mar 2020 Apr 2020 May 2020 Jun 2020 Jul 2020 Aug 2020 Sep 2020 Oct 2020 eMAG system ThunderX2 system Surface Pro X system JEP drafted JEP became a Candidate SPEC SERT changes approved All three of us became Committers to OpenJDK AArch64 Project All GCs enabled and heap + JVM scaling tests completed JDK 16 targeted We are OpenJDK! 
  • 25. Testing Setup & CI • We divided our changes into incremental patch sets and made sure that they cleanly apply to tip. • We tested the patches incrementally on Linux/AArch64, Windows/AArch64, Windows/x64, and, only for functional testing, Linux/x64. • We enabled CI for JTReg tests on our patches on the test platforms Phases Windows + AArch64 Linux + AArch64 Windows + X86-64 (VMs OK) Linux + X86-64 (VMs OK) Phase 1 hotspot:tier 1, jdk:tier1 and langtools hotspot:tier 1, jdk:tier1 and langtools hotspot:tier 1, jdk:tier1 and langtools hotspot:tier1 , jdk:tier1 and langtools Phase 2 - hotspot:all, jdk:all and langtools hotspot:all, jdk:all and langtools hotspot:all, jdk:all and langtools Phase 3 hotspot:all, jdk:all and langtools - - - Phase 4 JTReg + GTests + Adopt QA tests JTReg + GTests + Adopt QA tests JTReg + GTests + Adopt QA tests JTReg + GTests + Adopt QA tests
  • 26. Testing Setup & CI • We divided our changes into incremental patch sets and made sure that they cleanly apply to tip. • We tested the patches incrementally on Linux/AArch64, Windows/AArch64, Windows/x64, and, only for functional testing, Linux/x64. • We enabled CI for JTReg tests on our patches on the test platforms Test system Hardware Patch combo hbIR max hbIR settled max- JOPS critical- JOPS linux- aarch64 TX2 P1 100% 98% 94% 49% linux- aarch64 TX2 P1 + P2 100% 97% 94% 50% windows -aarch64 TX2 P1 + P2 100% 88% 83% 40% windows -x86-64 Skylake P1 100% 90% 85% 27% windows -x86-64 Skylake P1 + P2 100% 90% 85% 27%
  • 27. Our Workload Status and Benchmark Matrix Workload Tests Arm64 Status Comments Java Regression Testing Framework (JTREG) hotspot:all, jdk:all and langtools o* We will soon include Gtests and Adopt QA tests Java Micro Benchmark Harness (JMH) many microbenchmarks used for performance and implementation testing o* we ran the 'jmh-jdk-microbenchmarks' suite on our test platforms and found no significant issues SPEC JBB2015 o* Performance studies with newer GCs still WIP SPEC JBB2005 o* Performance studies with newer GCs still WIP SPEC JVM2008 crypto, xml, derby, compress, etc o* startup doesn't work on JDK8+ SPEC SERT o Benchmark changes made to accommodate the new platform combo, up-streamed to SPEC DaCapo Benchmark avrora fop h2 jython luindex lusearch lusearch-fix pmd sunflow tomcat xalan o* one benchmark utilizes an x86-64 dll. A few others don't work on JDK8+. Lower priority VSCode o Minecraft Server o Legend Status o Complete o* Almost there, see notes x Incomplete
  • 29. Next Steps The journey has just started … • macOS + AppleSi port • Collaboration with Azul • Learnings from Windows port: R18, CPU feature detection, etc. • RFE: https://github.com/openjdk/aarch64-port/pull/2 • JVMCI and AOT in HotSpot • RFE: https://github.com/openjdk/jdk/pull/685 • Backport to JDK11 for Windows and macOS • RFE: https://github.com/openjdk/aarch64-port/tree/jdk11-windows Keep the port up-to- date Working closely with the Windows Memory Management team Working closely with the MSVC team
  • 30. It’s Demo* Time! https://github.com/microsoft/ openjdk-aarch64/releases Download and Take it for a Spin *https://spring.io/guides/gs/spring-boot/
  • 32. Thank You! https://github.com/microsoft/ openjdk-aarch64/releases Download and Take it for a Spin Our GitHub Repo: https://github.com/microsoft/openjdk-aarch64 Our OpenJDK PR: https://github.com/openjdk/jdk/pull/212 A few announcements: https://devblogs.microsoft.com/java/announcing-openjdk-windows-arm/ https://www.infoq.com/news/2020/08/openjdk-win10-arm/ https://www.infoq.com/news/2020/09/microsoft-windows-mac-arm/

Editor's Notes

  • #3: We will provide: 1) a quick timeline of our development efforts and Microsoft’s journey into OpenJDK land (spoiler alert: we were welcomed with open arm(s) (pun intended)), 2) a few Arm64 and Windows nuances, 3) our testing and benchmarking North Stars. If we feel lucky, we will even showcase a demo on our Surface Pro X device.
  • #18: ProcessthreadsAPI.h
  • #19: ProcessthreadsAPI.h Interlockedcompare exchg intrinsic
  • #33: Talk about community