From patchwork Mon Feb 8 06:07:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 12074017 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 15489C433DB for ; Mon, 8 Feb 2021 06:09:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2F9964E27 for ; Mon, 8 Feb 2021 06:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbhBHGJQ (ORCPT ); Mon, 8 Feb 2021 01:09:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhBHGIX (ORCPT ); Mon, 8 Feb 2021 01:08:23 -0500 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE0FCC061786 for ; Sun, 7 Feb 2021 22:07:51 -0800 (PST) Received: by ozlabs.org (Postfix, from userid 1007) id 4DYwY66Qzfz9sWQ; Mon, 8 Feb 2021 17:07:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1612764458; bh=N7aZkZMAZjZ1mtft7AjfybYlaQ339ZQW3otqxHe66KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/xZ1AWrJiuJ+XRpBkyW5pV9Wh2b9D1R96S700Qxvu410XpnmPQ9LX2P+bfFzcdps 2+m0bBx2+WGFcoKwI2R8pugBIcEzRJCYzmZ+1LEyHYMd9yaJ5StYDe7Z/jof0PmfeT a+xjPCTzkVB51nRwYlx9DCu6WKKKEdQg3/Qw75dg= From: David Gibson To: pair@us.ibm.com, qemu-devel@nongnu.org, peter.maydell@linaro.org, dgilbert@redhat.com, brijesh.singh@amd.com, pasic@linux.ibm.com Cc: richard.henderson@linaro.org, ehabkost@redhat.com, cohuck@redhat.com, david@redhat.com, berrange@redhat.com, mtosatti@redhat.com, Marcel Apfelbaum , mst@redhat.com, borntraeger@de.ibm.com, mdroth@linux.vnet.ibm.com, Paolo Bonzini , David Gibson , jun.nakajima@intel.com, frankja@linux.ibm.com, pragyansri.pathi@intel.com, kvm@vger.kernel.org, qemu-ppc@nongnu.org, Thomas Huth , andi.kleen@intel.com, Greg Kurz , qemu-s390x@nongnu.org Subject: [PULL v9 11/13] spapr: PEF: prevent migration Date: Mon, 8 Feb 2021 17:07:33 +1100 Message-Id: <20210208060735.39838-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210208060735.39838-1-david@gibson.dropbear.id.au> References: <20210208060735.39838-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();