Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F8E6C46CA2 for ; Tue, 19 Dec 2023 16:36:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657043.1025670 (Exim 4.92) (envelope-from ) id 1rFd4a-0008Q7-5w; Tue, 19 Dec 2023 16:36:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657043.1025670; Tue, 19 Dec 2023 16:36:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFd4a-0008Q0-3P; Tue, 19 Dec 2023 16:36:00 +0000 Received: by outflank-mailman (input) for mailman id 657043; Tue, 19 Dec 2023 16:35:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFd4Z-0008Oc-Ck for xen-devel@lists.xenproject.org; Tue, 19 Dec 2023 16:35:59 +0000 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [2a00:1450:4864:20::42c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b02e817d-9e8c-11ee-98eb-6d05b1d4d9a1; Tue, 19 Dec 2023 17:35:58 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3367632ce7bso446076f8f.2 for ; Tue, 19 Dec 2023 08:35:58 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id h3-20020a5d6883000000b00336755f15b0sm1505163wru.68.2023.12.19.08.35.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Dec 2023 08:35:57 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b02e817d-9e8c-11ee-98eb-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1703003758; x=1703608558; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=j9hJKF7RRuBSejCOh++IK5x52P/Eji436fOwdpI2cfA=; b=VvJCrTC9YX5gz7kr6GichRnoEskvI0kHSvnRMoxOsAgy8aLwJyfHPjd/GY/wDcLscf kloIRlBDEbd4AWTMJt6MmhGXMQd3gbQ4bc+UWKALrZZiCQZ7qouELbBlkz2JDGkprICc lY6EuCmr4QlwTMS3SLJIcwZy6dc7UVQFNovoeLf+r4Dwo/0VzhpDXhKeE6FUorjgt5z6 pBEvWOGrozGupp6jbN+vuuxTt6U30Gj0XoXWNs13Fmi59RVIOuVn9Ytx3A7H5m9wEDLG LRlh8uIlOXDE3BBAqFlew/vrjfBN7/H4948mv3/W5SCRg1AUU6CN5g/FtO6Y+c8foh/y p1ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703003758; x=1703608558; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j9hJKF7RRuBSejCOh++IK5x52P/Eji436fOwdpI2cfA=; b=AnIliW4eE51s24uJV6MjuYRaYfxXe4YsiLxf+9QhagfrGlpLfqbALhnvhp49MTxJzB I7co7SWc1ny4La67qrfe8YpiDT2vj3qzUl2F7jVQfiPPOpSjX+ofzImJu1GYeT1zCM16 5WpVS+VVnuzOIel9kP6nC5EKncqFRlucvWZH4rS9PxSAfO/jhaRCFVUAZmJk/Lq8eyJY PeKlW4GpiVURoRCmJz+qTAZkTJOlGozEJz1IZOgf5QcGjwKxBohKUrp9XZuyDDN8eraB vK+Fxr3OZDOTSh0W7Jmh8lcz99WMflqjXSB2+uiL2M8R7OGxgmirUEJRTWI5HaoMeSn3 dA2g== X-Gm-Message-State: AOJu0YzXCEPg7hYpeJj2YCSYbqYj4idoHQSfSv6X++8c6WeQkLndT+1C cfb+OiYii9+XOQtEbokG/SZ0 X-Google-Smtp-Source: AGHT+IE88lp1v5YkDqE9DSdZM2tJSZjDJIgm63EytiwTouDSoM34/RqHkkU1qK4fGMnubsPa6QWjiw== X-Received: by 2002:adf:e2cf:0:b0:333:32d8:e0f2 with SMTP id d15-20020adfe2cf000000b0033332d8e0f2mr10168376wrj.102.1703003757990; Tue, 19 Dec 2023 08:35:57 -0800 (PST) Message-ID: <8a236600-7fa3-48da-a692-8286e5931f21@suse.com> Date: Tue, 19 Dec 2023 17:35:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/4] xen/x86: introduce self modifying code test Content-Language: en-US To: Roger Pau Monne Cc: Wei Liu , Anthony PERARD , Juergen Gross , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , xen-devel@lists.xenproject.org References: <20231215111842.8009-1-roger.pau@citrix.com> <20231215111842.8009-3-roger.pau@citrix.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQq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3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <20231215111842.8009-3-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 15.12.2023 12:18, Roger Pau Monne wrote: > Introduce a helper to perform checks related to self modifying code, and start > by creating a simple test to check that alternatives have been applied. > > Such test is hooked into the boot process and called just after alternatives > have been applied. In case of failure a message is printed, and the hypervisor > is tainted as not having passed the tests, this does require introducing a new > taint bit (printed as 'T'). > > A new sysctl is also introduced to run the tests on demand. While there are no > current users introduced here, further changes will introduce those, and it's > helpful to have the interface defined in the sysctl header from the start. > > Note the sysctl visibility is not limited to x86, albeit the only > implementation is for x86. It's expected that other architectures can reuse > the same sysctl and structure, with possibly different tests. Leave adjusting > those to when support for a different architecture is introduced, as the > sysctl interface is not stable anyway. > > Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich