From nobody Mon Feb 9 15:46:14 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=1606201307; cv=none; d=zohomail.com; s=zohoarc; b=CJ/nHiWwOdtXMiQDd/V+oTzk4uWTmhJVKxOGR/rQWPz2UaoEY+7CqY3+m4IUad1VXOBkccI8FUopymRNE+kk8WebVAx7Q0s1Cz8l4kJ/tofyTmFnzQd9+0n+Yl6k6DjX2OlXL7G4f2UtXeQ0maAfoYzYAwnNN8mivn10QCus56Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606201307; 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=uY+rObtaesBiYwhFR54/hfk+UTURWjLhSDOKmBjo9Hk=; b=YYh27kteUQ7c1HENtdoSBTsndrmmP+5LgJJxLOkc+gSmyrWJEwlnIS5Wd5IeNfHnL/Kqjbk8SkuhDX+vdL1GZlb1gtrVN8Qv/ZtmWJkgNNOQcl7TGocnl76YsEuXZL4UEiLdD3CLB/ohQTTPXk3hTO3eqlerflSw+zE+sXDvdr0= 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 1606201307205381.984064554464; Mon, 23 Nov 2020 23:01:47 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.35378.66897 (Exim 4.92) (envelope-from ) id 1khSKE-0001nR-CI; Tue, 24 Nov 2020 07:01:18 +0000 Received: by outflank-mailman (output) from mailman id 35378.66897; Tue, 24 Nov 2020 07:01:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khSKE-0001nH-7p; Tue, 24 Nov 2020 07:01:18 +0000 Received: by outflank-mailman (input) for mailman id 35378; Tue, 24 Nov 2020 07:01:17 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khSKD-0001kq-3z for xen-devel@lists.xenproject.org; Tue, 24 Nov 2020 07:01:17 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 38370360-fb20-49fc-88ce-cf4fc5afc72c; Tue, 24 Nov 2020 07:01:10 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A013DADCD; Tue, 24 Nov 2020 07:01:09 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1khSKD-0001kq-3z for xen-devel@lists.xenproject.org; Tue, 24 Nov 2020 07:01:17 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 38370360-fb20-49fc-88ce-cf4fc5afc72c; Tue, 24 Nov 2020 07:01:10 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A013DADCD; Tue, 24 Nov 2020 07:01:09 +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: 38370360-fb20-49fc-88ce-cf4fc5afc72c 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=1606201269; 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=uY+rObtaesBiYwhFR54/hfk+UTURWjLhSDOKmBjo9Hk=; b=DuiB6acuqrH4C2absqcxEFRbDrXB2fDjBgSxIwxTz1tlybaHV+QEpsJU02wI1BLe46mAw0 QMHW2k4JCUWGGaNTw0+FqZKNpJPpydJ3mutCADpZN9FTGdUIzLDMcOLuaegMoB+IhE4m7h YMuNtsNn46pIrv/Xlh+AWDys/+6aZfQ= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v7 2/3] xen/events: modify struct evtchn layout Date: Tue, 24 Nov 2020 08:01:05 +0100 Message-Id: <20201124070106.26854-3-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201124070106.26854-1-jgross@suse.com> References: <20201124070106.26854-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" In order to avoid latent races when updating an event channel put xen_consumer and pending fields in different bytes. At the same time move some other fields around to have less implicit paddings and to keep related fields more closely together. Signed-off-by: Juergen Gross --- xen/include/xen/sched.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index a345cc01f8..e6d09aa055 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -80,8 +80,7 @@ extern domid_t hardware_domid; #define EVTCHNS_PER_GROUP (BUCKETS_PER_GROUP * EVTCHNS_PER_BUCKET) #define NR_EVTCHN_GROUPS DIV_ROUND_UP(MAX_NR_EVTCHNS, EVTCHNS_PER_GROUP) =20 -#define XEN_CONSUMER_BITS 3 -#define NR_XEN_CONSUMERS ((1 << XEN_CONSUMER_BITS) - 1) +#define NR_XEN_CONSUMERS 8 =20 struct evtchn { @@ -94,9 +93,10 @@ struct evtchn #define ECS_VIRQ 5 /* Channel is bound to a virtual IRQ line. = */ #define ECS_IPI 6 /* Channel is bound to a virtual IPI line. = */ u8 state; /* ECS_* */ - u8 xen_consumer:XEN_CONSUMER_BITS; /* Consumer in Xen if nonzero */ - u8 pending:1; - u16 notify_vcpu_id; /* VCPU for local delivery notification */ +#ifndef NDEBUG + u8 old_state; /* State when taking lock in write mode. */ +#endif + u8 xen_consumer; /* Consumer in Xen if nonzero */ u32 port; union { struct { @@ -113,11 +113,13 @@ struct evtchn } pirq; /* state =3D=3D ECS_PIRQ */ u16 virq; /* state =3D=3D ECS_VIRQ */ } u; - u8 priority; -#ifndef NDEBUG - u8 old_state; /* State when taking lock in write mode. */ -#endif - u32 fifo_lastq; /* Data for fifo events identifying last queue. */ + + /* FIFO event channels only. */ + u8 pending; + u8 priority; + u16 notify_vcpu_id; /* VCPU for local delivery notification */ + u32 fifo_lastq; /* Data for identifying last queue. */ + #ifdef CONFIG_XSM union { #ifdef XSM_NEED_GENERIC_EVTCHN_SSID --=20 2.26.2