From nobody Mon Feb 9 12:43:38 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.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 (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1558518439; cv=none; d=zoho.com; s=zohoarc; b=g6V6wCSAjE8uqfvvT6Tq4YqrCEMYmPK4aYFwBZjOjIHtD7Mdmx++S1FBI8pB42XwVSk4iaMImpKg8A5D/L73lpJ81Uff7E7fzaONvDeyUt0TKjiyJOumgadsksou5/d6+9wm+kxTz8lCk8B8+zieV0JJno+X0DXnLkEpvlRAfoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558518439; 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:ARC-Authentication-Results; bh=0FieSynGniYoLnmsyGwQ22Wi/aM5mRnu9u2YVUxIN9o=; b=PA5SsdIpOEKVV1sT4aou173bcLmn98hxd/kwAtLp3gbva5RZnqr3yyCss+UBcqyXzuC+qBxaxzNvD7yBdR9Yl6jKnyxKnSdc5fZUV+i2YCvMf4PSK5gPSpVfXVnp5SW9L+SxQ4RSJu/sgXqv/0rw/0xB4AXkQIXMAiRMqH6cCvw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558518439749977.6727387432411; Wed, 22 May 2019 02:47:19 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hTNou-0006WW-Rt; Wed, 22 May 2019 09:46:00 +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.89) (envelope-from ) id 1hTNot-0006Vo-Vl for xen-devel@lists.xenproject.org; Wed, 22 May 2019 09:46:00 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 63e2fc0c-7c76-11e9-9cbe-4347524bb1c0; Wed, 22 May 2019 09:45:54 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2ABA5AF11; Wed, 22 May 2019 09:45:53 +0000 (UTC) X-Inumbo-ID: 63e2fc0c-7c76-11e9-9cbe-4347524bb1c0 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 22 May 2019 11:45:47 +0200 Message-Id: <20190522094549.28397-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190522094549.28397-1-jgross@suse.com> References: <20190522094549.28397-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 1/3] xen: drop in_atomic() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently there is only one user of in_atomic(), and that is in an #ifdef 0 section. This has been so since Xen 4.1, so chances are rather slim we suddenly want to enable it again. Dropping in_atomic() will remove the last user of preempt_count() in non-debug builds enabling further optimizations. Signed-off-by: Juergen Gross Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/hvm.c | 16 ---------------- xen/common/preempt.c | 5 ----- xen/include/xen/preempt.h | 2 -- 3 files changed, 23 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 8993c2aa57..7b36765b97 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3185,22 +3185,6 @@ static enum hvm_translation_result __hvm_copy( =20 ASSERT(is_hvm_vcpu(v)); =20 - /* - * XXX Disable for 4.1.0: PV-on-HVM drivers will do grant-table ops - * such as query_size. Grant-table code currently does copy_to/from_gu= est - * accesses under the big per-domain lock, which this test would disal= low. - * The test is not needed until we implement sleeping-on-waitqueue when - * we access a paged-out frame, and that's post 4.1.0 now. - */ -#if 0 - /* - * If the required guest memory is paged out, this function may sleep. - * Hence we bail immediately if called from atomic context. - */ - if ( in_atomic() ) - return HVMTRANS_unhandleable; -#endif - while ( todo > 0 ) { enum hvm_translation_result res; diff --git a/xen/common/preempt.c b/xen/common/preempt.c index 3b4178fd44..20913e20d3 100644 --- a/xen/common/preempt.c +++ b/xen/common/preempt.c @@ -25,11 +25,6 @@ =20 DEFINE_PER_CPU(unsigned int, __preempt_count); =20 -bool_t in_atomic(void) -{ - return preempt_count() || in_irq() || !local_irq_is_enabled(); -} - #ifndef NDEBUG void ASSERT_NOT_IN_ATOMIC(void) { diff --git a/xen/include/xen/preempt.h b/xen/include/xen/preempt.h index bef83135a1..f715ca09bc 100644 --- a/xen/include/xen/preempt.h +++ b/xen/include/xen/preempt.h @@ -26,8 +26,6 @@ DECLARE_PER_CPU(unsigned int, __preempt_count); preempt_count()--; \ } while (0) =20 -bool_t in_atomic(void); - #ifndef NDEBUG void ASSERT_NOT_IN_ATOMIC(void); #else --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel