Skip to content

Commit

Permalink
8303575: adjust Xen handling on Linux aarch64
Browse files Browse the repository at this point in the history
Reviewed-by: lucy, mdoerr
  • Loading branch information
MBaesken committed Mar 8, 2023
1 parent d988252 commit 8eaf84f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
Expand Up @@ -609,18 +609,20 @@ void VM_Version::check_virtualizations() {
if (check_info_file(pname_file, "KVM", KVM, "VMWare", VMWare)) {
return;
}
check_info_file(tname_file, "Xen", XenHVM, NULL, NoDetectedVirtualization);
check_info_file(tname_file, "Xen", XenPVHVM, NULL, NoDetectedVirtualization);
#endif
}

void VM_Version::print_platform_virtualization_info(outputStream* st) {
#if defined(LINUX)
VirtualizationType vrt = VM_Version::get_detected_virtualization();
if (vrt == KVM) {
st->print_cr("KVM virtualization detected");
} else if (vrt == VMWare) {
st->print_cr("VMWare virtualization detected");
}
VirtualizationType vrt = VM_Version::get_detected_virtualization();
if (vrt == KVM) {
st->print_cr("KVM virtualization detected");
} else if (vrt == VMWare) {
st->print_cr("VMWare virtualization detected");
} else if (vrt == XenPVHVM) {
st->print_cr("Xen virtualization detected");
}
#endif
}

Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/jfr/periodic/jfrOSInterface.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -253,6 +253,8 @@ const char* JfrOSInterface::virtualization_name() {
VirtualizationType vrt = VM_Version::get_detected_virtualization();
if (vrt == XenHVM) {
return "Xen hardware-assisted virtualization";
} else if (vrt == XenPVHVM) {
return "Xen optimized paravirtualization";
} else if (vrt == KVM) {
return "KVM virtualization";
} else if (vrt == VMWare) {
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/runtime/abstract_vm_version.hpp
Expand Up @@ -31,6 +31,7 @@
typedef enum {
NoDetectedVirtualization,
XenHVM,
XenPVHVM, // mix-mode on Linux aarch64
KVM,
VMWare,
HyperV,
Expand Down

3 comments on commit 8eaf84f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 8eaf84f Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken Could not automatically backport 8eaf84f0 to openjdk/jdk17u-dev due to conflicts in the following files:

  • src/hotspot/share/jfr/periodic/jfrOSInterface.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b MBaesken-backport-8eaf84f0

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk 8eaf84f09476b08ed421efe74d7554e2b29bc5a7

# Backport the commit
$ git cherry-pick --no-commit 8eaf84f09476b08ed421efe74d7554e2b29bc5a7
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 8eaf84f09476b08ed421efe74d7554e2b29bc5a7'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport 8eaf84f09476b08ed421efe74d7554e2b29bc5a7.

Please sign in to comment.