From nobody Fri Nov 29 16:42:27 2024 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=1632207764; cv=none; d=zohomail.com; s=zohoarc; b=c1sRu+H9/p6jpEvqvucBDCW4MPtIEDsC44Ubg02laUGmf1Oa+QJeXGmW0rOJMOo6mJ8glHjkmakp/RBUjP8ukKDppnrqv3APlhyZ5LHHOuOTNgq1Yp4UVPx+Ou938IUN/zoPUHG3wJlsYB8Bc4X/4mylUdQ00D88EvecjJTQ3zU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632207764; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=7thuIDnGv5oZ6BTCP+zSuwIv02tmpVWBhc2C3gScL0A=; b=n3Z+4yCA9IAydNbJjY6EX6SFV2B9z1lNDCoJYEox3a/+rEXvf8ZyzOm9wAPnl1KECiARP3Tlt6Sk41eP99uUTBstDo1PhgWiepWBM0CnNyYa+bwwKqunYfv+lugJT2gDAj8GDLnhJqW/VFCKEl+8/kmRzET6THy9kwSIJDt0rrU= 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) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632207764092892.8368456999482; Tue, 21 Sep 2021 00:02:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.191374.341361 (Exim 4.92) (envelope-from ) id 1mSZnT-0007vA-3o; Tue, 21 Sep 2021 07:02:31 +0000 Received: by outflank-mailman (output) from mailman id 191374.341361; Tue, 21 Sep 2021 07:02:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mSZnT-0007v3-0S; Tue, 21 Sep 2021 07:02:31 +0000 Received: by outflank-mailman (input) for mailman id 191374; Tue, 21 Sep 2021 07:02:29 +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 1mSZnR-0007ut-CR for xen-devel@lists.xenproject.org; Tue, 21 Sep 2021 07:02:29 +0000 Received: from smtp-out2.suse.de (unknown [195.135.220.29]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e1b44f86-1aa9-11ec-b89e-12813bfff9fa; Tue, 21 Sep 2021 07:02:28 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C24531FD60; Tue, 21 Sep 2021 07:02:27 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7949113B97; Tue, 21 Sep 2021 07:02:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tMNXHIODSWHLegAAMHmgww (envelope-from ); Tue, 21 Sep 2021 07:02:27 +0000 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: e1b44f86-1aa9-11ec-b89e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1632207747; 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; bh=7thuIDnGv5oZ6BTCP+zSuwIv02tmpVWBhc2C3gScL0A=; b=jAdmKx0bi/GxFtRD1x8hHCZEDyOQ/cvhk5YcWnckIWx43Mk91SCNdODfzpafnCcTY+64Og vWaYMT7ZXT1Bn1xhQ/qUlHk1gIqL1CrkEwp8TVH8oVO0BWYJ+hsBQRAjLikxcKNAX3wtvH O9djHthfpfICEmgIIifKGpYoHOBe8xQ= From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH] x86/xen: remove unneeded preempt_disable() from xen_irq_enable() Date: Tue, 21 Sep 2021 09:02:26 +0200 Message-Id: <20210921070226.32021-1-jgross@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1632207764386100001 Content-Type: text/plain; charset="utf-8" Disabling preemption in xen_irq_enable() is not needed. There is no risk of missing events due to preemption, as preemption can happen only in case an event is being received, which is just the opposite of missing an event. Signed-off-by: Juergen Gross Reported-by: Stephen Rothwell Reviewed-by: Jan Beulich --- arch/x86/xen/irq.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c index dfa091d79c2e..ba9b14a97109 100644 --- a/arch/x86/xen/irq.c +++ b/arch/x86/xen/irq.c @@ -57,24 +57,20 @@ asmlinkage __visible void xen_irq_enable(void) { struct vcpu_info *vcpu; =20 - /* - * We may be preempted as soon as vcpu->evtchn_upcall_mask is - * cleared, so disable preemption to ensure we check for - * events on the VCPU we are still running on. - */ - preempt_disable(); - vcpu =3D this_cpu_read(xen_vcpu); vcpu->evtchn_upcall_mask =3D 0; =20 - /* Doesn't matter if we get preempted here, because any - pending event will get dealt with anyway. */ + /* + * Now preemption could happen, but this is only possible if an event + * was handled, so missing an event due to preemption is not + * possible at all. + * The worst possible case is to be preempted and then check events + * pending on the old vcpu, but this is not problematic. + */ =20 barrier(); /* unmask then check (avoid races) */ if (unlikely(vcpu->evtchn_upcall_pending)) xen_force_evtchn_callback(); - - preempt_enable(); } PV_CALLEE_SAVE_REGS_THUNK(xen_irq_enable); =20 --=20 2.26.2