Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5585177pxv; Wed, 28 Jul 2021 14:25:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB7gGcOd2mWAZW3CSKw3DvC5R2fM2NOsQLUWHGqk8Jn13unO+MAdArsT4dwXo7cGthrm/+ X-Received: by 2002:a17:906:4f02:: with SMTP id t2mr1351451eju.217.1627507518912; Wed, 28 Jul 2021 14:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627507518; cv=none; d=google.com; s=arc-20160816; b=dz/PhiokiP1h/jaH4XN61X8i4i6VCiKuiJj4nXt0C/xwXcMS4khhETl1iLaRJEjnc4 PVBL7gBVChd6qFvMR80MfFNDp/lPJwp6UEkpn2f1EIOtrAcu7XxmZUukKJ2HCGm7exT8 bsXITl9JnE9OojzIVS4p2IRS40v7g+rsZGsdd0BrKsVBrk2im855jOFfP62CEz0Dh/OG MRSpVC7qG4Fx3Pz3t6y56J+Mx/gDpRlkLSyrGx8REMAWSP6EWUnzV2ndWyf58VwJE+gs mh9NlIhJ0Zxxj3RZYf4a2OAYD4sE/6WncnRPtAuk5emZoYQ6Q6GQdXT7zC4h99AiyoCC zMPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K1TzM5GCdD2KZ4YlaRJBeKPMnYblpusizbpB/Zymias=; b=uGMFDE5TM1JzCIYUkpNNuwjxb5vXbpkEw1ifUePvdc/Fw7DDACfUv5zYIgvfrXB1WJ Q1A3jhRm7NGvZoPI05nfe+48H4ACBxBUkMcwsCf+u7ZEG94GcSQ4/kPr8sHJv2TlZP8t DsGBjmBOqSEFqkxCCl/OF+/TjXn9VMhW6JPDGPMu76UC3iCdMSdoSTVPqx3vzN2+XfOU 7j8DF2yt1lI6mYAXf4r1D5RAmHxfXYvito7rAjynhJq8wU08jQW/Hd3fTrZriBYdh9Qa aT/OKgEWUheJpDGNd9cMS+CUMng1yCUGbFFBxxHWuFfriyg8ESLVZTdLhilzX9A1Kop1 2bKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JJO4cfSw; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si741013edc.206.2021.07.28.14.24.55; Wed, 28 Jul 2021 14:25:18 -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=@kernel.org header.s=k20201202 header.b=JJO4cfSw; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231830AbhG1VWw (ORCPT + 99 others); Wed, 28 Jul 2021 17:22:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:36910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbhG1VWv (ORCPT ); Wed, 28 Jul 2021 17:22:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 19AD260462; Wed, 28 Jul 2021 21:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627507369; bh=mC6lLtZPy3lFUz2DCHyydD1HsrkcO+Ge8lfn/foE4Fs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JJO4cfSwqJD3300iyEpLW8xUHz0MfRNetJzAmgA/z36ZOMuEp3jEA8la4CNC/vdg1 cqTCO/vOpcB16aV03AuQd+YtERggVRIQR+kbI08YFj7RrPVEsNqhwHzzsHyTmT5ZhX EGcbJcYsMpynfkb13HQkx6qw9AHtt3nFxcO0Q5WZw4cunP1TGdwdOv+shb0jaHh6K8 XjqcPC+j2MUCHiKk3M/22CSQYxFJCujDJsNQw1cdkgi1eMrf5KPy0QFnUaFihyC/9H JqgRvRex3jyOg/5Er/gaTYOPfJ5/h9bEAPg90czA0bpMFwmU9OQAd2gsf1JbbMWL5D I6cZdHOJj08BA== Date: Wed, 28 Jul 2021 23:22:47 +0200 From: Frederic Weisbecker To: Marcelo Tosatti Cc: nsaenzju@redhat.com, linux-kernel@vger.kernel.org, Nitesh Lal , Christoph Lameter , Juri Lelli , Peter Zijlstra , Alex Belits , Peter Xu , Thomas Gleixner Subject: Re: [patch 1/4] add basic task isolation prctl interface Message-ID: <20210728212247.GC293265@lothringen> References: <20210727104119.551607458@fuller.cnet> <7b2d6bf91d30c007e19a7d2cbddcb2460e72d163.camel@redhat.com> <20210727110050.GA502360@fuller.cnet> <20210727130930.GB283787@lothringen> <20210727145209.GA518735@fuller.cnet> <20210727234539.GH283787@lothringen> <20210728093707.GA3242@fuller.cnet> <20210728114548.GA293265@lothringen> <20210728132134.GA10515@fuller.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210728132134.GA10515@fuller.cnet> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 10:21:34AM -0300, Marcelo Tosatti wrote: > > > ISOL_FEATURES is just the "command" type (which you can get and set). > > > > > > The bitmask would include ISOL_F_QUIESCE_ON_URET, so: > > > > > > - bitmask = ISOL_F_QUIESCE_ON_URET; > > > - prctl(PR_ISOL_SET, ISOL_FEATURES, bitmask, 0, 0) enables the features in > > > the bitmask. > > > > But does it quiesce once or for every further uret? > > For every uret, while ISOL_F_QUIESCE_ON_URET is enabled through > prctl(PR_ISOL_ENABLE, enabled_bitmask, 0, 0, 0). Ok. > > > > - quiesce_bitmap = prctl(PR_ISOL_GET, PR_ISOL_SUP_QUIESCE_CFG, 0, 0, 0) > > > (1) > > > > > > (returns the supported actions to be quiesced). > > > > > > - prctl(PR_ISOL_SET, PR_ISOL_QUIESCE_CFG, quiesce_bitmask, 0, 0) _sets_ > > > the actions to be quiesced (2) > > > > > > If an application does not modify "quiesce_bitmask" between > > > points (1) and (2) above, it will enable quiescing of all > > > "features" the kernel supports. > > > > I don't get the difference between ISOL_FEATURES and PR_ISOL_QUIESCE_CFG. > > prctl(PR_ISOL_SET, cmd, ...) is intented to accept different types of "command" > variables (including ones for new features which are not known at this > time). > > - prctl(PR_ISOL_SET, ISOL_FEATURES, bitmask, 0, 0) enables the features in > the bitmask > > (which might now be superceded by > > prctl(PR_ISOL_ENABLE, ISOL_F_QUIESCE_ON_URET, 0, 0, 0)) > > - prctl(PR_ISOL_SET, PR_ISOL_QUIESCE_CFG, bitmask, 0, 0) configures > quiescing of which subsystem/feature is performed: > > #define ISOL_F_QUIESCE_VMSTAT_SYNC (1<<0) > #define ISOL_F_QUIESCE_NOHZ_FULL (1<<1) > #define ISOL_F_QUIESCE_DEFER_TLB_FLUSH (1<<2) Ok but...I still don't get the difference between ISOL_FEATURES and PR_ISOL_QUIESCE_CFG :-) > > So PR_ISOL_ENABLE is a way to perform action when some sort of kernel entry > > happens. Then we take actions when that happens (signal, warn, etc...). > > > > I guess we'll need to define what kind of kernel entry, and what kind of > > response need to happen. Ok that's a whole issue of its own that we'll need > > to handle seperately. > > > > Thanks. > > In fact, why one can't use SECCOMP for syscall blocking? Heh! Good point!