Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3574059img; Mon, 25 Mar 2019 13:05:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmtiPGd5xPLEt8LN4GG5smvheXyvCVlitr/38SUF/ciRQq4mXhNybrCKDmkd4b2/PFKLH6 X-Received: by 2002:a63:c45:: with SMTP id 5mr17854504pgm.385.1553544327336; Mon, 25 Mar 2019 13:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553544327; cv=none; d=google.com; s=arc-20160816; b=Etz7x7lKpoFHRE2WJ+hiyfpaoZcrPQfM2Bd3v6dQusIn/zED4ccJR6ieuuIt3J2dpP htWZeoVkmmd/D/heuzGnCqBEodxvNZ8KHbpkXa5T82QX3ZpHDT82MOHHxE+HIrSoCyy9 /8dVAMfyZDyo9CY20+8THDVsyXlFaNtfj4B+9zMwhouwKhd16lvktmdpsCS20L+2TR+k 8w8vMll2g2knPYJWy2eszZ69WjfeXoKH8pvn6S/JQum1QBaXeJaAKtSIx3m0kkO2QwdM fGHYCxdlVDJFs47072t6ZqKggX/u7ZWadeLzCQcqYelsOlYAXmS30r7wgojZwuZD/5BC ARdw== 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:references:cc:to:subject:from; bh=q+yukphVJSCEJl9gXPDsvEA+6nB5RmRFrKBA5Hvptbs=; b=QGWvAXp3uC5QvUSZKjtsYRU9RlHzSkajqa0l9nVnzaqtkXSUoHR5CIPFsXijUMfq63 ZSNQzWChx305HurvfDDXmOXpBIVp7Li1ExH1Np8tsF+JAT7USqd5iM1AvUCFFxdGgpXp GAfMWbhyf4kiikn+gxq2gE5fwYczzPcCS9nX7Fb/891iG87apvvbzI8qlTtZZy3+tLjk 08g8JGVNgN9qYwDlvO1AMsGsbP/E4kF1+Ao5LB8W5kxMNTHo385E5mPlElRE3E2QEbxY R7N34KRnEKUBpVrnf4nEnX0q/p+ZG9YpcFzYaIXUBUsdng1LBzL5JO9/2ibwF46mQzO0 4h4Q== 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 p1si12789058pls.387.2019.03.25.13.05.12; Mon, 25 Mar 2019 13:05:27 -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 S1730240AbfCYUEK (ORCPT + 99 others); Mon, 25 Mar 2019 16:04:10 -0400 Received: from foss.arm.com ([217.140.101.70]:54550 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728912AbfCYUEK (ORCPT ); Mon, 25 Mar 2019 16:04:10 -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 CB4551596; Mon, 25 Mar 2019 13:04:09 -0700 (PDT) Received: from [10.1.197.21] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CB833F59C; Mon, 25 Mar 2019 13:04:07 -0700 (PDT) From: Kristina Martsenko Subject: Re: [PATCH v7 5/10] KVM: arm/arm64: preserve host MDCR_EL2 value To: Amit Daniel Kachhap , 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> Message-ID: <19c2bdb3-6917-286e-3f2a-35fd71f69f51@arm.com> Date: Mon, 25 Mar 2019 20:04:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1552984243-7689-6-git-send-email-amit.kachhap@arm.com> Content-Type: text/plain; charset=utf-8 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 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. Thanks, Kristina