Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4863850rwb; Tue, 6 Sep 2022 14:06:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR4caevyx3r16dJRn8iKHcD88sY4rLnh2o85Qv38Xh9QG8BQFv0DuXv7T4inJcWOHmYYKsmd X-Received: by 2002:a17:907:9484:b0:738:6f9f:6032 with SMTP id dm4-20020a170907948400b007386f9f6032mr241057ejc.602.1662498396461; Tue, 06 Sep 2022 14:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662498396; cv=none; d=google.com; s=arc-20160816; b=oOntuXH65lTZzh2mRWkkUJzZ+FhXmHGr/F9r0FduG3hlt7/jKzep5G8JJ1a4OJTKcj MTKscFjcGtFT9DeEqiusz5g3BvSEnHh/tngAcq6vseVIFGF1MVz4uuWVbPZ893Eg0DuC 8WaCJ8dyXzQ3UCaz2oM9JRVW0UDROjZ7OHCQ4I4BCpDz7A61NRiLI7MENsQWI9XND01m CzfkxITYFggtWgtoeJ3n4hCXXD0tlYmchW+4OSYjeHO36EZx2WyoEELE9x8+c4WMjokD ZV1ybzOojA3fhpRVlSOZlzn5mTAg3kFToRQ79V5oGqS+5jU/JbHuJuL1IACrOM5MNwlg 2xIQ== 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=VfkRYEMWj3FD8tJg6/WhebmsvjXoNQjBzn0bpZ2iFog=; b=rHG8JNZUfVb7dCMXDWUUtTaemdYrPzb2j/npXIPZ1OiNAePieq/iIxlwfY2l0rbws3 wWLcdYBThqeqTCSNgqEE4FK170c2b/TlhaZzm0C+5Wz0AlH+hEe5ICfrjkKSb71HjPKX BTln4Hg6F7nQgrfJDYeYVpqwS574Wo+0SkrpfkzQL5qES+8RPvkLX+g8pSQ/UTffqXP0 Lga3XQmw+j2mgG8sv3vLvkCsDyd/BMY96bJe5EpQ64p2S4cxFn+k2Nmz6ypFhU7JPDXK peAzRn+E2jpcqhX+p8z9+6Lh9SfOru8B+qeUt6Cd43h0BxD7Eop7yxFiAz2Azp4oP457 Rfdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FXBP2PcZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a056402320600b0044e264ff140si6352802eda.175.2022.09.06.14.06.11; Tue, 06 Sep 2022 14:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FXBP2PcZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbiIFVAx (ORCPT + 99 others); Tue, 6 Sep 2022 17:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiIFVAu (ORCPT ); Tue, 6 Sep 2022 17:00:50 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15F854A801 for ; Tue, 6 Sep 2022 14:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VfkRYEMWj3FD8tJg6/WhebmsvjXoNQjBzn0bpZ2iFog=; b=FXBP2PcZI1p1iGJHVq+rmXJUFc hNewwmCKp0B8i+343tpoaqxtI6fszAT5bPagQgkp9nKY1u+n4cewpMO9nVjl7fH9m+RI+JgBV7rUs FxKTvczPiWvV6fTDfLjIqwk3wHJx6ZjVpIKBXGgvQdkqpy/89H7IWkUn9NZYrWUwHVGyKHRnLSD5b WvylxT4BYnnGIzSXW6VO7tOW6nPe3yNrXV9AtYapKXmR0O5rPLj5XgPGze+c0Wk8nZIjygTLD0gUy HXuXEF2rU6OF3D+qunS7GYG7saqc21+Ky1XkdtljtuDRsGB0GBPbFWbj3WD2/prcnhnMz4p/zDl0B 9tUJOq2Q==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVfgU-00AlK0-Ry; Tue, 06 Sep 2022 21:00:38 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DDDB7300244; Tue, 6 Sep 2022 23:00:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CC1CA2B977EDE; Tue, 6 Sep 2022 23:00:36 +0200 (CEST) Date: Tue, 6 Sep 2022 23:00:36 +0200 From: Peter Zijlstra To: Hans de Goede Cc: "Rafael J . Wysocki" , Pavel Machek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Dave Hansen Subject: Re: [PATCH] x86/cpu: Avoid writing MSR_IA32_TSX_CTRL when writing it is not supported Message-ID: References: <20220906201743.436091-1-hdegoede@redhat.com> <6ff23930-325b-4207-12fc-4d8fd5bea1ff@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ff23930-325b-4207-12fc-4d8fd5bea1ff@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 06, 2022 at 10:56:47PM +0200, Hans de Goede wrote: > Hi, > > On 9/6/22 22:43, Peter Zijlstra wrote: > > On Tue, Sep 06, 2022 at 10:17:43PM +0200, Hans de Goede wrote: > >> On an Intel Atom N2600 (and presumable other Cedar Trail models) > >> MSR_IA32_TSX_CTRL can be read, causing saved_msr.valid to be set for it > >> by msr_build_context(). > >> > >> This causes restore_processor_state() to try and restore it, but writing > >> this MSR is not allowed on the Intel Atom N2600 leading to: > > > > FWIW, virt tends to do this same thing a lot. They'll allow reading > > random MSRs and only fail on write. > > Right. So I guess I should send a v2 with an updated commit > message mentioning this ? Nah, just saying this is a somewhat common pattern with MSRs. The best ones are the one where writing the value read is invalid :/ or those who also silently eat a 0 write just for giggles. Luckily that doesn't happen often.