From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91C32C43461 for ; Thu, 10 Sep 2020 06:42:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4844E20829 for ; Thu, 10 Sep 2020 06:42:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fqoMcN4Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726963AbgIJGm1 (ORCPT ); Thu, 10 Sep 2020 02:42:27 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:46491 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729622AbgIJGjJ (ORCPT ); Thu, 10 Sep 2020 02:39:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599719947; 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=Y34zvoWXduiwibYbLiLWQREvNmCTcUaZJN7i3Ky+UIU=; b=fqoMcN4Z5CUFJBUeFAlfogbiV0YEOAZcHGFvZrh+oZ6xhUay/BytGxfPjrR3A9nUQb1MJQ JllwBN6IGuRWP1F7TVqKlTfVm01Wjf50PsvF7cdL3BvJKUT5QlyHh6T1qvBO8tzC6emgGK CE2/Hy8hz8yYFzoylaFwUQtVCkY5SO4= 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-324--LsA0AtMOamTxiuSwHlPFw-1; Thu, 10 Sep 2020 02:39:03 -0400 X-MC-Unique: -LsA0AtMOamTxiuSwHlPFw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7147F1091061; Thu, 10 Sep 2020 06:39:01 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.40.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7CCB5C1CF; Thu, 10 Sep 2020 06:38:57 +0000 (UTC) Date: Thu, 10 Sep 2020 08:38:54 +0200 From: Andrew Jones To: Peter Maydell Cc: Peter Maydell , lkml - Kernel Mailing List , Juan Quintela , Catalin Marinas , Richard Henderson , QEMU Developers , Steven Price , arm-mail-list , Marc Zyngier , Thomas Gleixner , Will Deacon , kvmarm@lists.cs.columbia.edu, "Dr. David Alan Gilbert" , Dave Martin Subject: Re: [PATCH v2 2/2] arm64: kvm: Introduce MTE VCPU feature Message-ID: <20200910063854.vwhtn3lc5tei72fh@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, drew