Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3932423ybc; Thu, 21 Nov 2019 16:32:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyB+AH3k7UO54RAC5jERFXphZYjvyFTyx32D2NPxnR0UY7S7qeoL6eI1dvJLADc1HC1wG9i X-Received: by 2002:a17:906:601:: with SMTP id s1mr17913602ejb.287.1574382764589; Thu, 21 Nov 2019 16:32:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574382764; cv=none; d=google.com; s=arc-20160816; b=AVhq2nvcH0MdLe1O1N9yY8TusNGwfxIWnut00SvdH2+DlvPtxWkfeqNqn/aXxfwN97 dMTZMhG5jNW7nIoZE59zaWPeD0HwCD2UIDY1QL9RHi5JX8fBLSWWl9tynljUMh/xrote 4VLRSVi2p0UNeAyjj+kgZ0wyj3Fx+bwtU5/gkaqp8GB2Y5Z09K6mrcENT8tZ9gD4kzLU MVCUPvmTI9d7zygg/VMzq18zTc5RGSB26ukHcnKeIqe4dkLAKd47Chd+rOkYH3hWR6+x h0nYPRVt/wzoOwW0ZJsO5dL6w6dcP+E9fBiDcFFeTCKOxEZkSrUR+tZJOYQw9PIKc4Vr H+CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=p8S5GRxfxB7MPCj+Eww2v+N3SSDa3SwY872hQxbGyeE=; b=YS0gL+Bo4hiGisl5n6FydgGkI3JUsVqN/SKEOBdeqo5IMDiE3qqRM5ISqw9c6u5rds J73zQW/VuSZF/BTahDcovg+ZP5EmAdGlkZYZJjXxuq4h/IV8wqDIZcBfApCGGEJU6omN WRi9iapSHq/FuC9Ppr1t/rJhvaLBRcTIUCxCZ9RX365RB7uHVknUrr71/bfMqNH+M4Jx bha9l9KaqY0D80FxSvrPEkFxn4yYJ2fb4355jNuVYIOjRs/A4ZONACDi6Wq57yIxR3bX 9oDfpWYhxVgbqJ4RVzd4hU4laAh56NSs8anXEKJJ50fGquT3/PhULiFa2B1MfFO2Yw/J A6Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=SwDeNapr; 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 h21si583358edb.20.2019.11.21.16.31.55; Thu, 21 Nov 2019 16:32:44 -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=@soleen.com header.s=google header.b=SwDeNapr; 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 S1726510AbfKVAay (ORCPT + 99 others); Thu, 21 Nov 2019 19:30:54 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:43104 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfKVAax (ORCPT ); Thu, 21 Nov 2019 19:30:53 -0500 Received: by mail-ed1-f67.google.com with SMTP id w6so4425149edx.10 for ; Thu, 21 Nov 2019 16:30:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p8S5GRxfxB7MPCj+Eww2v+N3SSDa3SwY872hQxbGyeE=; b=SwDeNapr8C2hZtNWi6QBd3lpU7IbLJ10rTgPoY37OuwGIIHILjqN8ZXIj83SFbbr7g YzAi6ZwttEnHRQxMLHdr0KR362IBbLpoJ5EQeuCtrhGYhqHmbxJ2UblkssOkCiA4sPgS Rml0Bkr1b8tqWCIvh+G9oBFMyxor3gMwJDbS/53jn8rJ3kmsZTBXA1PjvNfIKfTdTwLC wF3jnFSC3C9BdMkjWYAGvnrnEMotMC0HvDkDZ3uMzOkU+lr7w1aQmLJPPyOQb/OkjBFA PHVlsE9Glij+peO87AM8pBwdkmSWP8tNYMCmSsqv0mrQedYRcQNccHHzELqAuMzRn8/g 566A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p8S5GRxfxB7MPCj+Eww2v+N3SSDa3SwY872hQxbGyeE=; b=CEIU/AhVR7k+Y1PUaLkaowExjkSgp89axzGMbYtZ8+Td8ADrA9T3bEqme1h7RCdyXc 7wAL0eDypyf6n8N46/siV4XJE5R/LlV7wTv/2PUOIfLfKe7w6XgtY9l5ZQyf4b3tMqpt wgGCRi45HUZLNBKpW9VXO56him1fGWAlb9lpl1muJ446/4HTVbEZi33LNzQ+zoNZ3RfA uf7dL+km3m+z+Agopy/u78aKOOZM8nGtJ1YNhQhclOxBG7Di0CW0UbbKv3n9LRoeI+62 5R4AGXlAUlQocIaBzQOsbUAQaXqM0iPbLHwVatkXtldPvhaMblNIpdHjcCeCjc0rU0ll QXeQ== X-Gm-Message-State: APjAAAU2g4T04GL70CNeCSgxdAT72hIGEHKe76HkFg1YxCY+1scWNdIX EgLZ5KGgBRh4qVTPsSdHb5iNS6cfoQ+7nlzFj59IaA== X-Received: by 2002:a17:906:90b:: with SMTP id i11mr18003315ejd.109.1574382651825; Thu, 21 Nov 2019 16:30:51 -0800 (PST) MIME-Version: 1.0 References: <20191121184805.414758-1-pasha.tatashin@soleen.com> <20191121184805.414758-2-pasha.tatashin@soleen.com> <20191122002258.GD25745@shell.armlinux.org.uk> In-Reply-To: <20191122002258.GD25745@shell.armlinux.org.uk> From: Pavel Tatashin Date: Thu, 21 Nov 2019 19:30:41 -0500 Message-ID: Subject: Re: [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call To: Russell King - ARM Linux admin Cc: James Morris , Sasha Levin , LKML , Catalin Marinas , Will Deacon , steve.capper@arm.com, Linux ARM , Marc Zyngier , James Morse , Vladimir Murzin , Mark Rutland , Thomas Gleixner , Greg Kroah-Hartman , allison@lohutok.net, info@metux.net, alexios.zavras@intel.com, sstabellini@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, stefan@agner.ch, Masahiro Yamada , xen-devel@lists.xenproject.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +#ifdef CONFIG_CPU_SW_DOMAIN_PAN > > +static __always_inline void uaccess_enable(void) > > +{ > > + unsigned long val = DACR_UACCESS_ENABLE; > > + > > + asm volatile("mcr p15, 0, %0, c3, c0, 0" : : "r" (val)); > > + isb(); > > +} > > + > > +static __always_inline void uaccess_disable(void) > > +{ > > + unsigned long val = DACR_UACCESS_ENABLE; Oops, should be DACR_UACCESS_DISABLE. > > + > > + asm volatile("mcr p15, 0, %0, c3, c0, 0" : : "r" (val)); > > + isb(); > > +} > > Rather than inventing these, why not use uaccess_save_and_enable().. > uaccess_restore() around the Xen call? Thank you for suggestion: uaccess_enable() and uaccess_disable() are common calls with arm64, so I will need them, but I think I can use set_domain() with DACR_UACCESS_DISABLE /DACR_UACCESS_ENABLE inside these inlines. Pasha