From patchwork Mon Feb 8 03:20:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 378532 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4357849jah; Sun, 7 Feb 2021 20:21:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwB3FWJhWC8gqUVyurghyyWgD4tfsRVd6y1mJAamcucBn6n7trDGmWve/Dv0mttkj/QjoUD X-Received: by 2002:a25:c244:: with SMTP id s65mr23561517ybf.128.1612758080189; Sun, 07 Feb 2021 20:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612758080; cv=none; d=google.com; s=arc-20160816; b=KKCoL2Y4lNRFKCsNz9z/brhmNcK/E2NdXE2UqVXgLN/Vd1ht7q34CIiTd5I43PWvVr +mHGVedQeSXnknf0ff5TrDqL8VgX4FGQ4CX/EbYMqoTWeJ3Pu3gBs/REDJvLY/jZ/K1Q 8DVzlg3VdTYeYzKRUex8BCmOuGhESBdEeTmAHo8rI9uz3e9IvNOeGPCjyn8uf18Vib1u yf0s/CpZaYE9tIWlzt0jSp6VuOHh6c3Pj6cd3/jKni+G6j15GuPwykO/P/pXH6m6MicS RS2sDvro6bBQVXoBA0CJN1tvUyVPMrq7go9hy5Ry/H/g8Os/oMWWWMuCC7wk7EhrJb69 1bmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Wfrxe2AEinW34K0GuFsTKfhMgJ70NeWcmQ/m1I/W4tU=; b=Ovk+H8vJfcavojK0FpmVpxNJABE3AEfSIVf8pUw0Vq2tB9dAtXVxxwynu+f6HlujAT JuGSadFUoOC5bE/hGPRLFIVG41yrAyMVxM45Bp2KMg8FF+JJiPWea77Tg8G989+R9oNy wVFDv6gYRaaYW/teiB44PP5a4aeXmHTcHIJ6SseFYsqSjB3KbTklllS+vQG2WCkpZOI7 WgYdLIvufJIeIL3D0BoCPxAbZ7drU0rxoqIRHWiyekT+dU7WwYm8+16tSzgpAXfEi940 cqhEQw9tYy1ONdrEll8M3M8bTbqfNV0sC+9c5va8YEq/AL43fg931SerndqvqMaKCAJq 2Q0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MGOteG1t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g32si1979945ybj.490.2021.02.07.20.21.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Feb 2021 20:21:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MGOteG1t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8y35-0004FX-Ld for patch@linaro.org; Sun, 07 Feb 2021 23:21:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8x6J-0007l8-Bx for qemu-devel@nongnu.org; Sun, 07 Feb 2021 22:20:35 -0500 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:34669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8x6G-0001k2-5S for qemu-devel@nongnu.org; Sun, 07 Feb 2021 22:20:35 -0500 Received: by mail-il1-x134.google.com with SMTP id q9so11496723ilo.1 for ; Sun, 07 Feb 2021 19:20:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wfrxe2AEinW34K0GuFsTKfhMgJ70NeWcmQ/m1I/W4tU=; b=MGOteG1tAXL7clmx6mozj3kJm8zN1mKOSl5adIZe31SqVf5ZePTq0s33hjMzU/e/Ar rUcGCuHuHTAhLi6iKxJ95AkX9jQBcn/7Bd4pfuyTq2oxisbMtm0FJJbz4yCshAlFuKja br1sGPCmsGZ85cjxUrTpFddoKDdd2pQKVdEwCawU4RZintNzMJhMIaQZQMwEzKxEKMXg HXMUu9Sj0qRzitTZ//7L6A6h+5RJmnO/gzDxfPUYcfAAyagDQ0/2vQ/NZTnzbLtogeEW MmeKuFtOlpfGZ4nKLVyrFo6QaiKFjv7EiH33KkD8CK4V97M7JkHpo3ojBhJBMRqVM64+ 1kUw== 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=Wfrxe2AEinW34K0GuFsTKfhMgJ70NeWcmQ/m1I/W4tU=; b=kapX0KdLdVtbGE4UR/escOXeVH6Sv8Hlh3mewgza+e5DO7jKQKRto2iEbBLCO4iQde acxfEKu5ZmBBGU3TkqDg4HTF1sX1SyiSuDsvlgg78sopajGs4VKOBjmQsiC94M8Tw19/ cEMhta5f1XSu/nrs8R99G4/HEOzurJuhEZMIn0ufs6sLXvAgZHb3hbuFUm26noSdQa0e wVGx4s2Bmi+f35W1rAu8demvNxNehhNGslvhvAcQGXy8blaHBsUGedNBZNefti/zHCYM QBC12WYoBc+voDjpbOU7wTYM9mvsRDB9sMaeL4o+wWJAIs5do0yPqdBgZMjGpUQR2z6E bx8Q== X-Gm-Message-State: AOAM532p4eeK5VTMbZfzWIXVSt6Fq/0g2tYxZwKJaHw48GWvdMbpCojB XQ5vYG9H8wSaJiNYIc7Y9ccV X-Received: by 2002:a05:6e02:e51:: with SMTP id l17mr12795315ilk.199.1612754430274; Sun, 07 Feb 2021 19:20:30 -0800 (PST) Received: from localhost.localdomain ([147.75.106.138]) by smtp.gmail.com with ESMTPSA id o8sm8022965ilu.55.2021.02.07.19.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 19:20:29 -0800 (PST) From: Haibo Xu To: drjones@redhat.com, richard.henderson@linaro.org Subject: [RFC PATCH 5/5] Enable the MTE support for KVM guest Date: Mon, 8 Feb 2021 03:20:06 +0000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::134; envelope-from=haibo.xu@linaro.org; helo=mail-il1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, philmd@redhat.com, qemu-devel@nongnu.org, Haibo Xu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Haibo Xu --- hw/arm/virt.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 623d5e9397..c2358cf4c5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -79,6 +79,7 @@ #include "hw/virtio/virtio-iommu.h" #include "hw/char/pl011.h" #include "qemu/guest-random.h" +#include "migration/misc.h" #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ @@ -821,6 +822,21 @@ static void virt_powerdown_req(Notifier *n, void *opaque) } } +static int virt_precopy_notify(NotifierWithReturn *n, void *data) +{ + PrecopyNotifyData *pnd = data; + + switch (pnd->reason) { + case PRECOPY_NOTIFY_SETUP: + precopy_enable_metadata_migration(); + break; + default: + break; + } + + return 0; +} + static void create_gpio_keys(const VirtMachineState *vms, DeviceState *pl061_dev, uint32_t phandle) @@ -1898,9 +1914,9 @@ static void machvirt_init(MachineState *machine) } if (vms->mte && kvm_enabled()) { - error_report("mach-virt: KVM does not support providing " - "MTE to the guest CPU"); - exit(1); + /* connect migration precopy request */ + vms->precopy_notifier.notify = virt_precopy_notify; + precopy_add_notifier(&vms->precopy_notifier); } create_fdt(vms);