From patchwork Mon Jul 13 21:33:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1328487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=vXzvmOTK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B5H383J5fz9sRR for ; Tue, 14 Jul 2020 07:34:12 +1000 (AEST) Received: from localhost ([::1]:47324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv65S-00081a-8c for incoming@patchwork.ozlabs.org; Mon, 13 Jul 2020 17:34:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv657-0007yg-In for qemu-devel@nongnu.org; Mon, 13 Jul 2020 17:33:49 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:38937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv655-0004Wj-GS for qemu-devel@nongnu.org; Mon, 13 Jul 2020 17:33:49 -0400 Received: by mail-pf1-x443.google.com with SMTP id x72so6617967pfc.6 for ; Mon, 13 Jul 2020 14:33:47 -0700 (PDT) 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=T+RRv2+U9t+cg4c0rxOURe6KAEVhcGBktXAW6b9dt0M=; b=vXzvmOTKaHqsPejZd/IywWSEskA6XBndoWV1oyO1MWYkK1vN1vZrC3YQa6CUixOtiQ iqERKKmOrs7H/rNahc7QsvhxZNrrRvF1p6NpXy9CZ6yLE0/VYz3/Kx0ke56mj1USz+Qd da/2llcqO6eAW77C95smPieDqlr8BxrX3wzjOci/WdZ94dR4QjRjr3TYK6I57ZJx9jQ5 Af7p4ol1LBZbu6MPT0uItGbY73d4UdKjD4/lB6phKx02MT4XmMFNT6UgJUVDYqOIfJCq C6uMabsFai3TT87NzRNwA1+HrqVuo4v9kpc2Rc8YEQGp4dW0EPtdvv/+2ovLH/k6PNuc lpfA== 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=T+RRv2+U9t+cg4c0rxOURe6KAEVhcGBktXAW6b9dt0M=; b=jAIdW6+myARdNkd+8TYpyfjb8ZQPdIcckNk9alvOYc/Q394omxv/ZUp4rF7yVFWQwP NAgvUR3KwHFLl282L3eIyKCNJlDxsbGndGimRaqdpAXbRUNQtH8zc8vX7fmvoeqfh1bx +WoWUgrHm0IFFnaZ3IAIGLAV122LaMsVkdIc9I/eJh/N8/GpWoLXQQp9mz+/fXgZQxmp u/ZpE6522OlMYhXVjY2Ozm0iXWCr3QlKATx93RrlVYCb5LWqcir+MbdQD4ayvNrKEWMS j+1OtDuwz64gdFv1PGthcbDEZtHR9qBseaK5i9UN0bClbbZH/qspdUq9Ono32KHC8H/G 2mUQ== X-Gm-Message-State: AOAM532sDMXLEm9Zz/zcYBdvF5uNt1Yve1GU45SJ+OdX7KxjPrKxOBcL cBl2M1wcpQ/u5R6VFfwcSDD7CzQ5Eww= X-Google-Smtp-Source: ABdhPJyIRI9yG4hZLpS5h7+4K04Ch59H0xMvyvPo00gwZ4rVrIUczvnImwi/rQ9HNrtTNt7kbSejLg== X-Received: by 2002:a65:63d4:: with SMTP id n20mr917349pgv.213.1594676025616; Mon, 13 Jul 2020 14:33:45 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id l207sm3591565pfd.79.2020.07.13.14.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 14:33:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/3] hw/arm/virt: Enable MTE via a machine property Date: Mon, 13 Jul 2020 14:33:39 -0700 Message-Id: <20200713213341.590275-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713213341.590275-1-richard.henderson@linaro.org> References: <20200713213341.590275-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=ham 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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Control this cpu feature via a machine property, much as we do with secure=on, since both require specialized support in the machine setup to be functional. Default MTE to off, since this feature implies extra overhead. Signed-off-by: Richard Henderson --- include/hw/arm/virt.h | 1 + hw/arm/virt.c | 39 ++++++++++++++++++++++++++++++++++----- target/arm/cpu.c | 19 +++++++++++-------- target/arm/cpu64.c | 5 +++-- 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 54bcf17afd..dff67e1bef 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -140,6 +140,7 @@ typedef struct { bool its; bool virt; bool ras; + bool mte; OnOffAuto acpi; VirtGICType gic_version; VirtIOMMUType iommu; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9005dae356..5866c4ce20 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1837,12 +1837,19 @@ static void machvirt_init(MachineState *machine) OBJECT(secure_sysmem), &error_abort); } - /* - * The cpu adds the property if and only if MemTag is supported. - * If it is, we must allocate the ram to back that up. - */ - if (object_property_find(cpuobj, "tag-memory", NULL)) { + if (vms->mte) { + /* Create the memory region only once, but link to all cpus. */ if (!tag_sysmem) { + /* + * The property exists only if MemTag is supported. + * If it is, we must allocate the ram to back that up. + */ + if (!object_property_find(cpuobj, "tag-memory", NULL)) { + error_report("MTE requested, but not supported " + "by the guest CPU"); + exit(1); + } + tag_sysmem = g_new(MemoryRegion, 1); memory_region_init(tag_sysmem, OBJECT(machine), "tag-memory", UINT64_MAX / 32); @@ -2061,6 +2068,20 @@ static void virt_set_ras(Object *obj, bool value, Error **errp) vms->ras = value; } +static bool virt_get_mte(Object *obj, Error **errp) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + + return vms->mte; +} + +static void virt_set_mte(Object *obj, bool value, Error **errp) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + + vms->mte = value; +} + static char *virt_get_gic_version(Object *obj, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -2481,6 +2502,14 @@ static void virt_instance_init(Object *obj) "Set on/off to enable/disable reporting host memory errors " "to a KVM guest using ACPI and guest external abort exceptions"); + /* MTE is disabled by default. */ + vms->mte = false; + object_property_add_bool(obj, "mte", virt_get_mte, virt_set_mte); + object_property_set_description(obj, "mte", + "Set on/off to enable/disable emulating a " + "guest CPU which implements the ARM " + "Memory Tagging Extension"); + vms->irqmap = a15irqmap; virt_flash_create(vms); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5050e1843a..111579554f 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1698,6 +1698,17 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) cpu->id_pfr1 &= ~0xf000; } +#ifndef CONFIG_USER_ONLY + if (cpu->tag_memory == NULL && cpu_isar_feature(aa64_mte, cpu)) { + /* + * Disable the MTE feature bits if we do not have tag-memory + * provided by the machine. + */ + cpu->isar.id_aa64pfr1 = + FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0); + } +#endif + /* MPU can be configured out of a PMSA CPU either by setting has-mpu * to false or by setting pmsav7-dregion to 0. */ @@ -1787,14 +1798,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) cpu_address_space_init(cs, ARMASIdx_TagS, "cpu-tag-memory", cpu->secure_tag_memory); } - } else if (cpu_isar_feature(aa64_mte, cpu)) { - /* - * Since there is no tag memory, we can't meaningfully support MTE - * to its fullest. To avoid problems later, when we would come to - * use the tag memory, downgrade support to insns only. - */ - cpu->isar.id_aa64pfr1 = - FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1); } cpu_address_space_init(cs, ARMASIdx_NS, "cpu-memory", cs->memory); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 15494002d2..dd696183df 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -646,8 +646,9 @@ static void aarch64_max_initfn(Object *obj) t = cpu->isar.id_aa64pfr1; t = FIELD_DP64(t, ID_AA64PFR1, BT, 1); /* - * Begin with full support for MTE; will be downgraded to MTE=1 - * during realize if the board provides no tag memory. + * Begin with full support for MTE. This will be downgraded to MTE=0 + * during realize if the board provides no tag memory, much like + * we do for EL2 with the virtualization=on property. */ t = FIELD_DP64(t, ID_AA64PFR1, MTE, 2); cpu->isar.id_aa64pfr1 = t; From patchwork Mon Jul 13 21:33:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1328488 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Mfm+c2gQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B5H4G2n62z9sRK for ; Tue, 14 Jul 2020 07:35:10 +1000 (AEST) Received: from localhost ([::1]:51330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv66O-0001Cd-4N for incoming@patchwork.ozlabs.org; Mon, 13 Jul 2020 17:35:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv658-0007zh-2x for qemu-devel@nongnu.org; Mon, 13 Jul 2020 17:33:50 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:43471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv656-0004Wr-KX for qemu-devel@nongnu.org; Mon, 13 Jul 2020 17:33:49 -0400 Received: by mail-pl1-x644.google.com with SMTP id x8so6094540plm.10 for ; Mon, 13 Jul 2020 14:33:48 -0700 (PDT) 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=fkrsEVGzpPmXW0hscK/oXZbT5j1F7cd9XvYkd0Gcy7I=; b=Mfm+c2gQQQ6N4TLwLZKLDrPBgVWruO9BYlMO5gVTTbKj4r0xC/q/cWHK3gVEQK19y3 3+G+3esbcmw5qyKQaUOvPPpT3j7NUOS/f50FMnxv+CI7KP2meIYO3VCRONcod6Wl4tRn v0IQPPRC1ubYVo10Yq0nmjm0efWqHZrdQLki9DsHWhYqCE5QUUGKqF5RsJV0UvQk6BW8 XykHnoXYz/vPPKDAZ6g/x+v0ZKP+qs/X3etojeC4XL2NedykUrLqn+29VPxlVUi/zSWO 7p3QFq13Krfsa7bNp42CpUmRgUEtcEGx2kkOZg9dkhC0Zy5qpIuCQIHhgMRZsF0ge2ZZ zkfA== 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=fkrsEVGzpPmXW0hscK/oXZbT5j1F7cd9XvYkd0Gcy7I=; b=jYB22IjIH/X2VdK8mF9qVk2avBpxPzL7HcWLzEk+2ntIfrZnrNf4TC4DMRje/q2APD /mM36wgjw1LJqr3sfLdhk6Bfqs6fMRanFLyVdJiBclj/Q33WiTGAYnfDlBaO76X63anY RL5uDFVyoJeDN6sHJKucCKcJ0lDOoaXkNdrDzDZF0e6SHSzENRayYv6qq2IITCxPkNwJ 5zXxv91nzO1G/cZJnpV4Jw0xe0CoA1dalAltyQ14oC2jnHVZzhcioZLgceMmxk7g8E8/ Ut8Hjd6JSXWZ4QnfjAXYNK0WpfCRKBF8DSC/6Yd8ggZGUNu6zeeXEqKDkzMfFc+XWFKQ bTjg== X-Gm-Message-State: AOAM530lASfkQp95pQxIJDqgQd4U0IIi4cHTu+b5dZmzL3T60qjY4LaP 0AyE/WTLE+7ge6OmbWpnx05cJimDk94= X-Google-Smtp-Source: ABdhPJy5nVF/6fqCrHUHUXqodvzAUI339By72SHphWYGsrDfvFRh0sx3e+VXgjnGACNjGMM17x0nLw== X-Received: by 2002:a17:90b:f05:: with SMTP id br5mr1406274pjb.42.1594676026750; Mon, 13 Jul 2020 14:33:46 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id l207sm3591565pfd.79.2020.07.13.14.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 14:33:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/3] hw/arm/virt: Error for MTE enabled with KVM Date: Mon, 13 Jul 2020 14:33:40 -0700 Message-Id: <20200713213341.590275-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713213341.590275-1-richard.henderson@linaro.org> References: <20200713213341.590275-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=ham 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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" While we expect KVM to support MTE at some future point, it certainly won't be ready in time for qemu 5.1. Signed-off-by: Richard Henderson --- hw/arm/virt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5866c4ce20..a7f3d442db 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1773,6 +1773,12 @@ static void machvirt_init(MachineState *machine) exit(1); } + if (vms->mte && kvm_enabled()) { + error_report("mach-virt: KVM does not support providing " + "MTE to the guest CPU"); + exit(1); + } + create_fdt(vms); possible_cpus = mc->possible_cpu_arch_ids(machine); From patchwork Mon Jul 13 21:33:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1328514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jlx3UgxF; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B5H673Lvdz9sRK for ; Tue, 14 Jul 2020 07:36:47 +1000 (AEST) Received: from localhost ([::1]:54524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv67x-0002az-7K for incoming@patchwork.ozlabs.org; Mon, 13 Jul 2020 17:36:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv659-00081T-Q4 for qemu-devel@nongnu.org; Mon, 13 Jul 2020 17:33:51 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:36181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv658-0004X3-89 for qemu-devel@nongnu.org; Mon, 13 Jul 2020 17:33:51 -0400 Received: by mail-pj1-x1044.google.com with SMTP id md7so519340pjb.1 for ; Mon, 13 Jul 2020 14:33:49 -0700 (PDT) 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=DIdbI/TyoASf3/tuMyHXAq5AcBUAtBDJaojE6aqGDY8=; b=jlx3UgxF36aRyoGqa0A5weot5N48d4/gDVwwqcd/PmWFXXcN9qwrU6sQl7sGbzLOwb 5FY2tt+bisnoVfmprVOfR6bS1kDFbazygT8ZIs2NH4oefSBeJWUsEcpnUkHrQNIyzAuw sEM3RKpsy0WqxQ/BRULMIarC9HXlQtrP70fHYFgMAz4jDrAWAk/aVw0XF/hXSfTkwSKz 3T+t6GKtncVcD9O0Ks4KoPkC28N0OB5YtHIZZZBxsU0ndtFM85IPGUn9luYrnPPvICnX u0CkWFzDlFv4v665h5Ey/J1EoFSUHKzRL0XE9T7/N7v3sXa4ckDeX/2AZON9A/CtK3T5 ys8Q== 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=DIdbI/TyoASf3/tuMyHXAq5AcBUAtBDJaojE6aqGDY8=; b=uiK/LpcIL2YDYbHt8+y1iWHIAe+Pm5Irk5XIQIny0HSWPxiwNJ+NzX+IW0ZmKqffbt bTY4EtXGKe8lE+WBskYnlQRjwKORtVWoZEGf0s3Xuq5WxoTL0eLfDWEjkZVpClENFY5A 4417ixv90bfa4YYKaQ8Dlp63/9DqgYvHj6R+2DWvKPHh7rOWWoeIXGmO10/1WoKbWY+P 76YJCttgHCk/8Gs82+jwtJ+14M8uFxNvVUMi5dKbZ+u3plt7GH3XIpQloAL6TR2lWCXb 0ScCMiNrZh63TNAZtkcbNBdVW3K5OwfTHRxxbiDIzxZ/DZYOu/hXUraxFN46Mkxk9BV1 GGMQ== X-Gm-Message-State: AOAM530Wfzsh4Wy0evdK8UCiA25cybmxR/EBGjaMmzHpO13RvUOjriLX SzdETmio2zCJSbPkA+FtrFTVhwHsE2w= X-Google-Smtp-Source: ABdhPJyPuMPRzQGWbdb31sF59vQxPytgTy7wkBhq90mawdCT0IjQ0PLOc12P/YOkhZOBN2CTMqCwxQ== X-Received: by 2002:a17:90a:1901:: with SMTP id 1mr1393604pjg.199.1594676028548; Mon, 13 Jul 2020 14:33:48 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id l207sm3591565pfd.79.2020.07.13.14.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 14:33:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/3] hw/arm/virt: Disable memory hotplug when MTE is enabled Date: Mon, 13 Jul 2020 14:33:41 -0700 Message-Id: <20200713213341.590275-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713213341.590275-1-richard.henderson@linaro.org> References: <20200713213341.590275-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=ham 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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When MTE is enabled, tag memory must exist for all RAM. It might be possible to simultaneously hot plug tag memory alongside the corresponding normal memory, but for now just disable hotplug. Signed-off-by: Richard Henderson --- hw/arm/virt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a7f3d442db..ecfee362a1 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2194,6 +2194,11 @@ static void virt_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev, return; } + if (vms->mte) { + error_setg(errp, "memory hotplug is not enabled: MTE is enabled"); + return; + } + if (is_nvdimm && !ms->nvdimms_state->is_enabled) { error_setg(errp, "nvdimm is not enabled: add 'nvdimm=on' to '-M'"); return;