From patchwork Fri Jan 19 04:54:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125086 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp135183ljf; Thu, 18 Jan 2018 21:13:39 -0800 (PST) X-Google-Smtp-Source: ACJfBouGhLo5YtYv09egTBr+CbC/kbNVXnMnm84RtN/pPO+oKKTDxvcPLC+rvshR7X3ycqhVvbbz X-Received: by 10.129.101.68 with SMTP id z65mr8222579ywb.49.1516338819288; Thu, 18 Jan 2018 21:13:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516338819; cv=none; d=google.com; s=arc-20160816; b=x1HFn4oEfO7UrpBqfeUTY9k4vpN5J4w5OcnuYjtHpoREXe2wAuqkiMN8wO12CSwWs9 X/aBnzPRK1QQnriHTaoLxrCa/itSnUg4itjGoD/FSz6b7BTfiAr/aP2fyqm+2C58eCzH dyTRqxCOP8Dm47ki90x3B9+85lr7QkFR0WJ12ieAa03rZYcpaWqqQyufOx4H1e/9UAUc JFyD/vZhxSq2AfV/8B81J1V+yEZmc3Wk6bTiMPNfH5l1GMt2qycst8ym7jcJfMQyMkZa A22SFjNfe/Cgc+nF22GGzSpiqdn2VtSMfqt22jyfAZifSPFrQsp6Ox8EfnjX612wc7u2 Cwpw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=rtUJek3aPDGG5LW/JtqEYY8tEezLcf4E59P/pioBFKI=; b=fMuiJVS1hVtOofEhZH7th6DVAfzIWy4mvwzRFg1VjOUPgq1COeitZ1iW1PsBcGH0Yx 4XPHrs6Di859WphRTE4U8gF7wtDLU92OJyLwNj8UAv+Q2bfroC6QIgnzDHLZ8c1Fd5Nb BIMZsVrYEz76+UnDoyWie+evXiym5gV5fqIcwdnle8Dp9FglUluYXZ3V2m6Dcq1d5kgJ 8FQhaYmnro+3hZDus55hIMxp5ILToNOCUs1zV0rcjU8ibo1dVGgCi1Iah6Uh7cvn2tcN DZ22F4sOOHl3K54jb+riZoB4bKXXEZahWJrqpKDSbh71aBgWrgJhFi3dgS5Vdpf0GKvg LkRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CXz/b4Po; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i8si1037749ywm.416.2018.01.18.21.13.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Jan 2018 21:13:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CXz/b4Po; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:52960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecOzi-0001Le-Mi for patch@linaro.org; Fri, 19 Jan 2018 00:13:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecOhi-0002Hl-Pv for qemu-devel@nongnu.org; Thu, 18 Jan 2018 23:55:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecOhh-0000Oa-RM for qemu-devel@nongnu.org; Thu, 18 Jan 2018 23:55:02 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:42705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecOhh-0000NC-Ku for qemu-devel@nongnu.org; Thu, 18 Jan 2018 23:55:01 -0500 Received: by mail-pg0-x243.google.com with SMTP id q67so544220pga.9 for ; Thu, 18 Jan 2018 20:55:01 -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; bh=rtUJek3aPDGG5LW/JtqEYY8tEezLcf4E59P/pioBFKI=; b=CXz/b4PoW5wRvfI94OcgvLhJifAGlbJ/fiFUcIuD/J0Y5CDU+Gbwl/HchkSM5DolWE zaX/lBzxGH3B0+WAUlZU1zR0SsZgB/k7EKsA+f2RE3Zi0rH2RlKGNdjnww4WpCNyrFd6 vkXKupKJWtT3cP26KjZviCg7RS/QGV0r1ymIU= 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; bh=rtUJek3aPDGG5LW/JtqEYY8tEezLcf4E59P/pioBFKI=; b=dD5O2P4u75Qq7nHWpXahDmZV6L8XWrcYJgrOQdcub1BuGPVmU6sHvHxLny2i5FOsQo Lwhcsy4POurRZRwyTM47/2uyW+Qwf6vZyzvnxERQKCMz7VHPzgD4uMfsqJqFKFcOSWpu /9AC0D3mQruuDXqfUqsCKX2mpVk4pq4t4SKUJLCZM2+1QU/CWUafaq3SeoiDOzNRYYBO CNbrAisnGeefiE0yo7w1TutbhQ01DLWxYfogJymRN4+M2uKjDQkEx3d3Hwc209v629cP pbA/5Uv27cDJuN9Pueaa/LA/5usL/tyq3PZ/r26pGM3rnBEdFuu1gNMte2dUESNt9LWt jw4g== X-Gm-Message-State: AKwxytcuYRMWCeZ9JfAXzSH9jnhPrGxyys3SI6oc8psgHXilnx4LLsZA 1sKrSeSQOu9hvTqW1eFL6VgGr4nbkdM= X-Received: by 10.99.164.25 with SMTP id c25mr3248606pgf.430.1516337700197; Thu, 18 Jan 2018 20:55:00 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id m12sm13690022pga.68.2018.01.18.20.54.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 20:54:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 18 Jan 2018 20:54:33 -0800 Message-Id: <20180119045438.28582-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180119045438.28582-1-richard.henderson@linaro.org> References: <20180119045438.28582-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH v2 11/16] target/arm: Add SVE to migration state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Save the high parts of the Zregs and all of the Pregs. The ZCR_ELx registers are migrated via the CP mechanism. Signed-off-by: Richard Henderson --- target/arm/machine.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) -- 2.14.3 diff --git a/target/arm/machine.c b/target/arm/machine.c index cb0e1c92bb..2c8b43062f 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -122,6 +122,56 @@ static const VMStateDescription vmstate_iwmmxt = { } }; +#ifdef TARGET_AARCH64 +/* The expression ARM_MAX_VQ - 2 is 0 for pure AArch32 build, + * and ARMPredicateReg is actively empty. This triggers errors + * in the expansion of the VMSTATE macros. + */ + +static bool sve_needed(void *opaque) +{ + ARMCPU *cpu = opaque; + CPUARMState *env = &cpu->env; + + return arm_feature(env, ARM_FEATURE_SVE); +} + +/* The first two words of each Zreg is stored in VFP state. */ +static const VMStateDescription vmstate_zreg_hi_reg = { + .name = "cpu/sve/zreg_hi", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_UINT64_SUB_ARRAY(d, ARMVectorReg, 2, ARM_MAX_VQ - 2), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_preg_reg = { + .name = "cpu/sve/preg", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_UINT64_ARRAY(p, ARMPredicateReg, 2 * ARM_MAX_VQ / 8), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_sve = { + .name = "cpu/sve", + .version_id = 1, + .minimum_version_id = 1, + .needed = sve_needed, + .fields = (VMStateField[]) { + VMSTATE_STRUCT_ARRAY(env.vfp.zregs, ARMCPU, 32, 0, + vmstate_zreg_hi_reg, ARMVectorReg), + VMSTATE_STRUCT_ARRAY(env.vfp.pregs, ARMCPU, 17, 0, + vmstate_preg_reg, ARMPredicateReg), + VMSTATE_END_OF_LIST() + } +}; +#endif /* AARCH64 */ + static bool m_needed(void *opaque) { ARMCPU *cpu = opaque; @@ -586,6 +636,9 @@ const VMStateDescription vmstate_arm_cpu = { &vmstate_pmsav7, &vmstate_pmsav8, &vmstate_m_security, +#ifdef TARGET_AARCH64 + &vmstate_sve, +#endif NULL } };