Message ID | 20220223052223.1202152-4-junaids@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7868EC4332F for <linux-mm@archiver.kernel.org>; Wed, 23 Feb 2022 05:23:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F5A38D0006; Wed, 23 Feb 2022 00:23:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0572C8D0001; Wed, 23 Feb 2022 00:23:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3B148D0006; Wed, 23 Feb 2022 00:23:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id D6C158D0001 for <linux-mm@kvack.org>; Wed, 23 Feb 2022 00:23:53 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AED4722E5B for <linux-mm@kvack.org>; Wed, 23 Feb 2022 05:23:53 +0000 (UTC) X-FDA: 79172902746.01.001E268 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf02.hostedemail.com (Postfix) with ESMTP id 3E1E380005 for <linux-mm@kvack.org>; Wed, 23 Feb 2022 05:23:53 +0000 (UTC) Received: by mail-yb1-f202.google.com with SMTP id e129-20020a25d387000000b006245d830ca6so12322628ybf.13 for <linux-mm@kvack.org>; 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=rtEuutDtn+e8rmA1FBLAwQyOv/Ht+nsgSFPVSrwSmFpMIJHmUSeQnda7dCeU2ajAQA ZgCnj/ub+mvu7/q+X0CR4cUA5lU5QwCnBGXfn1GOR4TOt6SvRdfdff4gbGdRmeyIgq7i If1QKd3pz4IgS2SzO31ymlIPvTfdD7JNGKy0co3+rJXzQCYhnI3F2brnlYY0aGzKNCPA 0DrAzH38I5+xHhX7NljwPR5FQo75W43aaWZ2RRRgYPWDPFe15wdn4ZrQ6r8j5gZi/QLg MHTqvNSRmD99gzxgcnmlUZGscnD3dIumnv8lk6CMnpPjySU2Yz7Q6ktIvDMjZrnYbyx2 f/6g== X-Gm-Message-State: AOAM530T/kXpPk2Mtl7a8hw9tSVe3FO/qYo9wPJm6Qe7PLGVtEx7SsNQ TiMSIa2lc5yM9A502Q/83+bvQ+UgDjHa X-Google-Smtp-Source: ABdhPJyhZCUKb1E/Ab+htpmdItbzaBqk6IfSNwdQ2cMPET/cQ9m/cxN2+Idkkun2NTapLkyPe3v/k6Dz4k/E 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 <junaids@google.com> 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" Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=gL62Qc22; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of 36MQVYgcKCN8KVOBJETHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--junaids.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=36MQVYgcKCN8KVOBJETHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--junaids.bounces.google.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3E1E380005 X-Stat-Signature: ht6pa6oqi87d8tifyst3pcr1dyp39xuj X-HE-Tag: 1645593833-935443 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Address Space Isolation for KVM
|
expand
|
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 <asm/switch_to.h> #include <asm/tlb.h> +#include <asm/asi.h> #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))
To keep things simpler, we run the scheduler only in the full unrestricted address space for the time being. Signed-off-by: Junaid Shahid <junaids@google.com> --- kernel/sched/core.c | 5 +++++ 1 file changed, 5 insertions(+)