{"id":729383,"url":"http://patchwork.ozlabs.org/api/patches/729383/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1487364165-21882-1-git-send-email-jan.dakinevich@gmail.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<1487364165-21882-1-git-send-email-jan.dakinevich@gmail.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/1487364165-21882-1-git-send-email-jan.dakinevich@gmail.com/","date":"2017-02-17T20:42:45","name":"tty: hvc: don't allocate a buffer for console print on stack","commit_ref":null,"pull_url":null,"state":"rejected","archived":true,"hash":"0ef64c2a10f27f0dc55026e21a7b1793fa2f8b81","submitter":{"id":71018,"url":"http://patchwork.ozlabs.org/api/people/71018/?format=json","name":"Jan Dakinevich","email":"jan.dakinevich@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1487364165-21882-1-git-send-email-jan.dakinevich@gmail.com/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/729383/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/729383/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vQ6bC6hH5z9s8D\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 18 Feb 2017 09:07:51 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3vQ6bC5XvXzDqBn\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 18 Feb 2017 09:07:51 +1100 (AEDT)","from mail-lf0-x242.google.com (mail-lf0-x242.google.com\n\t[IPv6:2a00:1450:4010:c07::242])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3vQ4k46qm1zDqJx\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat, 18 Feb 2017 07:43:40 +1100 (AEDT)","by mail-lf0-x242.google.com with SMTP id x1so4653196lff.0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 17 Feb 2017 12:43:40 -0800 (PST)","from localhost.localdomain (194-28-30-174.static-pppoe.itce.ru.\n\t[194.28.30.174]) by smtp.gmail.com with ESMTPSA id\n\th24sm2768688ljb.46.2017.02.17.12.43.34\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 17 Feb 2017 12:43:34 -0800 (PST)"],"Authentication-Results":["ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"u12IPh1i\"; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"u12IPh1i\"; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"u12IPh1i\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:subject:date:message-id;\n\tbh=nWL2XhS9dz5CYdS1E/R4owNgnQNB/9iPHsIKXzOoQ+Q=;\n\tb=u12IPh1i/9OPCwmyGtGa4uE62vpfKjnH6PMLx1ealM/1yi3i+ApCjS2xr1rsmXVAEy\n\tP30w7MnM/iI9sur/0fA7qJC1wLEryuLKuZ1lqvyLkgfX4swjlhH5Risrs205JSDavKsd\n\tq+DnbQ5xuRS4UVBW+M7hX+/0ti/RSDUSn2MrtoAEj+LIenJ+8eVsIq+BgFMs3I6ULQOX\n\t3zn7LblMpkXjXpSDbFXxfBTFGkwqic0DzKNYF9hqssuQ4FwbPmzlXR60Hg/JCg8/rIgL\n\tZijCBw07MheXHagC6dW4Am6deeo6Qc7NiBG9aWKqjOSe5RnHi6jqYePu6mbpoenDGbh4\n\trnBA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:subject:date:message-id;\n\tbh=nWL2XhS9dz5CYdS1E/R4owNgnQNB/9iPHsIKXzOoQ+Q=;\n\tb=WNq5w7Mkg4es/Z+6YocbZ9aCsrY78h3fYpwR6evLwvO+cxf0kJP/HCMM23J4FtBpJ9\n\tREzktBcIRMil/PaVViXjqYI3vzp3hJMV8q0fAEwHHGYHufAXsXkq3TsYDbSedYqvySXR\n\tGdD4pdzSDxmAyh+myokS5srUXYIs9ScuGyLVb/gZ75FEK202oQ0ilaQ1SykHtOBdjWYR\n\trR3CdJwcsiGQfgyIZrH5SBewlNnTOqp7Hyc6wAvJD+shx7w52HnPy1jlA1IVKriXIaiH\n\tl1Yt9AW0pX/8/3Xm+83bTkTm1Hgza8B8S5ga6jWyEqiw8bYQe0VgSlkqS+iu2zcEOY93\n\tVRXg==","X-Gm-Message-State":"AMke39lEmeRx728pNEmPpwadTWabZNkneE5DHrGvSejgFfmuiSmwXk5dpvAC4sAmGhcUIg==","X-Received":"by 10.25.170.7 with SMTP id t7mr2852347lfe.105.1487364215474;\n\tFri, 17 Feb 2017 12:43:35 -0800 (PST)","From":"Jan Dakinevich <jan.dakinevich@gmail.com>","To":"Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tJiri Slaby <jslaby@suse.com>, Jan Dakinevich <jan.dakinevich@gmail.com>, \n\tPeter Hurley <peter@hurleysoftware.com>,\n\tDan Carpenter <dan.carpenter@oracle.com>, Arnd Bergmann <arnd@arndb.de>, \n\tAmit Shah <amit@kernel.org>, virtualization@lists.linux-foundation.org,\n\tlinuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org","Subject":"[PATCH] tty: hvc: don't allocate a buffer for console print on stack","Date":"Fri, 17 Feb 2017 23:42:45 +0300","Message-Id":"<1487364165-21882-1-git-send-email-jan.dakinevich@gmail.com>","X-Mailer":"git-send-email 1.9.1","X-Mailman-Approved-At":"Sat, 18 Feb 2017 09:04:47 +1100","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"The buffer is used by virtio console driver as DMA buffer. Since v4.9\n(if VMAP_STACK is enabled) we shouldn't use the stack for DMA.\n\nSigned-off-by: Jan Dakinevich <jan.dakinevich@gmail.com>\n---\n drivers/tty/hvc/hvc_console.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)","diff":"diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c\nindex 9b5c0fb..1ce6aaf 100644\n--- a/drivers/tty/hvc/hvc_console.c\n+++ b/drivers/tty/hvc/hvc_console.c\n@@ -143,10 +143,15 @@ static struct hvc_struct *hvc_get_by_index(int index)\n static void hvc_console_print(struct console *co, const char *b,\n \t\t\t      unsigned count)\n {\n-\tchar c[N_OUTBUF] __ALIGNED__;\n \tunsigned i = 0, n = 0;\n \tint r, donecr = 0, index = co->index;\n \n+\t/*\n+\t * Access to the buffer is serialized by console_sem in caller code from\n+\t * kernel/printk/printk.c\n+\t */\n+\tstatic char c[N_OUTBUF] __ALIGNED__;\n+\n \t/* Console access attempt outside of acceptable console range. */\n \tif (index >= MAX_NR_HVC_CONSOLES)\n \t\treturn;\n","prefixes":[]}