Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp913608ybi; Fri, 2 Aug 2019 06:23:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnJhGlKREHwEOuLUCepu8G8l3+neuXg4aTPpVSxIeBqVouQK+4DerPVScIhlP4kmOQQ77J X-Received: by 2002:a17:90a:9a95:: with SMTP id e21mr4273728pjp.98.1564752218806; Fri, 02 Aug 2019 06:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564752218; cv=none; d=google.com; s=arc-20160816; b=AhYVGBr9iGSlq2qsUaNBzDwlEs1M7fH4jyetgBKSKFKLwRmSKuiFYcmmkUTCwou5RN xo/lqspWO74mVYT42zOuGmR4QXfjEyEgmGCn8+nj0smJX5zKKEfkmuiIkLrg23bB3VdN Dbn2CaVftatHN/ByNnGXwV65Ts1PKSNkTvmJjYnN2AGyZwyDURbgckl83s9cB0Hsins6 V2767BvvMp3G79APE94TVHDC/J8OcU+8A96/LdztHXDtrWXgXCoj820eAfK7NkNME2/a s8rmoBOWG3s9xt938VfaAUMVkuo4ExGUB1cprHT7Jm7C6D11RzhUk3CLAqtfiMCBeht+ jT1g== 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; bh=qip0/4niVe3t0eqLUXzaEsnThAuuUjr0Sl7TEveH/lY=; b=gFNw2XL58TMuE7Fqcf1MQbDXS6qayBTaVKDeqbDCg+4GpWYqGVwl4znRzoAMUNo1/W ki6VEAMSatA7RJ2EV5DZXV/LT13U784VltfphyWoOTqReEKKMEGzIpUUWPH9ifqnKETY Fvpv9q+y867v6VdTCKaH8p5woKEf2qlg/0NrvCmu8YVBSkFL63Wh1Z5B5QxvLrKnB9VG wFZNWzDKPgmWcxtuQcIRgjfP8aMTLhNg5vu5T6ualVp53sohz0sgf4rBFlvMvOjvi/c2 63l7aBXW02A5CuGWQJ69T4zNr3X8Lx1YT88HRUgDlpxxqNVvhXEYlC5hkOZLvDShgtq2 TWgQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t185si28021677pgb.329.2019.08.02.06.23.23; Fri, 02 Aug 2019 06:23: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730993AbfHBJOp (ORCPT + 99 others); Fri, 2 Aug 2019 05:14:45 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42812 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727127AbfHBJOo (ORCPT ); Fri, 2 Aug 2019 05:14:44 -0400 Received: by mail-wr1-f68.google.com with SMTP id x1so26491015wrr.9 for ; Fri, 02 Aug 2019 02:14:43 -0700 (PDT) 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=qip0/4niVe3t0eqLUXzaEsnThAuuUjr0Sl7TEveH/lY=; b=AiTFJaiI6tqKi/1a34acbIQ3Pwed0GseI1IJ9RnokukPk2PjBDqQkoq8kzPfczs1m0 BX2gNR/M5XBcu7E772nljsvImhDuKVausmo5BxDE4TNYoQDX1/DPclSusaAuMAb1ymyp 1gdqBCs5JWwfIE5KJGhKbbITaoakTNFQ8JhNkUlh0fs1J8VmwuiM2sR6l7DdYOz72v0Z R4TO4UPrq6XmB+Fmq85pkhqSgKf69TgvsCeE2bUkI7Ob8q8Pcj4wrvhdb8ezJ0cpCcXd DMFfdlVRZZGnKWgR9n8441KGnNkhl53CwzNBfHjhDkdvrtmQoY+fsBttZHpIAJQx3WFT B6pw== X-Gm-Message-State: APjAAAXg0Yr1l9boalLMWgmB84SYRE8XeFrl5lMPldioY4Sr4YsyzHQq OT0UMNi3KOpD9VeqXK+Hq2kDJmi2JhA= X-Received: by 2002:adf:e8d0:: with SMTP id k16mr1884801wrn.31.1564737282526; Fri, 02 Aug 2019 02:14:42 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:4013:e920:9388:c3ff? ([2001:b07:6468:f312:4013:e920:9388:c3ff]) by smtp.gmail.com with ESMTPSA id y6sm62931619wrp.12.2019.08.02.02.14.40 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2019 02:14:42 -0700 (PDT) Subject: Re: [RFC PATCH v2 12/19] RISC-V: KVM: Implement stage2 page table programming To: Anup Patel , Palmer Dabbelt , Paul Walmsley , Radim K Cc: Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , Christoph Hellwig , Anup Patel , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20190802074620.115029-1-anup.patel@wdc.com> <20190802074620.115029-13-anup.patel@wdc.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <949b75ef-5ec6-cdfd-5d5d-5695f35bd20c@redhat.com> Date: Fri, 2 Aug 2019 11:14:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190802074620.115029-13-anup.patel@wdc.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 02/08/19 09:48, Anup Patel wrote: > + hgatp |= (k->vmid.vmid << HGATP_VMID_SHIFT) & HGATP_VMID_MASK; This should use READ_ONCE. Paolo > + hgatp |= (k->pgd_phys >> PAGE_SHIFT) & HGATP_PPN;