From patchwork Fri Jun 16 18:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793353 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 18D5360325 for ; Fri, 16 Jun 2017 18:58:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071632865B for ; Fri, 16 Jun 2017 18:58:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF75428670; Fri, 16 Jun 2017 18:58:48 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 77A9D2865B for ; Fri, 16 Jun 2017 18:58:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwQC-0005R2-Ro; Fri, 16 Jun 2017 18:56:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwQB-0005Pz-Bm for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:56:39 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 5B/B5-11537-6E924495; Fri, 16 Jun 2017 18:56:38 +0000 X-Brightmail-Tracker: H4sIAAAAA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!1497639395!101185733!1 X-Originating-IP: [104.47.40.46] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42546 invoked from network); 16 Jun 2017 18:56:37 -0000 Received: from mail-co1nam03on0046.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) (104.47.40.46) by server-5.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:56:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=h3f/coTeQ1KS76hSyraF0xgbRUrP0MlwXVxJgYYUBko=; b=J3u0xEu4eBGNIGO64qqsv9M768BcHJ4E2NtvbnFIBeCqR3lBEOIbDB3Pv35zcygKmdhu5OIihkaJaAxuL/jCAF/cn/9WHtr1fiahQQK5iddDprvdVz/bmNxQOcicvkd0YJWBp4SGjMFQIMVDRq283f+vrbKVW5WNx8bYm6oH3Zg= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 16 Jun 2017 18:56:33 +0000 From: Tom Lendacky To: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Date: Fri, 16 Jun 2017 13:56:30 -0500 Message-ID: <20170616185630.18967.80046.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> References: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR16CA0014.namprd16.prod.outlook.com (10.169.34.24) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR12MB1141: X-MS-Office365-Filtering-Correlation-Id: f0377f16-3be7-42e7-6786-08d4b4e968f1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 3:18ZWIWG7FxvS+mvn2XCl+y7M7ARz/Esd4Vt0iDBOKuEBy+hA1R/5oOpq3K69wCZ/OrGHNE2+bgLSHfWgZw8C6q9fOYwg26j30SjY1gvh5pYoUmmEqj/XoBc3wsBpnVl9ijpWo8m0klFtoN2drshbXn9hQMt1INl9swVM3z4aEBLR1iplNCfb3JxYqtIPVOYtn6tSw5rYg2PJ4WHXDCkhHewUBgvLvDteFLF9v3LqFoAmreu0QLW+ENvc5/pEeqnDB0q7WDM0zwCbTBZZ1AZ8/S1yKEtYbNILrO+ccHVVu/2Fxe14yLGL5xwIEdoe8OxiuHMHVx+DR4ZuAbtdSEe4iwx3u+mOgjkOQS52dwNfHqQ=; 25:ev+rA0NPLsdH5CpHTdgxgjzjSerrtgwqZysTJN0y3fFPvVkD1nlDrGQbzK8Sg/4aRZUEtoAVIN+DtvaLsUOcaQI11RNuidxmuSCWtOBelIBCsqXJCo9PDjvVqLaUt24MDNzPzaR3r7Uo8cG2DdoavwuJjjgG2PlzKua2MXMFcXhDTukw8W+ho0SNFr9+R4jxJ+thm5rl6MLLBi10BtmnCfkR5dGVXGNvw7syIxnREsvRb59ABfMk4ELtYjOEFQog0GK053bjq+SCUaDIHhfe9JWFy+Vbd0I2LmjYLGL4W/2O/L6fLT3uR64l55P9kkNs/2aAPcRUEdw6OVU6/TTl5uddZe7+iXsok5VJK+nhTLJJX21rEiWSekSKHGI0j9pmm2q404UO5ISbYzPyWAs7qrkbXv/ZNrJKv84kSNyYX6m/XT0jCXBtAVfoaQMfzoL/XWXWx1kFuRyX6QPW4A+vLH0dtT7lCGdmSx4sCmCTRDI= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 31:wg2g1YjG80DaVnxmzuXJU6yyu1fLzyBoOcNK0sYieB65h9KPdA0n4Mu1AZlrdiUGW3pLn7G97QveTDMB28eLhm0bjiOSzi44CV5g0128ZJzqLdQRgFfng2n4SN5YYlHTtvgHPHDGgM2qTY7V7A4RNF6AzWV6RmsWDB+F0mfaQaFml+4qihLELEVAXYOfTWKeL9FZrS+Jsqf13Mwhj6z92ON0m0qkuFzVDbUW5kmisTY=; 20:FrMXsHQorlcmSanK45wEte2gZDRe4NQwz1qlEfN4tIUKnScqkYShi+Di1/wnggFV4zcFw+ltuWaiId3HgMvjK9TgQ1XPTOCPIBRbkEd/zfLSMTKileK6w9TOBg5ipLrlQ2A6O7/Tc8GDYO1vTY4X9HwncswhvfOuDMc/IMQWLFhvw2fojVQ6PC4x85aSRuAU1g5IWia05JhxQ1vCT/WrFxvn/W4UmfD1nekZHaxb4FuJsw0w6C6+C8OKC6jcq4HLAtxjK9PhyC0HhIHTOpHn3sbaTPrDjGh7AMgjD/32ZNGEuNj6S6QSAH2rzYEtJ5Q4I6Sw/rmlTBaXFJv1B9oVfDuwSQHDvOaJu9B18wOhnm051N6vZKBKgeyUuvkTq8bRYsiUrh+XMPjLO1VNp3RgJYBZ25CivXIIpWQA+iANIc6BfBo9U/2DW0NwgN/VqLPgY266sFQLLyzkOKCuUJb/djeeWIeXMMeESF3UIyh1HG8QK+Fhix31yVQr64m0sLES X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1141; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzQ6Z3VGY2VxOFpUOG0wUDFmQzNBdFRWNlZHR3Y3?= =?utf-8?B?eXdGNzM0QlVpaVhPK3NLZ0NzTW9oaEszNUFGNkIxeDNzZWRsRGsvdW8yK2tZ?= =?utf-8?B?OXZQUDZQU0k3bjZDMW5jZFJFTU1HMmF1RHVtVkN2ekNUbGFLaXZRRTJsYk41?= =?utf-8?B?aUo1N0RKeFFQRzJ4VnNLQ2R2VmpiRU1PUThXNFJHMCtSVDVnbnJWZ2RRWlh6?= =?utf-8?B?OWZ2TXhUMG54NmtzL3VnL0t1VGVSN2xUNDJQT3BlLytWaWNySmhwQkp0bm1P?= =?utf-8?B?bG15cjVQM05ZK2RsWVBxQkxZMU90a1YrQk5pVjNnYlhZRDlwRzc4OVA0anZH?= =?utf-8?B?VVBRaVRrczZQWE9veTdTMXd2NjQ0MmcyTjVaSjRIOVhMMUhSUFNpKzFidXlt?= =?utf-8?B?aEhzTzM3TU5hdDFTeWlqZzRCT0ZRUFRFUnJURWpMby9FRDJXdDg2UEdNTEJQ?= =?utf-8?B?MmUvSmZWOEhqbTByclpNNHJaaW1JNDFlWUVGRnlSTHUwTFpoZzU3aDZGTHR0?= =?utf-8?B?S2lUS0ZMb2dVRjdTNVg5Y2tkbFVDK0RVaWo0ZEMwQ2c0NGJRaklj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ZDRJMDd1eklQWlFUcjVuOWttVXZUL3Z2?= =?utf-8?B?SklPSWFjb1ZtZCtSdkpDQXhybU5NbURER21Oai9qYVJPRVNQVjdzMVJ0ZDB0?= =?utf-8?B?S3E0b3R3VGpxUzdkeGJGRTVpSndrT2lPRGFCL3pMVWNwTG9mSDl4Mlp3emh6?= =?utf-8?Q?QfAHIlCnojTK4Dlctkt?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39410400002)(39860400002)(39400400002)(39840400002)(39450400003)(2906002)(23676002)(33646002)(103116003)(2950100002)(230700001)(9686003)(66066001)(3846002)(6116002)(47776003)(72206003)(53936002)(42186005)(53416004)(55016002)(50466002)(7406005)(54906002)(7416002)(38730400002)(110136004)(478600001)(8676002)(81166006)(86362001)(76176999)(6506006)(50986999)(305945005)(54356999)(4001350100001)(1076002)(5660300001)(7736002)(4326008)(83506001)(25786009)(189998001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1141; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOk5FNDFIUEp3dHVJZUFYWkhGNVFUVzE5ZHpY?= =?utf-8?B?N0FNMzRnSUgwU3MxWUczdFA2Z2ZBUGtSNHBleGprd3d1Y2M5dlRTZFN3U1NW?= =?utf-8?B?WFgxSlR2UFp3NWFpbVIvSjhaYUlIamZDYVRCNlZjcHpaUGpSd3o3Z1crM25O?= =?utf-8?B?b2ZYeENrTFpobENDMzkwa2JMYUo4V2xCMVp2ZkhObkNneExnM0I1cnBOV2gx?= =?utf-8?B?eUU0WHZSd01KR1JHR1BoZHRaeFpwSmxEb09tNzAyaEU4TzkvbC84bGlib044?= =?utf-8?B?R0xMdVZmK201UDhEUDdGaVRLekkvOTdWUU4wRUFmZmZPdnczSjVGOGJUUmg3?= =?ut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h3YjVNL0Nu?= =?utf-8?B?N3E1YjhYNjBSdStOZ0pSeWZ5SkFtOVVUellQVFFWZjVNNjhRbllhZmxXV1NK?= =?utf-8?Q?eb3/w3g?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 5:vdBsR5d8yKSh2RC3AOc2W0BEBxETEfeBYYjQRRzBxQ1zMBp/F3ER4Z/AHRcvoH48pJIwNvb35plZpR0h3KhcEFmxz/VlPDjqefXKTxNH+KalHQHQeV3mocc0/jyXitTdD8b0JJmlR2vC0pLaU8xjfhJ5vMFlkR94zV2v1j+yk/9JU8SPzFqruFW5aVNG6HsCnIYTYKBd79rRlbFBGJVyXbU/zVU3C7/lIqbFIbQJhsLWLOZrU6NseK7vIUTxBI28HYonNXM+drInr01Xx97txfD0tNan69ls9C0ye6LDR+yx6ImH3q7sQe201z9EyIWGcJba3kEmmSxHeG3dbrSwIXaGlbWIvbXq9vLjgGuHaufR9zOgkIVxNYBv3iyz9Epcd9kMBKH8UA1u3LuMIl+Py7Fi5I5S10Oop8oUAjuUR35KISZWylQpKtIfDVlsN85o3f2QzzAwyUxhmm4EVISRVBaqgoNZW6XY7ZXGDqzYzIEiq5Dj+QcZlp8tpA6tarXu; 24:LiSj6w/aDX04r1hVCVKKawtPni3kep57GnkAC/1aqEhhwcy46vF331oZV+fBFl9Uy0uXwX2/vmgtNQkpquaMuX3dp1SHvf+aUhmlFS1wSCw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 7:JgazXx0AruqbVI0uUcVsK4+JPH0WTBfxhI5GFgF+4ls8h2hZ8duIVRqFNAtHmL4Po3KRqDndQJiOY9N1ACsWd4dnZZqS/SRtOX17HhzQMndu+MAj7OKP4CMES0BZgmB4+3in4ozw5t7LS1PEA16v7iUwZ8wmSlQaJwlXcUZbk6iTA/hu8eibO+NRbME2pA7Q76Ytd8Z36Sp+cH5nydFPgobKVnO5BYVW7TX37PSaka0CMbihy5w2/BAwdB3zm4A/sgXy6c6a+11AbVnLtA52WElMYbSAl2CscJ0Lu0N5zDy0hStXUX+mEZTvz1KAOKMYhkC92ISNxT/DTBqKntZXpaz2S+FTyHRPj8Zvw3s67BxwwviBVBJ2t5iGjDj9JATg/9gdghYeU4q0PUh2xFEt4F8cMwkIGHc5Ysjq7qJcpD7juJPLPzyst1dPYMAXA0UMhGOP5YG1fi+wWqyKCGXa18Dc8PR8X9t1PDHDhQ5HhRHsvUZbOWM2UE9siFKJr6TFdm3F8321xvO8tGKY6SGLg6uT+38u/IYaXC9zPznrJElcL6LW4wWS0TUOxWggPJLnWTf6tZtG/308xKVAjiQ1QpXa5dVX6qPVYzW0BcclnnmBGD/6Bjfv2FKVhZBsCCi/USqmp7Qzh/3wHjcZbXq8W/8YPEOWtSFpwixNSl9tSpErW7Nw5x+2QiA4y0GlgBQpldrPCj7XQnTxfOpGa7k2rzapDevYisbnuH0xctIAK3I8+oLoSC4jSOArdJpOvZZBjJCrqqY+wIMNfNm6rb7+KRR2RRGE9a4VaHX88owwwCI= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 20:YlSvQhiEaowRdCnfqwS1UG9kQCfYvPsyBD0mPgXPRwiO8wxlqstkdY/ghBRyK9UuQZBXQZetzJOJNOdZo+EV1QwzFLq8SCxud/hytML4MdPhrDzxBG9XHOTXX0h+9o71tV0jDO1ENgaagHdCYuc5mbI+veSnIR23/3p2cC8NIUBB8ScihkVOxQehuM7N8+ySZza5QP150CWGB2v8/848hlhKbINf5BOFRhjPcV3ptu25GDJSkBNfr9VluKO6atM0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:56:33.2471 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 Cc: Brijesh Singh , Toshimitsu Kani , "Michael S. Tsirkin" , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Boris Ostrovsky , Jonathan Corbet , Joerg Roedel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Larry Woodman , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , Paolo Bonzini Subject: [Xen-devel] [PATCH v7 35/36] x86/boot: Add early cmdline parsing for options with arguments X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a cmdline_find_option() function to look for cmdline options that take arguments. The argument is returned in a supplied buffer and the argument length (regardless of whether it fits in the supplied buffer) is returned, with -1 indicating not found. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov --- arch/x86/include/asm/cmdline.h | 2 + arch/x86/lib/cmdline.c | 105 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/arch/x86/include/asm/cmdline.h b/arch/x86/include/asm/cmdline.h index e01f7f7..84ae170 100644 --- a/arch/x86/include/asm/cmdline.h +++ b/arch/x86/include/asm/cmdline.h @@ -2,5 +2,7 @@ #define _ASM_X86_CMDLINE_H int cmdline_find_option_bool(const char *cmdline_ptr, const char *option); +int cmdline_find_option(const char *cmdline_ptr, const char *option, + char *buffer, int bufsize); #endif /* _ASM_X86_CMDLINE_H */ diff --git a/arch/x86/lib/cmdline.c b/arch/x86/lib/cmdline.c index 5cc78bf..3261abb 100644 --- a/arch/x86/lib/cmdline.c +++ b/arch/x86/lib/cmdline.c @@ -104,7 +104,112 @@ static inline int myisspace(u8 c) return 0; /* Buffer overrun */ } +/* + * Find a non-boolean option (i.e. option=argument). In accordance with + * standard Linux practice, if this option is repeated, this returns the + * last instance on the command line. + * + * @cmdline: the cmdline string + * @max_cmdline_size: the maximum size of cmdline + * @option: option string to look for + * @buffer: memory buffer to return the option argument + * @bufsize: size of the supplied memory buffer + * + * Returns the length of the argument (regardless of if it was + * truncated to fit in the buffer), or -1 on not found. + */ +static int +__cmdline_find_option(const char *cmdline, int max_cmdline_size, + const char *option, char *buffer, int bufsize) +{ + char c; + int pos = 0, len = -1; + const char *opptr = NULL; + char *bufptr = buffer; + enum { + st_wordstart = 0, /* Start of word/after whitespace */ + st_wordcmp, /* Comparing this word */ + st_wordskip, /* Miscompare, skip */ + st_bufcpy, /* Copying this to buffer */ + } state = st_wordstart; + + if (!cmdline) + return -1; /* No command line */ + + /* + * This 'pos' check ensures we do not overrun + * a non-NULL-terminated 'cmdline' + */ + while (pos++ < max_cmdline_size) { + c = *(char *)cmdline++; + if (!c) + break; + + switch (state) { + case st_wordstart: + if (myisspace(c)) + break; + + state = st_wordcmp; + opptr = option; + /* fall through */ + + case st_wordcmp: + if ((c == '=') && !*opptr) { + /* + * We matched all the way to the end of the + * option we were looking for, prepare to + * copy the argument. + */ + len = 0; + bufptr = buffer; + state = st_bufcpy; + break; + } else if (c == *opptr++) { + /* + * We are currently matching, so continue + * to the next character on the cmdline. + */ + break; + } + state = st_wordskip; + /* fall through */ + + case st_wordskip: + if (myisspace(c)) + state = st_wordstart; + break; + + case st_bufcpy: + if (myisspace(c)) { + state = st_wordstart; + } else { + /* + * Increment len, but don't overrun the + * supplied buffer and leave room for the + * NULL terminator. + */ + if (++len < bufsize) + *bufptr++ = c; + } + break; + } + } + + if (bufsize) + *bufptr = '\0'; + + return len; +} + int cmdline_find_option_bool(const char *cmdline, const char *option) { return __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); } + +int cmdline_find_option(const char *cmdline, const char *option, char *buffer, + int bufsize) +{ + return __cmdline_find_option(cmdline, COMMAND_LINE_SIZE, option, + buffer, bufsize); +}