All of lore.kernel.org
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/3] arm64: KVM: Enable Common Not Private translations
Date: Wed, 23 May 2018 18:11:44 +0100	[thread overview]
Message-ID: <20180523171144.wiijmioqn4zl3ccx@armageddon.cambridge.arm.com> (raw)
In-Reply-To: <1526638022-4137-3-git-send-email-vladimir.murzin@arm.com>

On Fri, May 18, 2018 at 11:07:01AM +0100, Vladimir Murzin wrote:
> diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
> index a4c1b76..9a651a2 100644
> --- a/virt/kvm/arm/arm.c
> +++ b/virt/kvm/arm/arm.c
> @@ -472,7 +472,7 @@ static bool need_new_vmid_gen(struct kvm *kvm)
>  static void update_vttbr(struct kvm *kvm)
>  {
>  	phys_addr_t pgd_phys;
> -	u64 vmid;
> +	u64 vmid, cnp = kvm_cpu_has_cnp() ? 1 : 0;

Please define a VTTBR_CNP_BIT here instead of a hard-coded value.

>  	bool new_gen;
>  
>  	read_lock(&kvm_vmid_lock);
> @@ -522,7 +522,7 @@ static void update_vttbr(struct kvm *kvm)
>  	pgd_phys = virt_to_phys(kvm->arch.pgd);
>  	BUG_ON(pgd_phys & ~VTTBR_BADDR_MASK);
>  	vmid = ((u64)(kvm->arch.vmid) << VTTBR_VMID_SHIFT) & VTTBR_VMID_MASK(kvm_vmid_bits);
> -	kvm->arch.vttbr = kvm_phys_to_vttbr(pgd_phys) | vmid;
> +	kvm->arch.vttbr = kvm_phys_to_vttbr(pgd_phys) | vmid | cnp;
>  
>  	write_unlock(&kvm_vmid_lock);
>  }

-- 
Catalin

  reply	other threads:[~2018-05-23 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 10:06 [PATCH v4 0/3] Support Common Not Private translations Vladimir Murzin
2018-05-18 10:07 ` [PATCH v4 1/3] arm64: mm: " Vladimir Murzin
2018-06-08 17:44   ` James Morse
2018-05-18 10:07 ` [PATCH v4 2/3] arm64: KVM: Enable " Vladimir Murzin
2018-05-23 17:11   ` Catalin Marinas [this message]
2018-06-08 17:44   ` James Morse
2018-05-18 10:07 ` [PATCH v4 3/3] arm64: Introduce command line parameter to disable CNP Vladimir Murzin
2018-05-23 17:17   ` Catalin Marinas
2018-05-24  8:20     ` Vladimir Murzin
2018-06-08 17:44       ` James Morse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180523171144.wiijmioqn4zl3ccx@armageddon.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.