From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2F1BC432C0 for ; Fri, 22 Nov 2019 00:53:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F34C20674 for ; Fri, 22 Nov 2019 00:53:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="QDvDXbAX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F34C20674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iXxCg-0003Qe-4j; Fri, 22 Nov 2019 00:53:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iXxCf-0003QZ-7F for xen-devel@lists.xenproject.org; Fri, 22 Nov 2019 00:53:41 +0000 X-Inumbo-ID: 84147dde-0cc2-11ea-b678-bc764e2007e4 Received: from pandora.armlinux.org.uk (unknown [2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 84147dde-0cc2-11ea-b678-bc764e2007e4; Fri, 22 Nov 2019 00:53:38 +0000 (UTC) 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Xen-devel] [PATCH 1/3] arm/arm64/xen: use C inlines for privcmd_call X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , stefan@agner.ch, Masahiro Yamada , Will Deacon , Thomas Gleixner , Sasha Levin , sstabellini@kernel.org, James Morris , Linux ARM , xen-devel@lists.xenproject.org, Vladimir Murzin , Marc Zyngier , alexios.zavras@intel.com, boris.ostrovsky@oracle.com, allison@lohutok.net, jgross@suse.com, steve.capper@arm.com, Greg Kroah-Hartman , LKML , James Morse , info@metux.net Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" T24gVGh1LCBOb3YgMjEsIDIwMTkgYXQgMDc6Mzk6MjJQTSAtMDUwMCwgUGF2ZWwgVGF0YXNoaW4g d3JvdGU6Cj4gPiA+IFRoYXQgbWF5IGJlLCBidXQgYmUgdmVyeSBjYXJlZnVsIHRoYXQgeW91IG9u bHkgdXNlIHRoZW0gaW4gQVJNdjctb25seQo+ID4gPiBjb2RlLiAgVXNpbmcgdGhlbSBlbHNld2hl cmUgaXMgdW5zYWZlIGFzIHRoZSBkb21haW4gcmVnaXN0ZXIgaXMgdXNlZAo+ID4gPiBmb3Igb3Ro ZXIgcHVycG9zZXMsIGFuZCBtZXJlbHkgYmxhdHRpbmcgb3ZlciBpdCAoYXMgeW91cgo+ID4gPiB1 YWNjZXNzX2VuYWJsZSBhbmQgdWFjY2Vzc19kaXNhYmxlIGZ1bmN0aW9ucyBkbykgaXMgdW5zYWZl Lgo+ID4KPiA+IEluIGZhY3QsIEknbGwgdHVybiB0aGF0IGludG8gYSBiaXQgbW9yZSB0aGFuIGEg c3VnZ2VzdGlvbi4gIEknbGwgbWFrZQo+ID4gaXQgYSBOQUsgb24gYWRkaW5nIHRoZW0gdG8gMzIt Yml0IEFSTS4KPiA+Cj4gCj4gVGhhdCdzIGZpbmUsIGFuZCBJIGFsc28gZGlkIG5vdCB3YW50IHRv IGNoYW5nZSBBUk0gMzItYml0LiBCdXQsIGRvIHlvdQo+IGhhdmUgYSBzdWdnZXN0aW9uIGhvdyBk aWZmZXJlbnRpYXRlIGJldHdlZW4gYXJtNjQgYW5kIGFybSBpbgo+IGluY2x1ZGUveGVuL2FybS9o eXBlcmNhbGwuaCB3aXRob3V0IHVnbHkgaWZkZWZzPwoKU29ycnksIEkgZG9uJ3QuCgpJJ20gc3Vy cHJpc2VkIEFSTTY0IGRvZXNuJ3QgaGF2ZSBhbnl0aGluZyBsaWtlIHRoYXQsIGJ1dCBJIHN1c3Bl Y3QKdGhhdCdzIGJlY2F1c2UgdGhleSBkb24ndCBuZWVkIHRvIGRvIGEgc2F2ZS9yZXN0b3JlIHR5 cGUgb3BlcmF0aW9uLgpXaGVyZWFzLCAzMi1iaXQgQVJNIGRvZXMgdmVyeSBtdWNoIG5lZWQgdGhl IHNhdmUvcmVzdG9yZSBiZWhhdmlvdXIKKGFsdGhvdWdoIG5vdCBpbiB0aGlzIHBhdGguKQoKVGhl IHByb2JsZW0gaXMsIHR1cm5pbmcgdWFjY2Vzc19lbmFibGUvZGlzYWJsZSBpbnRvIEMgY29kZSBt ZWFucwp0aGF0IGl0J3Mgb3BlbiB0byBiZWluZyB1c2VkIGVsc2V3aGVyZSBpbiB0aGUga2VybmVs IChvb2gsIGEgY291cGxlCm9mIHVzZWZ1bCBsb29raW5nIGZ1bmN0aW9ucyB0aGF0IHdvcmsgb24g Ym90aCBhcmNoaXRlY3R1cmVzISAgSSBjYW4KdXNlIHRoYXQgdG9vISkgYW5kIHRoZW4gd2UgZW5k IHVwIHdpdGggc3R1ZmYgYnJlYWtpbmcgc3VidGx5LiAgSXQncwp0aGUgcG90ZW50aWFsIGZvciBz dWJ0bGUgYnJlYWthZ2UgdGhhdCBpcyBtYWtpbmcgbWUgTkFLIHRoZSBpZGVhIG9mCmFkZGluZyB0 aGUgaW5saW5lIEMgZnVuY3Rpb25zLgoKR2l2ZW4gdGhlIHR3byBoYXZlIGRpdmVyZ2VkLCB0aGUg b25seSBhbnN3ZXIgaXMgaWZkZWZzLCBzb3JyeS4KCi0tIApSTUsncyBQYXRjaCBzeXN0ZW06IGh0 dHBzOi8vd3d3LmFybWxpbnV4Lm9yZy51ay9kZXZlbG9wZXIvcGF0Y2hlcy8KRlRUQyBicm9hZGJh bmQgZm9yIDAuOG1pbGUgbGluZSBpbiBzdWJ1cmJpYTogc3luYyBhdCAxMi4xTWJwcyBkb3duIDYy MmticHMgdXAKQWNjb3JkaW5nIHRvIHNwZWVkdGVzdC5uZXQ6IDExLjlNYnBzIGRvd24gNTAwa2Jw cyB1cAoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVu LWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6 Ly9saXN0cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3F3FC432C0 for ; Fri, 22 Nov 2019 00:53:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 931DC20674 for ; Fri, 22 Nov 2019 00:53:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uddAoO5i"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="QDvDXbAX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 931DC20674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2HYwyz/NuThhF6bprI/zlmg5Up1IoM7B7oJZmdd/ZGo=; b=uddAoO5iMev9CN 7SIv/iAuI9My4V/G/wzWk94bIDBO20PFTKhMzqMrmKgmqajy6I0r9/Ey7OEIHs/LZTiW3p4zRtOTm KsvZx+YE/cKYnytxYxWJXcj7bpWoDXS07swVoMulZDAFLswjfEu9ckxOIShe5zJxAjRN+/CdImjmp OT4u3brtuA3H5n+ClGuXui8/SzbjBVz/a9lA/2QJc8QtJK6kyhqeW5y89JZf+AMICjhknfelKObhl DijNeUL4viXxZyaLM7wWwHRtKzYoC5rbM20eD1xN3oKjDuWc30ogVTcuTA0gNgrjdo3VF3FmTMwnH 8fH+YLgeEtazXd6W0mxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXxCf-0002nJ-VS; Fri, 22 Nov 2019 00:53:41 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXxCc-0002mh-Dm for linux-arm-kernel@lists.infradead.org; Fri, 22 Nov 2019 00:53:39 +0000 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191121_165338_466562_1DC8036C X-CRM114-Status: GOOD ( 15.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , stefan@agner.ch, Masahiro Yamada , Will Deacon , Thomas Gleixner , Sasha Levin , sstabellini@kernel.org, James Morris , Linux ARM , xen-devel@lists.xenproject.org, Vladimir Murzin , Marc Zyngier , alexios.zavras@intel.com, boris.ostrovsky@oracle.com, allison@lohutok.net, jgross@suse.com, steve.capper@arm.com, Greg Kroah-Hartman , LKML , James Morse , info@metux.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD08C432C0 for ; Fri, 22 Nov 2019 00:53:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAD72206CB for ; Fri, 22 Nov 2019 00:53:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="QDvDXbAX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbfKVAxr (ORCPT ); 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