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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 325CAC388F2 for ; Thu, 22 Oct 2020 13:25:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C172E20848 for ; Thu, 22 Oct 2020 13:25:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ChZloRpm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2899803AbgJVNZy (ORCPT ); Thu, 22 Oct 2020 09:25:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38154 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2894908AbgJVNZx (ORCPT ); Thu, 22 Oct 2020 09:25:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603373152; 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=BxPfxPSNfbnVjf34ePIHdZQgNiJCJyxLs4IXArAnJmw=; b=ChZloRpmYo1wsevYhGItQmJK3iulJyb1NkdWOlsHsGeewypAYeSCCjlpgM30F3uCLN3xSc BoE8vS9sIGkj3oIDQsCk/DT5o4gS1CG53dV3X1phaLzrNGKNkhZlK6ZjLpj54+TjKgjxVS /yUgblaLhANLMhm6lK33a3SL3GKLLeE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-rL5qCXgQN1Woc0F3bz3eqg-1; Thu, 22 Oct 2020 09:25:50 -0400 X-MC-Unique: rL5qCXgQN1Woc0F3bz3eqg-1 Received: by mail-wr1-f71.google.com with SMTP id p6so612340wrm.23 for ; Thu, 22 Oct 2020 06:25:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=BxPfxPSNfbnVjf34ePIHdZQgNiJCJyxLs4IXArAnJmw=; b=eeA0M1l/SEn6dB86NgsmdrgPUbiJwOMvNB+pfXk6hgfv3owyX9pgpoxfGgrytO0M5Z GU+x4HU+qD4J0bOllsqobhsYeMYwJP602OelPrL2jIvA7PzfpntgfmoPtHou3d1Spp+0 jO57gzg7JRS5UPA5iElvnat19K5mMVNnPjzN5H4rbIj8neh92Zuc9MGXzcVHEDbMRb93 73ponfhkAhLVo72Kw552l4y8uQRaSG1a8D4XOFFRne3HNllioNpjMDaIfWda0Sj11A9T FrGZAfNsVioSa3OlIV69xsrQJ9gYSL6Al8cxtowudSgYjcj8Do1RGJgKqEux0+Bv+W3A vZpQ== X-Gm-Message-State: AOAM531Dx30aB+xJmUFW953ENSEEDc9KjvZx0NHFWpYpaC8OhaPoTLb3 1nWGFTEKzGttkmRYz1XZcobeh93KgIuQ1YvDVvBL7pPaOo+/R4Jou4UR6ABxCaq1xtXfYgoVwXh 2SoUE04nCkGcLDupGDplofJEF X-Received: by 2002:a7b:cb10:: with SMTP id u16mr2568582wmj.20.1603373149087; Thu, 22 Oct 2020 06:25:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2n8WajVbZY49NzRz8HTVBT9A01wzfAhU1/YFTB2zSdisHBFJ3+FJItC+mxqL674ywS9q03Q== X-Received: by 2002:a7b:cb10:: with SMTP id u16mr2568565wmj.20.1603373148910; Thu, 22 Oct 2020 06:25:48 -0700 (PDT) Received: from vitty.brq.redhat.com (g-server-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id k6sm3778509wmk.16.2020.10.22.06.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 06:25:47 -0700 (PDT) From: Vitaly Kuznetsov To: Paolo Bonzini , Wanpeng Li , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Joerg Roedel Subject: Re: [PATCH] KVM: X86: Expose KVM_HINTS_REALTIME in KVM_GET_SUPPORTED_CPUID In-Reply-To: References: <1603330475-7063-1-git-send-email-wanpengli@tencent.com> Date: Thu, 22 Oct 2020 15:25:46 +0200 Message-ID: <871rhq4ckl.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paolo Bonzini writes: > 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. > > (But maybe this was discussed already; if so, please point me to the > previous discussion). > Not for KVM_GET_SUPPORTED_CPUID but for KVM_GET_SUPPORTED_HV_CPUID: just copying all the bits blindly is incorrect as e.g. SYNIC needs to be enabled with KVM_CAP_HYPERV_SYNIC[2]. KVM PV features also have pre-requisites, e.g. KVM_ASYNC_PF_DELIVERY_AS_INT requires an irqchip so again copy/paste may not work. -- Vitaly