From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226jQATt3WdZpYtgBBP1+BYJ4Fqch/5lxPhAW/TWZV2U+igHzFavxHTuI3lfPcfYsD5u2d9+ ARC-Seal: i=1; a=rsa-sha256; t=1516910012; cv=none; d=google.com; s=arc-20160816; b=m8anMYlJ7UszPpiWQYnDZk+Z/Y+0I4Gy9ROb2U9OoGZyYDd6QIstcViAGaIhuAog7J sbGe0IhG6ATxsPWx0npD86kgwKrSWaRsdGXf94ARc5PYaUnAUrk7rt65AWH3QGAl6gAN j7jtfPgy1T3pb/ZyF+n5uylaQc2F+7DnkVkBxGb1XS0nNPGkjbIWZ6JNKmemMSYGuLTt 3fty1973Tr86dQMuVe1UnAF7xK0YFuoQNLcobQxUldrx0VLI7zOZ/86VOkt1eeG18X6k nncFjwBGrXOPJF6UQO2f8EBuIMHtKWFxCKbve+BmW2GcVCpCKB2yI+MFucg7Tq5t7heS qJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject :arc-authentication-results; bh=EUSGHX13zQzz+aavjqxdyu7yRki2KprIG8L9yhJn+do=; b=BqVJKbBGroMa5EMR8MOMRfmuTfISBFZs9482oR2GdA6hklC8eNIvJ1mjrap/+bFEDC gJR16Db2wAlYlU0PuMzTbipuSL6RcuLfvcDkOPCzgE2hXg7/I6eQvpU0LqxzPzZuGakL A0Izgj8Cj0gLn4mKDHaadB5YxeKPM08PPcUc2TWAsxb6r4jaCF8wvV5Ax8iil+BhyXKE XMyXK6QyxSSfjBKdu1NtXe0dHK8rbFFSiwFo4C+R6mdbpAxTvGLe63f7fjfFSgnX+Ycb ZQxTa2cSbtspK5ImoiBOvT1bKH4TDYKom1TjfJT6ziYfgfQtUgUhiW7081vUCn4uUShL X2Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dave.hansen@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=dave.hansen@intel.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of dave.hansen@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=dave.hansen@intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,413,1511856000"; d="scan'208";a="26366201" Subject: Re: [PATCH v5 5/7] x86/pti: Do not enable PTI on processors which are not vulnerable to Meltdown From: Dave Hansen To: David Woodhouse , arjan@linux.intel.com, tglx@linutronix.de, karahmed@amazon.de, x86@kernel.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, bp@alien8.de, peterz@infradead.org, pbonzini@redhat.com, ak@linux.intel.com, torvalds@linux-foundation.org, gregkh@linux-foundation.org, gnomes@lxorguk.ukuu.org.uk, ashok.raj@intel.com, mingo@kernel.org, "Gross, Mark" , "Yang, Fei" References: <1516896855-7642-1-git-send-email-dwmw@amazon.co.uk> <1516896855-7642-6-git-send-email-dwmw@amazon.co.uk> Message-ID: <3f23ff04-f12e-d15b-31e8-6b48f2c13f19@intel.com> Date: Thu, 25 Jan 2018 11:53:29 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590581674274638091?= X-GMAIL-MSGID: =?utf-8?q?1590595432844457196?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On 01/25/2018 10:10 AM, Dave Hansen wrote: > On 01/25/2018 08:14 AM, David Woodhouse wrote: >> +static bool __init early_cpu_vulnerable_meltdown(struct cpuinfo_x86 *c) >> +{ >> + u64 ia32_cap = 0; >> + >> + if (x86_match_cpu(cpu_no_meltdown)) >> + return false; >> + >> + if (cpu_has(c, X86_FEATURE_ARCH_CAPABILITIES)) >> + rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); >> + >> + /* Rogue Data Cache Load? No! */ >> + if (ia32_cap & ARCH_CAP_RDCL_NO) >> + return false; >> + >> + return true; >> +} > > Feel free to add my ack on this. It looks fine to me. I'll test and > submit any necessary fixes once I actually get a system that has this bit. Well, that was fast. A system supporting the RDCL_NO bit booted this code. It reported not being affected by meltdown: foo:/sys/devices/system/cpu/vulnerabilities/ # grep . * meltdown:Not affected spectre_v1:Vulnerable spectre_v2:Vulnerable: Minimal generic ASM retpoline foo:/sys/devices/system/cpu/vulnerabilities/ #