From patchwork Thu Dec 7 22:45:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maran Wilson X-Patchwork-Id: 10101211 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 8E6A960325 for ; Thu, 7 Dec 2017 22:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F75828884 for ; Thu, 7 Dec 2017 22:47:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 742672888E; Thu, 7 Dec 2017 22:47:14 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C02FE28884 for ; Thu, 7 Dec 2017 22:47:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752484AbdLGWrL (ORCPT ); Thu, 7 Dec 2017 17:47:11 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:44667 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbdLGWrI (ORCPT ); Thu, 7 Dec 2017 17:47:08 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.21/8.16.0.21) with SMTP id vB7Mhcd6064139; Thu, 7 Dec 2017 22:45:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=cEi+W4NRJv+3a4MqlZGNbsTCCgs/Cw7BsEkvmqJDTfc=; b=FNcAqCEI2Dem56SxDLEhtLR/u8JnD12gU1ahOkl8CLMsNvLL4eElcikm4iaxgDkQlVvo jEJJHEM4R7zFVEp96dBEd7FAkyYKNc7dThTufJi3xwmDnvHbq0OndbxTQPI3Z7XTAEp+ GppHUa1Jn4q7HgLSgM8MdSIYkipwoUBulGAkDR5I+3WP+CE94YkJotJmAToedlTzNxQu q1G/C+pWT+aAwF0o/T6417CF170AkdzX00UF3t/Yht7Khan+jccjDHEArwuQT6vet0U9 flg9CTv6zbuhMjDFUJ6fFc7xchaIr6WsrsFuJ4dW5XDWpASot6fG5rTEMD8ZuBdYhgk0 LQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2eqepnr05p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2017 22:45:36 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vB7MjZ3K013486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Dec 2017 22:45:36 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vB7MjYs7032749; Thu, 7 Dec 2017 22:45:34 GMT Received: from marawils-linux.us.oracle.com (/10.141.197.9) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Dec 2017 14:45:34 -0800 From: Maran Wilson To: pbonzini@redhat.com, jgross@suse.com, boris.ostrovsky@oracle.com, roger.pau@citrix.com, andrew.cooper3@citrix.com, hch@infradead.org, x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, rkrcmar@redhat.com, JBeulich@suse.com Subject: [RFC PATCH v2 1/2] xen/pvh: Add memory map pointer to hvm_start_info struct Date: Thu, 7 Dec 2017 14:45:14 -0800 Message-Id: <1512686715-11488-2-git-send-email-maran.wilson@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1512686715-11488-1-git-send-email-maran.wilson@oracle.com> References: <1512686715-11488-1-git-send-email-maran.wilson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8738 signatures=668644 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=346 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712070332 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The start info structure that is defined as part of the x86/HVM direct boot ABI and used for starting Xen PVH guests would be more versatile if it also included a way to efficiently pass information about the memory map to the guest. That way Xen PVH guests would not be forced to use a hypercall to get the information and would make it easier for KVM guests to share the PVH entry point. --- include/xen/interface/hvm/start_info.h | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/include/xen/interface/hvm/start_info.h b/include/xen/interface/hvm/start_info.h index 6484159..60206bb 100644 --- a/include/xen/interface/hvm/start_info.h +++ b/include/xen/interface/hvm/start_info.h @@ -33,7 +33,7 @@ * | magic | Contains the magic value XEN_HVM_START_MAGIC_VALUE * | | ("xEn3" with the 0x80 bit of the "E" set). * 4 +----------------+ - * | version | Version of this structure. Current version is 0. New + * | version | Version of this structure. Current version is 1. New * | | versions are guaranteed to be backwards-compatible. * 8 +----------------+ * | flags | SIF_xxx flags. @@ -48,6 +48,12 @@ * 32 +----------------+ * | rsdp_paddr | Physical address of the RSDP ACPI data structure. * 40 +----------------+ + * | memmap_paddr | Physical address of the memory map. Only present in + * | | version 1 and newer of the structure. + * 48 +----------------+ + * | memmap_entries | Number of entries in the memory map table. Only + * | | present in version 1 and newer of the structure. + * 52 +----------------+ * * The layout of each entry in the module structure is the following: * @@ -62,6 +68,17 @@ * | reserved | * 32 +----------------+ * + * The layout of each entry in the memory map table is as follows and no + * padding is used between entries in the array: + * + * 0 +----------------+ + * | addr | Base address + * 8 +----------------+ + * | size | Size of mapping + * 16 +----------------+ + * | type | E820_TYPE_xxx + * 20 +----------------| + * * The address and sizes are always a 64bit little endian unsigned integer. * * NB: Xen on x86 will always try to place all the data below the 4GiB @@ -86,13 +103,24 @@ struct hvm_start_info { uint64_t cmdline_paddr; /* Physical address of the command line. */ uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */ /* structure. */ -}; + uint64_t memmap_paddr; /* Physical address of an array of */ + /* hvm_memmap_table_entry. Only present in */ + /* Ver 1 or later. For e820 mem map table. */ + uint32_t memmap_entries; /* Only present in Ver 1 or later. Number of */ + /* entries in the memmap table. */ +} __attribute__((packed)); struct hvm_modlist_entry { uint64_t paddr; /* Physical address of the module. */ uint64_t size; /* Size of the module in bytes. */ uint64_t cmdline_paddr; /* Physical address of the command line. */ uint64_t reserved; -}; +} __attribute__((packed)); + +struct hvm_memmap_table_entry { + uint64_t addr; /* Base address of the memory region */ + uint64_t size; /* Size of the memory region */ + uint32_t type; /* E820_TYPE_xxx of the memory region */ +} __attribute__((packed)); #endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */