From nobody Wed May 1 23:44:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=amzn.com ARC-Seal: i=1; a=rsa-sha256; t=1583410523; cv=none; d=zohomail.com; s=zohoarc; b=IL7HCi21mNAnOtIaU3PicaDaYboJ5LktktXwG80WJg0RMQ/jUK1hyZPA+BC+cmf8OrP9PT+idtYqC3mSMgJ/cqNlK2uc1/QceZjOmNfSKH82uEFMJr1ZFfH5vezduWxoE8nxPFXV+3bK6HUhvb7qBoLeoQUnQrvVitPm6BTn+VI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583410523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DJzQndyu3dJYlIrCuB/ciYW8JA5IwLGLHdKV2SMSzrA=; b=ByPYQ0WTfrexaNrB9IhClssGiLHY4HuShDB+8d8okPghcifWj5nyql8icUNbuE/ToWD2W2TOhppRcQ3+hJ8evoxYjrIV7TB8M7y2qh6GaNJ2yZLK23cDiiZEzAA+xCMAc6L962MWtRo8W5FjFNCrdNuFPsILS7B4T8HgJiBcTkI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1583410523802702.4972247947186; Thu, 5 Mar 2020 04:15:23 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j9pOb-0005gX-Ar; Thu, 05 Mar 2020 12:14:33 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j9pOa-0005gS-FM for xen-devel@lists.xenproject.org; Thu, 05 Mar 2020 12:14:32 +0000 Received: from smtp-fw-9101.amazon.com (unknown [207.171.184.25]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id de66aab8-5eda-11ea-8eb5-bc764e2007e4; Thu, 05 Mar 2020 12:14:32 +0000 (UTC) Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-c5104f52.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 05 Mar 2020 12:14:29 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-c5104f52.us-west-2.amazon.com (Postfix) with ESMTPS id D388BA20EF; Thu, 5 Mar 2020 12:14:28 +0000 (UTC) Received: from EX13D32EUB003.ant.amazon.com (10.43.166.165) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Thu, 5 Mar 2020 12:14:28 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D32EUB003.ant.amazon.com (10.43.166.165) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 5 Mar 2020 12:14:27 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 5 Mar 2020 12:14:24 +0000 X-Inumbo-ID: de66aab8-5eda-11ea-8eb5-bc764e2007e4 IronPort-SDR: 0RAc53iAnGJ3KrqDxXbB4NAx1roQW/p+RGvzo1vmsbNoT+GGnVqvU2P3VblaNOjreDj9gUAck3 71qiKqwKoM5g== X-IronPort-AV: E=Sophos;i="5.70,517,1574121600"; d="scan'208";a="21055607" From: To: Date: Thu, 5 Mar 2020 12:14:16 +0000 Message-ID: <20200305121417.16583-2-pdurrant@amzn.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200305121417.16583-1-pdurrant@amzn.com> References: <20200305121417.16583-1-pdurrant@amzn.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v2 1/2] libxl: create domain 'error' node in xenstore X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , Andrew Cooper , Paul Durrant , Ian Jackson , George Dunlap , Jan Beulich , Anthony PERARD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Paul Durrant Several PV drivers (both historically and currently [1]) report errors by writing text into /local/domain/$DOMID/error. This patch creates the node in libxl and makes it writable by the domain, and also adds some text into xenstore-paths.pandoc to state what the node is for. [1] https://xenbits.xen.org/gitweb/?p=3Dpvdrivers/win/xenvif.git;a=3Dblob;f= =3Dsrc/xenvif/frontend.c;hb=3DHEAD#l459 Signed-off-by: Paul Durrant Acked-by: Ian Jackson --- Cc: Andrew Cooper Cc: George Dunlap Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Wei Liu Cc: Anthony PERARD --- docs/misc/xenstore-paths.pandoc | 5 +++++ tools/libxl/libxl_create.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/docs/misc/xenstore-paths.pandoc b/docs/misc/xenstore-paths.pan= doc index 0a6b36146e..e2ab5da54e 100644 --- a/docs/misc/xenstore-paths.pandoc +++ b/docs/misc/xenstore-paths.pandoc @@ -539,6 +539,11 @@ address written in one of these paths to, for example,= establish a VNC session to the guest (although clearly some level of trust is placed in the value supplied by the guest in this case). =20 +#### ~/error [w] + +A domain writable path used by some PV drivers to pass error messages +to the toolstack. + ### Paths private to the toolstack =20 #### ~/device-model/$DOMID/state [w] diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 7891fae426..fb7b3999ae 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -797,6 +797,9 @@ retry_transaction: libxl__xs_mknod(gc, t, GCSPRINTF("%s/attr", dom_path), rwperm, ARRAY_SIZE(rwperm)); + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/error", dom_path), + rwperm, ARRAY_SIZE(rwperm)); =20 if (libxl_defbool_val(info->driver_domain)) { /* --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 23:44:31 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=amzn.com ARC-Seal: i=1; a=rsa-sha256; t=1583410528; cv=none; d=zohomail.com; s=zohoarc; b=CQTcMDccdK90lw4qn6lYHiSO4RUM4XK3htf+6NrK+6TnDAUJnJB6xUwsWMVbqE+WP9mVdzXOhdlpitSSaZmZNS3AJsPnEKxGz/RgxTbNgzYDevkq4FDfbFjB6YWtZe9jsZmecuSr08wHG/YZX8pVACvf3zVsyPXnXog6GXDtqo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583410528; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zP/5akkzt3NJvVaQAxUFXzoi0jWtbFcx06LkuF356/0=; b=ZECPbZOlIH06VCAW6q/CabLjb3mDqFXN8QYC98LmV7Fs4auqXpjcNCGjb/q1s0L+R6FTYmV3W/DV7fWyNghYSw5yHWxmGspA9Kvcwch+8+2OSEWcy5j3vMjqOB3NPVI5BAWQWfShIAjfRnyTPo4ZYjqW7xejGfuC39AxVwq71oI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1583410528570757.0791385491806; Thu, 5 Mar 2020 04:15:28 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j9pOq-0005iR-T8; Thu, 05 Mar 2020 12:14:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j9pOq-0005iB-5X for xen-devel@lists.xenproject.org; Thu, 05 Mar 2020 12:14:48 +0000 Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e7dad506-5eda-11ea-8eb5-bc764e2007e4; Thu, 05 Mar 2020 12:14:47 +0000 (UTC) Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-1968f9fa.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 05 Mar 2020 12:14:34 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2c-1968f9fa.us-west-2.amazon.com (Postfix) with ESMTPS id 0BF5FA23BE; Thu, 5 Mar 2020 12:14:33 +0000 (UTC) Received: from EX13D32EUB001.ant.amazon.com (10.43.166.125) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Thu, 5 Mar 2020 12:14:32 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D32EUB001.ant.amazon.com (10.43.166.125) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 5 Mar 2020 12:14:30 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 5 Mar 2020 12:14:27 +0000 X-Inumbo-ID: e7dad506-5eda-11ea-8eb5-bc764e2007e4 IronPort-SDR: 4PNbMkYV7oFwgzUY6GPEQbHW/IBJmFTVH6bHU/Fx44OxSTo9NNCiW3lL0LaO7lt4k9F0JK4D8T k/+P8W+VI5zA== X-IronPort-AV: E=Sophos;i="5.70,517,1574121600"; d="scan'208";a="19716572" From: To: Date: Thu, 5 Mar 2020 12:14:17 +0000 Message-ID: <20200305121417.16583-3-pdurrant@amzn.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200305121417.16583-1-pdurrant@amzn.com> References: <20200305121417.16583-1-pdurrant@amzn.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v2 2/2] libxl: make creation of xenstore 'suspend event channel' node optional... X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , Paul Durrant , Ian Jackson , George Dunlap , Jan Beulich , Anthony PERARD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Paul Durrant ... and make the top level 'device' node in xenstore writable by the guest The purpose and semantics of the suspend event channel node are explained in xenstore-paths.pandoc [1]. It was originally introduced in xend by commit 17636f47a474 "Teach xc_save to use event-channel-based domain suspend if available.". Note that, because, the top-level frontend 'device' node was created writable by the guest in xend, there was no need to explicitly create the 'suspend-event-channel' node as writable node. However, libxl creates the 'device' node as read-only by the guest and so explicit creation of the 'suspend-event-channel' node is necessary to make it usable. This unfortunately has the side-effect of making some old Windows PV drivers [2] cease to function. This is because they scan the top level 'device' node, find the 'suspend' node and expect it to contain the usual sub-nodes describing a PV frontend. When this is found not to be the case, enumeration ceases and (because the 'suspend' node is observed before the 'vbd' node) no system disk is enumerated. Windows will then crash with bugcheck code 0x7B. This patch adds a boolean 'suspend_event_channel' field into libxl_create_info to control whether the xenstore node is created and a similarly named option in xl.cfg which, for compatibility with previous libxl behaviour, defaults to true. It also makes the top level device node writable, as xend did, and updates xenstore-paths.pandoc to say that the suspend event channel node may not exist and that the guest may create it if it does not exist. [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/xens= tore-paths.pandoc;hb=3DHEAD#l177 [2] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/= 5/html/para-virtualized_windows_drivers_guide/sect-para-virtualized_windows= _drivers_guide-installing_and_configuring_the_para_virtualized_drivers-inst= alling_the_para_virtualized_drivers NOTE: While adding the new LIBXL_HAVE_CREATEINFO_SUSPEND_EVENT_CHANNEL definition into libxl.h, this patch corrects the previous stanza which erroneously implies libxl_domain_create_info is a function. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu Cc: Andrew Cooper Cc: George Dunlap Cc: Jan Beulich Cc: Julien Grall Cc: Stefano Stabellini Cc: Anthony PERARD v2: - Update xenstore-paths.pandoc and squash patch #3 --- docs/man/xl.cfg.5.pod.in | 7 +++++++ docs/misc/xenstore-paths.pandoc | 7 ++++--- tools/libxl/libxl.h | 13 ++++++++++++- tools/libxl/libxl_create.c | 14 ++++++++++---- tools/libxl/libxl_types.idl | 1 + tools/xl/xl_parse.c | 3 +++ 6 files changed, 37 insertions(+), 8 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 0cad561375..5f476f1e1d 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -668,6 +668,13 @@ file. =20 =3Dback =20 +=3Ditem B + +Create the xenstore path for the domain's suspend event channel. The +existence of this path can cause problems with older PV drivers running +in the guest. If this option is not specified then it will default to +B. + =3Dback =20 =3Dhead2 Devices diff --git a/docs/misc/xenstore-paths.pandoc b/docs/misc/xenstore-paths.pan= doc index e2ab5da54e..a8eecdb7ed 100644 --- a/docs/misc/xenstore-paths.pandoc +++ b/docs/misc/xenstore-paths.pandoc @@ -176,10 +176,11 @@ The size of the video RAM this domain is configured w= ith. =20 #### ~/device/suspend/event-channel =3D ""|EVTCHN [w] =20 -The domain's suspend event channel. The toolstack will create this -path with an empty value which the guest may choose to overwrite. +The domain's suspend event channel. The toolstack may create this +path with an empty value which the guest may choose to overwrite. If +the path does not exist then the guest may create it. =20 -If the guest overwrites this, it will be with the number of an unbound +If the guest writes this, it will be with the number of an unbound event channel port it has acquired. The toolstack is expected to use an interdomain bind, and then, when it wishes to ask the guest to suspend, to signal the event channel. diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 35e13428b2..d2afe48512 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -1272,10 +1272,21 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst,= const libxl_mac *src); * LIBXL_HAVE_CREATEINFO_DOMID * * libxl_domain_create_new() and libxl_domain_create_restore() will use - * a domid specified in libxl_domain_create_info(). + * a domid specified in libxl_domain_create_info. */ #define LIBXL_HAVE_CREATEINFO_DOMID =20 +/* + * LIBXL_HAVE_CREATEINFO_SUSPEND_EVENT_CHANNEL + * + * libxl_domain_create_info contains a boolean 'suspend_event_channel' + * value to control whether the xenstore path: + * + * /local/domain/$DOMID/device/suspend/event-channel (RW) + * + * is created. + */ + typedef char **libxl_string_list; void libxl_string_list_dispose(libxl_string_list *sl); int libxl_string_list_length(const libxl_string_list *sl); diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index fb7b3999ae..8afb0ce2be 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -57,6 +57,8 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc, if (!c_info->ssidref) c_info->ssidref =3D SECINITSID_DOMU; =20 + libxl_defbool_setdefault(&c_info->suspend_event_channel, true); + return 0; } =20 @@ -750,7 +752,7 @@ retry_transaction: roperm, ARRAY_SIZE(roperm)); libxl__xs_mknod(gc, t, GCSPRINTF("%s/device", dom_path), - roperm, ARRAY_SIZE(roperm)); + rwperm, ARRAY_SIZE(rwperm)); libxl__xs_mknod(gc, t, GCSPRINTF("%s/control", dom_path), roperm, ARRAY_SIZE(roperm)); @@ -782,9 +784,13 @@ retry_transaction: libxl__xs_mknod(gc, t, GCSPRINTF("%s/control/sysrq", dom_path), rwperm, ARRAY_SIZE(rwperm)); - libxl__xs_mknod(gc, t, - GCSPRINTF("%s/device/suspend/event-channel", dom_path), - rwperm, ARRAY_SIZE(rwperm)); + + if (libxl_defbool_val(info->suspend_event_channel)) + libxl__xs_mknod(gc, t, + GCSPRINTF("%s/device/suspend/event-channel", + dom_path), + rwperm, ARRAY_SIZE(rwperm)); + libxl__xs_mknod(gc, t, GCSPRINTF("%s/data", dom_path), rwperm, ARRAY_SIZE(rwperm)); diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index d0d431614f..2bce19bcf0 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -418,6 +418,7 @@ libxl_domain_create_info =3D Struct("domain_create_info= ",[ ("run_hotplug_scripts",libxl_defbool), ("driver_domain",libxl_defbool), ("passthrough", libxl_passthrough), + ("suspend_event_channel",libxl_defbool), ], dir=3DDIR_IN) =20 libxl_domain_restore_params =3D Struct("domain_restore_params", [ diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index b881184804..122c6eb641 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -2725,6 +2725,9 @@ skip_usbdev: =20 parse_vkb_list(config, d_config); =20 + xlu_cfg_get_defbool(config, "suspend_event_channel", + &c_info->suspend_event_channel, 0); + xlu_cfg_destroy(config); } =20 --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel