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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 9FA9CC433DB for ; Tue, 2 Mar 2021 19:25:11 +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 D7F1264EF4 for ; Tue, 2 Mar 2021 19:25:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7F1264EF4 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]:53290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHAdp-0003gp-R5 for qemu-devel@archiver.kernel.org; Tue, 02 Mar 2021 14:25:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH9v9-0003MQ-QD for qemu-devel@nongnu.org; Tue, 02 Mar 2021 13:38:59 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:34654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH9v7-0005Ch-4n for qemu-devel@nongnu.org; Tue, 02 Mar 2021 13:38:59 -0500 Received: by mail-lf1-x134.google.com with SMTP id v9so15092777lfa.1 for ; Tue, 02 Mar 2021 10:38:55 -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:content-transfer-encoding; bh=FK/zBjJzjtVDqlhSwAy/BibxYUGNW7h1EjsZ5YoLPY4=; b=Jr1vNfbZlCI+zrtKs52oNhC9V2X1JKDOZ7v45QARKBwvzAC/ZwAUWn6OOgn5jiYJqa PyhNPcfCKPPf5bl35Y88D5gdqGz+H0Z8M/jl7VrkEXL+5AFD8sklzb5rh7ZTeENoGvNC GEnI35zPAF7SWEV9qdoJ848F0xoAE7h8P+CDuYLksNvb6lLK6FGNOmDbbvXIAfNoRkrN 1gcpMOK0GoFKmN1Qlr0xAg10kLnCp2IvnAQdrL/jGY3xFHojwqDy/eS8dR6uI2q5cMXY zqVG+kseB33oRA/KVUzxCu08pipp46kh9eNXrM6OasX81DEIqj5sD9oBTZ5njvKc5m+8 HUtA== 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:content-transfer-encoding; bh=FK/zBjJzjtVDqlhSwAy/BibxYUGNW7h1EjsZ5YoLPY4=; b=jC1PcYd3zbpcNgzKfPfjlM66SJjxoaqyYTHb2VlXDNy4389McyEBhI6X9g7UZvHlQ1 sEm+nEibsELn+dSE0/XGbSxZnjdwcFZ42n4L0KAKZe82JB0mZTElvV4czZgtpgKU4Oq1 B1f/3J0iCahmiXI5AXClIh49typ4v7FYLLqiQGGIX14rVMEfKMnsXAwYdqa3q7STGBTk wJznhjdNgY50f3LviSZ/e5gpnGFUQa4O5ZDM72YvQ5zN9xWSUzg6muV5yO/OZWXOSH0/ zhCmJ2MblEkaCigRBIwl8dnrzYNIRpg28lyfmdibF11p03pllaYkOdsGqs5AXbdiUFhb DSlQ== X-Gm-Message-State: AOAM530g1+eTz9KK0alO+U+yv6JUxdLlELpGeSgP47XdswUJZB2dDLzA gQruE7syYYdqktfKBfALu9vjh+3py5oV70lbgicwyw== X-Google-Smtp-Source: ABdhPJw1TyGO3j1WHLcl+GrLcjCv3zxYI3eAWS+ZFxIIh65msDGkwJNFCbgKnkPiPgFLsOo+bUSCZ1Ei62YArntp3Wk= X-Received: by 2002:ac2:5e2f:: with SMTP id o15mr9222812lfg.190.1614710334313; Tue, 02 Mar 2021 10:38:54 -0800 (PST) MIME-Version: 1.0 References: <161290460478.11352.8933244555799318236.stgit@bmoger-ubuntu> In-Reply-To: From: Pankaj Gupta Date: Tue, 2 Mar 2021 19:38:43 +0100 Message-ID: Subject: Re: [PATCH v2] i386: Add the support for AMD EPYC 3rd generation processors To: Babu Moger Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=pankaj.gupta@cloud.ionos.com; helo=mail-lf1-x134.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-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 , Pankaj Gupta , "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 confirm I can see both the ssbd & irbs features in guest with the below patch. There was some issue at my end, Sorry! for the confusion. Can you please post the official patch for inclusion. Best regards, Pankaj On Mon, Mar 1, 2021 at 9:38 PM Babu Moger wrote: > > > > > -----Original Message----- > > From: Pankaj Gupta > > Sent: Monday, March 1, 2021 2:22 PM > > To: Moger, Babu > > Cc: Pankaj Gupta ; Paolo Bonzini > > ; richard.henderson@linaro.org; Eduardo Habkost > > ; Qemu Developers > > Subject: Re: [PATCH v2] i386: Add the support for AMD EPYC 3rd generati= on > > processors > > > > > > Hi Babu, > > > > > > > > I tried to test below patch for AMD EPYC Rome CPU and I got below e= rror > > [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=3D0x00003028 ebx=3D0x00009205 ecx=3D0x00002003 > > > > edx=3D0x00000000 > > > > > > > > [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) > > > > > > I did not see any problem with these patches. > > > My guest setup. > > > # lscpu |grep -o ssbd > > > ssbd > > > [root@rome-vm ~]# uname -r > > > 4.18.0-147.el8.x86_64 > > > [root@rome-vm ~]# cat /etc/redhat-release Red Hat Enterprise Linux > > > release 8.1 (Ootpa) # wrmsr 0x48 7 [root@rome-vm ~]# rdmsr 0x48 > > > 7 > > > > > > > > > My host os. > > > # uname -r > > > 4.18.0-193.el8.x86_64 > > > [root@rome images]# cat /etc/redhat-release Red Hat Enterprise Linux > > > release 8.2 Beta (Ootpa) > > > > > > Also, I only see ssbd feature when add this patch(EPYC-Rome-v2). > > > Otherwise, I don=E2=80=99t see ssbd feature. > > > > Thanks for checking! > > Can you also see the ibrs feature inside guest with this patch? > > Yes, The feature is available with this patch. Otherwise it is not availa= ble. > [root@rome-vm ~]# lscpu |grep -o ibrs > ibrs > > > > > Thanks, > > Pankaj > > > > > > Thanks > > > Babu > > > > > > > > > > > > > > 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= [] =3D > > { > > > > > > .xlevel =3D 0x8000001E, > > > > > > .model_id =3D "AMD EPYC-Rome Processor", > > > > > > .cache_info =3D &epyc_rome_cache_info, > > > > > > + .versions =3D (X86CPUVersionDefinition[]) { > > > > > > + { .version =3D 1 }, > > > > > > + { > > > > > > + .version =3D 2, > > > > > > + .props =3D (PropValue[]) { > > > > > > + { "ibrs", "on" }, > > > > > > + { "amd-ssbd", "on" }, > > > > > > + { "model-id", > > > > > > + "AMD EPYC-Rome Processor" }, > > > > > > + { /* end of list */ } > > > > > > + } > > > > > > + }, > > > > > > + { /* end of list */ } > > > > > > + } > > > > > > }, > > > > > > { > > > > > > .name =3D "EPYC-Milan",