From nobody Mon Feb 9 10:48:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1607531451; cv=none; d=zohomail.com; s=zohoarc; b=WjetCA3MJEZNOhEtHOp5Bmr7dqiY914cq17dMxj8c8SBJA+gJ1QlwHE0Rpzc8gSFkgbsjsLITnlLisjEeDDmN//WHoyUnGHUV9VthJf29YmKbwitNh2FjnJBBB1tIqCDMzHdoShVdfcAh971R3a52NEcFDsotUAQSR0/mPZRGHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607531451; h=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=g8rJKVfvD7B5g+TUwc6aQ0QAVGKg6M4SOf5V18X4xJk=; b=Q1FUpq5QoXey984OYxAQ96TCtgqJo3hnCQ9QCjgsLCBHtWWkVnYYmuc9ZZCfL0czCF6eeuteDgnc22VYVkrbSEfNic52wXnYEh5OB7tHEi3hWEGdmyB1L5MfgwF8qCqZrty+zn+sM1GAHiOt2HudOJIIkpQfDXZ4hbo82dzMMCA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine 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 1607531451244639.0219038307941; Wed, 9 Dec 2020 08:30:51 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.48486.85787 (Exim 4.92) (envelope-from ) id 1kn28s-0004cy-M1; Wed, 09 Dec 2020 16:16:38 +0000 Received: by outflank-mailman (output) from mailman id 48486.85787; Wed, 09 Dec 2020 16:16:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kn28s-0004cn-Ht; Wed, 09 Dec 2020 16:16:38 +0000 Received: by outflank-mailman (input) for mailman id 48486; Wed, 09 Dec 2020 16:16:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kn28r-0004SF-2F for xen-devel@lists.xenproject.org; Wed, 09 Dec 2020 16:16:37 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d08d6373-737d-49ff-ac70-952481d7f693; Wed, 09 Dec 2020 16:16:22 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 444A3AF8A; Wed, 9 Dec 2020 16:16:21 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d08d6373-737d-49ff-ac70-952481d7f693 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607530581; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g8rJKVfvD7B5g+TUwc6aQ0QAVGKg6M4SOf5V18X4xJk=; b=Gr6xFEk+e4HbG53mSI/tfN9x/ztLT9J2Zxt4L6Qqof0hSTZHL5Nq6i8ZsB+1CPQgqTnG+x 52z7Na5xWdk5TXma52nhw8mqa7aeoxBofwRZMBIk2SKhl6tsDo5mZoy6jqNoOZ1Ep1iNyc Hvs7W0Uq5gR2nqDxE++F3QCbGktgcLI= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: paul@xen.org, Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH RFC 3/3] xen/domain: add per-domain hypfs directory abi-features Date: Wed, 9 Dec 2020 17:16:18 +0100 Message-Id: <20201209161618.309-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201209161618.309-1-jgross@suse.com> References: <20201209161618.309-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" Add a new per-domain hypfs directory "abi-features" used to control some feature availability. Changing the availability of a feature is allowed only before the first activation of the domain. The related leafs right now are "event-channel-upcall" and "fifo-event-channels". For those bool elements are added to struct domain, but for now without any further handling. Signed-off-by: Juergen Gross --- xen/common/hypfs_dom.c | 39 +++++++++++++++++++++++++++++++++++++++ xen/include/xen/sched.h | 4 ++++ 2 files changed, 43 insertions(+) diff --git a/xen/common/hypfs_dom.c b/xen/common/hypfs_dom.c index 241e379b24..b54e246ad6 100644 --- a/xen/common/hypfs_dom.c +++ b/xen/common/hypfs_dom.c @@ -10,6 +10,42 @@ #include #include =20 +static int domain_abifeat_write(struct hypfs_entry_leaf *leaf, + XEN_GUEST_HANDLE_PARAM(const_void) uaddr, + unsigned int ulen) +{ + struct hypfs_dyndir_id *data; + struct domain *d; + + data =3D hypfs_get_dyndata(); + d =3D data->data; + + if ( d->creation_finished ) + return -EBUSY; + + return hypfs_dyndir_id_write_bool(leaf, uaddr, ulen); +} + +static const struct hypfs_funcs abifeat_funcs =3D { + .enter =3D hypfs_node_enter, + .exit =3D hypfs_node_exit, + .read =3D hypfs_dyndir_id_read_leaf, + .write =3D domain_abifeat_write, + .getsize =3D hypfs_getsize, + .findentry =3D hypfs_leaf_findentry, +}; + +static HYPFS_FIXEDSIZE_INIT(abifeat_evtupcall, XEN_HYPFS_TYPE_BOOL, + "event-channel-upcall", + HYPFS_STRUCT_ELEM(struct domain, abi_evt_upcal= l), + &abifeat_funcs, 1); +static HYPFS_FIXEDSIZE_INIT(abifeat_fifoevnt, XEN_HYPFS_TYPE_BOOL, + "fifo-event-channels", + HYPFS_STRUCT_ELEM(struct domain, abi_fifo_evt), + &abifeat_funcs, 1); + +static HYPFS_DIR_INIT(domain_abifeatdir, "abi-features"); + static const struct hypfs_entry *domain_domdir_enter( const struct hypfs_entry *entry) { @@ -131,6 +167,9 @@ static int __init domhypfs_init(void) { hypfs_add_dir(&hypfs_root, &domain_dir, true); hypfs_add_dyndir(&domain_dir, &domain_domdir); + hypfs_add_dir(&domain_domdir, &domain_abifeatdir, true); + hypfs_add_leaf(&domain_abifeatdir, &abifeat_evtupcall, true); + hypfs_add_leaf(&domain_abifeatdir, &abifeat_fifoevnt, true); =20 return 0; } diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 31abbe7a99..fb99249743 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -424,6 +424,10 @@ struct domain */ bool creation_finished; =20 + /* ABI-features (can be set via hypfs before first unpause).*/ + bool abi_fifo_evt; + bool abi_evt_upcall; + /* Which guest this guest has privileges on */ struct domain *target; =20 --=20 2.26.2