From patchwork Thu May 3 14:15:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10378467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4FDAF603B4 for ; Thu, 3 May 2018 14:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BDC128CC5 for ; Thu, 3 May 2018 14:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3049028E26; Thu, 3 May 2018 14:18:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B673E28CC5 for ; Thu, 3 May 2018 14:18:32 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DlRTXbAmCWSuMvYlchOf9mcnxXvcBepgLIB02dwUJ5A=; b=tYFgGvyjNvU0FOcX1CG99PgViE bcPlawTREIY1fxr0UifU8+nTMPtSjy3+jtj2l9oef8rbhryxnvwBb+fU23Z8N1/DpcHNCS6pFXXPR zG+sHnRY+EUFoqPRdruOewZHL7IQUAVbEgHKzPUWulwKSDlIyIpEjIa8qhwEBzndVdnYQXtZ066pI 0BMM1/DDRQaCCBocAlTSwCfjXXvTyJH+bIn/2n9KzPD2wZHiWaj2F3XTfw646WxLC5qRsuLShrF/5 jEojpvXE9lMasYMyigE631oQmra2P992Er/s1RbyOAcjQ3AR4Vmeb8YE+uXKFX4fnriBmjzacIzPJ MaX2wjhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEF3s-0004Yq-Vw; Thu, 03 May 2018 14:18:21 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEF1g-0003Uo-0h for linux-arm-kernel@lists.infradead.org; Thu, 03 May 2018 14:16:09 +0000 Received: by mail-wr0-x242.google.com with SMTP id i14-v6so14627958wre.2 for ; Thu, 03 May 2018 07:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=wXNsOIULzRBowlkHlt/Dd2liRl3+STS0XzbkUxVElPM=; b=cKfcqw7OehAu6sY0jYTYgvFAKeiqX4rmTWXzo9tmakVGK40VkXlaUnz5a8Z53Qhu2Q Gh5OtrObUQocBRBjVI7Z8CoDIEvKdeK59I7DkrR5c8m6ydG9Mcj/Qqx5oqQXJOg8yMDu bds1ptMh30yiHgIO/cUBougBwYQWYkjGIhddP3NjGd18fWY/2D7Mrwl+xRSdwVP6CraB WCXbL3g9DTSGN6lWa6DjJ6eHwYFEacCD+fEIlxrlLuXwrB9YpgusfvWSnaCfAVUj7A4u 1D+X9jceL+7Yvnrel8cBHdZMrEF2UJ/uN4ZiIIItgFjD/PpbHKTpqpSzek/YQsl4a00B WOsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=wXNsOIULzRBowlkHlt/Dd2liRl3+STS0XzbkUxVElPM=; b=sSdiLHfCBxhTuSWUQLNp6IQZAUzuD5HKrdRVfrMLUmRccWVG/K5JjKdUTTPXXYpjtc kK/veIDwZ+oFvDXL/nCt+L5r0+AQQUSjwshkFI0fsIlvpZi9/wI0ucLIkazy5wXRxffH GxUgGaME2enr4euySDeNR1rGQdBRbhSIdqXcMDl7KRRpZA/Y4wbA+LhPMMkkeO58dR5m ii42M9O47GIGJ01ssiFrZ0bXNNvAShAsGxZZw/8BIk+HK2SVNzbS1Yz9527/LvnzMwR2 txwkRf4uuI7poAbmCQpvDUyKiuQKyO3HUJFR7RrSG6kKkpWgr9Qpqx5eX1ajYfaz/ExG CjbA== X-Gm-Message-State: ALQs6tCCAfvVEaShHU8nQffLj18Zdgou8kKKCrJSrurXqs4XXJChsA8s 0wJTmyNeS/GT+e2c/YijKHv6ZA== X-Google-Smtp-Source: AB8JxZoPsEixtvtPtjFL5/kf9+eJmruA8lLTNPHuSDxpygbMTUZneSzwIrOUpIYddWNTRGnTIGl+ig== X-Received: by 2002:adf:ec41:: with SMTP id w1-v6mr19831174wrn.211.1525356952020; Thu, 03 May 2018 07:15:52 -0700 (PDT) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id u20-v6sm22090298wru.33.2018.05.03.07.15.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 07:15:51 -0700 (PDT) From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Jonathan Corbet , Mark Rutland , Robin Murphy , Al Viro , Andrey Konovalov , James Morse , Kees Cook , Bart Van Assche , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , Philippe Ombredanne , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Dan Williams , "Aneesh Kumar K . V" , Zi Yan , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 2/6] uaccess: add untagged_addr definition for other arches Date: Thu, 3 May 2018 16:15:40 +0200 Message-Id: X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180503_071604_076241_89531277 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chintan Pandya , Jacob Bramley , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Dmitry Vyukov , Ramana Radhakrishnan , Evgeniy Stepanov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To allow arm64 syscalls accept tagged pointers from userspace, we must untag them when they are passed to the kernel. Since untagging is done in generic parts of the kernel (like the mm subsystem), the untagged_addr macro should be defined for all architectures. Define it as a noop for other architectures besides arm64. Signed-off-by: Andrey Konovalov --- include/linux/uaccess.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index efe79c1cdd47..c045b4eff95e 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -13,6 +13,10 @@ #include +#ifndef untagged_addr +#define untagged_addr(addr) addr +#endif + /* * Architectures should provide two primitives (raw_copy_{to,from}_user()) * and get rid of their private instances of copy_{to,from}_user() and