From patchwork Tue Feb 13 21:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 200622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp811244dyb; Tue, 13 Feb 2024 13:12:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUvTjp7dsNog5529m3tqRCnVkqcDojoDayy5x9dLEtE0JTv5PkiPkNLd49PQyWPekeDfTwRjw3q7AjD2c2LJmHpNjeodw== X-Google-Smtp-Source: AGHT+IELzhiIx/kVUB2W/vp9EK2MZWTqtBGQKhBJC3JaKwuEQLA2NT6VjNKNgII8VGJu7w/z5Vu/ X-Received: by 2002:a05:6870:3049:b0:21a:33d4:4056 with SMTP id u9-20020a056870304900b0021a33d44056mr666243oau.12.1707858756593; Tue, 13 Feb 2024 13:12:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858756; cv=pass; d=google.com; s=arc-20160816; b=tLF7D1XT/XVUYnnW5dyfLr1k+ExsrsqlLFfpM1xOKvOv8huGAIE78fdBJ1IsWIPsiv EJ/Iaf17xH7/lM6YOvCikej1PNTrmL5da/kPxMVNTAYuqzhsVXyQby+4e8//dUbvMarZ a9bOpbxHzCw/ekIdg579taU/s+kyKfm33h20PQnUY0WCOU2AYjLfJvu2oE1ptfANr72K ICLhunHG4OEa8YR0N7HfFNR/HJMVegFfHolcYPtGpL623NV2ZA1rSvFUEIxXJcb4jaoD dHCj53mboFur2zOz0Ly+SR1N/yGm7beC2wBY3k4OeQzXYHNPrwv1fxx6lcDJwzoZoNaV jPbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=21XnL3/KpVSRQX9fQR+Ss73/rrljxkqQNbU70H6SdFY=; fh=KoBX2An01fzYyKHp18Cuerikeb0BwSIssF91gA+BEOU=; b=VN3ALhB0hcFh05kwiReyf0e7SDU+ksweHaSfZDYFGYn7vILEvsfUuIBQObfd/9gZMZ FQMXaBjI/ojvuQXZcRXaiqh3C4iIXk+DgizO22Ms1msOQY6cEN7KFvvdInA1sXkT5aoi 6bpfRtBEouJhSHePY4VCXLLuoUE0H50PdlMb51yOG0ehr2NDu4ph5y36YAvxn7uuvtQG JXMZPeqCOi48bIpj7kRgOgfH968tYdcBkFg8TJgVPS6iZsdgcfSoJK0GmbQQ4U5zpagi +fcRd9OLudoeJwTdQd+xeeoypigFHGo7+TdX4MmWERpyLhML9A2aLd28Aw0hwgS0V17s QRng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uZsom5YM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-64275-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64275-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCVFxH6zZtsuwPO0mQ1P6F4FyJKM8CoVnLlasjSLVLqEiP9QUjXlO2553e9Z0Vi1NilubMqKIGy8RERXAphUZOIj04ZQ+w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y8-20020a05622a120800b0042c60921ffasi4160071qtx.525.2024.02.13.13.12.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:12:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64275-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uZsom5YM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-64275-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64275-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 56AC81C23361 for ; Tue, 13 Feb 2024 21:12:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74CCF7762A; Tue, 13 Feb 2024 21:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="uZsom5YM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8sUBr5ij" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 6DE5071B4C for ; Tue, 13 Feb 2024 21:05:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858313; cv=none; b=RfoTEcSdwaH/poJ56qLLHN2uhZ24eCtyYTyBgPR4ZD1jckxDodhS0HErYvgtZTq1nb8MLc53OM0a704GRKJsbO8juoWuj5i61YuB4SGKapHGslfd9G+QSY2yFdkUMw1Fh2EfLSKzlKMU7e9N9Ut+HcsZ/PihhfKq28xeBsJAYgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858313; c=relaxed/simple; bh=8UoXimlIZEV2eh9uv+zpNtLrnTWnYvwIjEWGdn2Rb2E=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=AvBCQrpEuLEm4TtYZmBM8NAKigf+t136sSTune5iirh5EFWZnF7mnh8XausQ7StzpTxNbIjlulFx+AcjLbbOaHVh12BczxeIsQ9YHD4i95nTysHblB1c9qI2kqX/9lAw0ge5XhP5iT8DuDTPk7EAvcupnCpfwVF4YrGJQPtKn9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=uZsom5YM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8sUBr5ij; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Message-ID: <20240212154639.683073662@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858311; 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: references:references; bh=21XnL3/KpVSRQX9fQR+Ss73/rrljxkqQNbU70H6SdFY=; b=uZsom5YMvj6oRMdhpTRQuI761wmJ08YSXX2TwzbaHmTl/NG46b8mHHbCV8KFBJZfGKl5cq mIEHZj41WdB+mJjaE49aenH4Annddphpw0LT1PJ12iBl/WCzCugu2EBPMIqaQkJJQ/rioh fpkmb0QogNEMesRf1RiS3xDkYnzNmn01cQ9vMnSPDpwYz8GlO3L4VJin7QoSyWnmuuMY0R zcj1KjosHA3wX6fc5E5WjlHKt0AeXtEwBG5p8w9XOD8kCQGoi4RK1xdQhZdwuZzyOAyzvJ 2pMio1KrvGLVii1XZglfLVq6jz8ler6+jMfMUwvVITzziyetLr1xmNwMEfsIhQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858311; 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: references:references; bh=21XnL3/KpVSRQX9fQR+Ss73/rrljxkqQNbU70H6SdFY=; b=8sUBr5ijnUZGU/qNF8O472/7fPvXyDyD+2jquxP6o45wrPLxNMuYZR6Waak3WGb0d+689b ex0HGRggY3Pds1DQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Sohil Mehta , K Prateek Nayak , Kan Liang , Zhang Rui , "Paul E. McKenney" , Feng Tang , Andy Shevchenko , Michael Kelley , "Peter Zijlstra (Intel)" , Andy Shevchenko , Wei Liu Subject: [patch V3 14/22] x86/jailhouse: Prepare for separate mpparse callbacks References: <20240212154529.402604963@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Tue, 13 Feb 2024 22:05:10 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790819703368709339 X-GMAIL-MSGID: 1790819703368709339 From: Thomas Gleixner Provide a wrapper around the existing function and fill the new callbacks in. No functional change as the new callbacks are not yet operational. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/jailhouse.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) --- --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -118,6 +118,11 @@ static void __init jailhouse_get_smp_con } } +static void __init jailhouse_parse_smp_config(void) +{ + jailhouse_get_smp_config(false); +} + static void jailhouse_no_restart(void) { pr_notice("Jailhouse: Restart not supported, halting\n"); @@ -201,21 +206,24 @@ static void __init jailhouse_init_platfo struct setup_data header; void *mapping; - x86_init.irqs.pre_vector_init = x86_init_noop; - x86_init.timers.timer_init = jailhouse_timer_init; - x86_init.mpparse.get_smp_config = jailhouse_get_smp_config; - x86_init.pci.arch_init = jailhouse_pci_arch_init; - - x86_platform.calibrate_cpu = jailhouse_get_tsc; - x86_platform.calibrate_tsc = jailhouse_get_tsc; - x86_platform.get_wallclock = jailhouse_get_wallclock; - x86_platform.legacy.rtc = 0; - x86_platform.legacy.warm_reset = 0; - x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT; + x86_init.irqs.pre_vector_init = x86_init_noop; + x86_init.timers.timer_init = jailhouse_timer_init; + x86_init.mpparse.find_mptable = x86_init_noop; + x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; + x86_init.mpparse.parse_smp_cfg = jailhouse_parse_smp_config; + x86_init.mpparse.get_smp_config = jailhouse_get_smp_config; + x86_init.pci.arch_init = jailhouse_pci_arch_init; + + x86_platform.calibrate_cpu = jailhouse_get_tsc; + x86_platform.calibrate_tsc = jailhouse_get_tsc; + x86_platform.get_wallclock = jailhouse_get_wallclock; + x86_platform.legacy.rtc = 0; + x86_platform.legacy.warm_reset = 0; + x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT; - legacy_pic = &null_legacy_pic; + legacy_pic = &null_legacy_pic; - machine_ops.emergency_restart = jailhouse_no_restart; + machine_ops.emergency_restart = jailhouse_no_restart; while (pa_data) { mapping = early_memremap(pa_data, sizeof(header));