Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3643197imm; Wed, 5 Sep 2018 03:42:19 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdanw8Ehn+zMeeVKsbD3960sQ/ZZ1I1jd5WNwQOMyBru3qCByU8LfAAZ8WT5ZAAqmoMV3+9r X-Received: by 2002:a62:d1b:: with SMTP id v27-v6mr38871195pfi.87.1536144139210; Wed, 05 Sep 2018 03:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536144139; cv=none; d=google.com; s=arc-20160816; b=ZC2mSOr/Tswckp7vrsUhkcHuUpwwogEAwo5qqBhIo5NX3JsFCm+IuZsgoCm5JAsh0I kwBWm02vVii1mY8PAgu2voLbGEmzYhuXxVqMX6RsH2ogaWRxk+tr0TArGpJp1by9t3Q6 Na0jHljM4xGS207PdH/dkBxY6kNNRedQoDUrpomsnfm2oEuV22M4CoRkBoCHK7M+40ES /mIE0ljJu87U4Lk7HFGAImqERu21ImwaEKcrwHGUN9ZILeDTt5nwmXKr9+Shl6OjbSPS jWKKp7Yg9pe3ly5WpEu5aHD/KI/e7uY/fvVTdrr6X/ZUf9Pz5VopG3n1oiH120yesJaq g2Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=r7vCxV09WyGA8LY+xJB8ycC8GrFLDdsIwlwKEmCLBLE=; b=wx/ehj9VMNZosSPK+qOOoIk7ijbXH2Eqs5OCLgDeQpalxRqU28K59wsOxGb5sXMw9L bjLbPJGKH+lKsiTS3w+AVp/2YBROGenoWfJzYZs92ihogzAz48jqkMFgbWXKA35qYCrD oj6aNS6jnCDVfPX4iPXpxHtEgOPsn5CjbeFEySxwIFI44dHy6QGsodgKF0cbHnOIeL1h 3e/mcxo7HFi38SV3m8GCeXPne1sCrGzpB20l27vf4zAH5eBt4EJvqNrymtJxdB2swFVe ZjkQXRIUaMd45H+L/EAIiJedyqzG0KsqsAL2plb7Ee3ME1lE1kymNCAPz821K/s+cghO sPLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12-v6si1681665pgv.351.2018.09.05.03.42.03; Wed, 05 Sep 2018 03:42:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbeIEPKD (ORCPT + 99 others); Wed, 5 Sep 2018 11:10:03 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:50311 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726071AbeIEPKD (ORCPT ); Wed, 5 Sep 2018 11:10:03 -0400 Received: from [172.20.20.131] (unknown [182.150.46.145]) by APP-01 (Coremail) with SMTP id qwCowAD3_bWJso9b_xUaBw--.19874S2; Wed, 05 Sep 2018 18:40:10 +0800 (CST) From: Pu Wen Subject: Re: [PATCH v5 09/16] x86/bugs: add lfence mitigation to spectre v2 and no meltdown for Hygon To: Borislav Petkov Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, thomas.lendacky@amd.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org References: <20180905091309.GB2237@zn.tnic> Message-ID: Date: Wed, 5 Sep 2018 18:40:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180905091309.GB2237@zn.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID: qwCowAD3_bWJso9b_xUaBw--.19874S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KF17Wr47XrW7Kry8Aw4xJFb_yoW8ZrWDpF y0qFWSyF9rAwsayFZ7XF15Wr4vyr4xJw42kry5ur90va9Yvryvgr1Sgr17WFn5GryxXr4I qF4Yqrs8WF1rt37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkvb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWxJVW8Jr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxk0xIA0c2IEe2xFo4CEbIxvr21l 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07b0FxUUUUUU= X-Originating-IP: [182.150.46.145] X-CM-SenderInfo: psxzv046klw03qof0z/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/5 17:13, Borislav Petkov wrote: >> static const char *spectre_v2_strings[] = { >> [SPECTRE_V2_NONE] = "Vulnerable", >> [SPECTRE_V2_RETPOLINE_MINIMAL] = "Vulnerable: Minimal generic ASM retpoline", >> - [SPECTRE_V2_RETPOLINE_MINIMAL_AMD] = "Vulnerable: Minimal AMD ASM retpoline", >> + [SPECTRE_V2_RETPOLINE_MINIMAL_LFENCE] = "Vulnerable: Minimal LFENCE ASM retpoline", >> [SPECTRE_V2_RETPOLINE_GENERIC] = "Mitigation: Full generic retpoline", >> - [SPECTRE_V2_RETPOLINE_AMD] = "Mitigation: Full AMD retpoline", >> + [SPECTRE_V2_RETPOLINE_LFENCE] = "Mitigation: Full LFENCE retpoline", >> [SPECTRE_V2_IBRS_ENHANCED] = "Mitigation: Enhanced IBRS", >> }; > > This is user-visible and with all the back'n'forth and backporting > and the whole security fiasco, I don't want to have another source of > confusion. You'll have to live with it saying "AMD" in dmesg .... >> @@ -272,7 +272,7 @@ static const struct { >> { "off", SPECTRE_V2_CMD_NONE, false }, >> { "on", SPECTRE_V2_CMD_FORCE, true }, >> { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false }, >> - { "retpoline,amd", SPECTRE_V2_CMD_RETPOLINE_AMD, false }, >> + { "retpoline,lfence", SPECTRE_V2_CMD_RETPOLINE_LFENCE, false }, >> { "retpoline,generic", SPECTRE_V2_CMD_RETPOLINE_GENERIC, false }, >> { "auto", SPECTRE_V2_CMD_AUTO, false }, >> }; > > This even more so. Those are command line strings which we're still > communicating to people, even. So no, it needs to remain "retpoline,amd" > on Hygon. > > And then to not confuse people staring at the code either, we can drop > this change too: > > - SPECTRE_V2_CMD_RETPOLINE_AMD, > + SPECTRE_V2_CMD_RETPOLINE_LFENCE, > > Which leaves this patch only with the addition of the vendor tests. The > other stuff you can drop. That's reasonable. To avoid the confusion, will only leave the vendor testing for Hygon and drop the other changes, which also minimize the code modification. -- Regards, Pu Wen