From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752AbcHLAyO (ORCPT ); Thu, 11 Aug 2016 20:54:14 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49393 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751010AbcHLAyN (ORCPT ); Thu, 11 Aug 2016 20:54:13 -0400 X-IBM-Helo: d24dlp01.br.ibm.com X-IBM-MailFrom: bauerman@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org From: Thiago Jung Bauermann To: Samuel Mendoza-Jonas Cc: kexec@lists.infradead.org, Stewart Smith , Baoquan He , linuxppc-dev@lists.ozlabs.org, x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, Ingo Molnar , Paul Mackerras , Eric Biederman , Thomas Gleixner , Dave Young , Andrew Morton , Vivek Goyal Subject: Re: [PATCH v5 11/13] powerpc: Allow userspace to set device tree properties in kexec_file_load Date: Thu, 11 Aug 2016 21:54:02 -0300 User-Agent: KMail/4.14.3 (Linux/3.13.0-92-generic; KDE/4.14.13; x86_64; ; ) In-Reply-To: <1470962700.2570.6.camel@mendozajonas.com> References: <1470956898-5991-1-git-send-email-bauerman@linux.vnet.ibm.com> <1470956898-5991-12-git-send-email-bauerman@linux.vnet.ibm.com> <1470962700.2570.6.camel@mendozajonas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081200-1523-0000-0000-000002130670 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081200-1524-0000-0000-000027CC42ED Message-Id: <1516604.QKHlMVtQ9l@hactar> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-11_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608120009 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Sam, Thanks for the quick response. Am Freitag, 12 August 2016, 10:45:00 schrieb Samuel Mendoza-Jonas: > On Thu, 2016-08-11 at 20:08 -0300, Thiago Jung Bauermann wrote: > > @@ -908,4 +909,245 @@ bool find_debug_console(const void *fdt, int > > chosen_node) return false; > > } > > > > +/** > > + * struct allowed_node - a node in the whitelist and its allowed > > properties. + * @name: node name or full node path > > + * @properties: NULL-terminated array of names or > > name=value pairs + * > > + * If name starts with /, then the node has to be at the specified path > > in + * the device tree (including unit addresses for all nodes in the > > path). + * If it doesn't, then the node can be anywhere in the device > > tree. + * > > + * An entry in properties can specify a string value that the property > > must + * have by using the "name=value" format. If the entry ends with > > =, it means + * that the property must be empty. > > + */ > > +static struct allowed_node { > > + const char *name; > > + const char *properties[9]; > > +} allowed_nodes[] = { > > + { > > + .name = "/chosen", > > + .properties = { > > + "stdout-path", > > + "linux,stdout-path", > > + NULL, > > + } > > + }, > > + { > > + .name = "vga", > > + .properties = { > > + "device_type=display", > > + "assigned-addresses", > > + "width", > > + "height", > > + "depth", > > + "little-endian=", > > + "linux,opened=", > > + "linux,boot-display=",ss > > + NULL, > > + } > > + }, > > +}; > > Hi Thiago, > > As much as this solves problems for *me*, I suspect adding 'vga' here > might be the subject of some discussion. Having /chosen whitelisted makes > sense on it's own, but 'vga' and its properties are very specific without > much explanation. > > If everyone's happy to have it there, cool! If not, I have the majority > of a patch that handles the original reason for these property updates > separately in the kernel rather than from userspace. If needed I'll clean > it up and we can handle it that way. Ok, that's good to know. I'm fine with it either way. In any case, 'vga' in this patch also serves a good real-life example of a non-trivial binding outside of /chosen that we might want to whitelist in the future. -- []'s Thiago Jung Bauermann IBM Linux Technology Center