From patchwork Tue Jul 12 11:44:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 9225161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3067660572 for ; Tue, 12 Jul 2016 11:47:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C1D52787D for ; Tue, 12 Jul 2016 11:47:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF12127E63; Tue, 12 Jul 2016 11:47:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 673F22787D for ; Tue, 12 Jul 2016 11:47:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMw7P-0007Hs-FA; Tue, 12 Jul 2016 11:44:51 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMw7N-0007Hm-RF for xen-devel@lists.xen.org; Tue, 12 Jul 2016 11:44:49 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id 64/CF-30934-138D4875; Tue, 12 Jul 2016 11:44:49 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRWlGSWpSXmKPExsVysWW7jK7BjZZ wg233NCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oy3U+6wFjzlqLiw1raBcRZ7FyMnh5DAbiaJ U08zuxi5gOwjjBJbbq9mBkmwCehIfH96CswWEZCWuPb5MiNIEbPAIyaJ1Z86WEESwgIuEnenH gcrYhFQlfj94S0jiM0r4CSx+e0GsBoJAW2Jsw2/2EGaJQT6GCUe7tvIMoGRawEjwypGjeLUor LUIl0jS72kosz0jJLcxMwcXUNDE73c1OLixPTUnMSkYr3k/NxNjEBP1jMwMO5g3HXc7xCjJAe TkihvM3NLuBBfUn5KZUZicUZ8UWlOavEhRhkODiUJXr7rQDnBotT01Iq0zBxgSMGkJTh4lER4 9UDSvMUFibnFmekQqVOMilLivEwgCQGQREZpHlwbLIwvMcpKCfMyMjAwCPEUpBblZpagyr9iF OdgVBLmdQKZwpOZVwI3/RXQYiagxbUOzSCLSxIRUlINjLYe0xev+eE34YAb3w+hg8Z/g6eZOB +9f0Sx5Lfqmt5n+xkevtm7Q/3I6gN77TKyWCoFHqgvN+RMUFvYVfuxaKpnhO2vYK6AU9npDcd vu53g/NvzvyfsXfKcmb8i9c1qbhewvM6V+tmt9TVMqnzq7w5BZgO3Ko8psz1k75su959euqJ9 /XZmXSWW4oxEQy3mouJEAEiz965eAgAA X-Env-Sender: vkuznets@redhat.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1468323887!53304168!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46107 invoked from network); 12 Jul 2016 11:44:48 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Jul 2016 11:44:48 -0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1862180F6B; Tue, 12 Jul 2016 11:44:46 +0000 (UTC) Received: from vitty.brq.redhat.com (vitty.brq.redhat.com [10.34.26.3]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6CBihHH029357; Tue, 12 Jul 2016 07:44:44 -0400 From: Vitaly Kuznetsov To: xen-devel@lists.xen.org Date: Tue, 12 Jul 2016 13:44:42 +0200 Message-Id: <1468323882-6471-1-git-send-email-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 12 Jul 2016 11:44:46 +0000 (UTC) Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Jan Beulich Subject: [Xen-devel] [PATCH] x86, hvm: document the de facto policy for vCPU ids X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP PVHVM guests may need to know Xen's idea of vCPU ids they have and the only way they can figure them out is to use ACPI ids from MADT table. Document the de facto policy. Signed-off-by: Vitaly Kuznetsov Acked-by: Konrad Rzeszutek Wilk --- xen/include/public/hvm/hvm_info_table.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h index 9e3f807..08c252e 100644 --- a/xen/include/public/hvm/hvm_info_table.h +++ b/xen/include/public/hvm/hvm_info_table.h @@ -34,6 +34,14 @@ /* Maximum we can support with current vLAPIC ID mapping. */ #define HVM_MAX_VCPUS 128 +/* + * In some cases SMP HVM guests may require knowledge of Xen's idea of vCPU ids + * for their vCPUs. For example, HYPERVISOR_vcpu_op and some EVTCHNOP_* + * hypercalls take vcpu id as a parameter. It is valid for HVM guests to assume + * that Xen's vCPU id always equals to ACPI (not APIC!) id in MADT table which + * is always present for SMP guests. + */ + struct hvm_info_table { char signature[8]; /* "HVM INFO" */ uint32_t length;