Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp337558pxm; Wed, 23 Feb 2022 01:13:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzS+dt82fsnitHKRmOpJCTCvAk2hP+0nfrK2jhynjEDJ/Sg668FA/a+qkHM+w2roRP9Dejv X-Received: by 2002:a63:8748:0:b0:35e:d94:7b79 with SMTP id i69-20020a638748000000b0035e0d947b79mr22590585pge.81.1645607612912; Wed, 23 Feb 2022 01:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645607612; cv=none; d=google.com; s=arc-20160816; b=oOnACjCZcEn6rCCIRN55wTxkyyWeJAI8EKFOKjJX+j5Dgb3fcMCPyuU/9Y6R9atYmu U6yUw01bD1d+kRUcTBEwgwMsQmo/ccsbHNZK1xCEq3Po/VK88rdwLkWeoPiQ8sf219kd amh+r/8jViyWjfP9nUwt/2WPPFDOIo9fqhsdn8FQRyJK3GL8RzYLX3dhcyhAT/eyF7qA 8rN5DftzLK+hWk03nezCK21uRki15UHzWgA0/+YDFfc7pejTJjRPqULveT0ZQXHvXL5N giGp3YvyXGb5Ef0PoAys6wLYZdPYPLcwQS7KOz1ppqgm4TXiWdZHo/lJUzAw6jY29wYR o4kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=o+K8zCWcV59JiWXD4aWine0/FDtELjiPI/RbdPNAHQc=; b=tio04RgQQxRzi3PFWMmEY3gTxuXzrBVdbIodIKj5e3JeOYhxpYcPIqPqUCULQXDKRJ QjBpLCsFVffxpPt4ukPvUsj23PIJPvDaAI9Arnt6sOYgTg64YBGw4esH/wMbRRPmipqe 6k6wi5u+CWYh1G2itvx3BYe7kJM1EsBnp1kuuwTyJ76hQzCmNC4JuDiX7uIYrcg0X5dD WyKGZ41c1aQQfP9nkBLQtP3ac75uKweILAaq9CCxw0z3x5nB1YkkuOGy5AV3Wfks01ri pYB/9oXSqcpyccXWeElAYnXZNiFcLzzkkoiqCA6oNbKDfRxCbDF+WCmMgkVI2Y4ntKFx eLPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gL62Qc22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12si11887172pgr.270.2022.02.23.01.13.18; Wed, 23 Feb 2022 01:13:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=gL62Qc22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238089AbiBWFY2 (ORCPT + 99 others); Wed, 23 Feb 2022 00:24:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237834AbiBWFYU (ORCPT ); Wed, 23 Feb 2022 00:24:20 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60354694AE for ; Tue, 22 Feb 2022 21:23:53 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id o5-20020a25d705000000b0062499d760easo8076106ybg.7 for ; Tue, 22 Feb 2022 21:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=o+K8zCWcV59JiWXD4aWine0/FDtELjiPI/RbdPNAHQc=; b=gL62Qc22CZ6FeqYe4RTaen0CJKVsVLhWP6XuIpy8wtIhquKE7Hq2aAgjM0cnFrMx// B9jyIFrBZPnR4ZblulS8U7l5+BX78tipmOGn+uNc7HwBgNSyCtAgwmuxuLupc9yf33fw sG7BRSGiBqlxsiI4E0nPILyGbfSDlu+DOPd9cNUxoIqlK1SF5LShFZNMYNQ5wWc1UUUq JRgPAlM6n7K8F/7k32Qk1plHhKLU8qRnhntMmXKxbAFtecCJ3vVWG8s4ryjAHjKMNW6w HoGY4yajLvjwNYPSxXLVJpFkRwFJsLHr1WAWSZWkzlHrdQQ5OWrVIF2pqwZ0e1qUQPaz mArQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=o+K8zCWcV59JiWXD4aWine0/FDtELjiPI/RbdPNAHQc=; b=qB79eIGhGkIiwG/GqSgomgsUKyuG1p8+DUfbxDAH7adv/R4SMjFSPVxjDRzMsxb5XS SwdnXvA4VoecpgZNsjujMkyIBYM/yunBTsfweWNNGazbkvpxf0b5Cut1BZu5+YXAIYGu Ju/sIhRwUZVdu8Au4hWofoERAyUm4zkd8/2FQhhD/A0vlrLFV1FrxefhED4nsontyMzk gwL8mdpjBG4G7XmX9uwzI5rXt1AXEJJYp1rkSVJSLR2unh+u8OL+4HsCSqwzGkH5SrkA +RfarES+h3idZid3wKOmH0D3MEqlIW9gy88X4GfXlIMQ4OikG4mjN1abjEW1GAzideaW VJHw== X-Gm-Message-State: AOAM530qL3SONp6ezmLt09BaADB0bs+jj8jmmI8fxHOz68fy+pnMSAHl iRDSOonVGbILmJd0TubN3BOMO13u6DLmQlW7fnuFcmjVKo+36QvQJW+GsnoEevA8qPDXdNpenGr 3/lClCtdG3TxLmIrX/juqdbZ5+m4x8eXxgcNyhQx6Raxh4R2HRJu7cwntmgBXvhOGuMImOGOO X-Received: from js-desktop.svl.corp.google.com ([2620:15c:2cd:202:ccbe:5d15:e2e6:322]) (user=junaids job=sendgmr) by 2002:a25:a486:0:b0:61d:a523:acd0 with SMTP id g6-20020a25a486000000b0061da523acd0mr25432547ybi.203.1645593832574; Tue, 22 Feb 2022 21:23:52 -0800 (PST) Date: Tue, 22 Feb 2022 21:21:39 -0800 In-Reply-To: <20220223052223.1202152-1-junaids@google.com> Message-Id: <20220223052223.1202152-4-junaids@google.com> Mime-Version: 1.0 References: <20220223052223.1202152-1-junaids@google.com> X-Mailer: git-send-email 2.35.1.473.g83b2b277ed-goog Subject: [RFC PATCH 03/47] mm: asi: Switch to unrestricted address space when entering scheduler From: Junaid Shahid To: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, pbonzini@redhat.com, jmattson@google.com, pjt@google.com, oweisse@google.com, alexandre.chartre@oracle.com, rppt@linux.ibm.com, dave.hansen@linux.intel.com, peterz@infradead.org, tglx@linutronix.de, luto@kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To keep things simpler, we run the scheduler only in the full unrestricted address space for the time being. Signed-off-by: Junaid Shahid --- kernel/sched/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 77563109c0ea..44ea197c16ea 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -19,6 +19,7 @@ #include #include +#include #include "../workqueue_internal.h" #include "../../fs/io-wq.h" @@ -6141,6 +6142,10 @@ static void __sched notrace __schedule(unsigned int sched_mode) rq = cpu_rq(cpu); prev = rq->curr; + /* This could possibly be delayed to just before the context switch. */ + VM_WARN_ON(!asi_is_target_unrestricted()); + asi_exit(); + schedule_debug(prev, !!sched_mode); if (sched_feat(HRTICK) || sched_feat(HRTICK_DL)) -- 2.35.1.473.g83b2b277ed-goog