Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2657419imu; Sun, 9 Dec 2018 06:36:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/WQwZgO2o2vNAsc+mUzwzYgN0ESuo1nopFR3UQwW6bjp2UEilqR5GCtSfBoaz8BJx208GtL X-Received: by 2002:a17:902:28aa:: with SMTP id f39mr8883598plb.297.1544366185573; Sun, 09 Dec 2018 06:36:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544366185; cv=none; d=google.com; s=arc-20160816; b=nNm6oeyYbaLhH/KQuzo79qYAwRDrNlJsV+lAqToxoZmCtlPUfSc+jR72Cgz8wC20En hsi2wBj6Qb4XwHaMP7pXDgtWGohuyDaeNSvDIfzQHOzhlrANPkkImlRWF7ak8cN2g9r5 cIuP4wvUEjtZeKbYT/hWPATc7OyUON7/+co22UCKYF8DCxG67kRT3xqZ42hdgRZvFSGM jyuO3wJJeVcEpQhQSghCht5WDwkTrPs/XglWH8CrGO5w73nLP38YkJmjqQLk75ER0tLc akbHpYAuFhXxvr1jldN295P77/CTqb2uIUvXBgT1UsIjh2KfGfl4e9IOUoWrDjyssRul Uq7A== 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:openpgp:from:references:cc:to:subject:dkim-signature; bh=2YYL6SdlsnS8LvEcJiSWWic8y/Sq1+/soioBhtb8wzs=; b=v6AVD5rKHaOEHPG/fYYDxvdZm+8f7JFrWmPq1dEw1VAbEL7jGkWcSZioACstOlmb9E 1vw/3AB5pm1GuzFfdxIE53uQeoLf2qu6TvFzGVLhh2o61gjB5IYrjHmYunKlYk7RYaBI WhlhLTrMYbvybbDiFctW10T+upA4yqWYYZr71g5aA5ymwGAXjOfyHo6HUFF0Ln2nkQVb +Zft5f52nT5NLYhMNGSPWgOnCdbo5TGkLc9VPk1FFROOPTcattNFrouqlEZZCUQ3xdH9 2VPps+URBE5dO/7cemDdX0DJif8p9QvdH2RIkRnOVrxnhDmmTyk70l7ZK6SLuKTLPkQR r/ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNxikBmU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si7449269pgk.217.2018.12.09.06.36.10; Sun, 09 Dec 2018 06:36:25 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=YNxikBmU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726297AbeLIOfX (ORCPT + 99 others); Sun, 9 Dec 2018 09:35:23 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:38414 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbeLIOfX (ORCPT ); Sun, 9 Dec 2018 09:35:23 -0500 Received: by mail-oi1-f196.google.com with SMTP id a77so7022314oii.5 for ; Sun, 09 Dec 2018 06:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2YYL6SdlsnS8LvEcJiSWWic8y/Sq1+/soioBhtb8wzs=; b=YNxikBmUhzEUB88TlmfQ/ifjusKNul17kgrueqVDEBpj+bnexNXVRXxIqvewwhFW8l rjBrv77NC3Ydn93q1mz4cmDvGG1HhYEulOY4Y735hY7fiU46fAeGpmYMBpmlAibJgKXA MaXvr1twFp5iQ0G6ZG8RVk66huqvAaYQc5/o4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2YYL6SdlsnS8LvEcJiSWWic8y/Sq1+/soioBhtb8wzs=; b=SAJrRhPQk6VRda+KzViXFe2kYsTRPWgg+OVNZBzg1Qnp7kDZeLaoMXTxsoNaP7nwNO QeNdnkeacTOUnveGD5D0ZicNqZVMjyQgpLkEyW6jzTwdb0nFfdj1JFm4WEClCqhO0j71 aX1qYhzb6zav/ETWs6KmMhTvmMwihu8NopcXuXySQVQbwq1xAdkkSi4flo0k01BRvXEG z2XaxGPCcU3FkrER1I6zJe09PKdG7+v/6AanOxVr5Zm8REqhy1NL0u9cgF36e0O/4vH1 nxz5+D4fMnYDmEIEW/dBhZjEzdSpN4B98Gexzn39YY1TJU2QW3PsBqwPxVg9kFK/FQzt FS5A== X-Gm-Message-State: AA+aEWb9XfLmj3jS7GxqhzwMHZ/aicEBUo8vFxnLlszlgJ+u1FHXLU7q dSS2sJRrN4xtaY5fNr74hHzqTocwaWUJsg== X-Received: by 2002:aca:4fc5:: with SMTP id d188mr5225860oib.138.1544366121805; Sun, 09 Dec 2018 06:35:21 -0800 (PST) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id r9sm5001224otq.81.2018.12.09.06.35.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 06:35:21 -0800 (PST) Subject: Re: [PATCH v6 03/13] arm64/kvm: consistently handle host HCR_EL2 flags To: Kristina Martsenko , linux-arm-kernel@lists.infradead.org Cc: Adam Wallis , Amit Kachhap , Andrew Jones , Ard Biesheuvel , Catalin Marinas , Christoffer Dall , Cyrill Gorcunov , Dave P Martin , Jacob Bramley , Kees Cook , Marc Zyngier , Mark Rutland , Ramana Radhakrishnan , Suzuki K Poulose , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <20181207183931.4285-1-kristina.martsenko@arm.com> <20181207183931.4285-4-kristina.martsenko@arm.com> From: Richard Henderson Openpgp: preference=signencrypt Message-ID: <78a88508-7145-d58e-6275-937e1b23baa5@linaro.org> Date: Sun, 9 Dec 2018 08:35:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181207183931.4285-4-kristina.martsenko@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 12/7/18 12:39 PM, Kristina Martsenko wrote: > From: Mark Rutland > > In KVM we define the configuration of HCR_EL2 for a VHE HOST in > HCR_HOST_VHE_FLAGS, but we don't have a similar definition for the > non-VHE host flags, and open-code HCR_RW. Further, in head.S we > open-code the flags for VHE and non-VHE configurations. > > In future, we're going to want to configure more flags for the host, so > lets add a HCR_HOST_NVHE_FLAGS defintion, and consistently use both > HCR_HOST_VHE_FLAGS and HCR_HOST_NVHE_FLAGS in the kvm code and head.S. > > We now use mov_q to generate the HCR_EL2 value, as we use when > configuring other registers in head.S. > > Signed-off-by: Mark Rutland > Signed-off-by: Kristina Martsenko > Reviewed-by: Christoffer Dall > Cc: Catalin Marinas > Cc: Marc Zyngier > Cc: Will Deacon > Cc: kvmarm@lists.cs.columbia.edu > --- > arch/arm64/include/asm/kvm_arm.h | 1 + > arch/arm64/kernel/head.S | 5 ++--- > arch/arm64/kvm/hyp/switch.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~