From patchwork Tue Jun 27 15:14:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812521 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 BE0C4603D7 for ; Tue, 27 Jun 2017 15:16:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFACE2684F for ; Tue, 27 Jun 2017 15:16:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A413C28402; Tue, 27 Jun 2017 15:16:44 +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 176FE2684F for ; Tue, 27 Jun 2017 15:16:44 +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 1dPsCO-0003ea-5G; Tue, 27 Jun 2017 15:14: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 1dPsCN-0003dc-9Y for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:14:39 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 9E/AD-02185-E5672595; Tue, 27 Jun 2017 15:14:38 +0000 X-Brightmail-Tracker: H4sIAAAA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s.com!1498576475!103563012!1 X-Originating-IP: [104.47.40.86] 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 60426 invoked from network); 27 Jun 2017 15:14:36 -0000 Received: from mail-co1nam03on0086.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) (104.47.40.86) by server-15.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:14:36 -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=fO4j2EzAcdhy3ojK2umAg94OPxSr5Rf0ls7+7wfHCC8CU2GMPiQsnLku/N8YcTKB9fyZDyX6Y5xHg1DGFJ0Vlm5mb5mymTrvOOf1Ps4yA7Jf8Yl5J1ohM5xvV1sfFOpPd4Q7LGh6pyNemBKMuAq6Hbie4YgIyHp9bG0kaCTIgTI= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1149.namprd12.prod.outlook.com (10.169.204.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Tue, 27 Jun 2017 15:14:28 +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: Tue, 27 Jun 2017 10:14:24 -0500 Message-ID: <20170627151424.17428.16088.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170627150718.17428.81813.stgit@tlendack-t1.amdoffice.net> References: <20170627150718.17428.81813.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: BN6PR03CA0003.namprd03.prod.outlook.com (10.168.230.141) To MWHPR12MB1149.namprd12.prod.outlook.com (10.169.204.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2450a3a2-7c6c-411c-89a2-08d4bd6f3703 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506067)(300135500095); SRVR:MWHPR12MB1149; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1149; 3:YOHcS2NcXgQk5NDmWTsHrzXlnCHDoWgy7iSwfj0ZGUm//m7/1awFTRCVujDVJBnp8vyvXgfo2H5PLPgxJM/tf0fVWu4G3lavLmRXQv/Oz2bPuT4yMJxfQufSUOPEIjg90CcB/KvmeKYgBNvC2oWXabycELQjKlVHqeqvrhizkjtQiNZc7tYKEJ9pkgG3T3Bk/tTPhZvM6IJtE3PAcxbqsj31E+Yg6jnGPoyVVPb/5xrH+qrSHaCcwAujYmUJbIeP1ubhfKILML9qVpzValG4zj/UFqJGwKtYhM7CbDOPpy1dvY2t+VLEhG61HjVHO501VDuytLhHwjFEU9GUn2apuvmADGETNKuJZ0Rfqr1nyf88oFylXnGb+6aZE39+n6pQOayABOFVkFhD5IIzyLPxD75e2u9dlYrurCbq4sP/R8NCZ6IQnDID75FP0wTlwcoDI+fdaqoe+09xoiD2l3pGcPWsYL+ipXJIKxOc5fckPh7At9nPPB7MjpJPNQ713ZKvnKO0+NL5mPr/hn8lqAeK1mAaWBu9tD3P/nfDr7RQSvIY0BZV+EcWivEM56qxqqinubCfLe+mh5IgPDPuAkRZw6dfgxrAn5LNw/ty1EpTtTa6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riJ9nik6hLlNueiaZIfCbrtA3psscugvMPD58sSR4sQgwjM6LnycFV/AQgjREg64d4RI4iIVV98tUZZr2ME5E0R1WObR6e9ADj0Nc= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1149; 31:xlNLeUIg4T3orZd4XTCiCMiSFGSsC3OWYU7EyALgIrbgmRwOo3vKj7jtNZu1sFYxPDD/HrIcYDI7N/aW/yGHlHuAQfIVFTsqb18Ov+UOhQizYEzC/pukh8YAFtTJCQhZcbsgRbJq/+As4NxtSEnpB8mln0y3YR6N8E2BRPVpOEknLXz6cFnc3YabACYSJgDz771QDW1RbnTo6fwJpSedDNvCNNauH5oeGeryv3Nhc4LH6W3BDyaWESxWIzfQe80/rPqYNqu+BFmjrZj8BJJX1g4f5BxRzW/3qE1vSTClO5N1empBrDJ85K4EjHE1bUuu28/vE4RKnn8m67YjXSTdssULXTLqVH31EXo1sB8ydDD2FF5K+o7DU0jxGMj5HjyEgqOcckRM6BnwWhQzT0GJbsiLNKfFkGdRApTF0z9CY3tpHjPb5F55VQ6DvXkpSxm8JExqhJnprSp9us223LD5oqTtR6axk7C5rHRUkaLfqCSRa4FMv/MCjFqnxcfQoiHnezJDXKPwik8XUM3DIq0MF9Vfnl2GchFPCHWxbwTnhwjOJ1fJOCY+pglnxdzkBgmejezGoDLJDKgFxKLaUoFXzo33goMhASAHn3I2spMCDOSEwrJMr08xiNIYfgh6runp7iq1ysY7q7gxe4jWaDlk8s/xtJmXI+wDWUPRQVr7xf0= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1149; 20:rjmc9eHH+7FpvdTm8DfOjaMgJggDKHptKnG34KNFAYHhIXNK4Kn1eKvGIdpPVw5yM1G7cbD7kUfVFmvgSqx1Vpz647b2m1rtPj/YMe1IurVC/xuX+XwdpFLWNglONPA3O8Oodt6JiNCr8keK2pkdM9qq1FVsoljlkSNuM/bpSbpS6XA0pre+A7llNGTBG8NeCXJQp5OkTwhGiAEiVewketuU9udslpeKJXH75vk37HV6i6MdE0c6yZXMb+iXpyBbL50HccdKHUc9CPIGc6bbD0KuYNL4FgVoVVbggJtj1phQNK1NkA4BgSo3WHJuQhlCNLxcdRQXsSCJ0zml9Cos9hi6gsRdGksaikEsAa9vQMNrUM3KqM/eF1uFU3bRXa+yROCk+eTMxA8aGp0d+s4D1EfIAtI6uVUXy58krZx9Bgbyqa9atOqzamqGtcVcTm67YS3Mx5HMLxbu+vkQCtcaetKgpNnAtDnjgEZL8CY8DMP9xqTheml6/CSsG51l/W5R X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1149; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1149; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTQ5OzQ6TEdNMGlLZGdPVFRjNXpGZ2ZiU2laS2RPVDF6?= =?utf-8?B?VTRaWllhUDRLT0tYWjN5ejVMM3lRMDVmbG9mT3JpN0xUdEVUbnV0ZEc3VGxG?= =?utf-8?B?UlRBRWFzS3l0TVVwcVROM3MzNzNta2JhRzJVNERJQkJkdWZJSHZvWkpqdWxJ?= =?utf-8?B?T0VYdnZoZVhLSWhsb2ZwU1RvWUdzTitQVDZ2b0Q3S1Zncy9VUno3aG9mUVVm?= =?utf-8?B?WU82azVnY1orcHdId3c2Z2JpSEZRSEdYb1VkZ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BiWW1WWU81SFQwSEdWUC81TURJZStJQ3JaNlFCMFVDMFpM?= =?utf-8?B?dmlILzQ2NXhNaDBiMG5VYzhNL3FOTXQ1R3g0T3NDdVR4TlZUVHF0WmY1RnNP?= =?utf-8?B?VDEyWk9qbmxKTDZIVkxNN0d0NmJYRG5XTUdSWllFL2U3ekdnRktoL2FEN09t?= =?utf-8?B?emdzR3dZeUpiSlV0K0tsU1RlUWJKa3gzbVZZZTJNdFhFaUlVOHdUdXlJaFIx?= =?utf-8?B?ZE5QNkxsUFRWRUpQbGFuRW9HMUFUNXppU05HWTg3NjBzazgvUUdXQzJRV2Ix?= =?utf-8?B?dVFoenlTSW53UkRTNFgrYUJTYVkrenBXS0FzUWFDSmNXU1lsZWxPRlZrQlpj?= =?utf-8?B?WW1zdklLM3ZxT2hLME1BTGdGNEFWaU9TMlUwTWhzN28zSWdaejlCVjFLbFJh?= =?utf-8?B?eWpsVTMwNEQ1MzRac1U3R2VHWVJiS1RNV3NJNmovenliNGlSWjRiRjlYTWpK?= =?utf-8?B?TFZqaGVyUGpkQ3l6WjBkMlFHQnBQTUx0V1o5QU1GRVVxU3I5bW1aR0xKVXhi?= =?utf-8?Q?2K37nUuds0MUyiqZU=3D?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(97746001)(7736002)(230700001)(25786009)(103116003)(1076002)(83506001)(8676002)(81166006)(110136004)(86362001)(53936002)(189998001)(50986999)(54356999)(76176999)(6116002)(4001350100001)(38730400002)(3846002)(305945005)(2950100002)(6666003)(2906002)(33646002)(54906002)(55016002)(66066001)(42186005)(7416002)(7406005)(47776003)(50466002)(6506006)(53416004)(23676002)(478600001)(5660300001)(72206003)(9686003)(4326008)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1149; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv;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aTw92O0= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1149; 20:3wadgQG+cWgq7vaLvBdRYSlmeZppnyGT89K0y1SJf5hdhCLGIW1SW/NeUkEggOmqjzVWIGynTCmhqDbuTOX3SKsHfNgO/9Cf978yGsKqw6cE+ot6JAXIhuT2kwBcPhnB7sK0ttB62xRVxiMu3b4m5qjafAGe7NatwftpW8gsEqv1pCcMrSVGfQ4eOupl1JS5K7pbxDouR3pWmff+4UvuorJ4yVYoA4jM4hfcQ5upBFUj2WENOvKjdfdUehOH172Y X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:14:28.6876 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1149 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 v8 RESEND 36/38] 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 --- 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); +}