Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7487127ybi; Mon, 22 Jul 2019 14:14:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx77Ux5OnHNH0X5Zj2LhV+r6R46sXmA6zbV4HlPU4HAtoILyyTiXiGvlA6rLJJAiJKBJOe7 X-Received: by 2002:a63:d941:: with SMTP id e1mr40189924pgj.75.1563830079340; Mon, 22 Jul 2019 14:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563830079; cv=none; d=google.com; s=arc-20160816; b=kss2qybGzq62BOBFDvmSn9tu4YbcXRozny00hFOSETa2420AP7wbUUrfMvKnKbr6om TJj9FByB0KjZyNhgnKtpdXnI2qy5UfyTEhp5l7JUWtJzmxGwJGOrJhUMzWOUF4DfxROb gQmPufYFaYNsRL+ZZkFsuwuB3P57aQfGBM8nmeo95rX0bgT/k5BaYLGZZP/qFDZwdrZi BZO9/opRvY5x5i4npMHTiD7u/dJ2BFNZmFxiyDvSHCzz5Ye9ivn5zlRCuppmfxbMz/7e y9ogXntbqPPTj1t52RVk7ad4qTQhMGQZ3D3YshL9dYMe2oiMrcZ7ywKwTx8x+T2r5waC hBPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fNocDMYrT1KQ4mGX0e56l9y/Fc6mGtJ7+h6ibvZ9LRk=; b=xGsgkKNnFMGD6yjSjdPsLHnrPiQPJiyuB516GvqWxz3Ws9G01sZWWSnSVEpnPQAhCD R8oK7M1B02XUnayGh56l0YvlNJSQ1s5qyWnGqsTnU/4w7ZxGQHbq5oSqHFstOD1O3+Vt XwrDm9yOmmLyf3X+6lgmHAp7pcAfv2UzcT8e5e/+pfLxEooo7H9azTdI5+3cOra/WDDH ZjvJrNhXP7efEpb4vn+njtQ06t+Gu/NpVWKUbp+k60N05YUQ4NO+oIlJCgRKFRfG/18z E+tmdWs7iSk9XxMQv7VzFRiaBr6aiFhOs8HOHoToviTC+o6zgy5fjaFB9JlXWdXPH9Bi bJwQ== 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 l185si9697335pgd.379.2019.07.22.14.14.23; Mon, 22 Jul 2019 14:14:39 -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 S1730530AbfGVQiS (ORCPT + 99 others); Mon, 22 Jul 2019 12:38:18 -0400 Received: from foss.arm.com ([217.140.110.172]:41824 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727731AbfGVQiR (ORCPT ); Mon, 22 Jul 2019 12:38:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E72BF28; Mon, 22 Jul 2019 09:38:16 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C3953F694; Mon, 22 Jul 2019 09:38:14 -0700 (PDT) Date: Mon, 22 Jul 2019 17:38:12 +0100 From: Catalin Marinas To: Guo Ren Cc: Julien Grall , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, aou@eecs.berkeley.edu, gary@garyguo.net, Atish Patra , hch@infradead.org, paul.walmsley@sifive.com, rppt@linux.ibm.com, linux-riscv@lists.infradead.org, Anup Patel , Palmer Dabbelt , suzuki.poulose@arm.com, Marc Zyngier , julien.thierry@arm.com, Will Deacon , christoffer.dall@arm.com, james.morse@arm.com, linux-csky@vger.kernel.org Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file Message-ID: <20190722163811.GJ60625@arrakis.emea.arm.com> References: <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190621141606.GF18954@arrakis.emea.arm.com> <20190624153820.GH29120@arrakis.emea.arm.com> <20190701091711.GA21774@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 16, 2019 at 11:31:27AM +0800, Guo Ren wrote: > I saw arm64 to prevent speculation by temporarily setting TTBR0.el1 to > a zero page table. Is that used to prevent speculative execution user > space code or just prevent ld/st in copy_use_* ? Only to prevent explicit ld/st from user. On ARMv8.1+, we don't normally use the TTBR0 trick but rather disable user space access using the PAN (privileged access never) feature. However, I don't think PAN disables speculative accesses, only explicit loads/stores. Also, with ARMv8.2 Linux uses the LDTR/STTR instructions in copy_*_user() which don't need to disable PAN explicitly. -- Catalin