Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp710628pxf; Thu, 11 Mar 2021 12:58:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIGZrdG0Yve69sT1mHdQNg4h5MC4X1ZiILCWyjahth6FE3RQidGlgUS9feXMK85A70Vcv1 X-Received: by 2002:a17:906:d790:: with SMTP id pj16mr4821074ejb.255.1615496318290; Thu, 11 Mar 2021 12:58:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1615496318; cv=pass; d=google.com; s=arc-20160816; b=P0PIMBLy14jGkTgHSqjpi73j7ohU9xDJU3pfJsOK6CsFUJohyQX7tfxfkiwQjvbvTK V0fr4gv5OSmMFEOloBnBA7VafhmcSOaaQazuAaHaIRduEEARHt/UvTrhWT4iQd4eoNNx 9L4TSIda9C8GtQiVkuNpoSKqu/LWvp/CNo11S2xjjd3rXHBzOgDfK3Aec/yrWvaojbbC 9puhPzy/93/cyLYBn11HhTLuPvXjLSCipy8kX+C3aBVP6IUlez/VF+ltXcYIUxLTk6O/ KeIC7UJZUg6w03pXY7li5gmi2AL7vLeQAUZ8cfnIlXYpbzD0MfX2adr0m684WSvQkEBh nayQ== 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=l2Lq3YgcRdlf6Auj3smQD3kIB5u+xb18mnrgrCsmtUI=; b=mniJyA/KvaZB2cBPaPoF30SpJKP6M02ymuRZGx2TZL+D/Wuie1mAul8Fw5nZ5GShAY M4wZLrwoeWv7/vR+/+VBGnmxx/Wvzv4zmTyS7Eb3fpdLi3+tRYdH5q8Rs9wCW/iOcSnR ++fSd/mjDq0XPX0Qm+AZhjoGqQyHGQwcCdd6oYQ8vpgFJvJBpqeK87VxUSsv7lk/10w+ hSEbgQ4mzqfh8uEwxTZcoCubL3D2N1GnMhTO2/v6sKIggbP6I3roO4itLWmV9A6ayIyM TJ7Zy32rXa6NuPKCTmRAp5V5AKvjRjTD1yFtvAEzPVPlZWyuzUx8ozgWQE9lGIL7YXqJ nrog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="Y/DHvPlY"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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=NONE sp=NONE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si2366026ejc.739.2021.03.11.12.58.13; Thu, 11 Mar 2021 12:58:38 -0800 (PST) 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=@amd.com header.s=selector1 header.b="Y/DHvPlY"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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=NONE sp=NONE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbhCKU5R (ORCPT + 99 others); Thu, 11 Mar 2021 15:57:17 -0500 Received: from mail-dm6nam10on2059.outbound.protection.outlook.com ([40.107.93.59]:2689 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230341AbhCKU5H (ORCPT ); Thu, 11 Mar 2021 15:57:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OoH98O/u3snHsB1iL9RvzM41chXhOMMG2K3/jn50V4VLP9FSqh4e4emVuGzrSgBpVmg3ppSIMYnVqg5oNE2mvarawGdBfiNaWYsDOdv1SPsYa4cd4xgNxJjui3YpIo28/r6z0leEu+PDfU10nfTLrIO5RXuZcNTf7Wp6XADeh1XF0Pq9D+0Z2VfzwG5HIJIFdof+8pcWbNOhmUZPRH9ZRv1QxnU2xVTCcbS75A08XfgwOs455rpiQC4PPM6T6BdnwbsDHw7kLZtbYjD6mwuX8JE5aRU/kuLYp9YHPCm78+HoZcpq8aVwt5VKql4OR/xTG3smUcqUK2tF5fgy+rSe6A== 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=l2Lq3YgcRdlf6Auj3smQD3kIB5u+xb18mnrgrCsmtUI=; b=gK3liFOdzCQJHovaqelkz+K15n+2QKdvvNmDvxjNag5O2J0pvzWXx79vdt7OuNj78OhAwOBL2oh2K4eSg4qizJeRcxvAFmPHG6cQr7VS7rrbHjU0+7H/Pdx/gONOgWvSTvYO0V8AkV22YPMFb0aMrTm3kWtsaJxb5GEAJqI0u7nXQriq7YHDSYi3mJz0NrSkrdquxeGHh+cukZEYZEIabsVplUF9YAhPAbruq7KvxsejR/Pjl0pB5zWa9B9uXM0n3NE0MLbdj6tsNx74W/If7L1gjmUwvytRlXSRM5zOdi2chJVr74w5m+wclcG/LnZ4WgpkGPEJLv8TmpEAitt86w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l2Lq3YgcRdlf6Auj3smQD3kIB5u+xb18mnrgrCsmtUI=; b=Y/DHvPlY2B+ZR87h3a5autOeaWxR1cp+iDtP6XVFWpWQf+tg0Jwjdhea9roucbghAdORDrKzm8SXJzat9ycZGh+XQZxN7DBU+iDDGxEZnC6arMHUYkJdZckRqRPBCv5g++l5i6JGDuEl4vx5Ius40ZBUCk5Mm6FUqtc69UgStGc= Received: from SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) by SA0PR12MB4477.namprd12.prod.outlook.com (2603:10b6:806:92::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Thu, 11 Mar 2021 20:57:06 +0000 Received: from SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::20cf:9ae4:26fb:47b7]) by SN1PR12MB2560.namprd12.prod.outlook.com ([fe80::20cf:9ae4:26fb:47b7%7]) with mapi id 15.20.3912.030; Thu, 11 Mar 2021 20:57:06 +0000 Subject: Re: [PATCH v6 00/12] SVM cleanup and INVPCID feature support To: Borislav Petkov Cc: Paolo Bonzini , Jim Mattson , Vitaly Kuznetsov , Wanpeng Li , kvm list , Joerg Roedel , the arch/x86 maintainers , LKML , Ingo Molnar , "H . Peter Anvin" , Thomas Gleixner , Makarand Sonare , Sean Christopherson References: <032386c6-4b4c-2d3f-0f6a-3d6350363b3c@amd.com> <0ebda5c6-097e-20bb-d695-f444761fbb79@amd.com> <0d8f6573-f7f6-d355-966a-9086a00ef56c@amd.com> <1451b13e-c67f-8948-64ff-5c01cfb47ea7@redhat.com> <3929a987-5d09-6a0c-5131-ff6ffe2ae425@amd.com> <7a7428f4-26b3-f704-d00b-16bcf399fd1b@amd.com> <78cc2dc7-a2ee-35ac-dd47-8f3f8b62f261@redhat.com> <20210311200755.GE5829@zn.tnic> <20210311203206.GF5829@zn.tnic> From: Babu Moger Message-ID: <2ca37e61-08db-3e47-f2b9-8a7de60757e6@amd.com> Date: Thu, 11 Mar 2021 14:57:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <20210311203206.GF5829@zn.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SA9PR13CA0150.namprd13.prod.outlook.com (2603:10b6:806:27::35) To SN1PR12MB2560.namprd12.prod.outlook.com (2603:10b6:802:26::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.236.31.136] (165.204.77.1) by SA9PR13CA0150.namprd13.prod.outlook.com (2603:10b6:806:27::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.11 via Frontend Transport; Thu, 11 Mar 2021 20:57:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2b8f6fb3-73f6-4438-bc14-08d8e4d03a15 X-MS-TrafficTypeDiagnostic: SA0PR12MB4477: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:935; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TjP1O6rQP8JnSHK3p2gU6OBTs7HHJyZsDlH5kuEduMQxFhbbLTku68gH5lzlhb0CI8CW9Rg+85Lp/u+XkMKr4VRKQqODhM2miITuDdAr0GUAD4hc9inHQSsiRr8DKUmgafDMdJPmlWBk/JRrzCHv1Ws8M371Xt0PX8JqJTv7CkGV8e0SUQ2/ok2AyBfQ1T0IaLzxl89o0ZH2ZGIz7vtNONA8UxM87TuPaUNIKssUJzdvt5g5E8mLxOOul0+Yxm4igumPGJFft9BFaRW6KF2plRh4S+AEbaxCUe0R0chbCkLyiWGkZnsv6g/pNNNvOzNdeaa/1+pKuI9Dd+wEzPUw3aRw8lr1H7LOk+iQ19FRutxrRw0OrwO1OLCdvNPAsHTFD8V/DlccbHwk7ykrrQAiSsZ9/9UENyAOi4amFh4TmR2ezuHECVxRawQjhtPNPt9L14EHFchZvJLKXEq1jtCIa0VO+TqBmbsm7tewJdvrxlv8OObfyTKhYowQNxOiaVRDns0Nb0Vglnr2E7R0M2DRdR4uj1KrDVhinsYIux951VrQCPzgYE9X9gzfAADSMXgY6LGcNfWpHEi1VK4JBPZbeza8brctCjXUkgM/EBKcs3Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN1PR12MB2560.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(366004)(136003)(346002)(376002)(396003)(5660300002)(4326008)(316002)(16526019)(186003)(54906003)(26005)(66946007)(86362001)(478600001)(66556008)(6916009)(66476007)(31696002)(8936002)(6486002)(52116002)(8676002)(53546011)(16576012)(2616005)(956004)(2906002)(83380400001)(7416002)(31686004)(44832011)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?aWV5VUlhTW5ZN3R5SFZRdDBYRW40d254M3F0Yko5SEFWbkE5QnUxa0Fmd2Y0?= =?utf-8?B?Ykg1YVpaMitIazV6TXdadE1VSWNubXBLRTAyNUhCaGZvM1Q3M3cvYTczSEM0?= =?utf-8?B?ZFd3OHBDZGY3VTE5bXh6ZTlENko0RytQN2JwaWdhNUJrSURwR0N4UVB3SXlX?= =?utf-8?B?NVQxU1ZpMlUvMmdtZm1INk11TC91Q002cVprSnJzTGwyRFc1ODhKY2lSdUJj?= =?utf-8?B?dFE5M09iT1FialRZWW5yVGZZQ3dzcUEwZkFWVitpU0dqdHRaWXQrU05FQkZ5?= =?utf-8?B?Z0N2TTFBWnRncGZXYTFvS1pTcXNMUWl2RDlRVWdCWHBxbGU5Y1k4MWNNYVlO?= =?utf-8?B?WkJodElNTGtRSHdDM3lUa1hma2N3K0w0Wm8ydmZWVzJtVzZLUFhpWDZJVGNu?= =?utf-8?B?M3NuenBkQnZjQmwvY0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sTHVoT0RtWDJUTGNxaHJ0SUJEdEJncktIdFVFdHY1cXFXdVJ6UXZBaWVV?= =?utf-8?B?MGFzekh6ZlFYV25VSGVoV01wanVhMDcxWTg4dEFoM2swU2pCZ1hXRjFGeUgz?= =?utf-8?B?VkxRc1lwU2lIby9BY2pOdlZPbi8welFaWlpmVTBUOUc2TFNtM0J3SFV1U2F3?= =?utf-8?B?TmxHakxKSEN0ekd0VVFvR2c4YUkxWlA4eFVYSmNEUGg4akxKbEdYZE9tdWlt?= =?utf-8?B?S015Sm1kU1hiOUVFa0hReUdkZ0owVjdZWTlYNGd1Qis5dXZwUjRUYW5HWUZx?= =?utf-8?B?RmJNRW8wMWh2cXhac05hWVBQcDlXTTVTT0N4SjEyRHpLNTlmeEcyRVBTamxj?= =?utf-8?B?SGlZZlB2NFFxdFZQYStxZHBLY3dCeHp6bzAxMXIzbi9vYnNzOEZaQ3BGREdP?= =?utf-8?Q?bDpsy7gDm3hNu6sPGZxw3aCD1OZn9J6zCs4TrWF?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b8f6fb3-73f6-4438-bc14-08d8e4d03a15 X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2560.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2021 20:57:05.8994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PmE8SckORG2bHAI+wdCbCi8rssGUu88RJNh3No76ya47V6XAFuVErAY+1nCmECsN X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4477 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/11/21 2:32 PM, Borislav Petkov wrote: > On Thu, Mar 11, 2021 at 09:07:55PM +0100, Borislav Petkov wrote: >> On Wed, Mar 10, 2021 at 07:21:23PM -0600, Babu Moger wrote: >>> # git bisect good >>> 59094faf3f618b2d2b2a45acb916437d611cede6 is the first bad commit >>> commit 59094faf3f618b2d2b2a45acb916437d611cede6 >>> Author: Borislav Petkov >>> Date: Mon Dec 25 13:57:16 2017 +0100 >>> >>> x86/kaiser: Move feature detection up >> >> What is the reproducer? >> >> Boot latest 4.9 stable kernel in a SEV guest? Can you send guest >> .config? >> >> Upthread is talking about PCID, so I'm guessing host needs to be Zen3 >> with PCID. Anything else? > > That oops points to: > > [ 1.237515] kernel BUG at /build/linux-dqnRSc/linux-4.9.228/arch/x86/kernel/alternative.c:709! > > which is: > > local_flush_tlb(); > sync_core(); > /* Could also do a CLFLUSH here to speed up CPU recovery; but > that causes hangs on some VIA CPUs. */ > for (i = 0; i < len; i++) > BUG_ON(((char *)addr)[i] != ((char *)opcode)[i]); <--- > local_irq_restore(flags); > return addr; > > in text_poke() which basically says that the patching verification > fails. And you have a local_flush_tlb() before that. And with PCID maybe > it is not flushing properly or whatnot. > > And deep down in the TLB flushing code, it does: > > if (kaiser_enabled) > kaiser_flush_tlb_on_return_to_user(); > > and that uses PCID... > > Anyway, needs more info. Boris, It is related PCID and INVPCID combination. Few more details. 1. System comes up fine with "noinvpid". So, it happens when invpcid is enabled. 2. Host is coming up fine. Problem is with the guest. 3. Problem happens with Debian 9. Debian kernel version is 4.9.0-14. 4. Debian 10 is fine. 5. Upstream kernels are fine. Tried on v5.11 and it is working fine. 6. Git bisect pointed to commit 47811c66356d875e76a6ca637a9d384779a659bb. Let me know if want me to try something else. thanks Babu