From patchwork Fri Jun 10 15:06:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12877685 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 01A87C43334 for ; Fri, 10 Jun 2022 15:07:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.346493.572305 (Exim 4.92) (envelope-from ) id 1nzgE8-000084-V2; Fri, 10 Jun 2022 15:07:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 346493.572305; Fri, 10 Jun 2022 15:07:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzgE8-00007x-RI; Fri, 10 Jun 2022 15:07:08 +0000 Received: by outflank-mailman (input) for mailman id 346493; Fri, 10 Jun 2022 15:07:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzgE7-00007q-Nb for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 15:07:08 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fc08f6b6-e8ce-11ec-bd2c-47488cf2e6aa; Fri, 10 Jun 2022 17:07:05 +0200 (CEST) Received: from mail-bn7nam10lp2103.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.103]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 10 Jun 2022 11:07:02 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by BL1PR03MB5990.namprd03.prod.outlook.com (2603:10b6:208:313::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Fri, 10 Jun 2022 15:06:59 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534%6]) with mapi id 15.20.5332.014; Fri, 10 Jun 2022 15:06:58 +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: fc08f6b6-e8ce-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1654873625; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=gLjesH+T+vskWvkJfj6lxRgqCjz0WxAY6hopuCRcj3Q=; b=FRGkTXG698kcW1zeKubHvEJRM+JVlja17SD46WCcurahR7oFSPmMGTsg BUMq2HQEVujW6AhI5Ga/uXK4NjfeqZuIhpOunUs7IjEok5BzWdG1Slo60 6SJHsTCYRAsWEUG+ZS18JAExgggIL/xMEOFshrGQXFxv54XPMlGJcIArL E=; X-IronPort-RemoteIP: 104.47.70.103 X-IronPort-MID: 73336691 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:5hSOHaIDBimjoqYoFE+RzZQlxSXFcZb7ZxGr2PjKsXjdYENS1DIGz DceW27SOK6KNjbzf9t/b4Wzp01Uu8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uW0PRozftQL4kd6yJvTgzru3qwFE2kO PUqxNlBMh342O5RBDGnTLdny3blBo+4X7rzlGVxVH5p9bieT48A81dwapEbxrw8SMbzZxB+Z MO+1jcm4tcDBvGkii4zcPPTQtWmk29pmdnufIPjkZYTZAVZNZq3MYiFXtuYdg99R/Bmc4a+L EENrCc2B8WSyLQU5nhhBgi/DT2NU5DXitvQSA5y7+oOnZt7TNEJnAjtbMid0c7he4AoqZ/lp r529xT5ddzp+8tHNdA7bQ6ML+K4lKke2O8DEuiZXLaKYogB1Xh77bK3ZRd3pDbRHVP9up7pK j8 X-IronPort-AV: E=Sophos;i="5.91,290,1647316800"; d="scan'208";a="73336691" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eWaYAyPX9tWgaYTn6DEYlAzgsi4cKYfbuhgncKMqKuaR+a+0ARcuY8krHcBltd8sObP5GeeEljk5HxWQX5zFMkdyp2DvOyfyv3XNHQ4Kkf1Trs1x/V3uCFHrnAekAoDX6xZJJwMLIsArsgwCHla5gFl1gE0uQb6ASDOyUCOuCUn43DgOhAZvPXIyZuYlTJJ5j6UcnEHLU75bYwnJ1GSfKlvG4XkhsAa5sGJ5I1VErJQPfxotmcm2nxjCmgFRV0pNqCidK8lBUkRyRIpr7okvf60zfVvU9Seiicu6NzJ0UM9PeLsL8qepcElXeiYopFy0MvUfBjlsqPhVyZiKBOdpVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wDxbl4piy7/vppSjjPgZ0j1j3gPTXxcYrvotx+cUcJA=; b=UJ5DmxGH50OD7boF956SJNrpZvaS/sMMzMIVE9ittV6ZFRG0uGX+MJJJ2vLvXTtxcVfsS5A/lYxjzYf1EfkJqzO9kQuPGjSbQqAlaFGPqTpqPjlDJrUBDPbCgunqFs+eZSZJVeaKUOq3H2QoEQqxR4O7u59ZniCDo+0fsm08z/W0zTefki/FHOwLkNRwOXhmwOiypb3aT+rQ5vwcI52Eh9JGqldhCclX0EITDBoPTc2gLJLVAyGPPRQlxtO0v3Z27mGK3FpVufiYqELzDyf5hu6bxB7R3QvWdYXa8axxGQ32yCLznlYPDPmspCSn7iKzCY7V+zbHcJMi/eQPEszi/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wDxbl4piy7/vppSjjPgZ0j1j3gPTXxcYrvotx+cUcJA=; b=gvm7D6vXLJqqZenfA4FJULdAgSALwOpKBWcJAGqTdUeuPvST78UjqRuPxoxn62WQNqyfHPDp6Zr7+3Q1u6xZDHuI8Wz5aRFuoGUIOJH6QKV02/7N7eyQ9Tk8zZHDzsO10nsBgBr8JOwsAVQs/Ts+Q03FvlZmcf0oq7LR53nVlT8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH] xen/console: do not drop serial output from the hardware domain Date: Fri, 10 Jun 2022 17:06:51 +0200 Message-Id: <20220610150651.29933-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.36.1 X-ClientProxiedBy: LO4P265CA0043.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::22) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42daa9e5-950b-487f-a280-08da4af2dd9b X-MS-TrafficTypeDiagnostic: BL1PR03MB5990:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0AiRMAzlfZjOI+IjKQtnhib43t6kR0ZvVD5xrhYn9lPav0I0vFShnzhy3bDHUECx+/213URsMyZJrZwpmjF9o9NEsUmzn0fUfR5UDiSJxOtW4VUQP5s4xRqlSPe7qJD4l4Cs6J6b4PRkmJrgGhg+Dt0H7rkXf4HgOoo+Ko2kLRl6bp9jmOxWMNqLlxEgYe7qEQpj8lQ3eRvdaKYJZH0/CO23qwimiWkrhWdqxgc9uL2llEaGhoRFLvYysO05AmJ3SbkKBOdbCEnnoOhGxXpKQxIR0fRuyodbcFwmWwWd+4FtwwlJr/Is4TqmbIqhUGPHIvjWH6qBzP8FcdoANbxLnMo6dvFYEiPBCsc98J3femCwEF98eQ/GvUSnIhfEyPTsf3U7KkckXZ+6FIEQfoao/A8rlBwgPHwp+YvWklcwLDWIGZuUvVz9ZpNANtYE/5ar8kJlNijWmi3W4TJrvUPN47C6TNTi/ghbICPpT3suHjXhGKG2Avt6rBIoPCt91Kz6v3NQK37IzNNsW4sBOdTTkehGqHTG79jpcNgWSjl2xkw+oww/FEgdaFFl1kfTIykERUi7lMV+RkhmOjndwZ7ohw5QJFoKyu4o3puVY66T05KzeovA6KAbAvGV07DdCtywG8EIjydPK41pJI1odVGWIA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(54906003)(5660300002)(316002)(36756003)(38100700002)(82960400001)(8936002)(2906002)(6916009)(83380400001)(66946007)(66556008)(66476007)(2616005)(1076003)(186003)(4326008)(8676002)(6486002)(6506007)(6512007)(26005)(6666004)(508600001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gYkqWHifggBAII7zeJ/DT3EXbuy+?= =?utf-8?q?8OPjN80UIYEU+FtZWdyBDP4XIxnJpu4aKdjoZpM9YpWCFqA0WgkKlfRmhITLGSMOl?= =?utf-8?q?n1Z/tzKIEptsFTD3FyfLeafbkJjJ5iN+EzGt5SzYy4c57Q0Z1lGRXtDNCOU/TgEub?= =?utf-8?q?IGTk4MgZgQ7XUBW3AG71VV545tL001lWE1RJxbyKv0olNO2A+yfJSuPXhYBrf9fzG?= =?utf-8?q?e7oyU5xHLlhKKRh0aXtrWwvBqhMz0bOaN+0uORO7o4WcM2DqlIRDIEIpUTWS0zvaw?= =?utf-8?q?ZrzulgaHTgoi1GwzngQTWmH2CO2zr5AhExOgsjl0map3Z13id8ezq1FfdGlAQFY5y?= =?utf-8?q?kuLHYExh8GJZLV5OR4GfQLJiNrLHl70ia1nrQNlzxu/8Isp3TMiJKDxGfHSftqFwY?= =?utf-8?q?WCugpn/nvQQlb14S72quA/fZMAUOPpaWJDicQ6/68yfNmfZf8HOu0LKpBf3xTcSqq?= =?utf-8?q?0Jwmh9+VEKiddGrcB/S55zi6agAAEB9XJSGAP6QbdEklhAeR7BQ3xo/UpuTuxLDJd?= =?utf-8?q?yJ1RNjmCB2TM4ExwQCiEp8qFy4j9w2X+bz+/5vbw9r/ayhJ9BDsqUtNMCT2DQcai1?= =?utf-8?q?8v2cLqSR3w364lsXft0W4mCwCfNAR0pRA93SDGwHtAnkoSheFezH4kh9nYjyp64C1?= =?utf-8?q?8IaSeitlU5e+3dQJFUUBUss2UKFabMTsZHgn1xcF9FQYwEuAnTmlzndDN0LvX8gg/?= =?utf-8?q?7g22+VW7bxukcyXzsoQ655We0CxXIYrtclchO/ATKKsmzpWhF4IHIC5oE6IjhctRP?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stTLADqO/KwOZ8ySKEVKfpezo9jryJO9Q+mCpmt6/we1VhR9geY=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42daa9e5-950b-487f-a280-08da4af2dd9b X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 15:06:58.9195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aDRA+3F3NB2LWckew0C76ptc2IsOsIqPY26vCrNNHrS0xhPerO9TUYgh7OEWqweqqadSxAyppEnqK6i9e5Y3nQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB5990 Prevent dropping console output from the hardware domain, since it's likely important to have all the output if the boot fails without having to resort to sync_console (which also affects the output from other guests). Do so by pairing the console_serial_puts() with serial_{start,end}_log_everything(), so that no output is dropped. Note that such calls are placed inside of a section already protected by the console_lock so there are no concurrent callers that could abuse of the setting of serial_start_log_everything(). Signed-off-by: Roger Pau Monné --- xen/drivers/char/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index f9937c5134..13207f4d88 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -614,7 +614,10 @@ static long guest_console_write(XEN_GUEST_HANDLE_PARAM(char) buffer, /* Use direct console output as it could be interactive */ spin_lock_irq(&console_lock); + serial_start_log_everything(sercon_handle); console_serial_puts(kbuf, kcount); + serial_end_log_everything(sercon_handle); + video_puts(kbuf, kcount); #ifdef CONFIG_X86