From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D02CC4727C for ; Thu, 1 Oct 2020 14:42:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE5B320780 for ; Thu, 1 Oct 2020 14:42:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ts7t9i2b"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="O/ZBWi78" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE5B320780 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SA5YatQiZ3ekoFCZIUcpANZuCRm1BaAA+98nOXpOnK4=; b=Ts7t9i2bSaHoOSlGGUd8hSSyR LBWVw/XeVrNQzNm+NGvLBVyVWpoYqb5shCJGrLImvOtcMtWRbr68WAlo6Q7eJDKJeNUiPt26dX+/6 o3uyyrJLbaiyK1a8YkxRcBCKHNu0ODvSN1aA5pMb9A+F5BqSUcOwVjDgpU2M6Bqy6ROBPKgKGsohS FTk+U957P5Psh2SQU+RfWF2rbR8f+XsLeNhhaVFaOebBZZi82FCa+W9Lb4OQ0d9lsTtGFv6laUQLv 8NrMnznTrNcG0574tsX2OOSdgDPCyuaP1RkV2ULIvbdCYOEgctj2s5Pxg4Y2SP9i6OMQ96eL3qs1K IV+RzFn3w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNzlS-0001Fh-Jb; Thu, 01 Oct 2020 14:40:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNzlQ-0001El-69 for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2020 14:40:57 +0000 Received: from localhost (fla63-h02-176-172-189-251.dsl.sta.abo.bbox.fr [176.172.189.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C1EAA20780; Thu, 1 Oct 2020 14:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601563255; bh=DhY0IbX8UQYySEuqd6kJGsABVcgsf2XJo61neYj6iVo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O/ZBWi78hPtqwdVSIbY+TWkDscWVTruDQBqStBOGnT7e3MLHlds9c04L+sw7/cR00 wKD5yk9vWLUR0g2enFwY8Oe+xu94OWyMYPnHGjkTdYEt/ybCkVId/EB7jaxqN2Ruxm S+YC8oQanUYpQVJcvT8ZLAmjC9SR480rBNdwAxVg= Date: Thu, 1 Oct 2020 16:40:52 +0200 From: Frederic Weisbecker To: Alex Belits Subject: Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel Message-ID: <20201001144052.GA6595@lothringen> References: <04be044c1bcd76b7438b7563edc35383417f12c8.camel@marvell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201001_104056_371669_3659334B X-CRM114-Status: GOOD ( 24.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arch@vger.kernel.org" , "catalin.marinas@arm.com" , "peterz@infradead.org" , Prasun Kapoor , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-api@vger.kernel.org" , "tglx@linutronix.de" , "will@kernel.org" , "mingo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 22, 2020 at 02:49:49PM +0000, Alex Belits wrote: > +/** > + * task_isolation_kernel_enter() - clear low-level task isolation flag > + * > + * This should be called immediately after entering kernel. > + */ > +static inline void task_isolation_kernel_enter(void) > +{ > + unsigned long flags; > + > + /* > + * This function runs on a CPU that ran isolated task. > + * > + * We don't want this CPU running code from the rest of kernel > + * until other CPUs know that it is no longer isolated. > + * When CPU is running isolated task until this point anything > + * that causes an interrupt on this CPU must end up calling this > + * before touching the rest of kernel. That is, this function or > + * fast_task_isolation_cpu_cleanup() or stop_isolation() calling > + * it. If any interrupt, including scheduling timer, arrives, it > + * will still end up here early after entering kernel. > + * From this point interrupts are disabled until all CPUs will see > + * that this CPU is no longer running isolated task. > + * > + * See also fast_task_isolation_cpu_cleanup(). > + */ > + smp_rmb(); I'm a bit confused what this read memory barrier is ordering. Also against what it pairs. > + if((this_cpu_read(ll_isol_flags) & FLAG_LL_TASK_ISOLATION) == 0) > + return; > + > + local_irq_save(flags); > + > + /* Clear low-level flags */ > + this_cpu_write(ll_isol_flags, 0); > + > + /* > + * If something happened that requires a barrier that would > + * otherwise be called from remote CPUs by CPU kick procedure, > + * this barrier runs instead of it. After this barrier, CPU > + * kick procedure would see the updated ll_isol_flags, so it > + * will run its own IPI to trigger a barrier. > + */ > + smp_mb(); > + /* > + * Synchronize instructions -- this CPU was not kicked while > + * in isolated mode, so it might require synchronization. > + * There might be an IPI if kick procedure happened and > + * ll_isol_flags was already updated while it assembled a CPU > + * mask. However if this did not happen, synchronize everything > + * here. > + */ > + instr_sync(); It's the first time I meet an instruction barrier. I should get information about that but what is it ordering here? > + local_irq_restore(flags); > +} Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel