Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp467861pxk; Wed, 9 Sep 2020 09:56:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRdR5SUut0idbFtbdZTgdX7NbGlv6400cKWw5hFoTGOoSiolJ0/Icii1oRXglDMCOa3eda X-Received: by 2002:a17:907:2055:: with SMTP id pg21mr4736001ejb.501.1599670598996; Wed, 09 Sep 2020 09:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599670598; cv=none; d=google.com; s=arc-20160816; b=XsbTKBDEv+V7/S6oxwC8NxnXUdJ1JR1GJt1LNWWAlW0hsUcVh++QAd0PqJhByCOqYs KvRJwaKf43Fi/PBuG9P0Ly6k0l+ZZkmIjOUmfLtDuTrZOXtXptQIsHe8dQfWnKN3nlJk H1PAzkzmMFAd3PNofcpEj4cnkr4YmyUYKxKNQDNwH4bOp0xeZvmqTImAmPuG1/2YPtnY qBO6OP5JNduBWbwxXOOrlV1CqEaDOXlzO7nJ43UatA3FvHPeuP4fqDtzn1KAdIMkadmN 5fA71uKX8YuoGR7CKSXwk9mr9CJ0vFuN/n/wnFegbzo/Mzw9ITbVHivSd4tgu7X6CxaT AsZQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=tYTAx4l6f2u8KbHrEy5Rn6tgANLlely6K9NrAKkKaD4=; b=GuVb4EXPK3ck/lD7Nfu+pjroD22qE6I0ZYSnC31ZbfoBy1Zn5/nWS1EzHbF4CvP5BT BDgJMrR9+qlXT8qKTYYG4gpOZfi3UhIKRNmhsJrClmqDcHolI+bu7CIxtoFz4bccdZBm Xpdiy21wHQ8h08VE253LWqAxTS4rCGM+0MLsKX5K0hPWg6dfswYnOiBJgUhIAT778JzG ZZtwhBpxcWov4Rgs9KmTL2o2+OUjpIg4bKl/UNpCNn4ohZZIjWwVDVuI/9Jqn7pwF+dj tUPKF/H53cI88X68zJF2IMiRQo/XGbStQoH1A20NKSDZfOSUDfnyoNyLaqwV8gOJHPAJ 7emg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RfcRjoln; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i22si1855017edy.183.2020.09.09.09.56.16; Wed, 09 Sep 2020 09:56:38 -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=@linaro.org header.s=google header.b=RfcRjoln; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731011AbgIIQza (ORCPT + 99 others); Wed, 9 Sep 2020 12:55:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730573AbgIIPxb (ORCPT ); Wed, 9 Sep 2020 11:53:31 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A3F9C061756 for ; Wed, 9 Sep 2020 08:53:17 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id q21so3203874edv.1 for ; Wed, 09 Sep 2020 08:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tYTAx4l6f2u8KbHrEy5Rn6tgANLlely6K9NrAKkKaD4=; b=RfcRjolnslna7osjOO1TXCoghzNi2fKgyFZPEMSQax8YEU8v4535p5x6dM2zbOIX8K aGJX4vT0l4XB4cYXiNDKH+3JzRNjm3eijcTc7SfI9q1BpSt79VwY8JZjA17Leq2ZJjYD tOpHiKVDtUz2jt2C6HN0AItE24CYkZLmi72A1fJlHm2sL3JbaocWOehxQ156RbPQE4DY LBdCPb63BwhCd9tiQqsumCNyOc414IoPmrhnv6Dx6RngxPr4gNNW9DYbjhlC3gMkccSL 0WNDOoOdeaTUr5BMaP0jEDoAul/y2Yq5eI7X8LXVuiR4Tsj+mAF5IlR5CJZySYjOgH/B gTbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tYTAx4l6f2u8KbHrEy5Rn6tgANLlely6K9NrAKkKaD4=; b=bBCGtyzeiRoXxi8nnYyYMm2Du8Ox8IhKedHRmHaXLLGgxGXotimKi16IL7E9s+fetH H8QQMN47GluI20NPFDoymJrX25ivgxMmmVeZTU08A6ObC0GJvaRVacaUvd/cNrjMAvD/ YnQywxtuXVgRAPZffkt2mf6g9B7iBQGNtdN2dgFk6y0+NmiIJk7hErNEnRvTP71csxku f2XxBkcXFrrFWC+doTe/pEKsl9LyAEIuPgH/zGAtNUnXkiGklu/0CX80JVIcUqurWCEg nJ3q2dUQ+syrr/U5DMSZ4/LhEVhUjY7zutW1o4ikufGYNiqElHiMEb70SfEf27ejZu6E ZIkA== X-Gm-Message-State: AOAM5313ZYR7RWPrTtmEHKT868aMCj8WT5FAryIi7ZdIveJS5XOfFsEl DrmUz6deoKiaBuU9/jABRlLJOuHars3DLSi/BauNykXCVdrmOw== X-Received: by 2002:aa7:dd4b:: with SMTP id o11mr4647541edw.251.1599666793751; Wed, 09 Sep 2020 08:53:13 -0700 (PDT) MIME-Version: 1.0 References: <20200904160018.29481-1-steven.price@arm.com> <20200904160018.29481-3-steven.price@arm.com> <20200909154804.mide6szbzgdy7jju@kamzik.brq.redhat.com> In-Reply-To: <20200909154804.mide6szbzgdy7jju@kamzik.brq.redhat.com> From: Peter Maydell Date: Wed, 9 Sep 2020 16:53:02 +0100 Message-ID: Subject: Re: [PATCH v2 2/2] arm64: kvm: Introduce MTE VCPU feature To: Andrew Jones Cc: Steven Price , Peter Maydell , Juan Quintela , Catalin Marinas , Richard Henderson , QEMU Developers , "Dr. David Alan Gilbert" , kvmarm@lists.cs.columbia.edu, arm-mail-list , Marc Zyngier , Thomas Gleixner , Will Deacon , Dave Martin , lkml - Kernel Mailing List 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 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. -- PMM