Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3865702img; Mon, 25 Mar 2019 20:56:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkaHCvcKhOIRW9p2TxbTsnbTgekX44vvWDtfibU+EkLFqugfBqisqxPYkK4vKNBv/JsZSm X-Received: by 2002:a63:360e:: with SMTP id d14mr13563820pga.188.1553572598429; Mon, 25 Mar 2019 20:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553572598; cv=none; d=google.com; s=arc-20160816; b=unz2xfnYdClE90Lt+DIU6sMmOJl8KnDpVG6VCAvDwnRMbpiBmUKAxlnXXEXwXCYQje 3fF5knsFcjo3mL1qwtZlo8lxh38Caf7vgpOJGqmj993ozZmW0rozAy0/+swgZrIAs3X+ SwijB0seY4xxa5V2i1PnLiwhfxdkM9reQtlwFGLNAE5sxvLMdWM0f9MjKfKCta14BaCc X+8pgeFH2MHRB0jg43GdB0mWp8rLePU+1vj9AczTvfrlACJ/40C6zxRTStZP2X8bftDC Jpt+XKhUCOK0r1jMDcL+Oap6oP0U+aMCKHkWWjGKfm2gNZxFiRzQSzoApN6F2OFuNdTo pgxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qJE8ht2feA5Zyv+p3854IjMth0vnIOfaPjFJfg46mrM=; b=0GsSR+JtGaE44cBWQvv/fivD/WIgoLRW5puBZTGV3ORWCTX0+fU2wIgKcOS2+aUuJn PMiyRFwTrcGpR4bvpQ+xRckOZc/71XCK57IhrDct9RRToI4gPPOghNNZK5zmatwEitKj 3jpVAiHQ6nb2N2OATWo7IV9y/ZBm1A4VDlk1faP3O8jv94ruVrZmCA+wbfhFmsBvEG3Q sw+1se+6RanppgBzudUmeCWbmqYXk7WfndUgNhShEGV+zo/FdwDEZFKbm9s4i59VocbA XCE5Vtk+rk5dSnowKQQuGSRceb0LGlEuKJvrm7+F5cIdNqNTgSwgi8/r48LD+7OZNaNJ HxUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si14644817pgv.398.2019.03.25.20.56.21; Mon, 25 Mar 2019 20:56:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730559AbfCZDzn (ORCPT + 99 others); Mon, 25 Mar 2019 23:55:43 -0400 Received: from foss.arm.com ([217.140.101.70]:58852 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729681AbfCZDzn (ORCPT ); Mon, 25 Mar 2019 23:55:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9CEC180D; Mon, 25 Mar 2019 20:55:42 -0700 (PDT) Received: from [10.162.0.144] (a075553-lin.blr.arm.com [10.162.0.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6F353F59C; Mon, 25 Mar 2019 20:55:38 -0700 (PDT) Subject: Re: [PATCH v7 5/10] KVM: arm/arm64: preserve host MDCR_EL2 value To: Kristina Martsenko , linux-arm-kernel@lists.infradead.org Cc: Christoffer Dall , Marc Zyngier , Catalin Marinas , Will Deacon , Andrew Jones , Dave Martin , Ramana Radhakrishnan , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Mark Rutland , James Morse , Julien Thierry References: <1552984243-7689-1-git-send-email-amit.kachhap@arm.com> <1552984243-7689-6-git-send-email-amit.kachhap@arm.com> <19c2bdb3-6917-286e-3f2a-35fd71f69f51@arm.com> From: Amit Daniel Kachhap Message-ID: Date: Tue, 26 Mar 2019 09:25:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <19c2bdb3-6917-286e-3f2a-35fd71f69f51@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 3/26/19 1:34 AM, Kristina Martsenko wrote: > On 19/03/2019 08:30, Amit Daniel Kachhap wrote: >> Save host MDCR_EL2 value during kvm HYP initialisation and restore >> after every switch from host to guest. There should not be any >> change in functionality due to this. >> >> The value of mdcr_el2 is now stored in struct kvm_cpu_context as >> both host and guest can now use this field in a common way. >> >> Signed-off-by: Amit Daniel Kachhap >> Acked-by: Mark Rutland >> Cc: Marc Zyngier >> Cc: Mark Rutland >> Cc: Christoffer Dall >> Cc: kvmarm@lists.cs.columbia.edu > > [...] > >> /** >> - * kvm_arm_init_debug - grab what we need for debug >> - * >> - * Currently the sole task of this function is to retrieve the initial >> - * value of mdcr_el2 so we can preserve MDCR_EL2.HPMN which has >> - * presumably been set-up by some knowledgeable bootcode. >> - * >> - * It is called once per-cpu during CPU hyp initialisation. >> - */ >> - >> -void kvm_arm_init_debug(void) >> -{ >> - __this_cpu_write(mdcr_el2, kvm_call_hyp_ret(__kvm_get_mdcr_el2)); >> -} > > The __kvm_get_mdcr_el2 function is no longer used anywhere, so can also > be removed. Nice catch. Will do. Thanks, Amit D > > Thanks, > Kristina >