Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp443386pxb; Fri, 16 Apr 2021 09:16:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY1ulUeB1OmtrDG/cdSCLFfs6rVH2cE5wZFrzrImGEN/eKxLyGjrLxheFbopX70rxf5MJU X-Received: by 2002:aa7:d9cf:: with SMTP id v15mr10880962eds.358.1618589792457; Fri, 16 Apr 2021 09:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618589792; cv=none; d=google.com; s=arc-20160816; b=YER2Pn0Upm+sWqhk8OMb+QNb+iQXh1sNqInOESjRcjuwOkmeE41xR9TVZS4wdFubDT vylacrd+rAKYFfsHL9uB0tQ4Z3gVdH7c7S9LCUqaTFDfM6hBT7WSG3NELBUhAeEkp1b3 ZhDccIPgieRzYa/nOUhkVaWFDu+8Pw4G9aBDMu05vyUFiypBGk3kL+EdzSQsM2o61C7F yNDxlj4kKs/SvUqnR8FinxfHknpUSkMjdrwRSjwA6TW6j1x+5cwOJWkPyvmjQRYIDZcY FGchUErT2t9HXWn2tNtCQVA5mt5MHiH/DtaHlVhFWDGc0NC9UuFjcIY9j2Wj1Xh/I7ou xghg== 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 :ironport-sdr:ironport-sdr; bh=V63UJPQR8b6EdyZmr/3VnRg5RBlmH2w6E7wlm6bMVko=; b=dOk9fUnqXSq7x3UMgLmWhW4QA80StSvbCQrfO7yvdP30yyjPOC6SLC6nFfNBbo9+Tp K0GKi9jH7pI7r0sZvdE5uz37t2nMpLwxyZvo54kuUX09HA9NgBKXwoukiVTvHBCXCqFz tX8vABMEg8akbFJ6qkBEIuuiMa4hdq8X5hucLrOGsDmjxVFhy0cTGV/2+03CsLe4NGEq tkZWxgmQm4J4VsI44Z+qlG+h87ruxVW3l762jlECYTndKl6L5KjdL2XHVkP4NL87JgCx 3hxqh+oxRl4W/Eo9TTrMeObOIJdKKLdlZ/y6d7pdN6tXgd3pMP75Lrbw5oyWoA9+eyLR 60LA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp3si5097680ejb.704.2021.04.16.09.16.09; Fri, 16 Apr 2021 09:16:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344047AbhDPPmQ (ORCPT + 99 others); Fri, 16 Apr 2021 11:42:16 -0400 Received: from mga03.intel.com ([134.134.136.65]:28335 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343976AbhDPPmJ (ORCPT ); Fri, 16 Apr 2021 11:42:09 -0400 IronPort-SDR: vd+KVI7AyPpE0REhN8NACwSZDg0YLMktVidU4geP6OQ4tl+TfYVKcHkiqulWZsN6N7eoe/MVML 6HC1ptSRRsiw== X-IronPort-AV: E=McAfee;i="6200,9189,9956"; a="195082429" X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="195082429" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2021 08:41:44 -0700 IronPort-SDR: 3HYELYXhQ0Mx8RIPOamGTgbBRpB0AncsovXkZNC/8m2JSdrcRS+o6IlhQliG1Z6k8LBgLQ4zTa Vj7+eJtHfebw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="453378493" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 16 Apr 2021 08:41:37 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id F3CE424D; Fri, 16 Apr 2021 18:41:49 +0300 (EEST) From: "Kirill A. Shutemov" To: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Sean Christopherson , Jim Mattson Cc: David Rientjes , "Edgecombe, Rick P" , "Kleen, Andi" , "Yamahata, Isaku" , Erdem Aktas , Steve Rutherford , Peter Gonda , David Hildenbrand , x86@kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [RFCv2 05/13] x86/kvmclock: Share hvclock memory with the host Date: Fri, 16 Apr 2021 18:40:58 +0300 Message-Id: <20210416154106.23721-6-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210416154106.23721-1-kirill.shutemov@linux.intel.com> References: <20210416154106.23721-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hvclock is shared between the guest and the hypervisor. It has to be accessible by host. Signed-off-by: Kirill A. Shutemov --- arch/x86/kernel/kvmclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index aa593743acf6..3d004b278dba 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -252,7 +252,7 @@ static void __init kvmclock_init_mem(void) * hvclock is shared between the guest and the hypervisor, must * be mapped decrypted. */ - if (sev_active()) { + if (sev_active() || kvm_mem_protected()) { r = set_memory_decrypted((unsigned long) hvclock_mem, 1UL << order); if (r) { -- 2.26.3