Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp114782pxf; Tue, 6 Apr 2021 16:41:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG8zbpb+ip2AMPRK9NTJOOjM5mpq4nIxS/8U4pvDyRNn0BZke3gSBg8eF4s+WSEaWlzNel X-Received: by 2002:aa7:c850:: with SMTP id g16mr992169edt.324.1617752510401; Tue, 06 Apr 2021 16:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617752510; cv=none; d=google.com; s=arc-20160816; b=cYjm/Du5MTCw/UwUwA/wFlQKhgcEjqjHHUQShG06W3g04XuCBZ5QSjZFqsIhpEWycJ ZliCtk+4iwBWZr8sbwOfnOXt19zWTvA/D+iahFomNEsjswlU0njpTL93z7m9VLwxzGR+ DtTOzcTqBLGdEh/yEZhSaEqQFsiFfcfdH7bBy/1BikSwsA38NO13IN2ZossBBuv1vad2 Z/36hhc33pH9+LHBKsBeceK5jaqeZp6N8A70Tj7ipMqg9zXbQ8UbTbpw8fJZpvmdQYn4 aDVh7KQH7LmVQ1Kp+v4fF8Asw9vcs3c2z78HPcuPpJlXb/Iwhw4BdTPLWZ3nwMMcWHW7 vK5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=dvDp58NUEAmwXOA+CUb76JESQEzZ3RLgLcG2veKd+ac=; b=rDCtqYAEwF/ZNH1vk3H1jW+U4y9kvip3DTDdmCy7bVZEldgafVh59lvo5NU60RKjSQ V/GucnWBkuFnxa/I9WuzH/PbMkTnp+utAngm0rN5fcG6fVJjp7tyxLbVGCtY1SS7TgxH roNFkoIB3zzdogm5lYMILdDABiR232HEWhCRI7UrmgejTl2NWaZ5Jh4SOWqcM/quhNAM gKtMPVud6C684v5hyy5C3JzgL8OMI900XFsuHXkkmDB5XKvsQTRExgcHMUdkU6EewT9L 4P67ZqGrFbEZudgvIJHu+T3mq3xgPXpakM2HtvvAnxwTUHOWJSHViHhcmPUPaMrff7+Y ANag== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x7si7047365ejs.494.2021.04.06.16.41.27; Tue, 06 Apr 2021 16:41:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233071AbhDFKvf (ORCPT + 99 others); Tue, 6 Apr 2021 06:51:35 -0400 Received: from foss.arm.com ([217.140.110.172]:40688 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231156AbhDFKvd (ORCPT ); Tue, 6 Apr 2021 06:51:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D4F9531B; Tue, 6 Apr 2021 03:51:25 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.cambridge.arm.com [10.1.197.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D44A3F73D; Tue, 6 Apr 2021 03:51:24 -0700 (PDT) From: Luca Fancellu To: sstabellini@kernel.org, jgross@suse.com, jgrall@amazon.com Cc: boris.ostrovsky@oracle.com, tglx@linutronix.de, wei.liu@kernel.org, jbeulich@suse.com, yyankovskyi@gmail.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, bertrand.marquis@arm.com Subject: [PATCH] xen/evtchn: Change irq_info lock to raw_spinlock_t Date: Tue, 6 Apr 2021 11:51:04 +0100 Message-Id: <20210406105105.10141-1-luca.fancellu@arm.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unmask operation must be called with interrupt disabled, on preempt_rt spin_lock_irqsave/spin_unlock_irqrestore don't disable/enable interrupts, so use raw_* implementation and change lock variable in struct irq_info from spinlock_t to raw_spinlock_t Cc: stable@vger.kernel.org Fixes: 25da4618af24 ("xen/events: don't unmask an event channel when an eoi is pending") Signed-off-by: Luca Fancellu --- drivers/xen/events/events_base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 8236e2364eeb..7bbfd58958bc 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -110,7 +110,7 @@ struct irq_info { unsigned short eoi_cpu; /* EOI must happen on this cpu-1 */ unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */ u64 eoi_time; /* Time in jiffies when to EOI. */ - spinlock_t lock; + raw_spinlock_t lock; union { unsigned short virq; @@ -312,7 +312,7 @@ static int xen_irq_info_common_setup(struct irq_info *info, info->evtchn = evtchn; info->cpu = cpu; info->mask_reason = EVT_MASK_REASON_EXPLICIT; - spin_lock_init(&info->lock); + raw_spin_lock_init(&info->lock); ret = set_evtchn_to_irq(evtchn, irq); if (ret < 0) @@ -472,28 +472,28 @@ static void do_mask(struct irq_info *info, u8 reason) { unsigned long flags; - spin_lock_irqsave(&info->lock, flags); + raw_spin_lock_irqsave(&info->lock, flags); if (!info->mask_reason) mask_evtchn(info->evtchn); info->mask_reason |= reason; - spin_unlock_irqrestore(&info->lock, flags); + raw_spin_unlock_irqrestore(&info->lock, flags); } static void do_unmask(struct irq_info *info, u8 reason) { unsigned long flags; - spin_lock_irqsave(&info->lock, flags); + raw_spin_lock_irqsave(&info->lock, flags); info->mask_reason &= ~reason; if (!info->mask_reason) unmask_evtchn(info->evtchn); - spin_unlock_irqrestore(&info->lock, flags); + raw_spin_unlock_irqrestore(&info->lock, flags); } #ifdef CONFIG_X86 -- 2.17.1