From patchwork Mon Sep 2 08:34:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Heimes X-Patchwork-Id: 1979572 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wy2BG67WCz1ygs for ; Mon, 2 Sep 2024 18:35:02 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sl2WU-0003R5-2t; Mon, 02 Sep 2024 08:34:54 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sl2WQ-0003QM-Ph for kernel-team@lists.ubuntu.com; Mon, 02 Sep 2024 08:34:50 +0000 Received: from T570.fritz.box (2.general.fheimes.us.vpn [10.172.66.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 7D7F93F2E7 for ; Mon, 2 Sep 2024 08:34:49 +0000 (UTC) From: frank.heimes@canonical.com To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 0/2] KOP L2 guest fails to boot with 1 core - SMT8 topology (LP: 2070329) Date: Mon, 2 Sep 2024 10:34:42 +0200 Message-Id: <20240902083444.1600778-1-frank.heimes@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2070329 SRU Justification: [ Impact ] * On a P10 system with SMT-8 configured a level 2 guest (VM) fails to boot in case it only has one core assigned. [ Test Plan ] * Setup an IBM Power 10 system - that support up to SMT-8 and with firmware 1060, that offers support for KVM - using Ubuntu Server 24.04 for ppc64el. * Setup qemu/KVM on this system. * Configure a KVM guest (e.g. using virtinst or qemu-system-ppc64 directly) now with smt-8, but only one virtual CPU. * Try to boot this specific guest: qemu-system-ppc64 \ -drive file=rhel.qcow2,format=qcow2 \ -m 20G \ -smp 8,cores=1,threads=8 \ -cpu host \ -nographic \ -machine pseries,ic-mode=xics -accel kvm * It will fail to boot with a kernel that does not have the two patches in place. * Since this setup requires a special firmware level, the verification will be done by the IBM Power team. [ Where problems could occur ] * Primarily support for using DPDES (register) is required, since its needed for enabling usage of doorbells in L2 gusts. This is mainly done by adding DEFINEs, stubs and case. If the definitions are not correct or if the code executed by the new case (KVMPPC_GSID_DPDES) is done wrong, the guest state could be incorrect, harming the L2 guest doorbell. (DPDES is to provide the means for the hypervisor to save a [sub-]processor's Directed Privileged Doorbell exception state when the set of programs running on the [sub-]processor is swapped out or moved from one [sub-]processor to another.) * The missing Doorbell emulation got added by a 4 line if statement in powerpc/kvm/book3s_hv.c, which is relatively traceable. * The main issue I can think of is that kvmppc_set_dpdes is called with wrong arguments. * And kvmppc_set_dpdes will not work (at all) if the above DPDES support (and commit/patch) is missing. [ Other Info ] * Since (nested) KVM support is new on P10, this does not affect older Power generation (P9 is the only other hw generation that is supported by 24.04, but it only supports native virtualization). * Both patches are upstream accepted since v6.11(-rc1), hence will be in oracular and are also upstream tagged as stable updates. * Since the required firmware FW1060 is relatively new, we can assume that not many user ran into this issue yet. Gautam Menghani (2): KVM: PPC: Book3S HV nestedv2: Add DPDES support in helper library for Guest state buffer KVM: PPC: Book3S HV nestedv2: Fix doorbell emulation Documentation/arch/powerpc/kvm-nested.rst | 4 +++- arch/powerpc/include/asm/guest-state-buffer.h | 3 ++- arch/powerpc/include/asm/kvm_book3s.h | 1 + arch/powerpc/kvm/book3s_hv.c | 5 +++++ arch/powerpc/kvm/book3s_hv_nestedv2.c | 7 +++++++ arch/powerpc/kvm/test-guest-state-buffer.c | 2 +- 6 files changed, 19 insertions(+), 3 deletions(-) Acked-by: Thibault Ferrante Acked-by: Stefan Bader