[V2,6/9] clocksource: hyper-v: Mark hyperv tsc page unencrypted in sev-snp enlightened guest
Message ID | 20230627032248.2170007-7-ltykernel@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7923895vqr; Mon, 26 Jun 2023 20:51:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6znakN9FClcLkBNIr2fXBImOUuaQxik8vCwLRH2TwfnnjyYTENwiMAoIdrhO1ROoDt9Yq1 X-Received: by 2002:a05:622a:1312:b0:3f9:d266:7bcc with SMTP id v18-20020a05622a131200b003f9d2667bccmr35523338qtk.38.1687837890720; Mon, 26 Jun 2023 20:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687837890; cv=none; d=google.com; s=arc-20160816; b=f31teVGNKDcl5UgOW6KFy/PUoJkpFsjXQtw5P4Z4uKcP61ky2W3X5ADRb/JPkipnqS OTfjNH7Hzc6bXKzSG0bVe0Aobsxfx/2GmZUbmDzmyAVE2VgElGJqMYeO9dvp7LQQMSsm cHxjqdtUo6pcndnwotPe+QJMvu1w5fQ/0nOLkFU+5Ror4ZIBWXp06g4j7UXf3LcUOeMD P0r2udiX9OqTDMHvdrv4PQcVDbfTaJgZB4He38DPvjivQqK+0VA9YmKziWKCWf6zFbS3 rbGAyMIiwz3gMOGn3B18k7FlSSTvdregnzJf1YZDd+8iE+Dxyo+VE48KBDbBuGo4nbyr yStQ== 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=1RKpz5HBE9JLrRBFLWv7AJFc4wm2/SCXversK+BtfEc=; fh=ZK/DmW1x+WWTXdJ/EJHTsBEUe1j1GuqfQXG5AYfW/uc=; b=XR6/XEHcPp1zlWIc2zdvUTZ5xS4Jm2MtYy2/u90DZj7sGtcBuVOk9tnJFqRRy+nHOw UnRX8xL8J+NIHFVu465IZjAm1By/PTagDwjFDCEQy++kckO5/DDZv2Eq4pJ1IJiPxAZY 4Fz0OGE40Odfg4KA1ZNqxMzLN8wdZVvkcwaIgrxPtp1hE7ys/C3lQwbBe2C2G15RhNVX 62G4YXJUJqt8giIfg09oCAoYrDUtOKfgOqwnfAR5ChYkRkXcnCkzSZzt4ScpuqJ77Tk0 8P0gOB8RJLfUp+O+iMNqG5Gn17W7Hidl6r0MFhJ4KVTB3Sw09zfS5k+p3NZbVYvMJUeD kA5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=akngYKBl; 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 d8-20020a056a0024c800b0065930ad0643si6364451pfv.79.2023.06.26.20.51.18; Mon, 26 Jun 2023 20:51:30 -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=akngYKBl; 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 S230284AbjF0D3j (ORCPT <rfc822;nicolai.engesland@gmail.com> + 99 others); Mon, 26 Jun 2023 23:29:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjF0D2V (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Jun 2023 23:28:21 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 344622115; Mon, 26 Jun 2023 20:23:01 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-25f0e0bbcaaso1934878a91.3; Mon, 26 Jun 2023 20:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687836180; x=1690428180; 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=1RKpz5HBE9JLrRBFLWv7AJFc4wm2/SCXversK+BtfEc=; b=akngYKBlJ50MAGPqRAGc1r0u1GU6Eqd/kAPm+PCdK8pSl+BholJ8W5Lz/XKnrwxX/f XnfqQZCHFL4E3BVGKY1SMlHs+NQCxB9766HYFgLJNBCA3n+GCUq9PX3hcptZdmN/GDK0 eTp9qy4HkSuMUg7ntO6H+3RPeDxLRQiG7+OJP1ePF1Yv3QhuQVsG52hTKdJaNcqZSxNK BKLbEut+IXrScoi0AeaKz3UqI2w/QVgciZFaj/fKtxcWnAi1BRBz1StRmLXlilAAK0uy 8I6YPeJAJwukwzJWe+IQJvM4W19WDMFMZ+Grkr6xjMFE0uoIkwKl4JiHb6muyR0mc1Xq nP7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687836180; x=1690428180; 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=1RKpz5HBE9JLrRBFLWv7AJFc4wm2/SCXversK+BtfEc=; b=KZ5lrT1SWyVJJc4vNXmzflQch5kP/Y35+31v3Xhx0X+p3q5aacs/+sol4vKtNQFqjs 9QMk+eYyiGnGCVVbkEChKzDeP9Ictr+DBDNmlHwAV3i9z9OVm+yRj+f/qwlYeve4vHBg 43RB0gp+kgcY3ilsDTVjwBOQrCR14ynAqgYEWOo5az+kbLIHNS9lVLsbbkYIDeiWTzMU 1hVAj7wGjEH33tvvSpQea61ztlAMulC5xkKOFezVNyiZctWzDgPkJQNPq9nzinBg/LjZ /CNbXpftntwT9IBGdetvzOLZQZGjrZHiNW2NEkiq9dma/zikBDXjyAn8AZLuBGIoAMWJ 6d4Q== X-Gm-Message-State: AC+VfDz5o/OZTZJai/t7Z+Ta1Kj9xy52gdbqy7QyenfciypMcrMPPXPL eaUazSZmgh9rKP2EU3pHayw= X-Received: by 2002:a17:90a:354:b0:263:14fc:f9a6 with SMTP id 20-20020a17090a035400b0026314fcf9a6mr787598pjf.14.1687836180547; Mon, 26 Jun 2023 20:23:00 -0700 (PDT) Received: from ubuntu-Virtual-Machine.corp.microsoft.com ([2001:4898:80e8:37:c5e9:2003:6c97:8057]) by smtp.gmail.com with ESMTPSA id mm12-20020a17090b358c00b0025ec54be16asm618756pjb.2.2023.06.26.20.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 20:23:00 -0700 (PDT) From: Tianyu Lan <ltykernel@gmail.com> 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 <tiala@microsoft.com>, linux-arch@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, vkuznets@redhat.com Subject: [PATCH V2 6/9] clocksource: hyper-v: Mark hyperv tsc page unencrypted in sev-snp enlightened guest Date: Mon, 26 Jun 2023 23:22:44 -0400 Message-Id: <20230627032248.2170007-7-ltykernel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230627032248.2170007-1-ltykernel@gmail.com> References: <20230627032248.2170007-1-ltykernel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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?1769826304362761505?= X-GMAIL-MSGID: =?utf-8?q?1769826304362761505?= |
Series |
x86/hyperv: Add AMD sev-snp enlightened guest support on hyperv
|
|
Commit Message
Tianyu Lan
June 27, 2023, 3:22 a.m. UTC
From: Tianyu Lan <tiala@microsoft.com> Hyper-V tsc page is shared with hypervisor and mark the page unencrypted in sev-snp enlightened guest when it's used. Signed-off-by: Tianyu Lan <tiala@microsoft.com> --- drivers/clocksource/hyperv_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
From: Tianyu Lan <ltykernel@gmail.com> Sent: Monday, June 26, 2023 8:23 PM > > Hyper-V tsc page is shared with hypervisor and mark the page > unencrypted in sev-snp enlightened guest when it's used. > > Signed-off-by: Tianyu Lan <tiala@microsoft.com> > --- > 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 bcd9042a0c9f..66e29a19770b 100644 > --- a/drivers/clocksource/hyperv_timer.c > +++ b/drivers/clocksource/hyperv_timer.c > @@ -376,7 +376,7 @@ EXPORT_SYMBOL_GPL(hv_stimer_global_cleanup); > 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; > -- > 2.25.1 Reviewed-by: Michael Kelley <mikelley@microsoft.com>
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c index bcd9042a0c9f..66e29a19770b 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -376,7 +376,7 @@ EXPORT_SYMBOL_GPL(hv_stimer_global_cleanup); 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;