Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp267203pxt; Wed, 4 Aug 2021 10:34:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRhoHQD7qKcWKEOveks4No55/90uPEUUWnnb9PJ9nIaeBwS4kKnmdLMFlDOJGtu/DRMWYj X-Received: by 2002:a02:9385:: with SMTP id z5mr522168jah.95.1628098477059; Wed, 04 Aug 2021 10:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628098477; cv=none; d=google.com; s=arc-20160816; b=zazuNl0pay2r0n60MttcQ+bvsnnYaeJO+yxtl1CTkIf8krUVtacqXX1zsFmq8lcnWy exaHZyB8i184opKBt1eP2ZI6dYK7TJADnxBEFcOIBAi4x0/ZYRlHv99+4y5fHQWq9nmu ZZAQEdhfJcl/RC6kIspIxutY9GulaKwEzC7jobqD1G9h/7jrIV2+Ij3ff0Oq3ABcHgtU QEAlu5bIv9wWbTRbu4UvjYDgi2rhfPfm5RYu1mBGMWNQoCKuFlrPHwoiPVsVzZrHqgyQ Us5R+NV6YjEDNra1a04E6JNjVqpIqnXyWS/56aVf1CxNHJqGkvJNjy+0M27ZnUfUy0Ly bXig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=A3YHHdNQhQUPqpOyWucLW8OhP5ZvpbmVO6o/+w7Bn+c=; b=r08WBPQ3EM0G5VLgbFanLLJcr/1AKDrBSxFNlxnYJ+e9upLGHxAZtlTxCp7/xlmMcN E40fpTA+e08rFjE0QjjpoikSGUtWXjMAdAmT6eN2kBwseLgO3Dl8pT7eGThSE4BSSTOA 6YZfH3dCJOi6fny3bUlSGN2nUo5ChnTC5ie2CGAKCo+mevcA2BUXc4g/e268Ob9uPG3l D738PDDU0vgPrHK7AY0VGkmd4bztZGG4Y3ekc1PQFEFuGy+PLllI4k5dnlX5GSeGGdOa Iwhaq1WJ0+fcR3trYb4kNpT0m11Am/XymIgZzQBRqHO5z68VolVOtr1Gxg5trlGUu78w 5OeA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si2541801ioc.54.2021.08.04.10.34.24; Wed, 04 Aug 2021 10:34:37 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237102AbhHDMVK (ORCPT + 99 others); Wed, 4 Aug 2021 08:21:10 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:45634 "EHLO mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236370AbhHDMVK (ORCPT ); Wed, 4 Aug 2021 08:21:10 -0400 Received: by mail-wm1-f51.google.com with SMTP id l11-20020a7bcf0b0000b0290253545c2997so1330702wmg.4; Wed, 04 Aug 2021 05:20:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A3YHHdNQhQUPqpOyWucLW8OhP5ZvpbmVO6o/+w7Bn+c=; b=Rc+bYEA5OGyBlpKPYJaLaXQqxcwcgjBdpImuyuJtmzILo3wWb4sDDOB18JR3sLaZ9C R6780TiqBjVWXJVmm4ecOXgY7AKkyM54X3cb2CgeuSqF6ekc0R47XYcLS7HvM3wI3XRf +0TiJFls4UPGPgsN3uo+JW6ZfZJxpinb9ApDyEt+XVpvgkaLx1mUgLhslSfMfQEIWJQ9 vVD5371078JWqiUKdkcWH1IwM1AdjqA1/jpkrvNMpGsMtWr2AChLy1S/mgMQWfB2FBCo 1W5RfjEnK9dgj7Ed+An08NPh+6SroFPH4KxQTxYYBd+c0NlFLTL5nNDac2r+42yoMT7Z D4kQ== X-Gm-Message-State: AOAM530l27GogIOsvtTiIeMmoRskjbkxhRZbG/aJcmMPEIJyQ/K+2uCn IQD0wEzKEUB831IrKtwM/g8= X-Received: by 2002:a1c:c91a:: with SMTP id f26mr27416713wmb.162.1628079656210; Wed, 04 Aug 2021 05:20:56 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id j36sm5385370wms.16.2021.08.04.05.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 05:20:55 -0700 (PDT) Date: Wed, 4 Aug 2021 12:20:54 +0000 From: Wei Liu To: Praveen Kumar Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, viremana@linux.microsoft.com, sunilmut@microsoft.com, nunodasneves@linux.microsoft.com Subject: Re: [PATCH v5] hyperv: root partition faults writing to VP ASSIST MSR PAGE Message-ID: <20210804122054.2iqcdukdx6a3x54t@liuwe-devbox-debian-v2> References: <20210731120519.17154-1-kumarpraveen@linux.microsoft.com> <20210802125133.ci2jlg32mdfd5xds@liuwe-devbox-debian-v2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210802125133.ci2jlg32mdfd5xds@liuwe-devbox-debian-v2> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 02, 2021 at 12:51:33PM +0000, Wei Liu wrote: > On Sat, Jul 31, 2021 at 05:35:19PM +0530, Praveen Kumar wrote: > > For Root partition the VP assist pages are pre-determined by the > > hypervisor. The Root kernel is not allowed to change them to > > different locations. And thus, we are getting below stack as in > > current implementation Root is trying to perform write to specific > > MSR. > > > > [ 2.778197] unchecked MSR access error: WRMSR to 0x40000073 (tried to > > write 0x0000000145ac5001) at rIP: 0xffffffff810c1084 > > (native_write_msr+0x4/0x30) > > [ 2.784867] Call Trace: > > [ 2.791507] hv_cpu_init+0xf1/0x1c0 > > [ 2.798144] ? hyperv_report_panic+0xd0/0xd0 > > [ 2.804806] cpuhp_invoke_callback+0x11a/0x440 > > [ 2.811465] ? hv_resume+0x90/0x90 > > [ 2.818137] cpuhp_issue_call+0x126/0x130 > > [ 2.824782] __cpuhp_setup_state_cpuslocked+0x102/0x2b0 > > [ 2.831427] ? hyperv_report_panic+0xd0/0xd0 > > [ 2.838075] ? hyperv_report_panic+0xd0/0xd0 > > [ 2.844723] ? hv_resume+0x90/0x90 > > [ 2.851375] __cpuhp_setup_state+0x3d/0x90 > > [ 2.858030] hyperv_init+0x14e/0x410 > > [ 2.864689] ? enable_IR_x2apic+0x190/0x1a0 > > [ 2.871349] apic_intr_mode_init+0x8b/0x100 > > [ 2.878017] x86_late_time_init+0x20/0x30 > > [ 2.884675] start_kernel+0x459/0x4fb > > [ 2.891329] secondary_startup_64_no_verify+0xb0/0xbb > > > > Since, the hypervisor already provides the VP assist page for root > > partition, we need to memremap the memory from hypervisor for root > > kernel to use. The mapping is done in hv_cpu_init during bringup and > > is unmaped in hv_cpu_die during teardown. > > > > Signed-off-by: Praveen Kumar > > Looks good. I can fix a few styling issues in code and comments when I > commit this patch. Applied to hyperv-next. Thanks. Wei. > > Wei.