From patchwork Mon Feb 8 06:05:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 12073997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CD6DC433DB for ; Mon, 8 Feb 2021 06:07:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B868E64E27 for ; Mon, 8 Feb 2021 06:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbhBHGHN (ORCPT ); Mon, 8 Feb 2021 01:07:13 -0500 Received: from ozlabs.org ([203.11.71.1]:44627 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbhBHGGf (ORCPT ); Mon, 8 Feb 2021 01:06:35 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4DYwVt3vFWz9sWS; Mon, 8 Feb 2021 17:05:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1612764342; bh=N7aZkZMAZjZ1mtft7AjfybYlaQ339ZQW3otqxHe66KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnnXAy+jknbLBjIcGZP9I7awVZdkh8WzFru4SAFtSPHo4EVXTPF67GcSSQwjjBVJh 2a+8XbX0t0oTwxo/SvnNs8bf6lsorr6/5AK4Gofq+MGwy6wKsIzZ/nQGUgwDSHXXmm +6ZYHTklvtLAzO+MegAWjVUKxJ+mBTKwHLOJ5NNY= From: David Gibson To: pasic@linux.ibm.com, dgilbert@redhat.com, pair@us.ibm.com, qemu-devel@nongnu.org, brijesh.singh@amd.com Cc: ehabkost@redhat.com, mtosatti@redhat.com, mst@redhat.com, jun.nakajima@intel.com, kvm@vger.kernel.org, Richard Henderson , qemu-s390x@nongnu.org, Marcel Apfelbaum , pbonzini@redhat.com, frankja@linux.ibm.com, andi.kleen@intel.com, cohuck@redhat.com, Thomas Huth , borntraeger@de.ibm.com, mdroth@linux.vnet.ibm.com, David Gibson , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-ppc@nongnu.org, David Hildenbrand , Greg Kurz , pragyansri.pathi@intel.com Subject: [PULL v9 11/13] spapr: PEF: prevent migration Date: Mon, 8 Feb 2021 17:05:36 +1100 Message-Id: <20210208060538.39276-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210208060538.39276-1-david@gibson.dropbear.id.au> References: <20210208060538.39276-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We haven't yet implemented the fairly involved handshaking that will be needed to migrate PEF protected guests. For now, just use a migration blocker so we get a meaningful error if someone attempts this (this is the same approach used by AMD SEV). Signed-off-by: David Gibson Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Greg Kurz --- hw/ppc/pef.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c index f9fd1f2a71..573be3ed79 100644 --- a/hw/ppc/pef.c +++ b/hw/ppc/pef.c @@ -44,6 +44,8 @@ struct PefGuest { static int kvmppc_svm_init(Error **errp) { #ifdef CONFIG_KVM + static Error *pef_mig_blocker; + if (!kvm_check_extension(kvm_state, KVM_CAP_PPC_SECURE_GUEST)) { error_setg(errp, "KVM implementation does not support Secure VMs (is an ultravisor running?)"); @@ -58,6 +60,11 @@ static int kvmppc_svm_init(Error **errp) } } + /* add migration blocker */ + error_setg(&pef_mig_blocker, "PEF: Migration is not implemented"); + /* NB: This can fail if --only-migratable is used */ + migrate_add_blocker(pef_mig_blocker, &error_fatal); + return 0; #else g_assert_not_reached();