From patchwork Thu Aug 10 16:04:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tianyu Lan X-Patchwork-Id: 134116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp561798vqi; Thu, 10 Aug 2023 10:08:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEC4QaGRLYGLqWWf96BESbAy5QMQn6px5rX+/IzCwRXmHYMi6drOXXczn3fQYTrFbNiIKzU X-Received: by 2002:a2e:9bd3:0:b0:2b9:dd5d:5d0a with SMTP id w19-20020a2e9bd3000000b002b9dd5d5d0amr2561721ljj.40.1691687311322; Thu, 10 Aug 2023 10:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691687311; cv=none; d=google.com; s=arc-20160816; b=JZQi21bG72yM6LunBTUqZWS63P8QqWEo2sxXZhoy5YS4XGgWE4yM7OUl+aOnYH770b o8t1Fw7PJnHtL5w4HJFZzMaihbAdykqO1227JCq7O7Wu+j3QE1pMjShROFKzct/GXI0q AHot4zA0XQtY5zx07DrfetApP/MUEYVV+2lqWpBfQmebxyVR2zYn96hjABHISfMB+dq7 fdDQ4QkIC4VN6ZQ47Zxl7mQa5Ov9fAgsECBSaKUtjYMkaAUT2OklJwU0aDVVX3n+dLFa Yq7wB5WBu/Ki14WTj9EIdiihuUQJXVmaVx7n2Bcve7GDtxRGyqzmAiP3hOW3EWEcn4CA QGUg== 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=lxyPRx65GPTmM7WIGpMjts/akUWiTXqh+ZFAndUPdXI=; fh=TxLVtSsj0Yk+bstPG6ly04YaPbvjOFEmGNSQ8sZkNQc=; b=Ey6SfT4/RGF/Jyh0qGBl/6kXxnD0qbzb9avoMsRX7vjFyXH149oLfr6lDhrxkSWppH f2oDvdvpGeSm6tWjQ0qD/NMl7eUkGn+TdvoFojqT+wxB6HY2uCCWHuG/tS3SKbWxGGgL pgTzdnAiN0hQVO+sK5/Vs1t2bcy7zupY1Ue6BF7wj/BTalVichdZ+RmUpEURphq1vET/ 7n5RIt8lmFRlhAAB8JubHWkSimakAzWokItnzahgwnYAbz9z+7cmWB11ExZidlJ9G/ff BPZl7svVrbv7rejyHT1YVGRYw6HiBDrJgKa36KVhYDVazWinnbPtpLke/v8rHbC4+AJ0 IWUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RCXffTJs; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dv26-20020a170906b81a00b0099d54631b4bsi1890034ejb.170.2023.08.10.10.08.06; Thu, 10 Aug 2023 10:08:31 -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=@gmail.com header.s=20221208 header.b=RCXffTJs; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232030AbjHJQGm (ORCPT + 99 others); Thu, 10 Aug 2023 12:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236313AbjHJQFk (ORCPT ); Thu, 10 Aug 2023 12:05:40 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A003C25; Thu, 10 Aug 2023 09:04:36 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bbff6b2679so8285335ad.1; Thu, 10 Aug 2023 09:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691683472; x=1692288272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lxyPRx65GPTmM7WIGpMjts/akUWiTXqh+ZFAndUPdXI=; b=RCXffTJsDHcffmIPSgUKPLAjuz2B9B5upDilpJKvxXdse+2iU9qMd7XeUioEsL/IIx P49mC4Z7C2BWR4jgNtbX/rq5y7v1XSel5TXFTXUok3MrW+MmiJqkH3byV+llrk8HKq6U H7CoWlLozmvsDFj0PqumGlemwyQxY//zMB8iQjPFrgkXNtpuXt/bFiVYqYPuOJiI/06R vEy0jn5ymAGIXiBbExFCqoQ/R0nqeIBKzln7CVzEzdqsufVa2N2Zm+Ss86+gTrSekJi0 uz/CuciUxpLsNLDHf/pCvPxUVUSizB3w+dTFkwkyLWm/lFN799wXItMTWoCcb2WAnHyD gltQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691683472; x=1692288272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lxyPRx65GPTmM7WIGpMjts/akUWiTXqh+ZFAndUPdXI=; b=JyK6ut6fatUSWJI4ZuMAM13Uvd8T695aNPaz5djXjN6G13QKoi2HVNbNGIbFRH6B69 J5HSQ2FK16yh3iwzJeh9bmvEg7fM1oK5+HnFkgiiteJ/38MgtogOw+xEEqXgt7ycTj9H lh1+4iUpavoj/bsyIUundvq0ks1OPHVzENApSWQE0GON6AlnKfb/MHWoEiPWIjvb0nu9 GBljHeYnOEpoeEcwGfQSgbMK0fkswZej51A4X6XjxLIySRBZ4aoBGEYfFawEY7FU9MMm +SKC7B23PCk1oedsosSDxffD7v3qi8bN44XH7ov8dClBzkgytJFYsPYOTTdMozBFWTCI QdQw== X-Gm-Message-State: AOJu0Yw6CrUdN22PjUPiuw37/9ieG3WwC7eMzUkzWplRqmSDiBuqGzE5 3jY50nTmFQajLdbXPFJiDwc= X-Received: by 2002:a17:902:b10f:b0:1bc:50f9:8f20 with SMTP id q15-20020a170902b10f00b001bc50f98f20mr2336492plr.23.1691683472544; Thu, 10 Aug 2023 09:04:32 -0700 (PDT) Received: from ubuntu-Virtual-Machine.corp.microsoft.com ([2001:4898:80e8:0:c620:2003:6c97:8057]) by smtp.gmail.com with ESMTPSA id r4-20020a1709028bc400b001b895a17429sm1948821plo.280.2023.08.10.09.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:04:31 -0700 (PDT) From: Tianyu Lan To: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, daniel.lezcano@linaro.org, arnd@arndb.de, michael.h.kelley@microsoft.com Cc: Tianyu Lan , linux-arch@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, vkuznets@redhat.com, Michael Kelley Subject: [PATCH V5 6/8] clocksource: hyper-v: Mark hyperv tsc page unencrypted in sev-snp enlightened guest Date: Thu, 10 Aug 2023 12:04:09 -0400 Message-Id: <20230810160412.820246-7-ltykernel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230810160412.820246-1-ltykernel@gmail.com> References: <20230810160412.820246-1-ltykernel@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773862714102450692 X-GMAIL-MSGID: 1773862714102450692 From: Tianyu Lan Hyper-V tsc page is shared with hypervisor and mark the page unencrypted in sev-snp enlightened guest when it's used. Reviewed-by: Michael Kelley Signed-off-by: Tianyu Lan Reviewed-by: Dexuan Cui --- drivers/clocksource/hyperv_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c index e56307a81f4d..8ff7cd4e20bb 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -390,7 +390,7 @@ static __always_inline u64 read_hv_clock_msr(void) static union { struct ms_hyperv_tsc_page page; u8 reserved[PAGE_SIZE]; -} tsc_pg __aligned(PAGE_SIZE); +} tsc_pg __bss_decrypted __aligned(PAGE_SIZE); static struct ms_hyperv_tsc_page *tsc_page = &tsc_pg.page; static unsigned long tsc_pfn;