From patchwork Tue Aug 8 20:08:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9889029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 13CDE603F2 for ; Tue, 8 Aug 2017 20:11:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05F87287D5 for ; Tue, 8 Aug 2017 20:11:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF110288E6; Tue, 8 Aug 2017 20:11:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 45C38287D7 for ; Tue, 8 Aug 2017 20:11:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfAou-0000k2-78; Tue, 08 Aug 2017 20:09:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfAos-0000jT-M1 for xen-devel@lists.xen.org; Tue, 08 Aug 2017 20:09:38 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 46/13-01995-18A1A895; Tue, 08 Aug 2017 20:09:37 +0000 X-Brightm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.tower-31.messagelabs.com!1502222976!97469100!1 X-Originating-IP: [104.47.0.86] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60295 invoked from network); 8 Aug 2017 20:09:36 -0000 Received: from mail-he1eur01on0086.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.86) by server-2.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 8 Aug 2017 20:09:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KZ7YvX0FoxdHVDb/OJTOymoz3Xjz8P/UOoeybnjpyNA=; b=F8/Gdcc9Xexq0dP4DL1bkpFraKbJK5IyFy50Ko6EDTKHQQ4+/ujAq3+F4U4TquNP88wcJetB8FNH+Rh+MgeT4pIsIcdr6aewW6/sv0sHkj2mSF4oFRCYXwhTu90uz7d2HT50YLQHxNTSzdrWZYoNCNqlDeHB96hQga35QVjWnCk= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.58) by HE1PR0301MB2139.eurprd03.prod.outlook.com (2603:10a6:3:21::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Tue, 8 Aug 2017 20:09:33 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Tue, 08 Aug 2017 23:09:29 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Tue, 8 Aug 2017 23:08:41 +0300 Message-Id: <1502222922-25821-7-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502222922-25821-1-git-send-email-volodymyr_babchuk@epam.com> References: <1502222922-25821-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.58] X-ClientProxiedBy: AM5PR0602CA0008.eurprd06.prod.outlook.com (2603:10a6:203:a3::18) To HE1PR0301MB2139.eurprd03.prod.outlook.com (2603:10a6:3:21::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6230950d-5a6e-4500-90a0-08d4de9962e6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0301MB2139; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2139; 3:pDeysWDrRF8rgfVvRToBO5kZcEURnllBMTbE37UYmadKFG/xHnKv+cTa1guCYR33OHwevj8YPK/+2LIU7x3y0DcJxvUDBD9VoJPF1T7H9nIGPw6/rKZay4MGKz4j7ewRFRJI8e17wgQ91dVKJGBWWfpJ3I0+Z9gNfEilcXqC2JWhCSF8mhTYzj2ttdUFmD0ne1hkY+9j8vQA3cP++Ths/W2wFqsezVDG+QefikjDotgWEM0jdKvxgdN7i3r4zlqb; 25:IhpWWxQy2SlMiqbkXgcb5TNtBZ0k9wlOcy4ZFi9DWdPeQVsKY2MRUhjbg8j7K5/qhnqgV9RfM7uKU1NEiQiwfB4/jXKOV7d43RA48s4Q6gn1UzQnCZ52SXXKoXBiPXl3Qkopb4y4l+Dd9pLeh43sQjeLDlmIxmVJfzaCV5fe4jJ+SUhhRW8lLujS+kRIzIo1VydiswoISUxP7KzeKzZsxcSY92phuM3gknGIfbyBpXy/bryVqIi91ke9uIC9jXOrTH5DxfL/zyTBKNWZ8YcM9dsvJMoBnDWdJw8WmlGIUr3hoaXpfrCYcxzSCwW6KCXHCis3h2fNWz9Xva4rv9q8dw==; 31:a5NTVkeaMJ0/mN2OkOlJLPthUBhqNLw5c2gdvmkgpZF9SLFAwfa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antispam-Report-Test: UriScan:(4114951738403); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2139; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2139; X-Forefront-PRVS: 03932714EB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39410400002)(39850400002)(39400400002)(39840400002)(39450400003)(189002)(199003)(50986999)(72206003)(97736004)(36756003)(305945005)(50466002)(7736002)(189998001)(68736007)(50226002)(101416001)(5660300001)(76176999)(8676002)(81156014)(81166006)(2906002)(106356001)(105586002)(4326008)(7350300001)(66066001)(2361001)(8656003)(86362001)(47776003)(110136004)(38730400002)(478600001)(107886003)(3846002)(5003940100001)(2351001)(2950100002)(6916009)(48376002)(80792005)(6666003)(33646002)(53936002)(42186005)(8666007)(122856001)(6116002)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2139; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0301MB2139; 23:hVJhLlhJKzs4Ew+OSzzD5Buf3IWRcQFvZtGeXNu?= =?us-ascii?Q?T7rNk2DYCi8D8dc/WCT6TMSUwjlRFuwGxgMOn3cgawdQmuTPmLur9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MXrWCATAM9dUCImUAU19IoR7lZOI4cMzKcVEtYQcqbnIR3YSdkCYDgBzvbarnaPamU=; 7:Yfd2xLdRpbIgFIZ0enma+kvhvqjfguROGjgMlJGJyw9YKt3nkqGUwT+KbRVIhnJkT8jnCc+ArCdh5R4iZNa8UPb+nW2FMWr4aAUJtQbGx8OEe5PcyVcw0caB+Z6aWG6QYdxJXlJ3P0xCst9R/gHqXu9m7QXUQANgktiffccShMSlMMY9LPSJsSg4LbB9yzBL2gTUAjm7zXF/TC3XEZ6Ihy25eaq/y7lQ4/PO4FNz+0o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2017 20:09:33.1410 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2139 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH 6/7] arm: psci: use definitions provided by vsmc.h X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP vsmc.h provides definitions to construct SMC call function number according to SMCCC. We don't need multiple definitions for one thing, and definitions in vsmc.h are more generic than ones used in psci.h. So psci.h will only provide function codes and whole SMC function number will be constructed using generic macroses from vsmc.h. This change also affects vsmc.c and seattle.c, because they both use PSCI function numbers. Signed-off-by: Volodymyr Babchuk --- This is new patch, suggested by Julien Grail. --- xen/arch/arm/platforms/seattle.c | 5 +++-- xen/arch/arm/psci.c | 12 ++++++------ xen/arch/arm/vsmc.c | 26 +++++++++++++------------ xen/include/asm-arm/psci.h | 41 ++++++++++++++++++---------------------- 4 files changed, 41 insertions(+), 43 deletions(-) diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c index 86dce91..679632d 100644 --- a/xen/arch/arm/platforms/seattle.c +++ b/xen/arch/arm/platforms/seattle.c @@ -19,6 +19,7 @@ #include #include +#include static const char * const seattle_dt_compat[] __initconst = { @@ -33,12 +34,12 @@ static const char * const seattle_dt_compat[] __initconst = */ static void seattle_system_reset(void) { - call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); + call_smc(PSCI_0_2_FN32(PSCI_0_2_FUNC_SYSTEM_RESET), 0, 0, 0); } static void seattle_system_off(void) { - call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + call_smc(PSCI_0_2_FN32(PSCI_0_2_FUNC_SYSTEM_OFF), 0, 0, 0); } PLATFORM_START(seattle, "SEATTLE") diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index 34ee97e..4b01131 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -31,9 +31,9 @@ * (native-width) function ID. */ #ifdef CONFIG_ARM_64 -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64_##name +#define PSCI_0_2_FN_NATIVE(n) PSCI_0_2_FN64(n) #else -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN_##name +#define PSCI_0_2_FN_NATIVE(n) PSCI_0_2_FN32(n) #endif uint32_t psci_ver; @@ -48,13 +48,13 @@ int call_psci_cpu_on(int cpu) void call_psci_system_off(void) { if ( psci_ver > PSCI_VERSION(0, 1) ) - call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + call_smc(PSCI_0_2_FN32(PSCI_0_2_FUNC_SYSTEM_OFF), 0, 0, 0); } void call_psci_system_reset(void) { if ( psci_ver > PSCI_VERSION(0, 1) ) - call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); + call_smc(PSCI_0_2_FN32(PSCI_0_2_FUNC_SYSTEM_RESET), 0, 0, 0); } int __init psci_is_smc_method(const struct dt_device_node *psci) @@ -144,7 +144,7 @@ int __init psci_init_0_2(void) } } - psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); + psci_ver = call_smc(PSCI_0_2_FN32(PSCI_0_2_FUNC_PSCI_VERSION), 0, 0, 0); /* For the moment, we only support PSCI 0.2 and PSCI 1.x */ if ( psci_ver != PSCI_VERSION(0, 2) && PSCI_VERSION_MAJOR(psci_ver) != 1 ) @@ -154,7 +154,7 @@ int __init psci_init_0_2(void) return -EOPNOTSUPP; } - psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON); + psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(PSCI_0_2_FUNC_CPU_ON); printk(XENLOG_INFO "Using PSCI-%u.%u for SMP bringup\n", PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver)); diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index 718b30f..ea86eea 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -87,7 +87,9 @@ static bool handle_arch(struct cpu_user_regs *regs) /* helper function for checking arm mode 32/64 bit */ static inline int psci_mode_check(struct domain *d, register_t fid) { - return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) ); + return !( is_64bit_domain(d)^ + ((fid & (ARM_SMCCC_SMC_64 << ARM_SMCCC_CALL_CONV_SHIFT)) >> + ARM_SMCCC_CALL_CONV_SHIFT) ); } /* PSCI 2.0 interface */ @@ -97,34 +99,34 @@ static bool handle_ssc(struct cpu_user_regs *regs) switch ( ARM_SMCCC_FUNC_NUM(fid) ) { - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_PSCI_VERSION): + case PSCI_0_2_FUNC_PSCI_VERSION: perfc_incr(vpsci_version); PSCI_SET_RESULT(regs, do_psci_0_2_version()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_OFF): + case PSCI_0_2_FUNC_CPU_OFF: perfc_incr(vpsci_cpu_off); PSCI_SET_RESULT(regs, do_psci_0_2_cpu_off()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE_INFO_TYPE): + case PSCI_0_2_FUNC_MIGRATE_INFO_TYPE: perfc_incr(vpsci_migrate_info_type); PSCI_SET_RESULT(regs, do_psci_0_2_migrate_info_type()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE_INFO_UP_CPU): + case PSCI_0_2_FUNC_MIGRATE_INFO_UP_CPU: perfc_incr(vpsci_migrate_info_up_cpu); if ( psci_mode_check(current->domain, fid) ) PSCI_SET_RESULT(regs, do_psci_0_2_migrate_info_up_cpu()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_SYSTEM_OFF): + case PSCI_0_2_FUNC_SYSTEM_OFF: perfc_incr(vpsci_system_off); do_psci_0_2_system_off(); PSCI_SET_RESULT(regs, PSCI_INTERNAL_FAILURE); - return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_SYSTEM_RESET): + return true; + case PSCI_0_2_FUNC_SYSTEM_RESET: perfc_incr(vpsci_system_reset); do_psci_0_2_system_reset(); PSCI_SET_RESULT(regs, PSCI_INTERNAL_FAILURE); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_ON): + case PSCI_0_2_FUNC_CPU_ON: perfc_incr(vpsci_cpu_on); if ( psci_mode_check(current->domain, fid) ) { @@ -134,7 +136,7 @@ static bool handle_ssc(struct cpu_user_regs *regs) PSCI_SET_RESULT(regs, do_psci_0_2_cpu_on(vcpuid, epoint, cid)); } return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_SUSPEND): + case PSCI_0_2_FUNC_CPU_SUSPEND: perfc_incr(vpsci_cpu_suspend); if ( psci_mode_check(current->domain, fid) ) { @@ -144,7 +146,7 @@ static bool handle_ssc(struct cpu_user_regs *regs) PSCI_SET_RESULT(regs, do_psci_0_2_cpu_suspend(pstate, epoint, cid)); } return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_AFFINITY_INFO): + case PSCI_0_2_FUNC_AFFINITY_INFO: perfc_incr(vpsci_cpu_affinity_info); if ( psci_mode_check(current->domain, fid) ) { @@ -153,7 +155,7 @@ static bool handle_ssc(struct cpu_user_regs *regs) PSCI_SET_RESULT(regs, do_psci_0_2_affinity_info(taff, laff)); } return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE): + case PSCI_0_2_FUNC_MIGRATE: perfc_incr(vpsci_cpu_migrate); if ( psci_mode_check(current->domain, fid) ) { diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h index be2458a..af6edf8 100644 --- a/xen/include/asm-arm/psci.h +++ b/xen/include/asm-arm/psci.h @@ -1,6 +1,8 @@ #ifndef __ASM_PSCI_H__ #define __ASM_PSCI_H__ +#include + /* PSCI return values (inclusive of all PSCI versions) */ #define PSCI_SUCCESS 0 #define PSCI_NOT_SUPPORTED -1 @@ -41,30 +43,23 @@ register_t do_psci_0_2_migrate_info_up_cpu(void); void do_psci_0_2_system_off(void); void do_psci_0_2_system_reset(void); -/* PSCI v0.2 interface */ -#define PSCI_0_2_FN_BASE 0x84000000 -#define PSCI_0_2_FN(n) (PSCI_0_2_FN_BASE + (n)) -#define PSCI_0_2_64BIT 0x40000000 -#define PSCI_0_2_FN64_BASE \ - (PSCI_0_2_FN_BASE + PSCI_0_2_64BIT) -#define PSCI_0_2_FN64(n) (PSCI_0_2_FN64_BASE + (n)) - -#define PSCI_0_2_FN_PSCI_VERSION PSCI_0_2_FN(0) -#define PSCI_0_2_FN_CPU_SUSPEND PSCI_0_2_FN(1) -#define PSCI_0_2_FN_CPU_OFF PSCI_0_2_FN(2) -#define PSCI_0_2_FN_CPU_ON PSCI_0_2_FN(3) -#define PSCI_0_2_FN_AFFINITY_INFO PSCI_0_2_FN(4) -#define PSCI_0_2_FN_MIGRATE PSCI_0_2_FN(5) -#define PSCI_0_2_FN_MIGRATE_INFO_TYPE PSCI_0_2_FN(6) -#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7) -#define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8) -#define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9) +#define PSCI_0_2_FN32(n) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_STANDARD, n) +#define PSCI_0_2_FN64(n) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_64, \ + ARM_SMCCC_OWNER_STANDARD, n) -#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) -#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) -#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) -#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5) -#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7) +#define PSCI_0_2_FUNC_PSCI_VERSION 0 +#define PSCI_0_2_FUNC_CPU_SUSPEND 1 +#define PSCI_0_2_FUNC_CPU_OFF 2 +#define PSCI_0_2_FUNC_CPU_ON 3 +#define PSCI_0_2_FUNC_AFFINITY_INFO 4 +#define PSCI_0_2_FUNC_MIGRATE 5 +#define PSCI_0_2_FUNC_MIGRATE_INFO_TYPE 6 +#define PSCI_0_2_FUNC_MIGRATE_INFO_UP_CPU 7 +#define PSCI_0_2_FUNC_SYSTEM_OFF 8 +#define PSCI_0_2_FUNC_SYSTEM_RESET 9 /* PSCI v0.2 affinity level state returned by AFFINITY_INFO */ #define PSCI_0_2_AFFINITY_LEVEL_ON 0