From patchwork Mon Mar 29 21:15:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Ostrovsky X-Patchwork-Id: 12170983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8A5FC433E1 for ; Mon, 29 Mar 2021 21:15:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A5A0E61989 for ; Mon, 29 Mar 2021 21:15:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5A0E61989 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.103265.197046 (Exim 4.92) (envelope-from ) id 1lQzEN-0006QB-Fo; Mon, 29 Mar 2021 21:15:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 103265.197046; Mon, 29 Mar 2021 21:15:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lQzEN-0006Q4-Bk; Mon, 29 Mar 2021 21:15:27 +0000 Received: by outflank-mailman (input) for mailman id 103265; Mon, 29 Mar 2021 21:15:25 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lQzEL-0006Pu-2o for xen-devel@lists.xenproject.org; Mon, 29 Mar 2021 21:15:25 +0000 Received: from userp2120.oracle.com (unknown [156.151.31.85]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8ef4b350-952f-446f-ab28-0c01000a58c3; Mon, 29 Mar 2021 21:15:24 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12TLFLIP160028; Mon, 29 Mar 2021 21:15:21 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 37hwbncynw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Mar 2021 21:15:21 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12TLAX9R170068; Mon, 29 Mar 2021 21:15:20 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by userp3020.oracle.com with ESMTP id 37jefr9f6q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Mar 2021 21:15:20 +0000 Received: from BYAPR10MB3288.namprd10.prod.outlook.com (2603:10b6:a03:156::21) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Mon, 29 Mar 2021 21:15:16 +0000 Received: from BYAPR10MB3288.namprd10.prod.outlook.com ([fe80::f489:4e25:63e0:c721]) by BYAPR10MB3288.namprd10.prod.outlook.com ([fe80::f489:4e25:63e0:c721%7]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 21:15:16 +0000 Received: from bostrovs-us.us.oracle.com (209.17.40.37) by MW4PR04CA0095.namprd04.prod.outlook.com (2603:10b6:303:83::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.32 via Frontend Transport; Mon, 29 Mar 2021 21:15:14 +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: 8ef4b350-952f-446f-ab28-0c01000a58c3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=O+Eb95b8wJMI2NvNP5U2nCrXRJneKPvPebbBCQxucnY=; b=vl86/rWqRJH+PlUrcp0KaHhvkY97xflh1t+fTgptI9PwiMyyuLpiSvR9Z+kHPAAqOr8C T3/0KaDv0cSvt6C9MH+ekUniVGEyK10E1lmq1FcY6j7TS7cCSQiRVN9tJ1xcKE+5wqmK +3VEBZg1DRnbeAiO2FyPcQsCYsz07fl+cnJviqsd45evDxtPD0So/DpgTEjm1h444UAA X7rq5BrB677ovMjHh8ZdzVtkxkObHvccXZ0SXCFf5sjoaOX/iRjhE1zQBQFzYps4xDFq yaMWMX4SY0E0RFIar0auaezf/9HgpRdcuAn91B3vAE4PhWZETwR2mL7M752Bi6QlfbFX ng== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qxcu8ksJWCKhC/nMbcH1Kfcf/ahx2gO6n9zCel24IFcDgQIB7U/IyETFAjeQCbYDmah5VRWQXC/iC8X47OQXkKaIAl58KKcEg3/RkLMkom3dZQauu1yGXQtVdXxiYxPZ4AcPs9Dci3ncW9Nj2sCBkmwQ/n6NPU44H1Z0z2DLgcMx+cA4s1kRWVreR6m04eZKb0Q30Iy0SISJGPmI++DmqfLfampTxQcxPVhr/I1CnSHJgMg+pHmzbtxc+RRTqfD96pwm3FY1K1z4Xfz2QAwNQVYRsYMYSDUO4grPZ0qwHlyDJZdNPW+7/aE2Gc+wsf/WignJafyJ8bS/C/E+BaX2fA== 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-SenderADCheck; bh=O+Eb95b8wJMI2NvNP5U2nCrXRJneKPvPebbBCQxucnY=; b=YHk9U7OCL+3JUYzhz1q08udMpnmfdulQHVJOKZ3GqaonXoxaC691V2uYEdNY82lAWYTFTyTNMZ4SFKI1rpDHP/5bKt1dlyrfxdsmtTY9sUDCplcmXXkTfSnIYJfuax5eknQiVbssvyB/zcJjle+XtmoP7Wiet7ktdUeeT6gj7+8+eEd7cAYK9r1XbCQdRCrbDhGZm0zGPVXy5q5+od5RqbjL11K2Nx0Tkgfx+Ye3OUKrjr3EvEt9xINqs6j2qVMk7+PgRl3neD2wpciN2vvEtZKzrZKoMum4J/1IFWY5q20WoOlW0ZYilfQJeTuJ+Y43UBWHqLhSCcy218TTChcftw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O+Eb95b8wJMI2NvNP5U2nCrXRJneKPvPebbBCQxucnY=; b=GqsQEdBnJhMAmTfAQ/aozzUAzjh6EfFKOsiSev75P4kyG6BXDQLUNcynNTQ9L2reSEylDqtIWYaruHBijwWOMSI2rLJNMKsHN5z2aDSjq74sLe5drTPeVDNcM01R3WdD3ZTv52/6BSSVfGzTdt/20jIui/SuET1fvCSrCBmqPe4= Authentication-Results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=oracle.com; From: Boris Ostrovsky To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, wl@xen.org, boris.ostrovsky@oracle.com, stephen.s.brennan@oracle.com, iwj@xenproject.org Subject: [PATCH v3 0/2] Performance regression due to XSA-336 Date: Mon, 29 Mar 2021 17:15:00 -0400 Message-Id: <1617052502-14181-1-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [209.17.40.37] X-ClientProxiedBy: MW4PR04CA0095.namprd04.prod.outlook.com (2603:10b6:303:83::10) To BYAPR10MB3288.namprd10.prod.outlook.com (2603:10b6:a03:156::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb6a28a8-851d-4f50-6c5a-08d8f2f7bf9f X-MS-TrafficTypeDiagnostic: SJ0PR10MB4416: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RFDr5jwo80Z+zuXci4GIttyZEmHE89ETC/CwfihEi4R+99SO1ReKpPJ1HrCM5YD+HHl+ObGWm1x52aoDZyhPBDJvRYnwIk1fLyqoePRLpz2DXxpZ6kzcGKfzQZ9a1vP6PeYgQre7jxU1GZdRctBxM/1hAonNtUYOXKozFj/0zs9Va9kmSZpMGUjDWZrg3ND0ebIpLdQeFTOgj0z1SASdKATqEW2RfwHMhazHNYX7Lk/jTx78mANCZGNwR5Mc0R7m0TyXwt0x026HTQ/0/EQM6D6bjZTWMDuYy43wORsGBogSyVUljBENADcP/kx7k7rmC6Q8Crc90A1htbuVSqPxm1xPlRMx60OZOo+w3Pa7m38VK0uLeqKWuxGwvl3UOgilY1Jxo824OAcg5Cx0ozxE2fowThkqMEecVSx+lz/Vg7fohbFlHMDMDAHGXfRDOVBplpgKbYDypXhBZR1h/bthjyIoinS+0/hnWLILqPbuPRqdfl1j7dowSMLTF6eCNalYcLbcd5L4ojYit23WG8+sAE0Q9fiSaHhDRTDhFhOj7d6FLwr0P4vb0vMWlICvEc2kEE0Jsl5S1mQCGX0qaY5LDUnEvezmUVs2CBShQfMK8BACZbFkGsNkk9oUVfeY00tG2evmgQEyia55H9/V7lCf4rB92o9C3ONEi2eXMvaEO2Q= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3288.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(396003)(376002)(366004)(316002)(5660300002)(36756003)(6916009)(8936002)(6666004)(83380400001)(2906002)(16526019)(186003)(44832011)(2616005)(38100700001)(4326008)(66946007)(478600001)(6486002)(7696005)(52116002)(8676002)(956004)(26005)(66556008)(4744005)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?QxXnE6sq3Vw5MRvLCoqLgtoGc43Fz4?= =?utf-8?q?JIIRpbXI1YkApAkxgkdt7SafojEbqESXtAkBtqb2qwqBLEWcgiBj9mNRDOSUlxbFf?= =?utf-8?q?nhQfOT25AeTFgS7CdQkwV1dyKgQuzTqg6Yf22ZglIRmNM+6Y6VlANe/nfvsJKwK9G?= =?utf-8?q?CDLlFmUx3R+cfm5a1JiNbQ0kVysUE1gsCztOft33gAEco7LdfH18PIgmV2zNbDJex?= =?utf-8?q?mUievTRiMH8i1VGJm892Egt81xGejqhI5zazxJtOe9dTCrmT8mgWd7DrwPEAEiJLi?= =?utf-8?q?LZ9Ikzgg/eIx3ftHNtmjWCowzTv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pZ2bWJ3bp4pRVB8ksPHS75AImmCGfGfoPxoEUjP?= =?utf-8?q?S3D1wvdZ4tgC3+Ksv9OpJV+/iuh9+4bUwLnJo9tfH/Xh2PitLYvFvfeE+/b7+WJC0?= =?utf-8?q?eZdoKdIrpf/FdP?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb6a28a8-851d-4f50-6c5a-08d8f2f7bf9f X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3288.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 21:15:16.1983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EXs8N4PWVga2ZUEpzz48aIJwm0Fa24fxlo8m3LqK8HahuE0koSkrdkVI+Ui4SZHW6LnyEHQy43hMfeh+KXc/hT3gQ0JEvOHeYMNVN/qTXVk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9938 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=651 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103290157 X-Proofpoint-GUID: SstBIfmmOUER55_kewQwhQ4XBovKK0e- X-Proofpoint-ORIG-GUID: SstBIfmmOUER55_kewQwhQ4XBovKK0e- X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9938 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 clxscore=1015 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=844 suspectscore=0 spamscore=0 bulkscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103290157 The first patch addresses performance regression introduced by XSA-336 fixes. This patch could be considered as a candidate for inclusion in 4.15. The second patch is a minor cleanup and can safely wait until after 4.15. Boris Ostrovsky (2): x86/vpt: Do not take pt_migrate rwlock in some cases x86/vpt: Simplify locking argument to write_{un}lock xen/arch/x86/hvm/vpt.c | 48 +++++++++++++++++++++++++++++++++---------- xen/include/asm-x86/hvm/vpt.h | 18 ++++++++++------ 2 files changed, 49 insertions(+), 17 deletions(-)