From nobody Sun Feb 8 19:43:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1640076444; cv=none; d=zohomail.com; s=zohoarc; b=X2kM7ueaR1Q8Ew2TbzEKE2YFCxgP+c9G/9MXT2rnYfsjdbpOkJcj8gB3yADCcYIAMXDm3dlvVpMtV4dWvwakroo2OMYcEfsMA2hMEXG7TIdh9MtzTgQtDNtZMl6KZxINR+7P9kn+lXNrWZ7LnMJLeugT7MCIgF+AvIK5RyScI0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640076444; h=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; bh=NwQ4mRiosEanvExB6LuAnyU1/Dqqja/tWJzhJY5Y3Ms=; b=ayxqT/mBMDOhNF14pDOF/0CZn2ogjun/xvz8nFhfthna4I45/TiCeaA4z2JO8MFK72MzabqCXpJJNOwDYJBLliIup6epjOnwZjzciJMQtnakC+dCOvofIQma4165IIIQY8R/SrDXhTPl7MnbvegECqStRJ21EI/s5Hmo69ufGLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1640076444887332.3193260632694; Tue, 21 Dec 2021 00:47:24 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.250184.430883 (Exim 4.92) (envelope-from ) id 1mzanS-0003gV-OH; Tue, 21 Dec 2021 08:46:58 +0000 Received: by outflank-mailman (output) from mailman id 250184.430883; Tue, 21 Dec 2021 08:46:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mzanS-0003fM-Dj; Tue, 21 Dec 2021 08:46:58 +0000 Received: by outflank-mailman (input) for mailman id 250184; Tue, 21 Dec 2021 08:46:57 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mzanR-0002z5-5G for xen-devel@lists.xenproject.org; Tue, 21 Dec 2021 08:46:57 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8be91413-623a-11ec-8d39-b1a4ed000e3e; Tue, 21 Dec 2021 09:46:53 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9AABA210FE; Tue, 21 Dec 2021 08:46:53 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 727C513BEC; Tue, 21 Dec 2021 08:46:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mCPKGn2UwWFHMAAAMHmgww (envelope-from ); Tue, 21 Dec 2021 08:46:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8be91413-623a-11ec-8d39-b1a4ed000e3e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1640076413; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NwQ4mRiosEanvExB6LuAnyU1/Dqqja/tWJzhJY5Y3Ms=; b=toWR3hQZog096RnIYPQ1YgpGL+3XJJxAKXFR7/u0lBiMX8IQz65YmqikDO2VThhMo2Tr3m QGM+C2XHhFTEbmPyMPCNWoSGauQPn5SGNIQF/NQb6AZvt55hcNQR2AXv5iD2Q63LhjqSzl Ssb+a4Zou4T5AnVmYfO6lj2lQbaarsg= From: Juergen Gross To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org Cc: samuel.thibault@ens-lyon.org, wl@xen.org, Juergen Gross Subject: [PATCH v3 08/10] mini-os: add proper pvh grant table handling Date: Tue, 21 Dec 2021 09:46:34 +0100 Message-Id: <20211221084636.6987-9-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211221084636.6987-1-jgross@suse.com> References: <20211221084636.6987-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1640076446538100005 Content-Type: text/plain; charset="utf-8" Grant table initialization for PVH requires some additional actions compared to PV mode. Add those. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- arch/x86/gnttab.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/x86/gnttab.c b/arch/x86/gnttab.c index 56e59d7..281c207 100644 --- a/arch/x86/gnttab.c +++ b/arch/x86/gnttab.c @@ -22,11 +22,15 @@ */ =20 #include +#include +#include #include #include #include #include +#include =20 +#ifdef CONFIG_PARAVIRT grant_entry_v1_t *arch_init_gnttab(int nr_grant_frames) { struct gnttab_setup_table setup; @@ -39,6 +43,33 @@ grant_entry_v1_t *arch_init_gnttab(int nr_grant_frames) HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1); return map_frames(frames, nr_grant_frames); } +#else +grant_entry_v1_t *arch_init_gnttab(int nr_grant_frames) +{ + int i, rc; + struct xen_add_to_physmap xatp; + unsigned long pfn; + unsigned long frames[nr_grant_frames]; + + pfn =3D e820_get_reserved_pfns(nr_grant_frames); + for ( i =3D 0; i < nr_grant_frames; i++ ) + { + xatp.domid =3D DOMID_SELF; + xatp.idx =3D i; + xatp.space =3D XENMAPSPACE_grant_table; + xatp.gpfn =3D pfn + i; + rc =3D HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp); + if ( rc ) + { + xprintk("could not init grant table\n"); + do_exit(); + } + frames[i] =3D pfn + i; + } + + return map_frames(frames, nr_grant_frames); +} +#endif =20 void arch_suspend_gnttab(grant_entry_v1_t *gnttab_table, int nr_grant_fram= es) { --=20 2.26.2