From patchwork Fri Aug 4 02:20:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sky Liu X-Patchwork-Id: 9880295 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 A59FE60311 for ; Fri, 4 Aug 2017 02:22:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FC9F289A0 for ; Fri, 4 Aug 2017 02:22:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94B44289A2; Fri, 4 Aug 2017 02:22:54 +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=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 8B10F289A0 for ; Fri, 4 Aug 2017 02:22:52 +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 1ddSEC-0000ZL-48; Fri, 04 Aug 2017 02:20:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddSEA-0000Z7-MP for xen-devel@lists.xen.org; Fri, 04 Aug 2017 02:20:38 +0000 Received: from [85.158.143.35] by server-8.bemta-6.messagelabs.com id E1/93-09901-5F9D3895; Fri, 04 Aug 2017 02:20:37 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsXiVRvsqPv1ZnO kwbJ2EYslHxezODB6HN39mymAMYo1My8pvyKBNWPKWtWCPomKO8+WsjcwHhDpYuTiEBLoZ5Ro blrEDuKwCLxkkdg87zhjFyMnh4RAP6vE6edJEHacxPqZb9gg7DKJSV2XWUBsIQFliekrf7BDT Gpkkpjz/jsTSIJNQENi7ZSDYA0iAtIS1z5fZgQpYhY4wijxfskJsCJhgWSJjn2NrF2MHECrVS Xe9KuAhHkFLCUO7PgNtUxeYmLvNLCDOAWsJJquvWGHWGwp8ef/c5YJjAILGBlWMaoXpxaVpRb pGuklFWWmZ5TkJmbm6BoamOnlphYXJ6an5iQmFesl5+duYgSGFQMQ7GBc9tfpEKMkB5OSKG/1 saZIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8UsAwFRIsSk1PrUjLzAEGOExagoNHSYT35g2gN G9xQWJucWY6ROoUoyXHhtXrvzBxTDqwHUi+mvD/G5MQS15+XqqUOO9ykAYBkIaM0jy4cbAovM QoKyXMywh0oBBPQWpRbmYJqvwrRnEORiVh3gcgU3gy80rgtr4COogJ6KA/dY0gB5UkIqSkGhi lghmDJEJm8PekfkrxttdKYvByO3d2p1fp7fRmyyfaOhOa+h4tYDrEWL6EJ+B2O58en/kW7qwf q4pm3bvO+qD1wZ68G5ovNjfsCbp2v9iAd+X8sgdfRGfavT2942arm1lj8y+nrS8Ob010+3/N0 uFdskCyT/OPxDnpk49oFV9K/XaCdfX5/1uUWIozEg21mIuKEwGwxltnvQIAAA== X-Env-Sender: blackskygg@gmail.com X-Msg-Ref: server-13.tower-21.messagelabs.com!1501813236!70527662!1 X-Originating-IP: [74.125.83.65] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63030 invoked from network); 4 Aug 2017 02:20:37 -0000 Received: from mail-pg0-f65.google.com (HELO mail-pg0-f65.google.com) (74.125.83.65) by server-13.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 4 Aug 2017 02:20:37 -0000 Received: by mail-pg0-f65.google.com with SMTP id l64so423340pge.2 for ; Thu, 03 Aug 2017 19:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4v4cOc2ZVznpouxJg32uGgWn+LLrljO24MTFkWRPP0A=; b=pD+JPqMucpzl0gZ9KXEx/p8uX0BRdlYOHPr+4GhiSMu3gqgfvnYwG3auBPE5Pjorl2 7KDeumOQIZJb7h9D7bQPnQli6dGCy+GRn7/iUbvPHq83R6pvdsgLr5S+yRGIqd0jVlPm B3JADwe5exDH8duX04uIYulsiFW0TfMgozFiYkCiqRUYTrf/qq+XBuPXEOvCRYWSca5T LOVhBHZFfllfnONmwvG/j6kQrlxQrUHiLsT2K+zZ3Ow1/i//xHpbRW1Zp/HUs6dA7n6O x++cIAZUtdm11QUPbJ/uyFE56HDJuAINlsN2wN2va3pOdrTao8EqPzOcOUxb1HLzJSU9 k0DQ== 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:date:message-id:in-reply-to :references; bh=4v4cOc2ZVznpouxJg32uGgWn+LLrljO24MTFkWRPP0A=; b=Swmegn+QLXfljELneVJjiVisizV5oWR/BHPCP+2p92xvm6QKwYlvA1bWfLUh2Jfp+n MdTJVJ5eBtr2ytj2jY3f2ncdeAlIgLE44/k1fCMyQxcMcfyRPxPavlejUyU/Z2tkaWJP EctL5yj3CPWLmgDNvhxu7dQYNskZL1yjM2G7qD50dzeaW6BKp0ja7QEFXUowaD2U1GBW 9/qRnxQW9iKMszrgfH0Bccgyioq0T0o4L4acPl5T+HQE2t1GkFCLvlj65RS4qJAYHaep P1GUEkFfJQzTsB6dRA+zrNCNOX6NMufPF/SXitAZBNzag+2iG1YGi8ZaeFxiOkFIPNiq 6aPQ== X-Gm-Message-State: AIVw110sCiH6VWNaEfE/WFI7BjwJccqK65lDkaRDGAD1xNEgNbW8rXGH fu8kWqZ/8jS9G5Dp X-Received: by 10.99.109.5 with SMTP id i5mr758134pgc.440.1501813235145; Thu, 03 Aug 2017 19:20:35 -0700 (PDT) Received: from localhost.localdomain ([118.189.148.187]) by smtp.gmail.com with ESMTPSA id v62sm403738pfb.170.2017.08.03.19.20.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 19:20:34 -0700 (PDT) From: Zhongze Liu To: xen-devel@lists.xen.org Date: Fri, 4 Aug 2017 10:20:22 +0800 Message-Id: <20170804022025.25293-2-blackskygg@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170804022025.25293-1-blackskygg@gmail.com> References: <20170804022025.25293-1-blackskygg@gmail.com> Cc: Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu , Zhongze Liu Subject: [Xen-devel] [RFC PATCH 1/4] libxl: introduce a new structure to represent static shared memory regions 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 Add a new structure to the IDL famliy to represent static shared memory regions, as proposed in the proposal "Allow setting up shared memory areas between VMs from xl config file" (see [1]). [1] https://lists.xenproject.org/archives/html/xen-devel/2017-07/msg03047.html Signed-off-by: Zhongze Liu --- Cc: Wei Liu Cc: Ian Jackson Cc: Stefano Stabellini Cc: Julien Grall Cc: xen-devel@lists.xen.org --- tools/libxl/libxl.h | 4 ++++ tools/libxl/libxl_types.idl | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 7cf0f31f68..7c29ebc9e0 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -2228,6 +2228,10 @@ int libxl_fd_set_nonblock(libxl_ctx *ctx, int fd, int nonblock); int libxl_qemu_monitor_command(libxl_ctx *ctx, uint32_t domid, const char *command_line, char **output); +/* Constants for libxl_static_shm */ +#define LIBXL_SSHM_RANGE_UNKNOWN UINT64_MAX +#define LIBXL_SSHM_ID_MAXLEN 128 + #include #endif /* LIBXL_H */ diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 8a9849c643..1aa59a72a2 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -779,6 +779,33 @@ libxl_device_channel = Struct("device_channel", [ ])), ]) +libxl_sshm_cachepolicy = Enumeration("sshm_cachepolicy", [ + (-1, "UNKNOWN"), + (0, "ARM_NORMAL"), # ARM policies should be between 0 ~ 16 + (32, "X86_NORMAL"), # X86 policies should be >= 32 + ], init_val = "LIBXL_SSHM_CHCHE_POLICY_UNKNOWN") + +libxl_sshm_prot = Enumeration("sshm_prot", [ + (-1, "UNKNOWN"), + (3, "RW"), + ], init_val = "LIBXL_SSHM_PROT_UNKNOWN") + +libxl_sshm_role = Enumeration("sshm_role", [ + (-1, "UNKNOWN"), + (0, "MASTER"), + (1, "SLAVE"), + ], init_val = "LIBXL_SSHM_ROLE_UNKNOWN") + +libxl_static_shm = Struct("static_shm", [ + ("id", string), + ("offset", uint64, {'init_val': 'LIBXL_SSHM_RANGE_UNKNOWN'}), + ("begin", uint64, {'init_val': 'LIBXL_SSHM_RANGE_UNKNOWN'}), + ("end", uint64, {'init_val': 'LIBXL_SSHM_RANGE_UNKNOWN'}), + ("prot", libxl_sshm_prot, {'init_val': 'LIBXL_SSHM_PROT_UNKNOWN'}), + ("cache_policy", libxl_sshm_cachepolicy, {'init_val': 'LIBXL_SSHM_CACHEPOLICY_UNKNOWN'}), + ("role", libxl_sshm_role, {'init_val': 'LIBXL_SSHM_ROLE_UNKNOWN'}), +]) + libxl_domain_config = Struct("domain_config", [ ("c_info", libxl_domain_create_info), ("b_info", libxl_domain_build_info), @@ -797,6 +824,7 @@ libxl_domain_config = Struct("domain_config", [ ("channels", Array(libxl_device_channel, "num_channels")), ("usbctrls", Array(libxl_device_usbctrl, "num_usbctrls")), ("usbdevs", Array(libxl_device_usbdev, "num_usbdevs")), + ("sshms", Array(libxl_static_shm, "num_sshms")), ("on_poweroff", libxl_action_on_shutdown), ("on_reboot", libxl_action_on_shutdown),