Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3949831ybc; Thu, 21 Nov 2019 16:55:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxBrk8HNTSrcXPm/9aaWOGziM5GR2VL1+WmJZ21jlCVNC/CPDMFT4Mbkp3czhWXclFSASo5 X-Received: by 2002:a17:906:4b48:: with SMTP id j8mr18078383ejv.101.1574384118604; Thu, 21 Nov 2019 16:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574384118; cv=none; d=google.com; s=arc-20160816; b=zqsu9xrSYQLkpUUkVSpbqe9yHbjx/XN4Aj0h4ij1eASA4NhycaUNowMernlerzuWtw 8+44Vks+MeC/PCZ2LdLEel3Wa0bUpH3kh/M/u1hCeUBtgljZVCXjYrc9Iurcbxcx4cna M4SGmaCDJs3fBJuQJO8Cv1E8ddbaJS3cuNM4OTRFZjXI+79qu0IEId7bPIqZTI9Wwy/n Y3Wiml2S+8Q/8uW/EYRSNMh60/AbRJmNFjIiRSHcAvwx4xru6vK0J1gqMWAb1wujAl3F WdHEJSCHLFL1Mdt+1m9DdFAK9s7vAxm+b60V7e8QHAFqJvgONun1GHf2jHUN/x2OGHm0 GUpQ== 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:dkim-signature; bh=m8abUx8pSYpn1hn5D1w1GLb8aL+UUj0d2TyW9NfUG1g=; b=CLmYBuwKe6R79ObBAW5I1XKky3iUtDp34xtYeKzO6lJEoUPqC7bDdGcj64/Ak4mLus F9IUF2Sdvj5rBnWw056ZCtoa6hVyVaNyI3Q+Wrdx6NLEiAoPs1xlcvc9MKJmRD2QHM2i 5UFk/DYQcHDBEmZjXWlvq1+Zrb4PbH5j36OW+oovQ3HlbKVYESyGmOIMA7ySAAMf+i1e hur9cqbPA1p/UZ2ZvQEWtiKT2xKQaN/kbvohh/+bVFNagAmYQcP5a7jDHuRB2rNmn5AA JGiB7T0/toXJlfXGcjrWIqZ65QxmLRnFTqn1zaeT07wS/xxMv6WCwCoftmE5T8vx4oP3 bqbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QDvDXbAX; 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=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si3526570edm.382.2019.11.21.16.54.54; Thu, 21 Nov 2019 16:55:18 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QDvDXbAX; 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=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbfKVAxr (ORCPT + 99 others); Thu, 21 Nov 2019 19:53:47 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:36596 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfKVAxr (ORCPT ); Thu, 21 Nov 2019 19:53:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m8abUx8pSYpn1hn5D1w1GLb8aL+UUj0d2TyW9NfUG1g=; b=QDvDXbAXyOJq5lNNXeptcbMNI k0VOOqaMtYLgAsH3CMe5FWVVhuAK2Q6LNZOjK4odsCCM1Nt3Phq7R9wp5OcXjYdvnMflj6mnI7PBH dreG7wO50Wn1ZumhGlCeC8+ee4x0AIVreVJfffqnZrOUdAp8rmWQn7FKqJ0zTt6qON6JBxm6hrCt1 baCBq+6gHLQ5/6oHlov+evlBhdaxnQmYoDOR7ren/sR9HvX04+IDgURZAcqSXWAvj7spzEslGG+1J jWNum5v1ebB+VbwhXd7tlF/z5W43Q2emlgEDWrOQsUTIHov/zb7VRYJSryVEAPmFGjGs0rB2hZ65Y SdDtKL8Sg==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:38760) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iXxCJ-0001kC-NV; Fri, 22 Nov 2019 00:53:19 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1iXxCC-0003Dm-2F; Fri, 22 Nov 2019 00:53:12 +0000 Date: Fri, 22 Nov 2019 00:53:12 +0000 From: Russell King - ARM Linux admin To: Pavel Tatashin Cc: Mark Rutland , Catalin Marinas , stefan@agner.ch, Masahiro Yamada , Will Deacon , boris.ostrovsky@oracle.com, Sasha Levin , sstabellini@kernel.org, James Morris , Linux ARM , xen-devel@lists.xenproject.org, Vladimir Murzin , Marc Zyngier , alexios.zavras@intel.com, Thomas Gleixner , allison@lohutok.net, jgross@suse.com, steve.capper@arm.com, Greg Kroah-Hartman , LKML , James Morse , info@metux.net Subject: Re: [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call Message-ID: <20191122005311.GI25745@shell.armlinux.org.uk> References: <20191121184805.414758-1-pasha.tatashin@soleen.com> <20191121184805.414758-2-pasha.tatashin@soleen.com> <20191122002258.GD25745@shell.armlinux.org.uk> <20191122003403.GG25745@shell.armlinux.org.uk> <20191122003524.GH25745@shell.armlinux.org.uk> 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 Thu, Nov 21, 2019 at 07:39:22PM -0500, Pavel Tatashin wrote: > > > That may be, but be very careful that you only use them in ARMv7-only > > > code. Using them elsewhere is unsafe as the domain register is used > > > for other purposes, and merely blatting over it (as your > > > uaccess_enable and uaccess_disable functions do) is unsafe. > > > > In fact, I'll turn that into a bit more than a suggestion. I'll make > > it a NAK on adding them to 32-bit ARM. > > > > That's fine, and I also did not want to change ARM 32-bit. But, do you > have a suggestion how differentiate between arm64 and arm in > include/xen/arm/hypercall.h without ugly ifdefs? Sorry, I don't. I'm surprised ARM64 doesn't have anything like that, but I suspect that's because they don't need to do a save/restore type operation. Whereas, 32-bit ARM does very much need the save/restore behaviour (although not in this path.) The problem is, turning uaccess_enable/disable into C code means that it's open to being used elsewhere in the kernel (ooh, a couple of useful looking functions that work on both architectures! I can use that too!) and then we end up with stuff breaking subtly. It's the potential for subtle breakage that is making me NAK the idea of adding the inline C functions. Given the two have diverged, the only answer is ifdefs, sorry. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up