From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D863C4360F for ; Thu, 4 Apr 2019 09:39:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E09E420820 for ; Thu, 4 Apr 2019 09:39:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CBadh8Ns"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="BEfDEymY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E09E420820 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BPZGK5V+3F1umQzvMaomIL6l+NzUqCVBoniT5pL8FUg=; b=CBadh8Ns+rFyaB VU8YaEOOYtalWo3Kt2pjnEaAtXu3Jph+mOKFao0ymOV4fgjKgZEFnGLXzHO91a27/s0KMAqyy2l0W s6D/zeHQ82yDejMsWCKfRK33nE9NnxbIwUUCuUwmsQi6cCuRoTu4RjOP3V9BK+6osNxWHrP0SMDvO 25EkH7atLaHMErboRi6gn+Ai4MtnbRHgc850LtHV6ybAHaEjobtntGxq6pAZKJ9+OkingtYtgquoI 1S+ujVSK734ggQiRQSHUfMq5w7src5lGfUjrEi0WiBcO+Ng0mlSA+71hVqCZRijGTuvzA70aI7iay vwUuhI2Nh3Hp/MuaMB9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBypm-0004mD-DF; Thu, 04 Apr 2019 09:38:58 +0000 Received: from mail-eopbgr150075.outbound.protection.outlook.com ([40.107.15.75] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBypi-0004lU-Sk for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2019 09:38:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YwVhfPJJQBNGvkpxJt2/xoDXbkFPQ9QfEAe0+bdX4vM=; b=BEfDEymYKUX9D9/dgKsuNpl/Z/P2EdT/qBd6N4PxdnX9aovA3JFpd7KHpf1NwQaQEg6uVl5V6sAmd4rbo6ysGCt9rzt0KNe60+XanCv9RGJzOt+0fN5rhoOlStEg/EH1GYqtMSuaeTE6WraDS+xEeWYGSJONTXstuIXvIVnYxuM= Received: from VE1PR08MB4847.eurprd08.prod.outlook.com (10.255.113.87) by VE1PR08MB4640.eurprd08.prod.outlook.com (10.255.27.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.20; Thu, 4 Apr 2019 09:38:49 +0000 Received: from VE1PR08MB4847.eurprd08.prod.outlook.com ([fe80::3582:3f31:4569:21a3]) by VE1PR08MB4847.eurprd08.prod.outlook.com ([fe80::3582:3f31:4569:21a3%8]) with mapi id 15.20.1771.016; Thu, 4 Apr 2019 09:38:49 +0000 From: Dave P Martin To: Andrew Jones Subject: Re: [PATCH v7 26/27] KVM: Document errors for KVM_GET_ONE_REG and KVM_SET_ONE_REG Thread-Topic: [PATCH v7 26/27] KVM: Document errors for KVM_GET_ONE_REG and KVM_SET_ONE_REG Thread-Index: AQHU6lu4vG4sxWgk+ki0DR8rGDxmvqYrvsAA////q4CAAAFEgA== Date: Thu, 4 Apr 2019 09:38:49 +0000 Message-ID: <20190404093846.GD27348@e103592.cambridge.arm.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-27-git-send-email-Dave.Martin@arm.com> <20190403202746.yoxwokr5uitli5q4@kamzik.brq.redhat.com> <20190404083526.GZ3567@e103592.cambridge.arm.com> <20190404093415.kt6cvagteszwmyzi@kamzik.brq.redhat.com> In-Reply-To: <20190404093415.kt6cvagteszwmyzi@kamzik.brq.redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.5.23 (2014-03-12) x-originating-ip: [217.140.106.49] x-clientproxiedby: LNXP265CA0002.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::14) To VE1PR08MB4847.eurprd08.prod.outlook.com (2603:10a6:802:a6::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Dave.Martin@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f7594237-a017-4e65-09ed-08d6b8e15755 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR08MB4640; x-ms-traffictypediagnostic: VE1PR08MB4640: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(136003)(396003)(346002)(189003)(199004)(40434004)(478600001)(2906002)(6916009)(6246003)(33656002)(68736007)(186003)(93886005)(446003)(256004)(11346002)(71200400001)(5660300002)(8676002)(97736004)(476003)(6116002)(486006)(8936002)(105586002)(305945005)(81166006)(81156014)(52116002)(3846002)(66066001)(54906003)(76176011)(14454004)(4326008)(102836004)(26005)(25786009)(99286004)(106356001)(7736002)(71190400001)(14444005)(58126008)(86362001)(53936002)(72206003)(6512007)(6436002)(6506007)(6486002)(1076003)(5024004)(229853002)(386003)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4640; H:VE1PR08MB4847.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Dhz4OfJWvruyPrfXzIM9fh3KRG+ozdxRqVZ14e1l4DlajnascnK3G/uRdMkNM27Ucaz2V/rshuboYAoU+eeUGDJ+CB0xWvUouJWRRl3lppfe40dcjJkx/4PTtwlWjBqaVx2ox0foWXQO7U83DVpvEgRIzlPqRyqjOfDSwBoNq/lywhRhpZFGX0V/xMxuW77+qX/irdu06keB4Er9oaQ7Hv7Rfg2/R4667pBFDvDIItbrk0Pvv9BeINX8M8uiRtg08ct2ouRVrhxk2uqWFDL/9+grCKuf7CLODoznjB7p+3oSZxjdBT2xjRKvUrhjKsvz7MYTKvIcxwZt6B6CX59SGawQk9AfSV3XCgH6cp08fIsQNGSgXEQ5qVR8klN3phG1f0LOdsgegGIyZsyV5HE2szfoHq+ii1ltSv4k7DTKlCE= Content-ID: <1D2AF4F3301D244FB2E45127E9CE9697@eurprd08.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7594237-a017-4e65-09ed-08d6b8e15755 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 09:38:49.4619 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4640 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190404_023855_005731_34AF1709 X-CRM114-Status: GOOD ( 30.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "tokamoto@jp.fujitsu.com" , Christoffer Dall , Ard Biesheuvel , Marc Zyngier , Catalin Marinas , Will Deacon , Zhang Lei , Julien Grall , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 04, 2019 at 10:34:15AM +0100, Andrew Jones wrote: > On Thu, Apr 04, 2019 at 09:35:26AM +0100, Dave Martin wrote: > > On Wed, Apr 03, 2019 at 10:27:46PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:51PM +0000, Dave Martin wrote: > > > > KVM_GET_ONE_REG and KVM_SET_ONE_REG return some error codes that > > > > are not documented (but hopefully not surprising either). To give > > > > an indication of what these may mean, this patch adds brief > > > > documentation. > > > > > > > > Signed-off-by: Dave Martin > > > > --- > > > > Documentation/virtual/kvm/api.txt | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt > > > > index 2d4f7ce..cd920dd 100644 > > > > --- a/Documentation/virtual/kvm/api.txt > > > > +++ b/Documentation/virtual/kvm/api.txt > > > > @@ -1871,6 +1871,9 @@ Architectures: all > > > > Type: vcpu ioctl > > > > Parameters: struct kvm_one_reg (in) > > > > Returns: 0 on success, negative value on failure > > > > +Errors: > > > > + ENOENT: no such register > > > > + EINVAL: other errors, such as bad size encoding for a known register > > > > > > > > struct kvm_one_reg { > > > > __u64 id; > > > > @@ -2192,6 +2195,9 @@ Architectures: all > > > > Type: vcpu ioctl > > > > Parameters: struct kvm_one_reg (in and out) > > > > Returns: 0 on success, negative value on failure > > > > +Errors: > > > > + ENOENT: no such register > > > > + EINVAL: other errors, such as bad size encoding for a known register > > > > > > > > This ioctl allows to receive the value of a single register implemented > > > > in a vcpu. The register to read is indicated by the "id" field of the > > > > -- > > > > 2.1.4 > > > > > > > > > > Are we sure all architectures have these, and only these errors? A quick > > > grep indicates not. I'm not sure we can document this easily here due to > > > it addressing all architectures at once. Maybe we could add arch-specific > > > subsections, but I'm not sure it's worth it. > > > > Error codes are generally indicative at best, and rarely mutually > > exclusive in a given situation. > > > > Writing a caveat to say that you shouldn't make assumptions about > > precisely what error code will be returned in a given situation would > > look odd: that really applies widely all over the kernel/user ABI, not > > just here. > > > > _Maybe_ everything is exhaustively correct in this file already, but > > given the size of it, and the fact that many things are implemented > > per-arch, the chance of this seems zero. > > > > I could add "invalid register ID" for EINVAL. This allows some > > ambiguity about which error code applies for a nonexistent register. > > > > Alternatively, we could revert this documentation instead. > > Yeah, I vote we just drop this patch. It could add more confusion > when people start here to determine what to grep and then, when > grepping for it, can't find any occurrences, as would be the case > for ENOENT on at least a couple arches. I guess so. It's not like we're claiming this ioctl _can't_ fail. So leaving interpretation of the errno values to common sense is reasonable. > > It seemed appropriate to document the EPERM error for finalization > > ordering (added later), but since correct userspace code should never > > see this maybe it's reasonable to leave it undocumented(?) I assume you mean to remove this too? I don't think correctly written userspace should be relying on seeing this error code (as opposed to e.g., KVM_GET_REG_LIST's E2BIG which you must observe in order to allocate the right amount of memory for the reg list). Cheers ---Dave IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel