RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1151604 - systemd-detect-virt does not detect powerkvm virt on ppc64
Summary: systemd-detect-virt does not detect powerkvm virt on ppc64
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.1
Hardware: ppc64le
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1109875 rhsm-ppc64 1163882 1168850 1179458 1180596 1182933 1185286 1187501 1189279
TreeView+ depends on / blocked
 
Reported: 2014-10-10 19:24 UTC by Adrian Likins
Modified: 2015-11-19 14:57 UTC (History)
12 users (show)

Fixed In Version: systemd-219-1.el7
Doc Type: Known Issue
Doc Text:
Due to an unintended incompatibility between QEMU and the pSeries platform, the "systemd-detect-virt" and "virt-what" commands cannot properly detect PowerKVM virtualization on IBM Power Systems.
Clone Of:
Environment:
Last Closed: 2015-11-19 14:57:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1249025 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHBA-2015:2092 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2015-11-19 12:13:57 UTC

Internal Links: 1249025

Description Adrian Likins 2014-10-10 19:24:14 UTC
Description of problem:

RHEL7 running on ppc64le under PowerKVM does not detect virt.

model		: IBM pSeries (emulated by qemu)

[root@ibm-kvm-03-guest-01 ~]# systemd-detect-virt
none


Version-Release number of selected component (if applicable):
systemd-208-14.bs4.ppc64le
kernel-3.10.0-180.bs4.ppc64le
redhat-release-server-7.0-1.bs4.ppc64le



Steps to Reproduce:

Need a ppc64le machine.


Additional info:

virt-what also fails to detect virt in this case, see 
https://bugzilla.redhat.com/show_bug.cgi?id=1147876

Comment 3 Dan Horák 2014-10-11 07:07:59 UTC
lscpu (from util-linux) contains virt detection code for PPC

[root@ibm-power7r2-01-le02 ~]# lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    4
Core(s) per socket:    1
Socket(s):             4
NUMA node(s):          1
Model:                 IBM pSeries (emulated by qemu)
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
NUMA node0 CPU(s):     0-15
[root@ibm-power7r2-01-le02 ~]# rpm -q util-linux
util-linux-2.25.1-0.1.fc21.ppc64le

Comment 5 Lukáš Nykrýn 2014-10-13 13:38:20 UTC
There is something weird. I think that mentioned patch from util-linux would not work on rhel7.

It looks that 
/proc/device-tree/hypervisor/compatible
is present only with newest kernel which is in f21

Comment 9 David Gibson 2015-02-05 00:12:56 UTC
So the real question here is what do you want "virt" to mean in the context of this systemd test.

Any ppc64 system that shows platform "pSeries" (rather than "PowerNV") is (para)virtualized - and always has been - either under PowerVM or PowerKVM.  This includes every power system we've supported for a decade or so.

Comment 10 Karel Zak 2015-02-05 14:28:27 UTC
Yes, there is no hypervisor/ directory on 3.10.0-131.el7.ppc64, but it seems the file is in top level device tree directory:

# cat /proc/device-tree/compatible 
qemu,pseries

.. I guess it should be enough.

Comment 11 Karel Zak 2015-02-05 15:08:29 UTC
If I good understand IBM pSeries always has a hypervisor, but pSeries could be also emulated by qemu. IMHO the qemu version is what we're talking about. I don't see the /proc/devices-tree/hypervisor/ also on 3.14.5-200.fc20.ppc64p7, so it's no specific to old (rhel) kernels.

Comment 12 David Gibson 2015-02-06 00:01:45 UTC
So, some background.  powerpc kernels have a notion of "platform" which indicates the hardware &firmware environment the kernel is running in - it can be physical, para)virtual or some combination.  The platform is displayed at the bottom of the /proc/cpuinfo output.

Platform "pSeries" indicates the kernel is running in the paravirtualized environment described by the PAPR+ document (POWER Architecture Platform Requirements.  That environment could be provided either by PowerVM (IBM's proprietary hypervisor, aka pHyp) or (recently) by qemu.  I don't know what systemd wants the virtualization info for, so I don't know whether it matters to it whether it's qemu or PowerVM - for most purposes it shouldn't matter.

If the kernel is running "bare metal" on POWER, "pSeries" hardware, it will have platform "PowerNV" (for POWER Non-Virtualized).  This isn't supported in RHEL (though it will mostly work), but we're working towards limited support in 7.2 for use as a RHEV hypervisor.

/proc/device-tree exposes the device tree information supplied by that platform firmware, so it's contents depend on the firmware, not the (guest) kernel.

Incidentally, that lscpu patch looks wrong - running under KVM on POWER is no more "full virtualization" than running under pHyp - they're both providing basically the same PAPR+ virtual environment.

Comment 13 Karel Zak 2015-02-06 10:31:36 UTC
Thanks David, so if I good understand than in devices tree:

 * /ibm,partition-name means pHyp (according the lscpu Suse patch)
 * /compatible = ibm,powernv  means powerNV (bare metal)
 * /compatible = qemu,pseries means qemu

the Suse patch also checks for /hypervisor/compatible, but it seems line nonsense or some legacy, right?

Note that for systemd it's probably unimportant, but for lscpu(1) it would be nice to provide all the information (hypervisor type).

Please, review
https://github.com/karelzak/util-linux/blob/master/sys-utils/lscpu.c#L621

Comment 14 David Gibson 2015-02-09 00:20:52 UTC
Karel,

I think it is safer to first check for "Platform: PowerNV" in /proc/cpuinfo to detect the powernv case before checking /proc/device-tree.  The device tree is supplied by firmware, and might contain unexpected things depending on the exact firmware version.  cpuinfo is produced by the kernel and if it's not right more important things will be broken anyway.

Your patch appears to treat the PowerNV case as being KVM virtualized, which is not correct.  PowerNV == "POWER Non Virtualized", so it should be 

The test for pHyp vs KVM is probably right: because KVM implements the same paravirt interface as pHyp, there's no defined way to tell the difference, it's just a question of which (generally unimportant) properties happen to be implemented in pHyp but not qemu/KVM.

I note that there is a test for the case of a full-system partition under pHyp.  Non-virtualized full system partitions only exist on ancient POWER4 machines.  Newer machines have something called "full system partitions" but they're still para-virtualized just like any other partition.  I'm not sure if they will show up in the same way in the device tree though.

Comment 15 Karel Zak 2015-02-09 11:17:39 UTC
Ah... the thing with PowerNV is copy & paste mistake (work on conferences is probably bad idea ;-)

I'm not sure with the Power4, this code is originally from Suse, I guess they had some machines where it makes sense. I'll try to ask them for more details.

Thanks!

Comment 20 Lukáš Nykrýn 2015-06-04 10:18:50 UTC
Works now after rebase:
[lnykryn@ibm-p8-generic-01-le02 ~]$ systemd-detect-virt
none
[lnykryn@ibm-p8-generic-01-le02 ~]$ systemd-detect-virt --version
systemd 208
+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ
[lnykryn@ibm-p8-generic-01-le02 ~]$ usr/bin/systemd-detect-virt --version
systemd 219
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN
[lnykryn@ibm-p8-generic-01-le02 ~]$ usr/bin/systemd-detect-virt
kvm

Comment 23 errata-xmlrpc 2015-11-19 14:57:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2092.html


Note You need to log in before you can comment on or make changes to this bug.