Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5457008pxu; Thu, 22 Oct 2020 02:52:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMXjyvUkX6MNpUMiFnYsQ6Q238yb/xPx+Wo38eB/JjHBY7gwtwr3zshH2jiXAY5eRPc+PR X-Received: by 2002:aa7:c3c7:: with SMTP id l7mr1413488edr.213.1603360353352; Thu, 22 Oct 2020 02:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603360353; cv=none; d=google.com; s=arc-20160816; b=YvYdkLmVQq4MWxGmuX16i2jXt9mPo7oY/QDrp7G+R8JnFp/GNCfyQe8VtqNWrazTkd x5blN2TLXLGFaRgiabkWHaFm3lLaYXLHPTqEbWjwWwtCtYPy2eswUXehF0pTo191e6En 0fS595rJgGDlxQNdoVnaRVAQjrh7ax7CBsCNyJg+SZ7LxfFfoDwcEPp+vf+MGdJHwrOl I30tuqLouX2fAdkaaveHBOsSOrClfGpbEvyws4J6VxXuGx+Tu9IO33Gk73RO8uh5Vzv8 Wjo/r5aoiC/AGYVSLaiCt8tThxQzbKQdtX6s+5NjdA2Hi0qRGHVF0c+G5gk7cD+f6Uwc 3ZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YVuxwJ3hyt25tYMDo7KA9FGUbENDEaFuW9/mMP2hjWY=; b=CopmApqKIZWI+2jqwkjbGFOZoU5QtsQlOy1hbsvENDOht4huYU1uuTq0LsaufGq1rB gpYDUS23i7uZxhjY1mqPUSoc3sdYd8KGFos8MD8mt271ud7uZ9lCUVQF3qR9I7AZRgiO /Bi8VXsDChALm3WLjxBx0KJK6DFPFAor9nebA9wQyf1aWNk0PogHtM6f2fcYCJGAFH5/ 0N9+vnIk+GrVBT5HBDM1z9MbuzhaX/k+5FJv58e/v1wEOsdj4tV+ccZS/vBFSXxPNbve o6aWAFcLtluK96GYRwU8OtfvrxkzAOooiT24nbW2TNdcpruBXj49+qW8WsGEFUBLXbBp YeWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XdZFpfUX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si663805ejb.125.2020.10.22.02.52.11; Thu, 22 Oct 2020 02:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XdZFpfUX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896146AbgJVJtM (ORCPT + 99 others); Thu, 22 Oct 2020 05:49:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:48974 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896143AbgJVJtM (ORCPT ); Thu, 22 Oct 2020 05:49:12 -0400 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=1603360151; h=from:from:reply-to:subject:subject: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=YVuxwJ3hyt25tYMDo7KA9FGUbENDEaFuW9/mMP2hjWY=; b=XdZFpfUX5Q4edukPRqbno2sAVNX/9lStsFCY0SbUMIZdMDeuyPiBXOXTtEtl5tfur0ohB+ v75te7c9mliV8OqxcIfKDJgE5Igkrfgo8YRH5iJ8yl5l20L8mN4rIR4CY6qW1Sv+fYvd/3 q+PdCKHsYamkNp0VFS8CEvO750kZgLQ= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 000A5AE2B; Thu, 22 Oct 2020 09:49:10 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Jan Beulich Subject: [PATCH v2 4/5] xen/events: unmask a fifo event channel only if it was masked Date: Thu, 22 Oct 2020 11:49:06 +0200 Message-Id: <20201022094907.28560-5-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201022094907.28560-1-jgross@suse.com> References: <20201022094907.28560-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unmasking an event channel with fifo events channels being used can require a hypercall to be made, so try to avoid that by checking whether the event channel was really masked. Suggested-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - move test for already unmasked into loop (Jan Beulich) --- drivers/xen/events/events_fifo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c index 243e7b6d7b96..b234f1766810 100644 --- a/drivers/xen/events/events_fifo.c +++ b/drivers/xen/events/events_fifo.c @@ -237,6 +237,9 @@ static bool clear_masked_cond(volatile event_word_t *word) w = *word; do { + if (!(w & (1 << EVTCHN_FIFO_MASKED))) + return true; + if (w & (1 << EVTCHN_FIFO_PENDING)) return false; -- 2.26.2