[21.10 FEAT] CPU Model for new IBM Z Hardware - qemu part

Bug #1932175 reported by bugproxy
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
High
Skipper Bug Screeners
qemu (Ubuntu)
Fix Released
Undecided
Canonical Server

Bug Description

Define and implement a CPU model for the zNexts GA1 machines.
The CPU model must contain all new zNext architectural features and enable them for KVM guests.

Business Value: Enable Linux guests to exploit zNexts GA1 specific architecture features, e.g. new AI instructions.

This feature will be contribute to qemu.

Backports will be provided once available.

Related branches

bugproxy (bugproxy)
tags: added: architecture-s39064 bugnameltc-193307 severity-high targetmilestone-inin2110
Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → qemu (Ubuntu)
tags: added: qemu-22.04
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
Changed in qemu (Ubuntu):
assignee: Skipper Bug Screeners (skipper-screen-team) → Canonical Server Team (canonical-server)
Changed in ubuntu-z-systems:
importance: Undecided → High
Changed in qemu (Ubuntu):
status: New → Incomplete
Changed in ubuntu-z-systems:
status: New → Incomplete
tags: added: qemu-21.10
removed: qemu-22.04
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2021-08-13 04:07 EDT-------
The following commit is needed

fb4a081216 s390x/cpumodel: add 3931 and 3932

Frank Heimes (fheimes)
Changed in qemu (Ubuntu):
status: Incomplete → New
Changed in ubuntu-z-systems:
status: Incomplete → Triaged
information type: Private → Public
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This does not cleanly apply due to missing

commit 463e50da8bf81bb3eff108e4bdd8fa7aadb12f4c
Author: David Hildenbrand <email address hidden>
Date: Tue Jun 8 11:23:37 2021 +0200

    s390x/cpumodel: Bump up QEMU model to a stripped-down IBM z14 GA2

    TCG implements everything we need to run basic z14 OS+software.

Since we are not on 6.1 I'd not pick the other patch.
For now I'll backport the new entries ignoring the context change.
If there is a problem with that please let me know.

Right now it looks like:
  https://git.launchpad.net/~paelzer/ubuntu/+source/qemu/tree/debian/patches/ubuntu/lp-1932175-s390x-cpumodel-add-3931-and-3932.patch?h=merge-6.0-2exp-impish

Changed in qemu (Ubuntu):
status: New → In Progress
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Triaged → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

There isn't much I could do with it on my HW, but so far it LGTM.
PPA (if you want to try) is at:
  https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4644/+packages

Trivial check via -cpu ?

$ qemu-system-s390x -cpu ? | grep 16
s390 gen16a-base IBM 3931 GA1 (static, migration-safe)
s390 gen16a IBM 3931 GA1 (migration-safe)
s390 gen16b-base IBM 3932 GA1 (static, migration-safe)
s390 gen16b IBM 3932 GA1 (migration-safe)

Changed in qemu (Ubuntu):
status: In Progress → Fix Committed
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2021-08-17 09:43 EDT-------
(In reply to comment #7)
> This does not cleanly apply due to missing
>
> commit 463e50da8bf81bb3eff108e4bdd8fa7aadb12f4c
> Author: David Hildenbrand <email address hidden>
> Date: Tue Jun 8 11:23:37 2021 +0200
>
> s390x/cpumodel: Bump up QEMU model to a stripped-down IBM z14 GA2
>
> TCG implements everything we need to run basic z14 OS+software.
>
> Since we are not on 6.1 I'd not pick the other patch.
> For now I'll backport the new entries ignoring the context change.
> If there is a problem with that please let me know.
>
> Right now it looks like:
> https://git.launchpad.net/~paelzer/ubuntu/+source/qemu/tree/debian/patches/
> ubuntu/lp-1932175-s390x-cpumodel-add-3931-and-3932.patch?h=merge-6.0-2exp-
> impish

Patch looks good to me.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2021-08-24 11:53 EDT-------
I also tested the qemu in impish-proposed (6.0+dfsg-2expubuntu1) and it does work. With a private kernel I also do get the new features, with the one in impish I do not get the new facility bits and it seems that the host kernel still lacks these 2 commits:

1f703d2cf2046 KVM: s390: allow facility 192 (vector-packed-decimal-enhancement facility 2)
a3efa84292660 KVM: s390: gen_facilities: allow facilities 165, 193, 194 and 196

PS: the model number 3931 inside the guest and gen16a/b does work with QEMU, so its really just the kernel that misses 2 commits.
Do we have a separate bug for that?

Revision history for this message
Frank Heimes (fheimes) wrote :

Hi Christian, yes, I think that all makes sense right now.

We got the kernel part of this (the request for. the two commits you've mentioned) as a separate ticket: LP#1932174
And this is (aot) in status "In Progress", but got already acknowledged by the kernel team - means the kernel team accepted it, but it is (aot) neither in impish's current default kernel nor in impish's current -proposed kernel; but will be part of the next proposed kernel (when that happens the kernel ticket will be updated to Fix Committed).

However, for the reason of testing (and test building) I've created a kernel that incl. these two patches, and it's available here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1932174/comments/2
With this test kernel (PPA) and the qemu from -proposed it should also work and you should get the facility bits.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for the Tests Christian!
And in case anyone wonders, the qemu in proposed is ready and just held back by glibc 2.34. Once that migrates to -release qemu and many other components will follow.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.3 KiB)

This bug was fixed in the package qemu - 1:6.0+dfsg-2expubuntu1

---------------
qemu (1:6.0+dfsg-2expubuntu1) impish; urgency=medium

  * Merge with Debian experimental, remaining changes:
    - qemu-kvm to systemd unit
      - d/qemu-kvm-init: script for QEMU KVM preparation modules, ksm,
        hugepages and architecture specifics
      - d/qemu-system-common.qemu-kvm.service: systemd unit to call
        qemu-kvm-init
      - d/qemu-system-common.install: install helper script
      - d/qemu-system-common.qemu-kvm.default: defaults for
        /etc/default/qemu-kvm
      - d/rules: call dh_installinit and dh_installsystemd for qemu-kvm
    - Distribution specific machine type
      (LP: 1304107 1621042 1776189 1761372 1761372 1776189)
      - d/p/ubuntu/define-ubuntu-machine-types.patch: define distro machine
        types containing release versioned machine attributes
      - d/qemu-system-x86.NEWS Info on fixed machine type defintions
        for host-phys-bits=true
      - Add an info about -hpb machine type in debian/qemu-system-x86.NEWS
      - ubuntu-q35 alias added to auto-select the most recent q35 ubuntu type
    - Enable nesting by default
      - d/p/ubuntu/enable-svm-by-default.patch: Enable nested svm by default
        in qemu64 on amd
        [ No more strictly needed, but required for backward compatibility ]
    - improved dependencies
      - Make qemu-system-common depend on qemu-block-extra
      - Make qemu-utils depend on qemu-block-extra
    - tolerate ipxe size change on migrations to >=18.04 (LP: 1713490)
      - d/p/ubuntu/pre-bionic-256k-ipxe-efi-roms.patch: old machine types
        reference 256k path
      - d/control-in: depend on ipxe-qemu-256k-compat-efi-roms to be able to
        handle incoming migrations from former releases.
    - d/qemu-system-x86.README.Debian: add info about updated nesting changes
    - d/control*, d/rules: disable xen by default, but provide universe
      package qemu-system-x86-xen as alternative
      [includes compat links changes of 5.0-5ubuntu4]
    - d/p/ubuntu/enable-svm-by-default.patch: update to match v6.0
    - d/p/ubuntu/define-ubuntu-machine-types.patch: add ubuntu machine types
      for v6.0
    - d/p/ubuntu/lp-1929926-*: avoid segfaults by uretprobes (LP 1929926)
    - Ease the use of module retention on upgrades (LP 1913421)
      - debian/qemu-block-extra.postinst: enable mount unit on install/upgrade
  * Dropped Changes [in 1:6.0+dfsg-2exp]:
    - d/control-in: Disable capstone disassembler library support (universe)
    - Disable fuse export (universe dependency)
    - Ease the use of module retention on upgrades (LP 1913421)
      - d/run-qemu.mount, d/rules: provide run-qemu.mount in qemu-block-extra
      - d/rules: only save modules if /run/qemu isn't noexec
      - d/rules: clear all (current and former) modules on purge
    - d/control: qemu 6.0 broke libvirt <7.2 add a breaks to avoid partial
      upgrade issues (LP 1932264)
    - Enable SDL as secondary UI backend (LP 1256185)
      - d/control: add build dependency libsdl2-dev
      - d/control: enable sdl graphics on build
      - d/qemu-system-gui.install: add ui-sdl.so
      - d/control: add run...

Read more...

Changed in qemu (Ubuntu):
status: Fix Committed → Fix Released
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2021-09-17 05:22 EDT-------
Fix landed in impish / U21.10, hence closing the bug.
Changing IBM BZ status:->CLOSED

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.