From mboxrd@z Thu Jan 1 00:00:00 1970 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 8E7A684A37 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=1706714641; cv=none; b=uQzaBLNUXHc1GmCaqzypGvHvxHHq1ux5I/mFK0cklaP2G1hhq0ctLrEEygV2UqQcV8Wow8fYdCW/iX7Aldf6sINAPgU8q0DQEJDpEFCRnH0wcII1E6DVrtEyPxvQhb7hpDrKKOcQKAIRq9uzFcItZnBuQxronJ4jZ60SgbQndaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706714641; 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=nEOsWPaOxAi7ZfER1uhdf7QE3o5gPVMlVAB9Mmz54zq5BCw8A86QRh4z6+QCzz301b+1ke38EddEGTv7UocDu2V3WBGGNl5XSor6e1FrgN7z3Xor26XdT98QjjJYrVLB+wwdgXyVQqSXztZqJmscLfMSHiywknrnpjqlaNdPA3k= 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RDsw4kK2" 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-coco@lists.linux.dev 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.