From patchwork Fri Nov 24 10:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13467516 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 1C1ACC61DF4 for ; Fri, 24 Nov 2023 10:46:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.640496.998803 (Exim 4.92) (envelope-from ) id 1r6ThI-0000yl-VE; Fri, 24 Nov 2023 10:46:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 640496.998803; Fri, 24 Nov 2023 10:46:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6ThI-0000ye-R9; Fri, 24 Nov 2023 10:46:08 +0000 Received: by outflank-mailman (input) for mailman id 640496; Fri, 24 Nov 2023 10:46:07 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r6TTX-0006hx-D2 for xen-devel@lists.xenproject.org; Fri, 24 Nov 2023 10:31:55 +0000 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [2a00:1450:4864:20::530]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a9e978e5-8ab4-11ee-9b0e-b553b5be7939; Fri, 24 Nov 2023 11:31:44 +0100 (CET) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5431614d90eso2509960a12.1 for ; Fri, 24 Nov 2023 02:31:44 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id g1-20020a170906348100b009de3641d538sm1882374ejb.134.2023.11.24.02.31.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 02:31:43 -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: a9e978e5-8ab4-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700821904; x=1701426704; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DQmzcNiiecosotaPJOdRPOzfDS9PoO7Z6SaMHAHkahM=; b=QWhNT5itjIG8XYHI+ap8QQB0/dr+8UYx0d/2JCDQyfov8FkeI/fk2hC8ZJHYvBFaMH XdqiDGPOqwzqNfLFCUOreomFXxuemml+BvmHc+hcWca5ncEmW/r0tcchUu1EupTiqrOY 3J5C1PZMk5daiRBC4k24Z4ZWsXQV+JIoxDXZQINCKJGG0XHlwZTGfqR5HThIMXu4rKeJ CuCujFRK/zMnErxHcvlBJ3h9JMLvsh7ZwUTT3tSaqiN1uP/WbQaC5sB8KCO5T5KEEv/H mxtEwlICrtaC/uSBYCd5w4xF5aYCIJ7LyX40c/xUAJjQb2VBp0xnN2T3x4m71M3/dZe+ +R3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700821904; x=1701426704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DQmzcNiiecosotaPJOdRPOzfDS9PoO7Z6SaMHAHkahM=; b=I7SHFAZO8ZWONyiozQtUjvZVXiSbeLT8SB0KJsZZv5Zn61xtwUsijepKg8Hvch52Zo 7m4KU5yZQTfySCu5OQQjKtYeUqW2t/qx2anbzk6UCFtcn2xP39/ulUJVNjN3ukaGWj2F 5cVjbtkzEMzmIdbj/HVNptNYI/qthnao3BhBniTzeB1hKJU2D5vRiGszfrsW+CZOMIXr F7z8YaJD+c/ZeavCSmac/PSXRNjGHQPHpQ0+HuIjg9FuH56GVnDHIHSCMbw1n2jHuY4R BiRFl2dK49RFCSomOYLqWw86mKLwIxWKsUNaAUGrFIXgXG/I8NXxqxYkWNyGM5y8ze0/ qKQA== X-Gm-Message-State: AOJu0YyqRKIsHADHGRAblmHkFBfOT51AOxOhbEzyPY8cXhpd12xku16f KJdloMtb5KolVUQ+CC7GQ23/3C7Wh1reXA== X-Google-Smtp-Source: AGHT+IEdpyOKOH8SGDaH8oOfbMTxNOrbOmYlKrSzOrQ5D2QKwj8rNSiRjo+5Uk9JZuwJomGoLlzEnw== X-Received: by 2002:a17:907:3a91:b0:9be:2991:81fb with SMTP id fh17-20020a1709073a9100b009be299181fbmr1396968ejc.36.1700821903737; Fri, 24 Nov 2023 02:31:43 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2 33/39] xen/riscv: add minimal stuff to asm/processor.h to build full Xen Date: Fri, 24 Nov 2023 12:30:53 +0200 Message-ID: <11f177882b74c60233626075a69bdd00d3da2311.1700761381.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- Changes in V2: - Nothing changed. Only rebase. --- xen/arch/riscv/include/asm/processor.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h index 6db681d805..b6218a00a7 100644 --- a/xen/arch/riscv/include/asm/processor.h +++ b/xen/arch/riscv/include/asm/processor.h @@ -12,6 +12,9 @@ #ifndef __ASSEMBLY__ +/* TODO: need to be implemeted */ +#define get_processor_id() 0 + /* On stack VCPU state */ struct cpu_user_regs { @@ -53,6 +56,18 @@ struct cpu_user_regs unsigned long pregs; }; +/* TODO: need to implement */ +#define cpu_to_core(_cpu) (0) +#define cpu_to_socket(_cpu) (0) + +static inline void cpu_relax(void) +{ + int dummy; + /* In lieu of a halt instruction, induce a long-latency stall. */ + __asm__ __volatile__ ("div %0, %0, zero" : "=r" (dummy)); + barrier(); +} + static inline void wfi(void) { __asm__ __volatile__ ("wfi");