From nobody Tue Apr 30 02:17:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590410422; cv=none; d=zohomail.com; s=zohoarc; b=B5Bjo4zd8/GOSg9yHyBmUGyVvawLNiwUJNzmEcxbDo6YY/negdt8UUrx2LqLCW5OJyJOfHcry6n6nb9MfMG2ooB1O9g2pBa9+ekgndR89YPte0o06gS8000IE/bHCsbAUZmwyN9QgiwtmkJsGq54c40jphNRO5/4U/rbBH5Hpxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590410422; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T02mb27ISb8OK1RFXrli86Y+e+NczKcMwdlKkBghl+g=; b=Uv5XXmPX4cY16rS2BH0ONmEOlBauqK3MbPXJdVYWpJKEEJzmXtS7q/vtXeLeZuiGiHMw+LjU8+zPtzUQeStTYWrYX+D3xshLzAq8DhdBNiQ9KGgcdOC/YhDRLPDP9Ypoo/YCpSUm8qz7PxAhLuT2vGmhvIwGDZZn2Evr06Lpk9c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1590410422570521.4410426308468; Mon, 25 May 2020 05:40:22 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-2GHJxuDqPRSXYRdjMws2Dw-1; Mon, 25 May 2020 08:40:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E181F1009442; Mon, 25 May 2020 12:40:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C08F60FC2; Mon, 25 May 2020 12:40:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 40D371809547; Mon, 25 May 2020 12:40:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04PCe7Qf010651 for ; Mon, 25 May 2020 08:40:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E79310F8E09; Mon, 25 May 2020 12:40:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A60510F8E0F for ; Mon, 25 May 2020 12:40:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E58E804026 for ; Mon, 25 May 2020 12:40:01 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-A6A2kp0_MRuLl0P07V8J9g-1; Mon, 25 May 2020 08:39:59 -0400 Received: by mail-qt1-f196.google.com with SMTP id e16so7769647qtg.0; Mon, 25 May 2020 05:39:59 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:e0b9:8f39:f7d8:19fe:be67]) by smtp.gmail.com with ESMTPSA id w94sm8647059qte.19.2020.05.25.05.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 05:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590410421; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=T02mb27ISb8OK1RFXrli86Y+e+NczKcMwdlKkBghl+g=; b=AGngzimI7DV6mXEyLYlrtFvR4Vov+QZksoabN9ASi7YU4I8Xg0KjwmOlSaay4/zhhzr8lW AMNnSsBpiBnlJVO5msn4c3asZp+I/x4zJSLYxEFBTuS2RsW8fMdkr04NEou3dRJSkl9fxj KQT+2vLaOwGJZKt3zCgnj8D2axPJajU= X-MC-Unique: 2GHJxuDqPRSXYRdjMws2Dw-1 X-MC-Unique: A6A2kp0_MRuLl0P07V8J9g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T02mb27ISb8OK1RFXrli86Y+e+NczKcMwdlKkBghl+g=; b=YG/MiIb1Wj5B7skr7dE1y8kLH46X8gLmtrmFHJ+zvIfxz8dlrNXSD67+NqM/3ngClj WbLBXgjGdblobq98a6zwfwegcmgCYEDMyPtH3D9C5/4nhg0DxO5DZSOc8d5G6nYYB9ya cRCmAsz7ehDIcxttzQnTUQpDu1oWedZkVL6oHWj/NV7CYrt3QBGq+Ds/vb3Wf8OwitBY aN/pCaBPQPR7Anq3X9i9kvNLDg41J/+C3YQn+4f8ev6xBJVxHyO/6LMtuKVUqIEq/LiS rThz58iYr70lfyYN/w2mrnexf/y2HK546XX7QlrNO5v0RrxkoqIqgOtWvGSExJOCHIN0 byxg== X-Gm-Message-State: AOAM530GnkrMlrEwlpTZZN5XnnuRftAB1Ga8go+CpT0LQ+4B6rWI+TN8 wqcnp+gmcTOmhuDT1JqUBKAnvhz8 X-Google-Smtp-Source: ABdhPJzlghhRDGi15cOWWrElPvNdl2UR85idZLxBKhQG85c96ovyNB8c96QL71CmgXPNVB5tr8JSJw== X-Received: by 2002:ac8:2c38:: with SMTP id d53mr28170434qta.162.1590410398357; Mon, 25 May 2020 05:39:58 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 1/1] qemuProcessRefreshCPU: skip 'host-model' logic for pSeries guests Date: Mon, 25 May 2020 09:39:45 -0300 Message-Id: <20200525123945.4049591-2-danielhb413@gmail.com> In-Reply-To: <20200525123945.4049591-1-danielhb413@gmail.com> References: <20200525123945.4049591-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: jdenemar@redhat.com, Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit v3.10.0-182-g237f045d9a ("qemu: Ignore fallback CPU attribute on reconnect") forced CPU 'fallback' to ALLOW, regardless of user choice. This fixed a situation in which guests created with older Libvirt versions, which used CPU mode 'host-model' in runtime, would fail to launch in a newer Libvirt if the fallback was set to FORBID. This would lead to a scenario where the CPU was translated to 'host-model' to 'custom', but then the FORBID setting would make the translation process fail. PSeries can operate with 'host-model' in runtime due to specific PPC64 mechanics regarding compatibility mode. The update() implementation of the cpuDriverPPC64 driver is a NO-OP if CPU mode is 'host-model', and the driver does not implement translate(). The commit mentioned above is causing PSeries guests to get their 'fallback' setting to ALLOW, overwriting user choice, exposing a design problem in qemuProcessRefreshCPU() - for PSeries guests, handling 'host-model' as it is being done does not apply. All other cpuArchDrivers implements update() and changes guest mode to VIR_CPU_MODE_CUSTOM, meaning that PSeries is currently the only exception to this logic. Let's make it official. https://bugzilla.redhat.com/show_bug.cgi?id=3D1660711 Suggested-by: Jiri Denemark Signed-off-by: Daniel Henrique Barboza Reviewed-by: Jiri Denemark --- src/qemu/qemu_process.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a1ef1d42b0..999e576e5b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7775,6 +7775,15 @@ qemuProcessRefreshCPU(virQEMUDriverPtr driver, * running domain. */ if (vm->def->cpu->mode =3D=3D VIR_CPU_MODE_HOST_MODEL) { + /* + * PSeries domains are able to run with host-model CPU by design, + * even on Libvirt newer than 2.3, never replacing host-model with + * custom in the virCPUUpdate() call. It is not needed to call + * virCPUUpdate() and qemuProcessUpdateCPU() in this case. + */ + if (qemuDomainIsPSeries(vm->def)) + return 0; + if (!(hostmig =3D virCPUCopyMigratable(host->arch, host))) return -1; =20 --=20 2.26.2