Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2155702pxb; Fri, 25 Mar 2022 12:05:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySnWWr/LVAHHJQpvBf5YAL1h5KMgZX2DTi6htLF9L4Dkv64xHR3C/EadFK6V2Tq6hSewjw X-Received: by 2002:a17:903:41cf:b0:154:25bf:7d0f with SMTP id u15-20020a17090341cf00b0015425bf7d0fmr12981426ple.41.1648235106656; Fri, 25 Mar 2022 12:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648235106; cv=none; d=google.com; s=arc-20160816; b=EakBLnp5Xj/ucSKNjuHD5Aiohtk5hVr7rrG7fiId0e0Buqr40lVhzzybnhAI1Ruu7h ZY5QzNfb2xFssOcRx2gSB+XDKxsoCF7uIgUeqtCAjduNVT85I7QEHhSN8qvdKHvCDBGp xc3Bs7Irm8kGARoRhvUgiIecqp9lTSe4im+IEqKYmzqI/7gWabTdN+sVm/RlSMbF8vUf BrmWI1qQNy5RdzKhX5PWtMLblSPEbEI6ogDOFu5ePOD3XbZnQlfxai0C4zXebHTpHH6b E99qpV9udxVa4ljWVE4GyRoyA09aLswmP4zY2hqd/VG/i3cP/LOce2qTGhK3iM1nl8hu pdiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=MW2R3ZwScMs/e2ATd9gf1x0MyXKZJAhQ19cegQ4o0K0=; b=mPyS3V6yWGsGblZHeg9Q5HAi23kdJkI3ZycD+HT0aYYBfR1eHjXh4Cy78yh/iMxVDA YqC3f0hHY4HW6okRJOhkdN2n2vdgTTzev1AL7pz0EL770MOGtZeIH3YHaqci+OmvMbgx 3KlcmjGx/PzYoZeJODXMA+aSabZ/iqZFn1Xxi+3MxNOJkH8ACpxdAiAIhbUbKEDS/a9N TXoSd47L7FHW9/ES3oZx0R7kGpPMFGgP+OnboOtV4Z2hPJQlYj9LyW8WUKItqzLiyRCt fI42xE5Mrw3Up2Havh1LRGPqTLkisd7EN28ngx5LPiQzjffQbRh9txaqC7Am6UINrv6n 7xHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OOiD8r9m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i15-20020a170902c94f00b00153f163b3d3si3569444pla.26.2022.03.25.12.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:05:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OOiD8r9m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B4A81F3790; Fri, 25 Mar 2022 11:13:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354364AbiCYKQN (ORCPT + 99 others); Fri, 25 Mar 2022 06:16:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346104AbiCYKQL (ORCPT ); Fri, 25 Mar 2022 06:16:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 551EF7462A for ; Fri, 25 Mar 2022 03:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648203276; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MW2R3ZwScMs/e2ATd9gf1x0MyXKZJAhQ19cegQ4o0K0=; b=OOiD8r9mdCJz6THyS7OuIIVgFUJhANSOIS2xD8hXyJEOmDJqfkMqpPKiQ2AQ2cawMWJmxh 1sYzR44wcjIrhreG+I4+Mt1sOsukX7qkCCay6g2rkGh+fpvCMQv0uUfcOHPH1hWO8Ji6e/ UK+Zploq7CdBYCBDTMgIlxwVD9oTBXU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-199-VUb-p-cFPCWVfZJzHbo_6w-1; Fri, 25 Mar 2022 06:14:32 -0400 X-MC-Unique: VUb-p-cFPCWVfZJzHbo_6w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A91B31044563; Fri, 25 Mar 2022 10:14:31 +0000 (UTC) Received: from [10.72.12.33] (ovpn-12-33.pek2.redhat.com [10.72.12.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC148141DEE9; Fri, 25 Mar 2022 10:14:26 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v5 18/22] KVM: arm64: Support SDEI ioctl commands on VM To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, maz@kernel.org, linux-kernel@vger.kernel.org, eauger@redhat.com, shan.gavin@gmail.com, Jonathan.Cameron@huawei.com, pbonzini@redhat.com, vkuznets@redhat.com, will@kernel.org References: <20220322080710.51727-1-gshan@redhat.com> <20220322080710.51727-19-gshan@redhat.com> From: Gavin Shan Message-ID: <17119a1b-9fb1-2a15-ac19-8f4e128288f5@redhat.com> Date: Fri, 25 Mar 2022 18:14:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Oliver, On 3/25/22 3:35 PM, Oliver Upton wrote: > On Fri, Mar 25, 2022 at 02:59:52PM +0800, Gavin Shan wrote: >>> The PSCI implementation is a great example of how KVM has grown its >>> implementation in line with a specification, all the while preserving >>> backwards compatibility. >>> >> >> The only information feed by VMM is the exposed events. The events >> can't be registered from guest kernel, and raised from host to guest >> kernel until it's exposed by VMM. > > I would suggest assuming that all SDEI events are exposed by default in > KVM. We will not require a VMM change to enable events individually. > Ok, it was exactly what I did in v4, but the event is exposed by VMM in v5. In v6, it will be staticly defined again :) >> Besides, the exposed events will >> be defined staticly in host/KVM as we discussed on PATCH[02/22]. We >> also discussed to eliminate those ioctl commands. So I think we needn't >> to add KVM_SDEI_CMD_SET_VERSION. Further more, the version is only a >> concern to host itself if the migration can be done through the >> firmware pseudo system registers since the migration compatibility >> is the only concern to VMM (QEMU). > > This all needs to work just like the KVM_REG_ARM_PSCI_VERSION version, > I'd recommend taking a look at how we handle that register in KVM. > Ok. I will do necessary investigation :) >> Yes, Currently, 0.1/0.2/1.0 versions are supported by PSCI. 0.1 is >> picked until VMM asks for 0.2 and 1.0 explicitly. However, it seems >> QEMU isn't using 1.0 PSCI yet and maybe more patch is needed to enable >> it. > > As far as how it interacts with KVM, QEMU looks fine. The name of the > KVM_ARM_VCPU_PSCI_0_2 bit is quite frustrating. It actually implies that > KVM will enable it highest supported PSCI version. If the feature bit is > cleared then you only get PSCIv0.1 > > However, the DT node that QEMU sets up looks a bit crusty. The > properties for conveying PSCI function IDs were only ever necessary for > PSCIv0.1. The only property of interest any more is 'method', to convey > the SMCCC conduit instruction. > Ok, Thanks again for the further information about PSCI implementation. I will go through the code when I have free cycyles :) Thanks, Gavin