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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL 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 425C7C56201 for ; Thu, 22 Oct 2020 17:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D92AC24630 for ; Thu, 22 Oct 2020 17:14:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="D5Hb6sVo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S369077AbgJVRN7 (ORCPT ); Thu, 22 Oct 2020 13:13:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S369090AbgJVRNw (ORCPT ); Thu, 22 Oct 2020 13:13:52 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8F6C0613CF for ; Thu, 22 Oct 2020 10:13:52 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id c5so1760462otr.1 for ; Thu, 22 Oct 2020 10:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kQQlSF/0lUzBXugc4fEPyjtlzyb7/jQQu7GyIK58eNM=; b=D5Hb6sVoyFHbSWGhGKpzNat9YJJsBpV9GEOlfoxFl4d9eZnnYrGZ1lLOLuXiDsBuh1 d0cHrv1ykacVV2mVWES1MnNFc0LTOveQwXy3BJJ+JdVyy0XwnS35zjDAqjVEFbtRHfMg GGvSNBZbrhY2OE1YzQVsUx5NB5UXR5VevcBGBo+O/8uyW8SvFBzU2+SMfSSbaZpkLpir 9OxFFdIWZU5m86vjW//qS+QC2GACQjySY5OkJJesvuexmypKrPTS24mesvCc/LBPysHJ uYT/r6dtAYtVPFO0mpGDe3MVIasJZxXRPh7q73s/ydSermTfaGVefT6OLVRX7njVYDVy dPKg== 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=kQQlSF/0lUzBXugc4fEPyjtlzyb7/jQQu7GyIK58eNM=; b=R0vEvSG36X3D6bUSSQw/PC+CJiIBprqUBGfsfk+vEKV9br7HwIKUFmuUr/cbPucW7B hVBrkd3x1ZbUDEnhN/6eowgviY3T2ZHZ+suQJssX+Txq3iN7IE+6eI1dq9LnrC/tpQCo jVmX/zUIRgMPc70k44j6ox/npstIqJm5mpNEvm2fPvljoztvd7t0gU0tdRTKRmzQD9qK ksBfmf23uvVCUva9PvO6IrTr0GOATZzrB99ahKpj9raK326rpoJWYfkGdJmrEdRCANJ+ 76LUvLrRNfMgoqJaRHiTx3gzcuhCKzgoQv6EVMZDSjyf8Foh0+B0v5Nx2SxpdLOujphJ a8kg== X-Gm-Message-State: AOAM530m2rd02S25lZp0J1Ym/0liFWCgfK+2RuVu92AAAPIetv/uVugi 0fNZLFGDkguUfLhVqt/2WGEnVt8zW2KoA9F9Q24h9Q== X-Google-Smtp-Source: ABdhPJx2w3YUlN/3PB1QFTGlbY/e6pEIoW08rIDoq2LlMVKf4jXtyet0dE+as4/GxxhMd5fC11yDQpdzkMicsNPvLWE= X-Received: by 2002:a05:6830:10d3:: with SMTP id z19mr2731575oto.295.1603386831866; Thu, 22 Oct 2020 10:13:51 -0700 (PDT) MIME-Version: 1.0 References: <1603330475-7063-1-git-send-email-wanpengli@tencent.com> <281bca2d-d534-1032-eed3-7ee7705cb12c@redhat.com> In-Reply-To: <281bca2d-d534-1032-eed3-7ee7705cb12c@redhat.com> From: Jim Mattson Date: Thu, 22 Oct 2020 10:13:40 -0700 Message-ID: Subject: Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID To: Paolo Bonzini Cc: Wanpeng Li , LKML , kvm list , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 9:37 AM Paolo Bonzini wrote: > > On 22/10/20 18:35, Jim Mattson wrote: > > On Thu, Oct 22, 2020 at 6:02 AM Paolo Bonzini wrote: > >> > >> On 22/10/20 03:34, Wanpeng Li wrote: > >>> From: Wanpeng Li > >>> > >>> Per KVM_GET_SUPPORTED_CPUID ioctl documentation: > >>> > >>> This ioctl returns x86 cpuid features which are supported by both the > >>> hardware and kvm in its default configuration. > >>> > >>> A well-behaved userspace should not set the bit if it is not supported. > >>> > >>> Suggested-by: Jim Mattson > >>> Signed-off-by: Wanpeng Li > >> > >> It's common for userspace to copy all supported CPUID bits to > >> KVM_SET_CPUID2, I don't think this is the right behavior for > >> KVM_HINTS_REALTIME. > > > > That is not how the API is defined, but I'm sure you know that. :-) > > Yes, though in my defense :) KVM_HINTS_REALTIME is not a property of the > kernel, it's a property of the environment that the guest runs in. This > was the original reason to separate it from other feature bits in the > same leaf. > > Paolo > We don't actually use KVM_GET_SUPPORTED_CPUID at all today. If it's commonly being misinterpreted as you say, perhaps we should add a KVM_GET_TRUE_SUPPORTED_CPUID ioctl. Or, perhaps we can just fix this in the documentation?