Message ID | 20221104220053.1702977-2-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp659641wru; Fri, 4 Nov 2022 15:02:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5cWRfZqVcm9SdqOPlfduBxvU4M/zsp1V0u+KmYxSDJeg0VfsrXLqKdgIkEVfC/44ilMHDj X-Received: by 2002:a63:2f45:0:b0:457:dc63:68b4 with SMTP id v66-20020a632f45000000b00457dc6368b4mr32100534pgv.228.1667599342100; Fri, 04 Nov 2022 15:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667599342; cv=none; d=google.com; s=arc-20160816; b=E85HjYLQgCK55aQVXbuK6Vj4/jhIn/gkxHjLdackxj1+ul+4PdEp4P+c/kolyCiNuq TlV4RsitEW0AUu2S1QFm69HhDrf9hOcQVWUsJFdM9gqYvLteA+iWX6rH9XV6WLAjvzmP CzFqTAjWEX19x/3UC10Z3kuZNpiiZYb0iLzfcPb5Mz3bWfJ5+wH+ulp3jXr2YIuhu0Wr 6PxyECHiiakb+WkDoEtwrpxtkq5jdPpA3BloO0QA8XELnPra2ya5eCkhKrjWIy5eJk0S WoP+oiY9qcbIk04siL7/OQY4JVfQa+mFm8rhEPImMGSGtxJgp/1bRm9VYg8s2tjyF1U+ /j5w== 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:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=ORwfmj6kJY3MPYNwljMh0Ojz+sLVhyTdNLlUMLv1/pk=; b=l05vh/X4WuFouqtGqsakZLKUs+0MFIzlk6FcIOYprMwy9cA1VKPoDYINRbB5mjU1QD oQIP2bj7eKfKdPmikbd591TpOQtQRcrNMImQwHmUzOW3io7UAdmoyrEoO2xmHNBfDApE Zkr+o4XkU/BtiO+IGkGLFRT136im42e0c/XqPuza3cxDZxYQsPkagWZeAgCKxr0ic0su oC+XTwiO4iafKuj9+OKCUTpslUlcfUwQBJuhQh9mBnL1qURMHVWGwfHrEIVKt2595vPu WPKvF6RAy5EKzGnTvc/1vt5/cAQ+w97iFYNof4VbS9UwSdIyEdqbRLqELZGSTVO9OjzQ 7gLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PO78hPWL; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a056a00188100b0056bc14f1cd2si589223pfh.10.2022.11.04.15.02.08; Fri, 04 Nov 2022 15:02:22 -0700 (PDT) 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=PO78hPWL; 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 S230140AbiKDWBQ (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Fri, 4 Nov 2022 18:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbiKDWBE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Nov 2022 18:01:04 -0400 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC8548756 for <linux-kernel@vger.kernel.org>; Fri, 4 Nov 2022 15:01:02 -0700 (PDT) Received: by mail-pf1-x44a.google.com with SMTP id x8-20020aa79568000000b0056dd717e051so3049321pfq.11 for <linux-kernel@vger.kernel.org>; Fri, 04 Nov 2022 15:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=ORwfmj6kJY3MPYNwljMh0Ojz+sLVhyTdNLlUMLv1/pk=; b=PO78hPWLhGiPOdh3FKBDOyG8KHk37JCjEqyaVuWHpv31zowr7R3uAFNA1xtr4KmvX7 MNgLdzxinD3pD3F+Iy+FJRRYB6+BaIPkmAKMS8sMpLZvtYHqQ0Za+XlkPiLJGehQiKZD Ias/Me6yBT1a0kIMIsVRb9byR3i+C25+OfJMXPHOLtheGpsxMiwTrdYfDGgT7qe6YH0p VYlbRiW0TZ1PXbmeLJXvnAbdVEU6FaoijOh4HcfTQ+mLSmRNyTJbqm5Qx1KjIGGv3lW2 KyB/3dFcoWYX++Bzh/d18RvfnpRxTpexGp5tVGKeS09SDdPSUNgquKt+qz/3a71UO18U AzaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ORwfmj6kJY3MPYNwljMh0Ojz+sLVhyTdNLlUMLv1/pk=; b=heu+Y+yHIH7PaGLre7J/K9qWlzHFPKAVZdozZw6K12yeqPeacesYNUDEhhOFiplI3K UBFknwddBKZysQhAJcyVbo0HrcD/9MPgYNXJ/y2+R/iYIpVX7lkNOE/tc7FAyKOqV+gz 3wVKjZv9RSq6uWCC6DUT/4EWh0vGSWEHN3HE4Wdqvb2farXOBo6Zn4ti+Omh5b/v4nNH XAZ6G/C4FWf0G2yOfldRPhIHYnHhhCRohjJ2lbksQ+Auk0mIsuji4ARuhP4eHq4KTBbK oyhftq1CP6H6g4Opnice4UomUOoDUWEpocEOAEj6Lzkp/+u6NlrfXmV1u/f39qeYTW7Q FVvg== X-Gm-Message-State: ACrzQf1J6WOEECqEQqAbVfdvhILR5hPWZiPQ8MqZ6tA7cI8JnNna5Y3F hlHJrszivwXD9s9u7GhIE8CMz8DvFAA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90b:1809:b0:213:aeae:64a1 with SMTP id lw9-20020a17090b180900b00213aeae64a1mr37290558pjb.226.1667599262508; Fri, 04 Nov 2022 15:01:02 -0700 (PDT) Reply-To: Sean Christopherson <seanjc@google.com> Date: Fri, 4 Nov 2022 22:00:52 +0000 In-Reply-To: <20221104220053.1702977-1-seanjc@google.com> Mime-Version: 1.0 References: <20221104220053.1702977-1-seanjc@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221104220053.1702977-2-seanjc@google.com> Subject: [PATCH 1/2] x86/mm: Recompute physical address for every page of per-CPU CEA mapping From: Sean Christopherson <seanjc@google.com> To: Dave Hansen <dave.hansen@linux.intel.com>, Andy Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org> Cc: linux-kernel@vger.kernel.org, Andrey Ryabinin <ryabinin.a.a@gmail.com>, Sean Christopherson <seanjc@google.com>, Dmitry Vyukov <dvyukov@google.com> 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,USER_IN_DEF_DKIM_WL autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748604648018763033?= X-GMAIL-MSGID: =?utf-8?q?1748604648018763033?= |
Series |
x86/mm: More KASAN per-CPU CEA mapping bug fixes
|
|
Commit Message
Sean Christopherson
Nov. 4, 2022, 10 p.m. UTC
Recompute the physical address for each per-CPU page in the CPU entry
area, a recent commit inadvertantly modified cea_map_percpu_pages() such
that every PTE is mapped to the physical address of the first page.
Fixes: 9fd429c28073 ("x86/kasan: Map shadow for percpu pages on demand")
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/mm/cpu_entry_area.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c index dff9001e5e12..d831aae94b41 100644 --- a/arch/x86/mm/cpu_entry_area.c +++ b/arch/x86/mm/cpu_entry_area.c @@ -97,7 +97,7 @@ cea_map_percpu_pages(void *cea_vaddr, void *ptr, int pages, pgprot_t prot) early_pfn_to_nid(PFN_DOWN(pa))); for ( ; pages; pages--, cea_vaddr+= PAGE_SIZE, ptr += PAGE_SIZE) - cea_set_pte(cea_vaddr, pa, prot); + cea_set_pte(cea_vaddr, per_cpu_ptr_to_phys(ptr), prot); } static void __init percpu_setup_debug_store(unsigned int cpu)