From patchwork Thu Feb 23 17:03:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Venu Busireddy X-Patchwork-Id: 9588623 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 170A260578 for ; Thu, 23 Feb 2017 17:06:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00F34286E4 for ; Thu, 23 Feb 2017 17:06:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9E992893F; Thu, 23 Feb 2017 17:06:20 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY 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 BC6AC286E4 for ; Thu, 23 Feb 2017 17:06:19 +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 1cgwoQ-0006Gb-GV; Thu, 23 Feb 2017 17:04:14 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgwoO-0006GK-Sk for xen-devel@lists.xen.org; Thu, 23 Feb 2017 17:04:12 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 48/11-12625-C061FA85; Thu, 23 Feb 2017 17:04:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRWlGSWpSXmKPExsXSO6nOVZdbbH2 EwZxLmhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aPjq1sBYcFK/qvfWBvYPzP28XIySEkMJFJ 4tRlpy5GLiD7L6PEhLtfmCCcjYwSj/63sEE4nYwS3c9mMYG0sAkYSBw93MMKYosIyEr8/b+dG cRmFmhmllj0SBHEFhaIkLhxeTI7iM0ioCqx5PYRFhCbV8BDYvrJdWwgtoSAnMTNc53MELahxO mH2xgnMPIsYGRYxahRnFpUllqka2iul1SUmZ5RkpuYmaNraGCsl5taXJyYnpqTmFSsl5yfu4k R6HsGINjB+PK05yFGSQ4mJVHeZxfXRQjxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4L0vsj5CSLAo NT21Ii0zBxiEMGkJDh4lEd6PIGne4oLE3OLMdIjUKUZFKXFeIVGghABIIqM0D64NFviXGGWlh HkZgQ4R4ilILcrNLEGVf8UozsGoJMy7BWQ8T2ZeCdz0V0CLmYAWWzqvBVlckoiQkmpglOzU83 185JNW1HZLjbrPksH7copfrNhbumsRe1FtYLvK1W/bTnHs7Km89SbzR6AUV/MJMaU1Zz/VTj7 Fv6zSZuWWWcFcTw0LHkm3l0TaPhMyTeqe2/Bqx67FGwxnXHp4WXKNlpF8EmPc88TNnP0v5Lxd eWdyfvePte/+Hfck4/phjbQ+nkWzlFiKMxINtZiLihMBvPm93ncCAAA= X-Env-Sender: venu.busireddy@oracle.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1487869449!87130242!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46329 invoked from network); 23 Feb 2017 17:04:11 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 23 Feb 2017 17:04:11 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1NH42w3023002 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Feb 2017 17:04:02 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v1NH41nO014155 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Feb 2017 17:04:02 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v1NH41FX005371; Thu, 23 Feb 2017 17:04:01 GMT Received: from lenovo.localdomain (/24.55.20.143) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 Feb 2017 09:04:00 -0800 From: Venu Busireddy To: venu.busireddy@oracle.com Date: Thu, 23 Feb 2017 11:03:55 -0600 Message-Id: <1487869435-1661-1-git-send-email-venu.busireddy@oracle.com> X-Mailer: git-send-email 2.7.4 X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Jan Beulich , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH v2] iommu: Elaborate the usage of RMRR specification on the command line 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP As some users have suggested, elaborate the usage of RMRR specification on the command line, and provide a usage example. Also, always treat the specified page numbers as hexadecimal values. Signed-off-by: Venu Busireddy Acked-by: Roger Pau Monné Reviewed-by: Jan Beulich Acked-by: Kevin Tian --- Changes in v2: - Provide a better usage example. - Treat input page numbers as hexadecimal values. docs/misc/xen-command-line.markdown | 10 ++++++++++ xen/drivers/passthrough/vtd/dmar.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index 3acbb33..a035c3f 100644 --- a/docs/misc/xen-command-line.markdown +++ b/docs/misc/xen-command-line.markdown @@ -1406,6 +1406,16 @@ If segment of the first device is not specified, segment zero will be used. If other segments are not specified, first device segment will be used. If a segment is specified for other than the first device and it does not match the one specified for the first one, an error will be reported. + +'start' and 'end' values are page numbers (not full physical addresses), +in hexadecimal format (can optionally be preceded by "0x"). + +Usage example: If device 0:0:1d.0 requires one page (0xd5d45) to be +reserved, and device 0:0:1a.0 requires three pages (0xd5d46 thru 0xd5d48) +to be reserved, one usage would be: + +rmrr=d5d45=0:0:1d.0;0xd5d46-0xd5d48=0:0:1a.0 + Note: grub2 requires to escape or use quotations if special characters are used, namely ';', refer to the grub2 documentation if multiple ranges are specified. diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index 9484f3b..436a533 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -1097,13 +1097,13 @@ static void __init parse_rmrr_param(const char *str) unsigned long start, end; do { - start = simple_strtoul(cur = s, &s, 0); + start = simple_strtoul(cur = s, &s, 16); if ( cur == s ) break; if ( *s == '-' ) { - end = simple_strtoul(cur = s + 1, &s, 0); + end = simple_strtoul(cur = s + 1, &s, 16); if ( cur == s ) break; }