Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp697517pxf; Thu, 11 Mar 2021 12:36:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaWnG4edi1ZhDU/DksZyfZ2QdsoJlayY8eWkzs7M30LSldCrJkVqGjs8rG1luR6gta809I X-Received: by 2002:a17:906:d0c3:: with SMTP id bq3mr4766393ejb.424.1615494989693; Thu, 11 Mar 2021 12:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615494989; cv=none; d=google.com; s=arc-20160816; b=Sw5+QozQPDHAmERfbCnfwzIvqFwbvX8xuJerCb4y3MOyDxe1UmVU/FrpC7uHXHdkXS NY2vO/vQU8v86qDYhiMw4tqNc462YVTHC57s46EwnTsqG9s8Wn8Mdi6kFrxCN8SDPrEB 0KVGyLrleh6XCKk10OOjLGyoAi8eZ9340wsvaNs5CZxnDOfUaDc8bl550abNRhvB7erB iVqlujxj8ugSEs2ag2xZXXvWGp9Gi7IPxWa9dxkTNnpAp1v5QjOm1dn56cHYCfixVlxD u6LgOi1IGF8Yp/rzXMs0YykV98C35JkJjnAP8eeBe5nFP7wXsnsLGk48q1qaLDpD13Hh 4lWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X0fH1nKE+B03jnhHgFBoQ/AhcZ8YeXX1uTmcsmmAkq0=; b=CDObEbF7CDTSMMsXcldQjn6fspqnh/oFnRpBcX5BUIJpy1jG1NHAleAOXRLCnffFTP 8hsXwPJsMA3DF1rReaUysm46q0mILZgKfvYALOHbxXE29JEXEGF9lbcoYlFhKkM1x8Tu SinAiD4S4LG/gn9GS4OK2pRdE3ggjrX9Xj7XWNMlTzI8FcSDu7ZeEOJoPCEjsyE7U6zn fvbFaEvqfemzNrli27pVQvKfruWHoDaWAHUzIru9BIrBEo2ui2tofgdRMwt2aEbwqJk4 MI8eijTOx7mMgBsFdcXMfke0XxoVuRjISvxpkGH7IkWIUbb8waCBq7Jkd1W/WPRcvGsM Ozbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=CZQq1kEt; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do13si2460858ejc.87.2021.03.11.12.36.06; Thu, 11 Mar 2021 12:36:29 -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=@alien8.de header.s=dkim header.b=CZQq1kEt; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230426AbhCKUc3 (ORCPT + 99 others); Thu, 11 Mar 2021 15:32:29 -0500 Received: from mail.skyhub.de ([5.9.137.197]:50856 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbhCKUcM (ORCPT ); Thu, 11 Mar 2021 15:32:12 -0500 Received: from zn.tnic (p200300ec2f0e1f00a86a11edd1796e13.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:1f00:a86a:11ed:d179:6e13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3F4321EC041D; Thu, 11 Mar 2021 21:32:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1615494730; 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:in-reply-to:in-reply-to: references:references; bh=X0fH1nKE+B03jnhHgFBoQ/AhcZ8YeXX1uTmcsmmAkq0=; b=CZQq1kEt+fYlsQYDk8iKQIr7kZBShezRTt1o6/eFG3JHlcPrPYk8ZoICB6TmkumNZo/ATP TzZfnSAK8MKwQSY5P3MLo8QbjPJ8H/ge0JzXWSCPvw/+GCLu0tPWU0JidZ0Q2i+MX650rD LRjtyvvm9IOT+VRPl1dobHQNnCLeJ/I= Date: Thu, 11 Mar 2021 21:32:06 +0100 From: Borislav Petkov To: Babu Moger 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 Subject: Re: [PATCH v6 00/12] SVM cleanup and INVPCID feature support Message-ID: <20210311203206.GF5829@zn.tnic> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210311200755.GE5829@zn.tnic> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette