Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1743021rdb; Wed, 31 Jan 2024 07:50:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/OIEV/R8300NWbieZmJHSKtWfhA4EVg/Cn8l6y0lDwwV3UI0P+JOecySVfgpiI7AO0jyG X-Received: by 2002:a17:903:228b:b0:1d7:8672:44ce with SMTP id b11-20020a170903228b00b001d7867244cemr2282495plh.26.1706716236878; Wed, 31 Jan 2024 07:50:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706716236; cv=pass; d=google.com; s=arc-20160816; b=YKN8Lkb1hp9tn32R0U8ekVeX2TqSLHxDeVpRjw6Z4D/ymkpgZj80eIeXTHfIuM5dgc vBCFyJUnOCxxbCeCjQRNLr6qw6bFsAlVQlmokZxuHA7WyxFEWbwCNOUaV4Spmi/d/JN8 /wAC6zQomZjp1CdfE9+ehRZe5dtA5WvxCjguIui68ipHQ87IC48C+rFM9ChEt3f8jLdW GD2aZ+o3c5+TRgA/auyY/7ZPDSSPXuULEQsitYEaOYkvO0kwcnMn0N1DFnWbpfe0Pft2 foT6HqdzqfZ1kSW6qJDZk0H4w/ZDAnf+qfHoxi7bpgvjsjmI3iMMG3FMN2pf/l1/dV+z GLEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ShXEhsnOf4Qa8k8iTBTenpYOXlavsQuWnbVyMIJ1hzA=; fh=4Iio6l2MLH3eqHwI64ItFC6xy5Nwsxub9+u1yqEnhDQ=; b=Ka1AV4ca24Wr2pOtWDeaddiUj+dQEcPfNdkINgKkOVfH8i1uGoH4qFTfDF1uvlcZTZ sDsZz17dEM0LJ7KZRZ4pY00fsgrD5Bw50c4ybAT7nCWjmCcP85MKFxXY0rAJERmE28k2 Q30kDS59zZ8UcLaDWkcVcM2BrXmxxr1K9PwYxzVWto7ir95BP008VK2fHPNlm8EBIKay g0kWiMqCf1BlNTh4yMshg51C3VGBQCJcRByjM3i57sJalxpwtngMwZxtPMD3aGY0gB2R FL+8z/+q6RaxtSL7E2OVdx3p1PwwpTRcatbV67yC/lrt5K9+LZgAt49uvNBxsGnkEUMQ ayoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RDsw4kK2; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-46704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWyDa+d9sKFi7YSO+hrlPgOBaMuNB27YBun/6OXPBpp6xzMX2FEmAPB/vbom2xpq1h0kPnQ8HJZ8wd2U7y21eQuFaTPZsKkqBziB/AD6A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 2-20020a170902ee4200b001d8e2c08e1asi5701390plo.70.2024.01.31.07.50.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:50:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RDsw4kK2; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-46704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 54B46B29256 for ; Wed, 31 Jan 2024 15:24:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B890886ADE; Wed, 31 Jan 2024 15:24:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RDsw4kK2" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B52480C11 for ; Wed, 31 Jan 2024 15:23:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706714640; cv=none; b=m7lJ+QoswkwqkHwsWB8tToDxn2OEChfJRxQIYZz7Pof5ftrDJ9U2+ShupAIjEPqwFL4n5rhL1VOr6NxVY9Z3GChgrSR7BFkahRCJ9tWTiC43GlecSjK7sOggEXS8TocHnB9iHKJ/fhSa9eFhSrr9BNMlJGLAvOI3klBrhVHwUAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706714640; c=relaxed/simple; bh=nPSaMyCuayy/I+QR1Qo4ECI40Tw9VjSdBcgrujLtNpk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wr1J9vmATv8gLAS+b0L6kzGGd/n3trURfMyfJzYgFuosMMujlSfT2U+VljuPtbVQBDY2oLbNv0Wz35Cmzs824mfiv6ou+Jx7pyjG3LjRjvoJ+3Afv5BtOiu3FNqSRFl38yH/YFnw81PAuh7G5B3LJafyEkmTdeLjs/aPRkA1LSU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RDsw4kK2; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706714638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ShXEhsnOf4Qa8k8iTBTenpYOXlavsQuWnbVyMIJ1hzA=; b=RDsw4kK2gHDkvRchbESRRC60cPHjZZqqw3zrjfW6bgNbNwlMhylHEg2cSHUBCHGVuVD6+I gRGd7nHLdAWHuFmboN+9PyqQ/UAEZLDkZvg2OaoKdnnKV4pGs3W/sNev38HPptHfRXCdY6 oU/Rn7UW17wm+uul0JiSCFUduxJ7XmQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-153-DXhB-mCfPv-1sXMqsS7BtQ-1; Wed, 31 Jan 2024 10:23:55 -0500 X-MC-Unique: DXhB-mCfPv-1sXMqsS7BtQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4853F185A784; Wed, 31 Jan 2024 15:23:54 +0000 (UTC) Received: from localhost (unknown [10.72.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32C088B; Wed, 31 Jan 2024 15:23:53 +0000 (UTC) Date: Wed, 31 Jan 2024 23:23:50 +0800 From: Baoquan He To: "Huang, Kai" , Nikolay Borisov Cc: Paolo Bonzini , "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" , "Rafael J. Wysocki" , Peter Zijlstra , "Hunter, Adrian" , Kuppuswamy Sathyanarayanan , "Reshetova, Elena" , "Nakajima, Jun" , "Edgecombe, Rick P" , Tom Lendacky , "Kalra, Ashish" , Sean Christopherson , "kexec@lists.infradead.org" , "linux-coco@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCHv6 00/16] x86/tdx: Add kexec support Message-ID: References: <20240124125557.493675-1-kirill.shutemov@linux.intel.com> <3f44458f-2b4a-4464-a3df-cb791298dafc@redhat.com> <5d91fc11-0b3b-40f0-872d-abdbb4038f76@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 On 01/31/24 at 01:07pm, Huang, Kai wrote: > > > Runtime disabling kexec looks better than at cmpile time, esp for > > > distros. While from above patch, making using of kexec_load_disabled > > > to achive the runtime disabling may not be so good. Because we have a > > > front door to enable it through: > > > > > > /proc/sys/kernel/kexec_load_disabled > > > > AFAIU it can't be enabled via this sysctl because the handler for it expects > > only 1 to be written to it: > > > > 2 .proc_handler = proc_dointvec_minmax, > > > > 1 .extra1 = SYSCTL_ONE, > > > > 994 .extra2 = SYSCTL_ONE, > > > > This is also my understanding. > > The documentation also says once it is turned to disable we cannot turn back again: > > kexec_load_disable > =================== > > A toggle indicating if the syscalls ``kexec_load`` and > ``kexec_file_load`` have been disabled. > This value defaults to 0 (false: ``kexec_*load`` enabled), but can be > set to 1 (true: ``kexec_*load`` disabled). > Once true, kexec can no longer be used, and the toggle cannot be set > back to false. you are quite right, I have never noticed this, thanks. Then then mentioned patch looks good to me.