From patchwork Wed Dec 8 08:47:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 12663909 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02BB5C433F5 for ; Wed, 8 Dec 2021 08:48:01 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.242082.418758 (Exim 4.92) (envelope-from ) id 1muscC-0001q9-1X; Wed, 08 Dec 2021 08:47:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 242082.418758; Wed, 08 Dec 2021 08:47:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1muscB-0001po-TU; Wed, 08 Dec 2021 08:47:51 +0000 Received: by outflank-mailman (input) for mailman id 242082; Wed, 08 Dec 2021 08:47:50 +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 1muscA-0001K1-7I for xen-devel@lists.xenproject.org; Wed, 08 Dec 2021 08:47:50 +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 8503115e-5803-11ec-a831-37629979565c; Wed, 08 Dec 2021 09:47:48 +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 0B6352191A; Wed, 8 Dec 2021 08:47:48 +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 D68F813F3B; Wed, 8 Dec 2021 08:47:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id AOoeMzNxsGGzdQAAMHmgww (envelope-from ); Wed, 08 Dec 2021 08:47:47 +0000 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: 8503115e-5803-11ec-a831-37629979565c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1638953268; 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=nT3PojRsjaFLQH8p/xAS/Bo0Edytu7k5yswmTd3p+WU=; b=UvBlVWL1x0/G7DJ4GahBrQIUwzTNp7P6vYBL61uj9csWpmzLvAgjU6q1K2PEqq5F7jKpjk oeSQqU35zbMmC3i4UhtxsDczk7qjozkgZIJyVfe9Ts6ej+AACj+iJiD6W7ODW0+jds/IH5 g7UcKdnXiarpssq735mbcS1rfVXJW/Y= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Ian Jackson , Wei Liu , Andrew Cooper Subject: [PATCH v3 1/2] tools/helpers: fix PVH xenstore-stubdom console parameters Date: Wed, 8 Dec 2021 09:47:44 +0100 Message-Id: <20211208084745.31082-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211208084745.31082-1-jgross@suse.com> References: <20211208084745.31082-1-jgross@suse.com> MIME-Version: 1.0 When using a PVH mode xenstore-stubdom the frame number of the console should be a PFN instead of a MFN. Signed-off-by: Juergen Gross Reviewed-by: Andrew Cooper --- V2: - rename variable (Andrew Cooper) --- tools/helpers/init-xenstore-domain.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c index b205a79ee6..9457d0251b 100644 --- a/tools/helpers/init-xenstore-domain.c +++ b/tools/helpers/init-xenstore-domain.c @@ -30,7 +30,7 @@ static char *param; static char *name = "Xenstore"; static int memory; static int maxmem; -static xen_pfn_t console_mfn; +static xen_pfn_t console_gfn; static xc_evtchn_port_or_error_t console_evtchn; static struct option options[] = { @@ -283,7 +283,9 @@ static int build(xc_interface *xch) } rv = 0; - console_mfn = xc_dom_p2m(dom, dom->console_pfn); + console_gfn = (dom->container_type == XC_DOM_PV_CONTAINER) + ? xc_dom_p2m(dom, dom->console_pfn) + : dom->console_pfn; err: if ( dom ) @@ -528,7 +530,7 @@ int main(int argc, char** argv) do_xs_write_dir_node(xsh, fe_path, "tty", ""); snprintf(buf, 16, "%d", console_evtchn); do_xs_write_dir_node(xsh, fe_path, "port", buf); - snprintf(buf, 16, "%ld", console_mfn); + snprintf(buf, 16, "%ld", console_gfn); do_xs_write_dir_node(xsh, fe_path, "ring-ref", buf); xs_close(xsh);