Received: by 10.223.185.116 with SMTP id b49csp5943653wrg; Wed, 7 Mar 2018 22:19:15 -0800 (PST) X-Google-Smtp-Source: AG47ELvG8/O8+n4igMNLFX9fCSwUGeeiqDN9iiO5cRqxG+n0kJU/cqMg0XSU/bwYfhjLOVnWBA2n X-Received: by 2002:a17:902:5401:: with SMTP id d1-v6mr23271582pli.176.1520489955002; Wed, 07 Mar 2018 22:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520489954; cv=none; d=google.com; s=arc-20160816; b=c4Yz/SsnHItQdZZ+/+AkWun3a5Gvpb6QmT+JgS5aSPAdhXTPbgMNAFDqybSGwIJ9qk e3blENVVlroXtPQvFaGDlAm9+LV1myh3Mp/uG54S0uFvcTnWSR0jS5LulqkuAMJOAm+n 9ZsaueymU70cOwTLSumHjyDvSrHJkOm6sg85g4/pzE7Ii6lTIjrg5vlpj5qdjEpJrhk4 GucNbtSFQJrh83zbOylLvE1GCaEeh6Ht3ONPdCDoX1WNq9U0FZ75okYnXI/9GP58jEai rN5b8rm4hbvE9EFr2Vx0ontWmLmy3CCJ1JM8c30CCyzjYZ7NhvcCqUzIx8FM70wGOwW+ 2Wlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=zFhUIMQnQda98x1LG2YYdoKDEi2sCF/lhpUjyCwOxaM=; b=fwT9NPDQ3GGZ92bYne/JczQCowypVvWbQD0rYv32r5dRZCw0f4XcvKBcgoKVx80l4X r6UOsHeDRE9kMUk1qPgW+mqRwmXeUK5gLjZw4YNJZ/YfG9GGtZfKsLrtvz+fDo95+NNe DAuU+t0VK4bd/fjMfG+McI4IYMomA7EG5d4ZMBhlZ9q2s07BSm7ruk7gPjGWLeUq1HTG ztbYvWI8056GC/i8CN5CUzt1a4q/o4DiZdAJSh3sL0jaSk5sJ2DkqeG9Gf5j2DcFDmCB A83BSDwgZhkrSPPfx/QJd3TTbWM6+olx1JWo6srfAsFu8kgoTiOj29fPgczbnM/QXGJJ O4rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pLMmadqK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8-v6si1895443plz.495.2018.03.07.22.19.00; Wed, 07 Mar 2018 22:19:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pLMmadqK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935445AbeCHGSI (ORCPT + 99 others); Thu, 8 Mar 2018 01:18:08 -0500 Received: from mail-ua0-f194.google.com ([209.85.217.194]:42710 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935211AbeCHGSE (ORCPT ); Thu, 8 Mar 2018 01:18:04 -0500 Received: by mail-ua0-f194.google.com with SMTP id b23so3178671uak.9; Wed, 07 Mar 2018 22:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zFhUIMQnQda98x1LG2YYdoKDEi2sCF/lhpUjyCwOxaM=; b=pLMmadqKzkinzcc/UtWETOZENK9ZPnWU3D1gp8PdpVbrukSpGOVqa/D9Lsqo3l7Kx0 aZWCoMopJHUavfsYYbMtlpbcQ2Yd1kxnCe7C8Kj5/WuQYAJEUUfBTv1/YbKk94DhmJLg 22EOdN2bIrHy6inwwYhJ6xq55QxWrSQFQrQsCBJU/UvuXuJHx1vVKwwUl3l7eYn0CHFq l526sjGZwJn9vF7vXYvUmmkGr0Q6h4N7Nb4jFXK+9jh7k1dnVsNW230cRWCRQBrMcuzK 3nonE2ofcsWRe9YWUaWpPersjtK7ixSQ+gJDa4WCzrZVWxrti2tf/G5EbaeglwzHQEwW 10GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zFhUIMQnQda98x1LG2YYdoKDEi2sCF/lhpUjyCwOxaM=; b=kAP+j/bSB3znRJ4PDZ91F8g/zONJiF4mP+5aD44HFz2lC+nN5nqCVZHj39z/4l2df3 PZalP/4BWso0K/a/Do1EXsVbG3Y11EU45BSAcafqd/59PXBQ5YkKk+m6LmeTcTwGwsJ8 5K9slqhFcDfjbpDB5icWdVmHJo+bIGJO8qAWRpNI1LoZ0dHUXP3hwRuQNHX73pJ0c5H5 yZ6dFcxSXxgWxpnpTMYTHpEjdtS3qLgkZJc7bKUf6+S3FxiLgAZ9LyVXFYfAGd/TUBWm pOFDPIgNlz4+ZQKjn7NAq5OTI9oFKN8yeHacHavCNISO94564PQk2y/n3L9XUW4qh/vY ABWQ== X-Gm-Message-State: APf1xPBuqlawpmhSsK0s2fvX/S6Y7SoFpSZKsY/Trt9jNim/LmLXg1k+ AeJBAVs/rJ0H5hsldzKiSRP4RBpdybSTUI53rFPiEQ== X-Received: by 10.176.27.3 with SMTP id d3mr17077745uai.60.1520489883454; Wed, 07 Mar 2018 22:18:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.35.193 with HTTP; Wed, 7 Mar 2018 22:18:02 -0800 (PST) In-Reply-To: <5A85C974.70500@arm.com> References: <0184EA26B2509940AA629AE1405DD7F201A9E8EA@DGGEMA503-MBS.china.huawei.com> <5A70C5A0.1050600@arm.com> <5A7DDDEE.9050306@arm.com> <93d07d3e-8388-7814-d674-538071d84e2a@huawei.com> <5A85C974.70500@arm.com> From: gengdongjiu Date: Thu, 8 Mar 2018 14:18:02 +0800 Message-ID: Subject: Re: [PATCH v9 5/7] arm64: kvm: Introduce KVM_ARM_SET_SERROR_ESR ioctl To: James Morse , drjones@redhat.com Cc: gengdongjiu , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "corbet@lwn.net" , "marc.zyngier@arm.com" , "catalin.marinas@arm.com" , "linux-doc@vger.kernel.org" , "rjw@rjwysocki.net" , "linux@armlinux.org.uk" , "will.deacon@arm.com" , "robert.moore@intel.com" , "linux-acpi@vger.kernel.org" , "bp@alien8.de" , "lv.zheng@intel.com" , Huangshaoyu , "kvmarm@lists.cs.columbia.edu" , "devel@acpica.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, sorry for my late response due to chines new year. 2018-02-16 1:55 GMT+08:00 James Morse : > Hi gengdongjiu, > > On 12/02/18 10:19, gengdongjiu wrote: >> On 2018/2/10 1:44, James Morse wrote: >>> The point? We can't know what a CPU without the RAS extensions puts in there. >>> >>> Why Does this matter? When migrating a pending SError we have to know the >>> difference between 'use this 64bit value', and 'the CPU will generate it'. >>> If I make an SError pending with ESR=0 on a CPU with VSESR, I can't migrated to >>> a system that generates an impdef SError-ESR, because I can't know it will be 0. > >> For the target system, before taking the SError, no one can know whether its syndrome value >> is IMPLEMENTATION DEFINED or architecturally defined. > > For a virtual-SError, the hypervisor knows what it generated. (do I have > VSESR_EL2? What did I put in there?). > > >> when the virtual SError is taken, the ESR_ELx.IDS will be updated, then we can know >> whether the ESR value is impdef or architecturally defined. > > True, the guest can't know anything about a pending virtual SError until it > takes it. Why is this a problem? > > >> It seems migration is only allowed only when target system and source system all support >> RAS extension, because we do not know whether its syndrome is IMPLEMENTATION DEFINED or >> architecturally defined. > > I don't think Qemu allows migration between hosts with differing guest-ID > registers. But we shouldn't depend on this, and we may want to hide the v8.2 RAS > features from the guest's ID register, but still use them from the host. > > The way I imagined it working was we would pack the following information into > that events struct: > { > bool serror_pending; > bool serror_has_esr; > u64 serror_esr; > } I have used your suggestion struct > > The problem I was trying to describe is because there is no value of serror_esr > we can use to mean 'Ignore this, I'm a v8.0 CPU'. VSESR_EL2 is a 64bit register, > any bits we abuse may get a meaning we want to use in the future. > > When it comes to migration, v8.{0,1} systems can only GET/SET events where > serror_has_esr == false, they can't use the serror_esr. On v8.2 systems we > should require serror_has_esr to be true. yes, I agreed. > > If we need to support migration from v8.{0,1} to v8.2, we can make up an impdef > serror_esr. For the Qemu migration, I need to check more the QEMU code. Hi Andrew, I use KVM_GET/SET_VCPU_EVENTS IOCTL to migrate the Serror exception status of VM, The even struct is shown below: { bool serror_pending; bool serror_has_esr; u64 serror_esr; } Only when the target machine is armv8.2, it needs to set the serror_esr(SError Exception Syndrome Register). for the armv8.0, software can not set the serror_esr(SError Exception Syndrome Register). so when migration from v8.{0,1} to v8.2, QEMU should make up an impdef serror_esr for the v8.2 target. can you give me some suggestion how to set that register in the QEMU? I do not familar with the QEMU migration. Thanks very much. > > We will need to decide what KVM does when SET is called but an SError was > already pending. 2.5.3 "Multiple SError interrupts" of [0] has something to say. how about KVM set again to the same VCPU? > > > Happy new year, thanks! > > James > > > [0] > https://static.docs.arm.com/ddi0587/a/RAS%20Extension-release%20candidate_march_29.pdf > _______________________________________________ > kvmarm mailing list > kvmarm@lists.cs.columbia.edu > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm