From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 0DBADC43381 for ; Mon, 1 Mar 2021 17:03:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 83AD865130 for ; Mon, 1 Mar 2021 17:03:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83AD865130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cloud.ionos.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGlxQ-0007Ss-JA for qemu-devel@archiver.kernel.org; Mon, 01 Mar 2021 12:03:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGlgD-0002y5-Ua for qemu-devel@nongnu.org; Mon, 01 Mar 2021 11:45:57 -0500 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:39118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGlgB-0006C4-NI for qemu-devel@nongnu.org; Mon, 01 Mar 2021 11:45:57 -0500 Received: by mail-lj1-x229.google.com with SMTP id u4so20217497ljh.6 for ; Mon, 01 Mar 2021 08:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=epwhuvzJqthXYztTTlYNcztCNpxiGJcELnCl5JuU+Ak=; b=evTXz1LPdMuvI3Kg3cxJrhWFXXGlr9l8/VkS0I1GzTzEJzPaL5sso9GlDgVFAcJaF9 EGfBqG8IiLOwHcHVC0U5UDkcmn9+1e1cLd2cyInJnHuZPHnmoNx4tiuaROU6a1FtLXK/ RPRTKXkZbL7Ue4J1qIwq+VXyOonzhuFM+0BrzZGySjSqBSYLzLzOvW6AWt+KXJF/Gw5Y aHmqTATUxVvbMyCI9GMoRLFEAHprC3hAVsHkKbQQVnQ4ijxIHtixQjyvcHabQXxOnsT6 EJMapw10T1ZaulM3BVIU4x3E09dFSU9BIaLl+GAThpv7LNhv8782Adrx47gvUZV6DyYW oT7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=epwhuvzJqthXYztTTlYNcztCNpxiGJcELnCl5JuU+Ak=; b=gviTAFbtMuBxw1Ap2I8ZTwIGm6tUFvTnrjvMnWO9kxkY7/SkTSiFmt/muUCUipRG1I j9eAQQAPEgQvSZOC2moFx8efGj922tacAohpK8HO2wZDdbhtvL3rAhUSWoDav2uZ/aJD NRzeoiuYQx9GkijqyKyLoILZvpLkx6ERBqcBQ2dUfLnOwf4iubRSntWBw40cFzeQCcVm /+aKMIMsS8JamJkFsKjSvzgsLvMdi8nGiF0S9A51MTAh8U1Td2eoMsgiY5fNxDqJWEeT S/QxMJBkYcSOgIe9jJyTrRVDyKfu/rkQ5V0V+qQHQgFyThH2zUvI3hI/smdrHF1V4FIi W6qQ== X-Gm-Message-State: AOAM531+uKLZkOl8U0ehYD8B7QWarui3jGGDyYHjkTNDr7MKsSphnLhf 9cxt6TERak+8IcMhfOKRt72IturRzhDVETsNIjIBYw== X-Google-Smtp-Source: ABdhPJxl9EZiwMombNuKx1pSPmovZ0zVUwUwLZqPvlZql4fNm0omU2YphGeErb304vvLoz4tKhkzZnMFDJz83dIIxM8= X-Received: by 2002:a05:651c:110b:: with SMTP id d11mr9286567ljo.334.1614617152845; Mon, 01 Mar 2021 08:45:52 -0800 (PST) MIME-Version: 1.0 References: <161290460478.11352.8933244555799318236.stgit@bmoger-ubuntu> In-Reply-To: From: Pankaj Gupta Date: Mon, 1 Mar 2021 17:45:41 +0100 Message-ID: Subject: Re: [PATCH v2] i386: Add the support for AMD EPYC 3rd generation processors To: Pankaj Gupta Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=pankaj.gupta@cloud.ionos.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 01 Mar 2021 12:01:58 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Qemu Developers , Babu Moger , "richard.henderson@linaro.org" , Eduardo Habkost , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi Babu, I tried to test below patch for AMD EPYC Rome CPU and I got below error [1]: Also, I noticed SSBD CPU flag for guest was still available even without this patch, I noticed that for the guest, AMD_SSBD not got set. Guest: 0x80000008 0x00: eax=0x00003028 ebx=0x00009205 ecx=0x00002003 edx=0x00000000 [1] [ 0.008000] unchecked MSR access error: WRMSR to 0x48 (tried to write 0x0000000000000000) at rIP: 0xffffffff9245c9e4 (native_write_msr+0x4/0x20) [ 0.008000] [] ? x86_spec_ctrl_setup_ap+0x35/0x50 [ 0.008000] [] ? identify_secondary_cpu+0x53/0x80 [ 0.008000] [] ? start_secondary+0x6a/0x1b0 0.011970] unchecked MSR access error: RDMSR from 0x48 at rIP: 0xffffffff9245c772 (native_read_msr+0x2/0x40) Thanks, Pankaj > > It is normally added as v2 for compatibility. Like this. > > o.k. Thanks! > I will test this tomorrow. > > > > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > > index 24db7ed892..f721d0db78 100644 > > --- a/target/i386/cpu.c > > +++ b/target/i386/cpu.c > > @@ -4179,6 +4179,20 @@ static X86CPUDefinition builtin_x86_defs[] = { > > .xlevel = 0x8000001E, > > .model_id = "AMD EPYC-Rome Processor", > > .cache_info = &epyc_rome_cache_info, > > + .versions = (X86CPUVersionDefinition[]) { > > + { .version = 1 }, > > + { > > + .version = 2, > > + .props = (PropValue[]) { > > + { "ibrs", "on" }, > > + { "amd-ssbd", "on" }, > > + { "model-id", > > + "AMD EPYC-Rome Processor" }, > > + { /* end of list */ } > > + } > > + }, > > + { /* end of list */ } > > + } > > }, > > { > > .name = "EPYC-Milan",