Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp364292pxf; Wed, 31 Mar 2021 05:29:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaWP4jRNrZhNgI5r+31NS2+u9fba6d1VLcPf5RUQ4UArZzm35izx2+X2bLDTjUmHWYznXl X-Received: by 2002:aa7:dad7:: with SMTP id x23mr3385725eds.292.1617193741801; Wed, 31 Mar 2021 05:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617193741; cv=none; d=google.com; s=arc-20160816; b=IpRgiMA487FIBLsQVK0I+nEY2u4M1qXb/1c4Vc4e7ZpPhsu106W2ola4V7ifcSyrcG fuWtBr4AyY1NLGtcK5Tvv4c/wOcb9BGoJPHJTjuIX7D1/v7Z5RT1uNS9RmjIF6ZAKLn2 mXw2tm+EPM9iBq86Ra9xm5/E4fN/PnvK/x2XKgL4Y/Hmkx5KQYO9OSkr7/1mwbLv1GpC 6aHJYq1RNot/RyZAdr6T1ZZ/wIhS9Z/uE5UxzVQEoaPmBJfVUputlIlPSgOgkgQm0xjr Cgz1YtAuV58UE8+hEw0+a7S3/k+vojSSVK7G6QJRkSt+/nTD8Raq/zXpJD8zbAoGpjzR u0Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=i9iBaLNrNdHy5Myw5Ru7jrMYIVd0xBvqef8GrfatpKg=; b=xAK/Y89wudH+aDopqnHxFeD33tDld8Abl6ufTxp7S2aoo/IfE+3XbmqC2A+pQeGQ/i /yL6wuPCsyeRsng1suNLRq5leuIDlDRR/kZvVeTLACO8N6FTxBNdqS3vWtJSyRI0OF13 kgrpngagTxAwYc1dLbN/NAW7mJ04/asQUQHmR/IwbhnrrebQuNBNN+YiLyMlGhj7W6An u5ieTx2DRSPvB/wU7XTAlz6a2Uc0GYUY/tQ/d5K8GQLLhFxHscPUVAL41MNGVtB8xrxI hQ5214ASxXsuQ3n/6YamUHEBjL6U+zFLW1Me2N2ogJ/9LvVCBSSf19JvXzIEzIWAMqf5 dbfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VX9YN86u; 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 q27si1920088edi.328.2021.03.31.05.28.38; Wed, 31 Mar 2021 05:29:01 -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=VX9YN86u; 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 S235616AbhCaM1y (ORCPT + 99 others); Wed, 31 Mar 2021 08:27:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51667 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235589AbhCaM1Q (ORCPT ); Wed, 31 Mar 2021 08:27:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617193636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i9iBaLNrNdHy5Myw5Ru7jrMYIVd0xBvqef8GrfatpKg=; b=VX9YN86ueeXJf45+zyoYsd6YNsi0OpQJlW0q6Wub2llzWCmE2FuokvoCzJiKt46MRCDIHn 0JG9au1DDWAUkY6H4uUMrinphpPKtMT1KlQkfUDqG6eKCXYTRUt3CTPF8PytpgFKQqV/EN VyByWbeDm+HHI9W5dhr8NlgoLzgUwZM= 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-12-CDBisXgpPgyy02PVaj0T5A-1; Wed, 31 Mar 2021 08:27:12 -0400 X-MC-Unique: CDBisXgpPgyy02PVaj0T5A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 41E641922964; Wed, 31 Mar 2021 12:27:10 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-114-218.ams2.redhat.com [10.36.114.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id E99FD1895C; Wed, 31 Mar 2021 12:27:05 +0000 (UTC) From: Emanuele Giuseppe Esposito To: kvm@vger.kernel.org Cc: Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Shuah Khan , Alexander Graf , Andrew Jones , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 2/4] Documentation: kvm: update KVM_GET_EMULATED_CPUID ioctl description Date: Wed, 31 Mar 2021 14:26:47 +0200 Message-Id: <20210331122649.38323-3-eesposit@redhat.com> In-Reply-To: <20210331122649.38323-1-eesposit@redhat.com> References: <20210331122649.38323-1-eesposit@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KVM_GET_EMULATED_CPUID returns -E2BIG if the nent field of struct kvm_cpuid2 is smaller than the actual entries, while it adjusts nent if the provided amount is bigger than the actual amount. Update documentation accordingly. ENOMEM is just returned if the allocation fails, like all other calls. Signed-off-by: Emanuele Giuseppe Esposito --- Documentation/virt/kvm/api.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 307f2fcf1b02..8ba23bc2a625 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -3404,12 +3404,10 @@ which features are emulated by kvm instead of being present natively. Userspace invokes KVM_GET_EMULATED_CPUID by passing a kvm_cpuid2 structure with the 'nent' field indicating the number of entries in -the variable-size array 'entries'. If the number of entries is too low -to describe the cpu capabilities, an error (E2BIG) is returned. If the -number is too high, the 'nent' field is adjusted and an error (ENOMEM) -is returned. If the number is just right, the 'nent' field is adjusted -to the number of valid entries in the 'entries' array, which is then -filled. +the variable-size array 'entries'. +If the number of entries is too low to describe the cpu +capabilities, an error (E2BIG) is returned. If the number is too high, +the 'nent' field is adjusted and the entries array is filled. The entries returned are the set CPUID bits of the respective features which kvm emulates, as returned by the CPUID instruction, with unknown -- 2.30.2