From nobody Tue Feb 10 04:17:28 2026 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=1566224963; cv=none; d=zoho.com; s=zohoarc; b=jxG3eUspFDWz5sQZQvVhEitddA8eUSh9U3IW7CBLttyln8bXLSxuiYRANuKNh8aSvr2Tc8XiWjHc3KsPWQX7uHSQWxMOH1khc0/08Bko2URhgvXjhS2eh5rOlIa3smKNkuF3V+19N6/OJC5s5gUtXis82wk1g5wCzDgNXewbfgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566224963; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Cm0cPtxEyRX2EOFBwp4YFmukFT9Ue/LvB0n8E7zK0NU=; b=Xd9TrB6hsNfkheNsZfz8F6fH1lcvqnNFhtxbb1G/hZDJriyrkdSh95/KVKHxnkdvUk36zk7R4kOAy/jawwDIgXtW7pVQ1R8zOIkjRmXEpQWZrs6KE/mlrkdXsPWjdmxaBB1wez0EdJIZlqSfqVjrOq42JwAjg3dGhnSs6hciOVs= 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 1566224963343449.27309036744987; Mon, 19 Aug 2019 07:29:23 -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 1hzicj-0007I8-96; Mon, 19 Aug 2019 14:27:05 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hzici-0007Ht-2I for xen-devel@lists.xenproject.org; Mon, 19 Aug 2019 14:27:04 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 69736474-c28d-11e9-b90c-bc764e2007e4; Mon, 19 Aug 2019 14:27:02 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7D9DC1576; Mon, 19 Aug 2019 07:27:02 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29E2E3F718; Mon, 19 Aug 2019 07:27:01 -0700 (PDT) X-Inumbo-ID: 69736474-c28d-11e9-b90c-bc764e2007e4 From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 19 Aug 2019 15:26:51 +0100 Message-Id: <20190819142651.11058-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190819142651.11058-1-julien.grall@arm.com> References: <20190819142651.11058-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v4 2/2] xen/domain: Use typesafe gfn in map_vcpu_info 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: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich 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" At the same time, modify the documentation of the hypercall to reflect the real meaning of the field mfn. Signed-off-by: Julien Grall --- Changes in v4: - Patch added --- xen/common/domain.c | 6 +++--- xen/include/public/vcpu.h | 2 +- xen/include/xen/domain.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index e8f6dfbdf1..915ebca190 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1282,7 +1282,7 @@ int vcpu_reset(struct vcpu *v) * of memory, and it sets a pending event to make sure that a pending * event doesn't get missed. */ -int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset) +int map_vcpu_info(struct vcpu *v, gfn_t gfn, unsigned offset) { struct domain *d =3D v->domain; void *mapping; @@ -1299,7 +1299,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, = unsigned offset) if ( (v !=3D current) && !(v->pause_flags & VPF_down) ) return -EINVAL; =20 - page =3D get_page_from_gfn(d, _gfn(gfn), NULL, P2M_ALLOC); + page =3D get_page_from_gfn(d, gfn, NULL, P2M_ALLOC); if ( !page ) return -EINVAL; =20 @@ -1538,7 +1538,7 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUE= ST_HANDLE_PARAM(void) arg) break; =20 domain_lock(d); - rc =3D map_vcpu_info(v, info.mfn, info.offset); + rc =3D map_vcpu_info(v, _gfn(info.mfn), info.offset); domain_unlock(d); =20 break; diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h index 3623af932f..dc4c6a72a0 100644 --- a/xen/include/public/vcpu.h +++ b/xen/include/public/vcpu.h @@ -182,7 +182,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_set_singleshot_timer_t); */ #define VCPUOP_register_vcpu_info 10 /* arg =3D=3D vcpu_register_vcpu_i= nfo_t */ struct vcpu_register_vcpu_info { - uint64_t mfn; /* mfn of page to place vcpu_info */ + uint64_t mfn; /* gfn of page to place vcpu_info */ uint32_t offset; /* offset within page */ uint32_t rsvd; /* unused */ }; diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 3f09cb66c0..7e754f7cc0 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -58,7 +58,7 @@ void free_pirq_struct(void *); int arch_vcpu_create(struct vcpu *v); void arch_vcpu_destroy(struct vcpu *v); =20 -int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset); +int map_vcpu_info(struct vcpu *v, gfn_t gfn, unsigned offset); void unmap_vcpu_info(struct vcpu *v); =20 int arch_domain_create(struct domain *d, --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel