Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4229413pxk; Tue, 22 Sep 2020 13:51:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjHkdfmTCox6QC12zK9b/+AhzCtDewkljYC9dX9tX3m/vaO8UHpCR8LC9X/yIsSjdNIB6O X-Received: by 2002:a05:6402:1711:: with SMTP id y17mr6059344edu.345.1600807880299; Tue, 22 Sep 2020 13:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600807880; cv=none; d=google.com; s=arc-20160816; b=eUBhQJvzesYORUGJ7I6kbRKf3SgpH6TfpmSv67pfZkhmmZP+A3fSnWAnS2eRxBm3JG 0QbgGle0yG2vV9/o5inraBYAiAvdVEe0kBXleHcfA3/SLwgRb5auiSgHFrAHenQp6897 u1KR+f7leszmw5tsCqzMTSloqbgyRsadNjTXIMmfi9RmCb7QgozZJ3ucMtdVn0om5R2C +nFDpUmJQwhImnDpNrU3eN31Toj7phdEidMj+5yiK0LxsIxBy+hOgByUx/VCs9OhGstD sxSnP7UAGgF6wn7IWfyawdrke/KKo5PTgqT32JwHcL6znz0y8N8V34k4xe45OPI9mkyL gNRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EQoerP3tBfn00ZbzFIq6padP28pN7slotXicRp3957E=; b=UDFw+/MiFRa0K37vRRwNZteymDWM7Wck1oRc9LedpqESD9SsseMwZEqFnTITO1eA2V a2O/CN4hhtD0lCVQEiSwxrJtrsZE+5jCTBn8NBP9J8Pm8+D6bZU1ySDtIbodQcpLKgtd f81pt0ReZefjsF/v9+IAqQOEsI7Dhxk6o/LwDKH/n361tSNUzlCatJEUifhhReOiLO5X 2UhybOZSvCk2T4V8rEcrhPnhmYaKkWx0w8iviH/s1hDzvHgQdAiO780g6uDiGo6E5SPu +Xwljxc05Lg1qWO57BJSlqJoWxfBWBeU8eKo2uTUrXsB3HgDmPBiUrRXWpHqJs2jQjev NXBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=H9Qf7DVj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si11610168edp.33.2020.09.22.13.50.56; Tue, 22 Sep 2020 13:51:20 -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=@google.com header.s=20161025 header.b=H9Qf7DVj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726749AbgIVUtf (ORCPT + 99 others); Tue, 22 Sep 2020 16:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbgIVUtb (ORCPT ); Tue, 22 Sep 2020 16:49:31 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C57C0613D3 for ; Tue, 22 Sep 2020 13:49:30 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id k18so4726301wmj.5 for ; Tue, 22 Sep 2020 13:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EQoerP3tBfn00ZbzFIq6padP28pN7slotXicRp3957E=; b=H9Qf7DVjzS2uazzSXcsF8UxvWOQKx0YXcEpjys0QzFlKULYxwAudttOshKaEI0RuGb 4prt+n606mkeJnvIfKgeFNTlwVwlhtSJD0+RZnlVnWFk3fZ4nUnaRPb6MXAgbeyuXVun pq7vfFGhwkMqfw+3auW+vxQqRRlSQ8SCE7Nn1MNv7PRGWmatEP4MLbSn5TNCgvqY3eOw a9qDfY42N1RtFtFwqdvHF5aAPfgP7wyquROGWLpWezzG1V78CKbgDQ/B29XsdbO7C4fR 4b7gie1b35wjCzbbUJYBQAXq4G0Mp6m2BWA+R+OLZUs2WHa7DWZv8DDrFo4xqRr9qLMn ukSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EQoerP3tBfn00ZbzFIq6padP28pN7slotXicRp3957E=; b=WRooajGQEp+Kraq0GIUoG3fIaOpU5yAuCDaWKCYmT6S8ruuFYzIpvi+/26ySpDu9z9 O0IqPLCuPP4aUrKPp4pYxokyMTBEBc88V/OWYy4Goc67q+wiFhjtsgwW0vVTIGDu8O+O 3S/LJEszZ4pjxflLLNblE+u4yVLhHbccQwzuMut8g290mlGpJuaA00BN5uxpH3L8gFrP HaLq73Vnp7NhBErADgwPv8Nwl5gC1iCq0MGV1n2t0fC8Amipl7cFXzz5sEiVPyA+PUMX U0a561hN1jFDgBlKFOldFZliBiqTEYjI1A0npMKbMh4QOs3asf7hUxgvoNN5ZupW5cNe OeaA== X-Gm-Message-State: AOAM533OJP+Ac1mrFJvaOmYZ89+juJpA2PvtQLraZpYC07MzM7Im28ro wCbVmKFAIDIyhXsbgsVIcSVUIQ== X-Received: by 2002:a7b:cd06:: with SMTP id f6mr3030151wmj.66.1600807769052; Tue, 22 Sep 2020 13:49:29 -0700 (PDT) Received: from localhost ([2a01:4b00:8523:2d03:1105:630f:e990:272f]) by smtp.gmail.com with ESMTPSA id a15sm29708484wrn.3.2020.09.22.13.49.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 13:49:28 -0700 (PDT) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Cc: Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, David Brazdil , Andrew Scull Subject: [PATCH v4 10/10] kvm: arm64: Remove unnecessary hyp mappings Date: Tue, 22 Sep 2020 21:49:10 +0100 Message-Id: <20200922204910.7265-11-dbrazdil@google.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922204910.7265-1-dbrazdil@google.com> References: <20200922204910.7265-1-dbrazdil@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With all nVHE per-CPU variables being part of the hyp per-CPU region, mapping them individual is not necessary any longer. They are mapped to hyp as part of the overall per-CPU region. Acked-by: Andrew Scull Signed-off-by: David Brazdil --- arch/arm64/include/asm/kvm_mmu.h | 20 -------------------- arch/arm64/kvm/arm.c | 16 ---------------- 2 files changed, 36 deletions(-) diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index e134c2ba2c5d..8e7919801196 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h @@ -531,21 +531,6 @@ static inline int kvm_map_vectors(void) DECLARE_PER_CPU_READ_MOSTLY(u64, arm64_ssbd_callback_required); DECLARE_KVM_NVHE_PER_CPU(u64, arm64_ssbd_callback_required); -static inline int hyp_map_aux_data(void) -{ - int cpu, err; - - for_each_possible_cpu(cpu) { - u64 *ptr; - - ptr = per_cpu_ptr_nvhe_sym(arm64_ssbd_callback_required, cpu); - err = create_hyp_mappings(ptr, ptr + 1, PAGE_HYP); - if (err) - return err; - } - return 0; -} - static inline void hyp_init_aux_data(void) { u64 *ptr; @@ -555,11 +540,6 @@ static inline void hyp_init_aux_data(void) *ptr = __this_cpu_read(arm64_ssbd_callback_required); } #else -static inline int hyp_map_aux_data(void) -{ - return 0; -} - static inline void hyp_init_aux_data(void) {} #endif diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index cd5293e55fec..22ec7176f95b 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -1591,22 +1591,6 @@ static int init_hyp_mode(void) } } - for_each_possible_cpu(cpu) { - kvm_host_data_t *cpu_data; - - cpu_data = per_cpu_ptr_hyp_sym(kvm_host_data, cpu); - err = create_hyp_mappings(cpu_data, cpu_data + 1, PAGE_HYP); - - if (err) { - kvm_err("Cannot map host CPU state: %d\n", err); - goto out_err; - } - } - - err = hyp_map_aux_data(); - if (err) - kvm_err("Cannot map host auxiliary data: %d\n", err); - return 0; out_err: -- 2.28.0.681.g6f77f65b4e-goog