From patchwork Fri May 20 13:37:46 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: 12856850 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 794E4C433EF for ; Fri, 20 May 2022 13:38:44 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.334169.558197 (Exim 4.92) (envelope-from ) id 1ns2pq-0006tn-VH; Fri, 20 May 2022 13:38:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 334169.558197; Fri, 20 May 2022 13:38:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ns2pq-0006ta-QU; Fri, 20 May 2022 13:38:30 +0000 Received: by outflank-mailman (input) for mailman id 334169; Fri, 20 May 2022 13:38:30 +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 1ns2pq-00056k-3C for xen-devel@lists.xenproject.org; Fri, 20 May 2022 13:38:30 +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 20a5a0bc-d842-11ec-bd2c-47488cf2e6aa; Fri, 20 May 2022 15:38:28 +0200 (CEST) Received: from mail-sn1anam02lp2045.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([104.47.57.45]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 20 May 2022 09:38:24 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by SA2PR03MB5755.namprd03.prod.outlook.com (2603:10b6:806:111::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Fri, 20 May 2022 13:38:22 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::5df3:95ce:4dfd:134e]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::5df3:95ce:4dfd:134e%5]) with mapi id 15.20.5273.018; Fri, 20 May 2022 13:38:22 +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: 20a5a0bc-d842-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1653053908; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=6MXC9SRRU9edsk/Euin3gOSSBFKjI554IJeuGPPnKKw=; b=iKQ324taiG3eWLF8KXpBmv+UZBgPmtKyTuVBr4frB9UXA5a+/9gYeRuF 4nxVxZiGjq7N1N2ZdoDNUMFnpAvAGCOyI7Kp4YRW2YqKOAZyyJsy5paHI YcdQ5ke2zJ34XSg8DkY9b3k0B8pnWa7qjenkOkZeSNvLmW7qW6gkJgL9g I=; X-IronPort-RemoteIP: 104.47.57.45 X-IronPort-MID: 71798641 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:vYCrhq6u2r8WZK7sAVPZGwxRtCLGchMFZxGqfqrLsTDasY5as4F+v jAXXWGGPfiNNDaneN5za9vi9EhX7JTX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OISNjLw4zzYLLhJavmnhnQYseuv4FElnJ 3lpAohBd167zfrcmS8sXLWqn3d+Qdrz0Wn5U6TgHPlr8C8bik9EdB9iYVQdQacw1Y8vflnuZ g7kF6xht5yN1ftjS7979/HW1VBjUyvu0cvluYVkjh2TZYeUrlMtoYSlXklXKvoJBiKqbzPLd MeTP01vJ1tABCnhjHizyRSKeWXLzoO9kzseDlBhiSXuwIm6UyRgXFogfD3pU1wha7Ve6M0md gsDZ4Y5I2mNvVmC56VJN1xNvdfWVa9Ny4lDgqpUCfaPZBCHU7xgLjKx5hwzN2WWfUzvekPcd L6IRlliVI= X-IronPort-AV: E=Sophos;i="5.91,239,1647316800"; d="scan'208";a="71798641" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n/BVOxJw9h2Kg1Su+/KWbU1sThMnPC9hnj21grXqKWkYqaMwVzlQVN/GqoNQyvTuruOH1PUMtJj+NerKyTvoGEM6sLaB0xTXuJVc6X5MKJCllq3IshpEOY+6aGkwHiIErvJ2WNcEACGLKzpqlqpqYjDlj5ghMtK8IUH1ax0/1rfLyN8NinRp2hNYmmiRJXKuN78X9G+blM1V2pxQLfvijCQlXCp4Z25BBvSySDWI9O0UcACbnzms7YJDvjJG1wWD7Ojl3GAZBXzQ5l/f5q+/BOpUscQ09Lkh8RWhctmlIHhIHR2DNdxu9VQGbV+Ho6mkFCDhDI2CcZ89tokNx1SQvA== 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=5wQyHDBl72WDDVIoX0a3nPky6wCNM1VhocR08J8m0p4=; b=IJ0hAbQg/sdSVg3apMfR56SEMRILCiDFr5ZCSfKB1zOxlLrSMzR70PvOFwm6hmrgblRY0o1l3l2ycluBZwC2oOu/jwCCNG3b+dSxMhKNTXD2jpZQWNWqSp9PkR8YUgpLlOucdK+Gpcu7y8+ZJ0WPSsaophsJbDz+tTDuqp0RS08K5C1hYs7VFKd6QSkw6MGmGfDT0ZEVvB7hLR1umvqUXRv+9G2O9Ph/BzK6JqA5QCMeDFnBs4eXEQYNjMDpxljuZ5Ff2Vta++z751Wtu1lEm4dUp8BvqY1AaHR4QEUK2W2HpqLZeyN6MKcDak1/flvsU3X0XdleDQ8JACgcVv6wRg== 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=5wQyHDBl72WDDVIoX0a3nPky6wCNM1VhocR08J8m0p4=; b=n0hJmV6yFBrG6SVj6wyPmNRmnbRsBQNpE+ErEvlLkKO6f5Jz6B/Z4U6Gn4naeUP7r3DABNrv6wAiDkDZ0LCPgl9T6jvWo3+Rk/7SqsmZd+srTCIYh31fPchLZM0pf9fEfvxeRuUU28UgJwJWEeCl+gy69TkqGNUcvH9kTHm1A7o= 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 , Jun Nakajima , Kevin Tian , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH 5/5] x86/vmx: fix indentation of LBR Date: Fri, 20 May 2022 15:37:46 +0200 Message-Id: <20220520133746.66142-6-roger.pau@citrix.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220520133746.66142-1-roger.pau@citrix.com> References: <20220520133746.66142-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0506.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:272::19) 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: f2d15561-4d60-4ccd-99f7-08da3a6601d5 X-MS-TrafficTypeDiagnostic: SA2PR03MB5755:EE_ X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr 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: obKYK02mWqQIX8OvM7VWRnzHlkaarh90WEPFVIcutC9qCHupeOPdIGYWJDEE9a3m17xXmJQzDZ5w/O6VWS0H83+rjh2c31aNNkbAdoGndiGfFdxbaWc3O6zkH3+4uVS930xQ/BrO5M1gryOjLIwJfFk5oD4exhgvtZ02oTVpR9tX9Fr5QZ7awLRdq/y8G40vmFCKrjO6vw1XM+RCoSxW0lkC05gvGAq5f+DaRP1O23vt/ZD9o3rEfu4M9f/FMotfkzARrXvTvajxOomp0nyFNWckJl9Ou181qn4/mkG1/wR/IVkL75kbGIRgcmTUE9aLKAU5Do7M0io6aG5W+9oLpE0Q6qyZ3FcfM2mUJwj+cLYJDJPWM7Gl/3OT6IBmjReAM/xFFK6t7UeLLoMWLqtJOMK8i3OiS4hpsZ/tj+V/m9kQ/+w6yvTY8AYqZwkkEAnHwXFOObMpee/BdHcMigm86grdJcHVh2t86pooX/7C8vuQHaa2ur2rUxvxTY5N6iKJQNQJ1WQjn0cUGoKkfdK7f8NHHMapGqdYEvWzDmZuAf/wOReJ4N+5nIUhNgUYoMc9YJ+vpPQfCU9zdzoi8jQSSXNuyidC6f8uEPRpWU+jPaRmHTUVLU5eEeiJ5hU64uyOeKzxl9UeVghn1xUy5jmD8g== 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)(316002)(6916009)(86362001)(66556008)(66476007)(66946007)(8676002)(4326008)(6486002)(83380400001)(6512007)(26005)(2906002)(6506007)(508600001)(1076003)(38100700002)(2616005)(82960400001)(6666004)(36756003)(5660300002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?hLVq2qMI4kDyjxI7+yKj5uU9h1NB?= =?utf-8?q?uVs9zd2ReXJqBA5On7KtsC3KFwdt0PVZ8TQYrmOJ2QTctgxKAxDFX0uHzX2vEQfPt?= =?utf-8?q?EYRVGYHm7tM7KKilUHHBKxy6ly2Pt1JuZb5sP5EZwAngUuedv0OZUn+r6GD0XtIwp?= =?utf-8?q?byPfsMA0H6aMMj3ANiv/sUecjUKMcBB3paIFXMFYg5PU6wz83gTLYyBaI2yaQE+hm?= =?utf-8?q?grrAK41o3CGsJ9DX6BVwUduS6uEWrYO+KcFcxqeCK6WqPVf1kjdHGO53Wl58CVyy9?= =?utf-8?q?prnWPq3LTB3fPCMe+V35pLdqIxPDJFGwiX06YKqDfxzvnifQF/6STgreBGAQ+uAtZ?= =?utf-8?q?zp3Iexs7v2oNw6DB6M3RDVfLdq2wBi98X+WUCkI3oJsEmpzf34xJLCin/3maqtOrF?= =?utf-8?q?qNF4vQY8Dc474MXWRc59uwPoo6JNVfDURplL90r4lxuXk2B/LNUL56QD5JHvBiWCz?= =?utf-8?q?WYTwkcX8P/6keFM7Q6OojMr+yuTY0itCUyJmmat9EQWitaydar5YErcC6CS0dx0Tk?= =?utf-8?q?IcIdcDL3rUzMt1Jt08Yfbz8EIvDoQ1caX0i3oAo+FG4ULD+qO3Hp/WQysFVwIw4FI?= =?utf-8?q?1QuLdHohj1kVDiheHLp+ZTpdM65Ndhq8VHF6lW5C4Pc2t3Vy9pphYsbyUhH2DFbGc?= =?utf-8?q?UsgJxXij8nH4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JvxthI9YbSMbLiPV1BV/vEtxQ6KR5e7lfGthq?= =?utf-8?q?7UD4YW2aQhgeQfqa6RrGb4eoBHtgRv59bMoeAxi50k0NldQlxA1hK5qCQzZ/O5KJm?= =?utf-8?q?WRbHio2PksnH0d0ujfqCGpV2m8w06IsSeumCydLIoj9LMs/N4xARs=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2d15561-4d60-4ccd-99f7-08da3a6601d5 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 13:38:22.1478 (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: zXTi61gzez7fZ9dwJV+CsE/tW6po5vCmcFfePspzrazRDNaZAlC+JiihDCUc4/lODvKFL45/SsMMwI8ESuvg9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5755 Properly indent the handling of LBR enable in MSR_IA32_DEBUGCTLMSR vmx_msr_write_intercept(). No functional change. Signed-off-by: Roger Pau Monné Reviewed-by: Kevin Tian --- Feel free to squash onto the previous patch, did separately to aid the readability of the previous change. --- xen/arch/x86/hvm/vmx/vmx.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 3f45ac05c6..ff10b293a4 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -3540,31 +3540,31 @@ static int cf_check vmx_msr_write_intercept( if ( lbr->count ) { - for ( ; lbr->count; lbr++ ) - { - unsigned int i; - - for ( i = 0; i < lbr->count; i++ ) + for ( ; lbr->count; lbr++ ) { - int rc = vmx_add_guest_msr(v, lbr->base + i, 0); + unsigned int i; - if ( unlikely(rc) ) + for ( i = 0; i < lbr->count; i++ ) { - gprintk(XENLOG_ERR, - "Guest load/save list error %d\n", rc); - domain_crash(v->domain); - return X86EMUL_OKAY; - } + int rc = vmx_add_guest_msr(v, lbr->base + i, 0); - vmx_clear_msr_intercept(v, lbr->base + i, VMX_MSR_RW); + if ( unlikely(rc) ) + { + gprintk(XENLOG_ERR, + "Guest load/save list error %d\n", rc); + domain_crash(v->domain); + return X86EMUL_OKAY; + } + + vmx_clear_msr_intercept(v, lbr->base + i, VMX_MSR_RW); + } } - } - v->arch.hvm.vmx.lbr_flags |= LBR_MSRS_INSERTED; - if ( lbr_tsx_fixup_needed ) - v->arch.hvm.vmx.lbr_flags |= LBR_FIXUP_TSX; - if ( ler_to_fixup_needed ) - v->arch.hvm.vmx.lbr_flags |= LBR_FIXUP_LER_TO; + v->arch.hvm.vmx.lbr_flags |= LBR_MSRS_INSERTED; + if ( lbr_tsx_fixup_needed ) + v->arch.hvm.vmx.lbr_flags |= LBR_FIXUP_TSX; + if ( ler_to_fixup_needed ) + v->arch.hvm.vmx.lbr_flags |= LBR_FIXUP_LER_TO; } else /* No model specific LBRs, ignore DEBUGCTLMSR.LBR. */