Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2242986pxb; Fri, 17 Sep 2021 05:43:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJMv6SE1Lzbp2atDsALSBTgn8KqLhE/Is+QcPKmYO9Ppqg4EJ4GhBwW8pBvLci4jquF9en X-Received: by 2002:a02:5b0a:: with SMTP id g10mr8817476jab.112.1631882600977; Fri, 17 Sep 2021 05:43:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631882600; cv=pass; d=google.com; s=arc-20160816; b=IAfzac8zzaxPsVn1FHCV/MfQX6XdyyZn5bUZO1tY6Krrm7M3VMuK2WcQtgTsoy46a6 2pfiwYdghoczeM+J9xEM3QEQekQcbk6XE7UE3aCVhTe7OkHDPOg19Lc38lN6Y+CSBQ6j Ml0iU620aPqP+INKDJSXMhz4MSa7FpoNVjMxtJGxMRlOGKNAcHv8F74Gcd8uOqJTlEFw cSp3i0mhGLcIBaPmAySJicUmgnvPAyi71YotvKbHqidjlxT6Ux7f+hqxDKH18l6rFusH VCaVpDKjNndnMNpjZ+37f86Jou8UwDgOvH7bQqIBE0SWLCb2GWVNTwFgatJITFnzK7TG zlPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=s7rb3jCSHExyz8eZmcspOvf3jieEjAd49nmXFnNZWiI=; b=MF/TwOi8OMbxINOpx/NpCNc8FUgM9JOcp08A68Mbm0FfqG4325cdpPL3WBt5e+ix8K 3IilNsrKG81nJ66YCv5G2ffX7jy3MEzn2ZvTjC+bi2qewx8eriJV9xtY+3BpSTlsNCQi CLqWunXQX6WCfKvEkP0w0HKit7y2KY8k2tcUlmAOEiDSpf5bgnVhduYjvm/R6coZ3/wL X7Bzf3P8oyzSsFzkNkFH+y9JCDRkfRboRr7fh2URwtLNTgks2BcY/yFyt8yEKODknF5E 8MvV9nGaz1oe3q0xy4LvLeK1TgwudxkFDKe2RhLnt5nptCwoR8BZr/cfpoGXncHzZP9d YBgA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=FFAsL6jN; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si5480118iod.86.2021.09.17.05.43.09; Fri, 17 Sep 2021 05:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=FFAsL6jN; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233683AbhIQGmD (ORCPT + 99 others); Fri, 17 Sep 2021 02:42:03 -0400 Received: from de-smtp-delivery-102.mimecast.com ([194.104.111.102]:41348 "EHLO de-smtp-delivery-102.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbhIQGmA (ORCPT ); Fri, 17 Sep 2021 02:42:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631860837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s7rb3jCSHExyz8eZmcspOvf3jieEjAd49nmXFnNZWiI=; b=FFAsL6jNdKXmAR4I69OWeyE8gGtasq/sHhkMIPYdv+ak1BRv2nw7s9p534XBOZ+zUMa6I6 bdhFuLkwAJIozXO1IaePXEVFpoSTQjiwTNXjy5Tdu3auvc44aAumZnATWmwuvgHhNylsQ7 wwrllOdK/tlrStA04bLVGgIM1nZpupM= Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2111.outbound.protection.outlook.com [104.47.18.111]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-32-iHAqES0YPuGfJ-JzOAbWJw-1; Fri, 17 Sep 2021 08:40:36 +0200 X-MC-Unique: iHAqES0YPuGfJ-JzOAbWJw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f9MEn6BXNPg0dHOJiSHIFGZ6Zp/95X7OwOOWzub2Y1AASax+HACJYw1UpnoJNfVzqjNaPXy2zYrCZ5iwR+bwYDWo3N2hsaYWKRghF8waUoOVPa8LFfNeQTOy05CBtjYveiVBe6rUJ/BdENF7gwXmVQoo/AW183h/yiMQOUxrEbtUoH74NcbFsmFMxOYUF0Ww+I3G8otBQLyUShyaBfGkLTHkWdzw+HN7ANymctMnbErx/hzCz8t2266H1FDa3KxXOMwqzXp4eaCmKjoIJxClJeNaNpC0u0n/nCGplkw+ph7NETbVlt08D6zgEz+RUCxUwNL+WzmR0uwM5Xj/W5zmLw== 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; bh=s7rb3jCSHExyz8eZmcspOvf3jieEjAd49nmXFnNZWiI=; b=QEX9HbF03oh+HOukV4kISAbliJUKu/hTkxOhT9LIf8CTPWnreDjMtC9rJ/Z81RQuntfEX6e7GIYjJGw7PKBD8NBdDcaQzMPT6Iwq/fzjdtCitgIVZpxRhMi1EhW7W+35JM6EwRkMDxKFFYwyBaH7L9Gj35Mz5+BxJEJRkEIiEfvzCox6pUX/BdI2mJqrh6P4VUgePj7+ABf5FdhJ6uh2JoW81HsYum7cSFrEi4POemgVPBSvdVEmxIVsJ3rkzwyJbpgLtrPqvoRurhwr6bd2dmzP5fTXQc2j4Cc8KUoowNW6rIBTM0kYEbdgMS/GdFlaPBWuPMwIVGnnE4hs+F3WPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB7037.eurprd04.prod.outlook.com (2603:10a6:800:125::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Fri, 17 Sep 2021 06:40:35 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.016; Fri, 17 Sep 2021 06:40:35 +0000 Subject: Re: [PATCH] xen/x86: fix PV trap handling on secondary processors To: Boris Ostrovsky Cc: Stefano Stabellini , lkml , "xen-devel@lists.xenproject.org" , Juergen Gross References: <34898e9c-5883-a978-98ee-b81b22d8caed@suse.com> <823f4ef4-f9e5-68cb-d6e9-d079483c1e21@oracle.com> From: Jan Beulich Message-ID: <0afce6e8-3c8a-e5ae-cd54-0fd598276506@suse.com> Date: Fri, 17 Sep 2021 08:40:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <823f4ef4-f9e5-68cb-d6e9-d079483c1e21@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PR0P264CA0213.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::33) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.156.60.236] (37.24.206.209) by PR0P264CA0213.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Fri, 17 Sep 2021 06:40:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf53f549-a884-41dc-6935-08d979a60d8f X-MS-TrafficTypeDiagnostic: VI1PR04MB7037: X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fP073QF1ahvxF7ZiQOsWKUPfjxawEZFTb+2/2fJ6PuAIErBDyF2Fb16rNVhS7qZB+cP5mARfgjcL9RKcQMOP587IfhAy1NG0/X8FfVKC8yWBUHfYgJM0jgAjAMiw54UWEIRhms07/YlTlfYrYm4872xPvYZfPCikYT88OOKHEGBD/x4En+qjNbww+587PnbLk5urDNHyJBUOZ0GPlOdcfqg5a20GLKd9NGSsMWRlLJMf9bGNYd4VmZqtA3zKrGxiqSVVD0rCOyJeFpA6vsXI5TI6OtLpoHGBw8Jxw4KcxbTVj9pVUagMwWQz+YHURs8lsgvMYnmqtkoLP9AvlJTyEzCBXFeHtPexZzBxzNgVtz7GQFJVibMUW503HvAiuoFDQ21TlQoGvonNMDXeGca4GV5dXw8FlSuk4mNnmGNnCzM73vdfDAK/B4mfh2r2EYvRqDnMewOBUhcBwcDF7OijbYd0CMSGaQTa7udLchaT1m85BhlgSIVELIYFrt0qm3fW+bz1m17A3egSbF9FJ+RzTyKDoyy/dJuT3S9XcB6J4Gw+uJq6wYZVXFyj2sFsO2CCYBpf+3E+M94wp0zgmrDmvRYcivOgiqp2PtVQwvDcOUIyc/iG4fXtl0285M44kSEWmPHGZDAtKNAXQUGKCSbk6bdSm+dJnlQza9rU5vG/CKf+wefvzjkOHcRvN+IEQLYZ9v2LLlUTDNuatXCDyd997lDdLW7pifM63KQFT909NX0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(83380400001)(31686004)(8676002)(4326008)(86362001)(956004)(26005)(5660300002)(66946007)(2616005)(2906002)(38100700002)(107886003)(36756003)(16576012)(54906003)(316002)(66476007)(4744005)(6916009)(53546011)(66556008)(6486002)(8936002)(186003)(31696002)(508600001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGh4RWREaHhQTldSMUZKZnVSQkpvM2hsSWkwMm5sN3ZjU0NtS2xCWjd1a2xn?= =?utf-8?B?Mk5QczlRQnJuMXh5RkQxSHBqV2ZNOVlDdGdPQXBWeDF2RXYvYUE3aWFnMHlJ?= =?utf-8?B?ZEpiNFlyRmNLQU0za09Ja2tnejdBaEtRWG0zUTh6aXJUU1FXTDdnYXJHVzJJ?= =?utf-8?B?VE5vZFJ4L0sxWGh1alc2MEQyTVhBdXlrNjRNRFNlT3ZIV1ZaVE9RZjJTYTZL?= =?utf-8?B?bDg3WjhrdW5nRnNkTlR0TkM2K1pJY1MybWVBS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LL290Z2dULzh1bVBiZVM4THhmbWYxZjEySWJxMzA4ckxITkFG?= =?utf-8?B?R1NQV2hPSWhvZmNhVUdGV1UvcHVPQzg2NzlRVldJRWJvSWMyYmo4SjYwYlds?= =?utf-8?B?SEoxWi9zR3VxZXZlTnowbzFkNERxNXVsY3RFL1JjZ1IySmNtTnpTeVppMzI5?= =?utf-8?B?UmxzYXNtaWluT2xlTWErK2gwVi9YZXh6NkplVWdjYTRNQkVTNGVraU0yVDhJ?= =?utf-8?B?SXFCUEFWM1IzM3IxWjk1M3dsWEV2d0JKM2hRbWtIanlYNUl6akVKTkNyTEdn?= =?utf-8?B?Tm8xakRnTXF0cm9keXphdFZQajkwYm50RmFTcHR1NTE5eGJKYUpKMnpUNEJY?= =?utf-8?B?Q0kySzBKVVZISkU3Q0F5UUltS1ZCb0ovZEg5NVV1KzVsOTd4Z280NmgrdkJG?= =?utf-8?B?bHpjNHdRRUlKMWFxUkNDVjFxMGhlN09NNXpmWVZqZ1VNWnJYL1d4T0htUTl6?= =?utf-8?B?ck1rdkZVa0M4cjVzMk8vSHpWaGV2alJEUVl4clI3dHBTTG4xUS92S1dhdWVW?= =?utf-8?B?NzUwa3lFTUhzVlBQTExjZWlmNkdjY2ZPU210MjJTSFEvdVBMOEhCekQ4Y3k0?= =?utf-8?Q?G2kGFfvgYshGebxlstpfes6f6dx2P3E/+CKoVNb?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf53f549-a884-41dc-6935-08d979a60d8f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2021 06:40:35.0219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GsSTe3j0pMUo6G5YDbnQ5ZS/J1KjhrZ7CearnoLOgFW8F7RwmbgVPz8aeEde63dOx32YV36gOIdkzUtsbpRe6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7037 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.09.2021 03:34, Boris Ostrovsky wrote: > > On 9/16/21 11:04 AM, Jan Beulich wrote: >> { >> const struct desc_ptr *desc = this_cpu_ptr(&idt_desc); >> + unsigned i, count = (desc->size + 1) / sizeof(gate_desc); >> >> - xen_convert_trap_info(desc, traps); > > > Can you instead add a boolean parameter to xen_convert_trap_info() to indicate whether to skip empty entries? That will avoid (almost) duplicating the code. I can, sure, but I specifically didn't, as the result is going to be less readable imo. Instead I was considering to fold xen_convert_trap_info() into its only remaining caller. Yet if you're convinced adding the parameter is the way to do, I will go that route. But please confirm. Jan