Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp950534pxk; Thu, 10 Sep 2020 03:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZxp4dFk/qa+F777Mx0kT16z8isul/jZns6XmDPBkTaousaBtpET6tCj8uNufLiBovHZyS X-Received: by 2002:a17:906:4993:: with SMTP id p19mr8325231eju.277.1599732300429; Thu, 10 Sep 2020 03:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599732300; cv=none; d=google.com; s=arc-20160816; b=c/aBlzBj4ImS73PT039RWMYrTGS7adCOVYDkrR36JNWmkufzlS53MjUg6UXpeFNsso B35QSr2DBOzdpm3TgPccCjVlRl0aIWSleJvCFwkGnBt6u7cIdmzDj3TaAuMP1t6pu7Ft ZGbnGcnXUmk0jNjEZstjMMqlj8z2QmOasKhJS5XcOvNpcVdiO6rBcGsdsMY6bcVWZV89 NvLSmqaAGVo7X7Ouhz9U3tQhjwli2S7XlUbHVu5/NLADHffLP46eTGxsVjOBIl+5yd+y 133lx9c0EZAvjjq+0STVxYrumiIJ/WH715KJLwui2E3AKUaUCmTWf5XZSN2DztfoLEmY Q6qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=SAWVsQ1VutHeIxcMMMfasmStNBpMRCAzjajMGXTXbd0=; b=gyRFHA4vKDEro7rCklPgXy3kU63ABn1XzKhpOn9L4csxAMaA67El5AGA6h32s/QVcO sLiSETl2FNe/WNjVQgT77eF3WXYcTMjQLGusaZoUjEjl27dUF9ZGYlgIMS5pyBb/GBye KtNsY5hbv9zwfbvFmjoBgLWNSkCaMxi/k++VbFEJdbjKIC1HSltIN4t3rXpeKs4K+Xs+ Fy2jFI89fPRaH+7ceQWvk0c5n344Mu+0h0T/V0aFqEnpOix7TTDjdNYEtqsl7WY7Job8 pXH6hrEJBCoiLucFGj/H93a4/PBIC6EikprMwj2uGAQp5kPCBqkFCyFC038VAfh5S/M5 1gCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eHtit0kB; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si3025523ejs.330.2020.09.10.03.04.37; Thu, 10 Sep 2020 03:05:00 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=eHtit0kB; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730233AbgIJKBY (ORCPT + 99 others); Thu, 10 Sep 2020 06:01:24 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:21775 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730257AbgIJKBQ (ORCPT ); Thu, 10 Sep 2020 06:01:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599732074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SAWVsQ1VutHeIxcMMMfasmStNBpMRCAzjajMGXTXbd0=; b=eHtit0kB4Q4gqxCFnvs2sI/d1zB45cvF+vS4fBVctNtQB7dyum3wgsgdHAVCkPqmajfyTV rK7w4uQVbZNby42gkseiqeFWLxHhIJQAaxPmg/ytNX3fzdBnNrGmLcV5j2FqP0Ql76DS7E DrRVbJBNULeZhT/RYaFKC4XS6Hxgjf8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-295-2ul8F2GxPr6_nDXiBcdcfQ-1; Thu, 10 Sep 2020 06:01:11 -0400 X-MC-Unique: 2ul8F2GxPr6_nDXiBcdcfQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35E8C801FDF; Thu, 10 Sep 2020 10:01:08 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.40.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32A011002D5E; Thu, 10 Sep 2020 10:01:04 +0000 (UTC) Date: Thu, 10 Sep 2020 12:01:01 +0200 From: Andrew Jones To: Peter Maydell Cc: Peter Maydell , Juan Quintela , Catalin Marinas , Richard Henderson , QEMU Developers , lkml - Kernel Mailing List , "Dr. David Alan Gilbert" , Marc Zyngier , Thomas Gleixner , Steven Price , Will Deacon , kvmarm@lists.cs.columbia.edu, arm-mail-list , Dave Martin Subject: Re: [PATCH v2 2/2] arm64: kvm: Introduce MTE VCPU feature Message-ID: <20200910100101.4c47ww4xniza7owi@kamzik.brq.redhat.com> References: <20200904160018.29481-1-steven.price@arm.com> <20200904160018.29481-3-steven.price@arm.com> <20200909154804.mide6szbzgdy7jju@kamzik.brq.redhat.com> <20200910063854.vwhtn3lc5tei72fh@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200910063854.vwhtn3lc5tei72fh@kamzik.brq.redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 10, 2020 at 08:38:54AM +0200, Andrew Jones wrote: > On Wed, Sep 09, 2020 at 04:53:02PM +0100, Peter Maydell wrote: > > On Wed, 9 Sep 2020 at 16:48, Andrew Jones wrote: > > > We either need a KVM cap or a new CPU feature probing interface to avoid > > > making userspace try features one at a time. It's too bad that VCPU_INIT > > > doesn't clear all offending features from the feature set when returning > > > EINVAL, because then userspace could create a scratch VCPU with everything > > > it supports in order to see what KVM also supports in one go. > > > > You could add one if you wanted -- add a new feature bit > > TELL_ME_WHAT_YOU_HAVE. If the kernel sees that then on filure > > it clears out feature bits it doesn't support and also clears > > TELL_ME_WHAT_YOU_HAVE. If QEMU sees EINVAL and TELL_ME_WHAT_YOU_HAVE > > is still set, then it knows it's dealing with an old kernel > > and has to do one-at-a-time probing. If it sees EINVAL but not > > TELL_ME_WHAT_YOU_HAVE then it knows it has a new kernel and > > has just got all the info. > > > > That's a great proposal. I'll try to find time to send the patches. > We also have KVM_ARM_PREFERRED_TARGET, which is documented as """ ... The ioctl returns struct kvm_vcpu_init instance containing information about preferred CPU target type and recommended features for it. The kvm_vcpu_init->features bitmap returned will have feature bits set if the preferred target recommends setting these features, but this is not mandatory. ... """ But, it says "recommended" features, not "all supported" features, and the current implementation of KVM_ARM_PREFERRED_TARGET only zeros out features. So, I think we should just leave KVM_ARM_PREFERRED_TARGET as is and stick to the plan of extending VCPU_INIT. Thanks, drew