Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4390487pxu; Tue, 1 Dec 2020 03:56:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyj6HnlBMJ5HDkD1HPEXGOI8SVgl8IR+J/kmmYVLkG9JhRLdVutTD5dlH6gToOHR7Jz4P7t X-Received: by 2002:a17:906:3b55:: with SMTP id h21mr2616761ejf.184.1606823763034; Tue, 01 Dec 2020 03:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606823763; cv=none; d=google.com; s=arc-20160816; b=fbZfD5adtCHrNbnYTy+1Z94saPXg8Z77boYjht9icVnyRicBwIM8TxTBMZsF3LEsOo rKVj28H3vIoEzg9T0SJR6SdweYZ8ApQjqicawj6Y2gwHZCbbk6e1/mlck8MVpArAm5lQ BtNynS6lUDcqEfBtaOy84syx9c2I5Oz0f9uo9hphefjEWH7gyNsp67ABUV2z/tKUX7vd QydWKLdztAr/Ctg8Z/SIjsWFO2mn2DD4ZoLmyNN7k2vrJbzxhsQkgHuJ+tLZzy2b+pxN IHEd5bSkUmcdMzaZmtX5/krL80IACb6O6AM6LCwYWH5hbw7se+qnet4EpAWTP9qeFmRi 595A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=juS2iDkfSvnFB7SfyXrTxHmMdUoTvMTg/sfbuDgrGV8=; b=af6Y25jR1TLiFCrGDQY+LlC3jxv27EYDk6JPoQUFKw3z5QwglXaRUTMS66/eU3KcuU x9zLyjrQXGc+U9n9WrY+9frdQvxcpsI7+sjgRAUB4Vexlnn3jDb2YDi7jyRslbhSR/MB wTdm/Gf1fDUAQwsEIIhWseHX2CVRIBKV53ZkiqiCJyvUELLVoKNZaXO2GiZ4T4cnJ8Jn P+Ofrg32VXkR8C+npmxCvDlHGn5zrB4QOBoQz0gvyORUyF8fanSR9RwqyUuVGoBDx+ZM s1xPTgbLNnyisn5hde90ArYAY8EmMYEk3nizcf8egovKVO/UL+VvnI4l4lEqwof7Q/Iq xZAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S4VW9Sgn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si711728ejx.607.2020.12.01.03.55.39; Tue, 01 Dec 2020 03:56:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S4VW9Sgn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728108AbgLALuo (ORCPT + 99 others); Tue, 1 Dec 2020 06:50:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:53900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgLALuo (ORCPT ); Tue, 1 Dec 2020 06:50:44 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9726820770; Tue, 1 Dec 2020 11:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606823402; bh=UE/XVXCsi7+x/uyIjMjMl6em1uv7ikjqa7mp1FXveyA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S4VW9Sgn7iW1ndWIZxYcNhZNcYzrdu4YLpAlGR+L9NWq1kn48g6Y4AjQsLMUboqDi px82TrnsP+fOea64waKx9MDPGYbxyC/mmTjMV2SDQGdhlKvlPPX3OrDSqCpOMwmDfU pi97M7j6fHneG9TEh+N29owEJN700T5yy5JzU9kQ= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kk4AS-00F1ps-IO; Tue, 01 Dec 2020 11:50:00 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 01 Dec 2020 11:50:00 +0000 From: Marc Zyngier To: Shenming Lu Cc: James Morse , Julien Thierry , Suzuki K Poulose , Eric Auger , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Christoffer Dall , Alex Williamson , Kirti Wankhede , Cornelia Huck , Neo Jia , wanghaibin.wang@huawei.com, yuzenghui@huawei.com Subject: Re: [RFC PATCH v1 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side In-Reply-To: <9b80d460-e149-20c8-e9b3-e695310b4ed1@huawei.com> References: <20201123065410.1915-1-lushenming@huawei.com> <20201123065410.1915-4-lushenming@huawei.com> <5c724bb83730cdd5dcf7add9a812fa92@kernel.org> <2d2bcae4f871d239a1af50362f5c11a4@kernel.org> <49610291-cf57-ff78-d0ac-063af24efbb4@huawei.com> <48c10467-30f3-9b5c-bbcb-533a51516dc5@huawei.com> <2ad38077300bdcaedd2e3b073cd36743@kernel.org> <9b80d460-e149-20c8-e9b3-e695310b4ed1@huawei.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <274dafb2e21f49326a64bb575e668793@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: lushenming@huawei.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, eric.auger@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, alex.williamson@redhat.com, kwankhede@nvidia.com, cohuck@redhat.com, cjia@nvidia.com, wanghaibin.wang@huawei.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-12-01 11:40, Shenming Lu wrote: > On 2020/12/1 18:55, Marc Zyngier wrote: >> On 2020-11-30 07:23, Shenming Lu wrote: >> >> Hi Shenming, >> >>> We are pondering over this problem these days, but still don't get a >>> good solution... >>> Could you give us some advice on this? >>> >>> Or could we move the restoring of the pending states (include the >>> sync >>> from guest RAM and the transfer to HW) to the GIC VM state change >>> handler, >>> which is completely corresponding to save_pending_tables (more >>> symmetric?) >>> and don't expose GICv4... >> >> What is "the GIC VM state change handler"? Is that a QEMU thing? > > Yeah, it is a a QEMU thing... > >> We don't really have that concept in KVM, so I'd appreciate if you >> could >> be a bit more explicit on this. > > My thought is to add a new interface (to QEMU) for the restoring of > the pending states, which is completely corresponding to > KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES... > And it is called from the GIC VM state change handler in QEMU, which > is happening after the restoring (call kvm_vgic_v4_set_forwarding()) > but before the starting (running) of the VFIO device. Right, that makes sense. I still wonder how much the GIC save/restore stuff differs from other architectures that implement similar features, such as x86 with VT-D. It is obviously too late to change the userspace interface, but I wonder whether we missed something at the time. Thanks, M. -- Jazz is not dead. It just smells funny...