Received: by 10.223.185.116 with SMTP id b49csp6515253wrg; Wed, 28 Feb 2018 10:41:22 -0800 (PST) X-Google-Smtp-Source: AH8x225NH3HVTzyP5gdp+ATiBJ3Kjun0dWRvckjUm8YQaQCYa/MiTntQyYn2m7Hx9XVcM/rjWNcO X-Received: by 10.98.103.69 with SMTP id b66mr18816450pfc.114.1519843282350; Wed, 28 Feb 2018 10:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519843282; cv=none; d=google.com; s=arc-20160816; b=KRce30AHDHcqzVSONcojwTAdvwcoI4bpGfKSekT6aPeQGUUVaJRC+ZC9+jK6NYZpq/ CpMF7LqOmc2W7Dg8BfgNWLpi1uCb4B2Vha0ziZwN0zhO+/cWuTxg0D8VsELbxtUGTxdB 1yddtnyjgPHcNQrugGiWG9O3CxNnOweDiLzpPWtBAzYtpUThq9CzppsrDWvsgFCEh9s2 P9T0bspEV7dVH8Zog2R54vYzntcsVeL/qfiPYv51Fz4B+A9Jbna+EJlvhTwU6I6LvoTK dM6M3FMB8EKtbP3SCha2zbCKisuSjUqLBrSW7BPwJcnKT6284I+57Mlt2gaxWR9lnv8i 9zSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=NKwZy7QIXdf9jOB2cu42yNxtdW0rMIf+9HvGbPGJ6RA=; b=uTFoKZgjvwwq+G/zJm+pAXGLs4nbPuloJn6l5vZdEPo6X8GrAVbwsUZ3tCtN39tipp m0mDEVWmtIBVnJTS/tQdOF9/4d9GjR+uph7nzHJc0aN9asmwHy8nDKQOjwUvoDUkoN9f mdUzHGKLas2jqV3BKAnkkGeoQIqUL0i6P2HT+rsPyHU15GFNxq7Fp/yYbdUdHpGwqrch U1HZI39Ru+uc/uPGTmI98Q2nTokE+aOeCp2n1WbpDtAoAKhkaIVu9+iPT+dHuLXEVPum zM5y4qoTMEgaa5NgrWP4bD/DVg1zUY0Ef8aK6zVKLxs+LqcpN6ZCpoYYDlTK1JfQW0Pg T8kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=th1P5pCJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si1340296pgo.250.2018.02.28.10.41.07; Wed, 28 Feb 2018 10:41:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=th1P5pCJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932969AbeB1Sjd (ORCPT + 99 others); Wed, 28 Feb 2018 13:39:33 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34046 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932386AbeB1Sjb (ORCPT ); Wed, 28 Feb 2018 13:39:31 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1SIVmTP182118; Wed, 28 Feb 2018 18:38:50 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=NKwZy7QIXdf9jOB2cu42yNxtdW0rMIf+9HvGbPGJ6RA=; b=th1P5pCJ+W0fY5Q5zsqy2g1FoWxdb+5O/8bVRGxFfLQfiE4Cs6rQUmyTXDQWDkT7/5DW kTXUppevaMdcnMCPKf5dsU6HyGoAqPGzd9x38ptUtnPFgZh9Ruq2sUU3QylKV9wCqhah 6x6Zu33k4oW7iOfM0NmWtM7r6R6yKqeLtz2hVTYUpFu6CCbQTTT0HhuEvxfuV85lS0zG 9siG8vrIDJTk4ucHpOg1op7lSkXfSw47AdsKNQIn2oTqTWX6MZ5hGil26PhDnD9zzGBG nutYWRDIlbo5PN7jsq64OqOiyOHisuecXew3Zyp3RHS7NaLx+4RRaoP6t91sengXFHCR nQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2ge1rt82a0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Feb 2018 18:38:50 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w1SISmOE016604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Feb 2018 18:28:48 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1SISl0a012361; Wed, 28 Feb 2018 18:28:47 GMT Received: from marawils-linux.us.oracle.com (/10.141.197.9) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Feb 2018 10:28:46 -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, JBeulich@suse.com, 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, jpoimboe@redhat.com, bp@suse.de, kirill.shutemov@linux.intel.com, thomas.lendacky@amd.com, luto@kernel.org, maran.wilson@oracle.com, dave.hansen@linux.intel.com, davem@davemloft.net, gregkh@linuxfoundation.org, mchehab@kernel.org, linus.walleij@linaro.org, rdunlap@infradead.org Subject: [RFC PATCH v4 6/7] xen/pvh: Add memory map pointer to hvm_start_info struct Date: Wed, 28 Feb 2018 10:28:02 -0800 Message-Id: <1519842483-8887-7-git-send-email-maran.wilson@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1519842483-8887-1-git-send-email-maran.wilson@oracle.com> References: <1519842483-8887-1-git-send-email-maran.wilson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8818 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=386 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802280226 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 pass information about the memory map to the guest. This would allow KVM guests to share the same entry point. Signed-off-by: Maran Wilson --- include/xen/interface/hvm/start_info.h | 50 +++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/include/xen/interface/hvm/start_info.h b/include/xen/interface/hvm/start_info.h index 648415976ead..80cfbd35c1af 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,15 @@ * 32 +----------------+ * | rsdp_paddr | Physical address of the RSDP ACPI data structure. * 40 +----------------+ + * | memmap_paddr | Physical address of the (optional) 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. + * | | Zero if there is no memory map being provided. + * 52 +----------------+ + * | reserved | Version 1 and newer only. + * 56 +----------------+ * * The layout of each entry in the module structure is the following: * @@ -62,10 +71,34 @@ * | reserved | * 32 +----------------+ * + * The layout of each entry in the memory map table is as follows: + * + * 0 +----------------+ + * | addr | Base address + * 8 +----------------+ + * | size | Size of mapping in bytes + * 16 +----------------+ + * | type | Type of mapping as defined between the hypervisor + * | | and guest it's starting. E820_TYPE_xxx, for example. + * 20 +----------------| + * | reserved | + * 24 +----------------+ + * * 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 * boundary. + * + * Version numbers of the hvm_start_info structure have evolved like this: + * + * Version 0: + * + * Version 1: Added the memmap_paddr/memmap_entries fields (plus 4 bytes of + * padding) to the end of the hvm_start_info struct. These new + * fields can be used to pass a memory map to the guest. The + * memory map is optional and so guests that understand version 1 + * of the structure must check that memmap_entries is non-zero + * before trying to read the memory map. */ #define XEN_HVM_START_MAGIC_VALUE 0x336ec578 @@ -86,6 +119,14 @@ 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 */ + /* version 1 and newer of the structure */ + uint32_t memmap_entries; /* Number of entries in the memmap table. */ + /* Only present in version 1 and newer of */ + /* the structure. Value will be zero if */ + /* there is no memory map being provided. */ + uint32_t reserved; }; struct hvm_modlist_entry { @@ -95,4 +136,11 @@ struct hvm_modlist_entry { uint64_t reserved; }; +struct hvm_memmap_table_entry { + uint64_t addr; /* Base address of the memory region */ + uint64_t size; /* Size of the memory region in bytes */ + uint32_t type; /* Mapping type */ + uint32_t reserved; +}; + #endif /* __XEN_PUBLIC_ARCH_X86_HVM_START_INFO_H__ */ -- 2.16.1