From nobody Mon May 6 16:52:58 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1558711493; cv=none; d=zoho.com; s=zohoarc; b=FmaxctK6PCcc1a+vC5Rkchiq7ToIFOdtd9qWZjOX84HeLfdETAl7N3ip4Oj8aejh22egrD9a/4hjxdsIGZNqdrgFrNyEYm6dLN/WfSzRW7ytvrkh2WB7D6KakhbpZ6pbpGYhiO/P1/W0rjRVSUdIHaukNEDR72q9WducTZlU/gE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558711493; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=I32xg9PzXhQCWuO1K6mcbyZN9o8AZ2BRMxB4evHaPns=; b=nk17P5bpBz9Wn+qIQdSFmJkdzDleoij+Zqyn9RKW6uwy1+QN34zn2HPXmfjsof+WIMb8+bc9IrYCE1i3AOh2686TEH1Z7hLxTciEONd96UE8l6ewrgpD9y2m1q7W+4n1kyxdODajiT8EgyMjjS6hmNVCSb8vxIYRRwVyUf1JIlk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 155871149321435.63195923504918; Fri, 24 May 2019 08:24:53 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hUC2Z-0000kA-8e; Fri, 24 May 2019 15:23:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hUC2X-0000k5-95 for xen-devel@lists.xenproject.org; Fri, 24 May 2019 15:23:25 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dd65df6e-7e37-11e9-b26c-6b9b4f3bcd6b; Fri, 24 May 2019 15:23:21 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 03AD7AF52; Fri, 24 May 2019 15:23:21 +0000 (UTC) X-Inumbo-ID: dd65df6e-7e37-11e9-b26c-6b9b4f3bcd6b X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 24 May 2019 17:23:18 +0200 Message-Id: <20190524152318.19735-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v2] xen/vm_event: fix rc check for uninitialized ring X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Tamas K Lengyel , Wei Liu , Razvan Cojocaru , George Dunlap , Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" vm_event_claim_slot() returns -EOPNOTSUPP for an uninitialized ring since commit 15e4dd5e866b43bbc ("common/vm_event: Initialize vm_event lists on domain creation"), but the callers test for -ENOSYS. Correct the callers. Signed-off-by: Juergen Gross Acked-by: George Dunlap Acked-by: Razvan Cojocaru --- V2: add blank line (Jan Beulich) replace two further ENOSYS returns with EOPNOTSUPP (Razvan Cojocaru) --- xen/arch/x86/mm/p2m.c | 3 ++- xen/common/monitor.c | 2 +- xen/common/vm_event.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 57c5eeda91..8fd3c9d996 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -1705,7 +1705,8 @@ void p2m_mem_paging_populate(struct domain *d, unsign= ed long gfn_l) =20 /* We're paging. There should be a ring */ int rc =3D vm_event_claim_slot(d, d->vm_event_paging); - if ( rc =3D=3D -ENOSYS ) + + if ( rc =3D=3D -EOPNOTSUPP ) { gdprintk(XENLOG_ERR, "Domain %hu paging gfn %lx yet no ring " "in place\n", d->domain_id, gfn_l); diff --git a/xen/common/monitor.c b/xen/common/monitor.c index cb5f37fdb2..d5c9ff1cbf 100644 --- a/xen/common/monitor.c +++ b/xen/common/monitor.c @@ -98,7 +98,7 @@ int monitor_traps(struct vcpu *v, bool sync, vm_event_req= uest_t *req) { case 0: break; - case -ENOSYS: + case -EOPNOTSUPP: /* * If there was no ring to handle the event, then * simply continue executing normally. diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c index 6e68be47bc..6833c21544 100644 --- a/xen/common/vm_event.c +++ b/xen/common/vm_event.c @@ -64,7 +64,7 @@ static int vm_event_enable( /* The parameter defaults to zero, and it should be * set to something */ if ( ring_gfn =3D=3D 0 ) - return -ENOSYS; + return -EOPNOTSUPP; =20 vm_event_ring_lock_init(*ved); vm_event_ring_lock(*ved); @@ -465,7 +465,7 @@ static int vm_event_grab_slot(struct vm_event_domain *v= ed, int foreign) unsigned int avail_req; =20 if ( !ved->ring_page ) - return -ENOSYS; + return -EOPNOTSUPP; =20 vm_event_ring_lock(ved); =20 @@ -513,7 +513,7 @@ bool vm_event_check_ring(struct vm_event_domain *ved) * this function will always return 0 for a guest. For a non-guest, we ch= eck * for space and return -EBUSY if the ring is not available. * - * Return codes: -ENOSYS: the ring is not yet configured + * Return codes: -EOPNOTSUPP: the ring is not yet configured * -EBUSY: the ring is busy * 0: a spot has been reserved * --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel