From patchwork Tue Jun 6 19:55:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269706 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 9E7F9C8300C for ; Tue, 6 Jun 2023 19:55:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544184.849761 (Exim 4.92) (envelope-from ) id 1q6cm2-0002ez-7P; Tue, 06 Jun 2023 19:55:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544184.849761; Tue, 06 Jun 2023 19:55:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm2-0002es-4k; Tue, 06 Jun 2023 19:55:22 +0000 Received: by outflank-mailman (input) for mailman id 544184; Tue, 06 Jun 2023 19:55:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm1-0002el-H8 for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:21 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 111a1ffe-04a4-11ee-b232-6b7b168915f2; Tue, 06 Jun 2023 21:55:20 +0200 (CEST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f4b384c09fso7994921e87.3 for ; Tue, 06 Jun 2023 12:55:20 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:19 -0700 (PDT) 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: 111a1ffe-04a4-11ee-b232-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081320; x=1688673320; 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=7TGArhQdSQX8UOhmIpz6TBiOEP22ajLMR7OWHR6Nu4A=; b=O/XGaXCCKoTPUoZQ8DfwCH/WP0x17xGqKCKSMRVwnICDn5x6+ADpIfUG2vJJxCaDcN QFOtJe3BevRTdoRxJ1ihm4+sKe3JcEDxsdXFX3YdPQ+YGsT14pmvjZIUNfm3DpzQyQV1 sVz6ntBRlEqDBMyEDqmt/Phn47dsMM5EKpGP6bW/ObW/xhPDtskv/EzeaGrwm5Dh9Eup JIF3S1CRyf0y4cuYGUuv7/j7E4ppdu/YTOVcJg1lcvjR2QlxzsRNkH4IjTHkfq3C7COe oSiKG8EWvk4/M86K/1vgJf3wJayoGlvoweT7MwP38fVyJfMtgei/ecNoMkSJWBjYzHCn ImcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081320; x=1688673320; 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=7TGArhQdSQX8UOhmIpz6TBiOEP22ajLMR7OWHR6Nu4A=; b=Lw8rQ7xi596fGcX8gatd/heJjKMhtjlKlX+wRczZqo/L/Otlc2SB+SHOHeW2p/d1Zy xqckWYjiPUmQBHazSeVhTM61/0xKJuiHWx084BQoGL67NUGQo6E9XQpi1o7XNQ7psCYd DWJ3T/wdilUkPIAnoKhxtaFe+ouzSSnD8O+VJmxsY+VVIhMscSV5sDhH+SaKVUb5CKPF 1fzJxHpTY4UlHKWstGl9q5yDkx8XZcaS3OA/F/mqrNMBHTbu/dBHPYl6PW5gqBxvjdp9 b3A3hKhprd/YyCt8LGB5N87otJVBrrScxBsPJXf8KccIP+EcpEKFm6cFOCCvyKjtHZM1 +Z4w== X-Gm-Message-State: AC+VfDwW3CMGc1+FIyp8ObX2N27ittrKIOILkX3H3ufrH7k5EmcvDM9A l7iCDA+2d23YLSUjxQMSl6m38m22unQ= X-Google-Smtp-Source: ACHHUZ57sB49WRMNcaI7ZfKQo7gAicuQco4hCa6Kjlrsr1+WkBj5jKHEmupI5ZX9n2A1vFpA6QoZyQ== X-Received: by 2002:a19:a416:0:b0:4f6:116d:6d26 with SMTP id q22-20020a19a416000000b004f6116d6d26mr1219679lfc.42.1686081319616; Tue, 06 Jun 2023 12:55:19 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 1/8] xen/riscv: make sure that identity mapping isn't bigger then page size Date: Tue, 6 Jun 2023 22:55:09 +0300 Message-Id: <4ad639bed6b8aa6cee34288a7ce154db21d761b5.1686080337.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- xen/arch/riscv/xen.lds.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 878130f313..74afbaab9b 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -20,6 +20,7 @@ SECTIONS . = XEN_VIRT_START; _start = .; .text : { + _idmap_start = .; _stext = .; /* Text section */ *(.text.header) @@ -35,6 +36,7 @@ SECTIONS *(.gnu.warning) . = ALIGN(POINTER_ALIGN); _etext = .; /* End of text section */ + _idmap_end = .; } :text . = ALIGN(PAGE_SIZE); @@ -174,3 +176,10 @@ ASSERT(!SIZEOF(.got), ".got non-empty") ASSERT(!SIZEOF(.got.plt), ".got.plt non-empty") ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions") + +/* + * We require that Xen is loaded at a page boundary, so this ensures that any + * code running on the identity map cannot cross a page boundary. + */ +ASSERT(IS_ALIGNED(_idmap_start, PAGE_SIZE), "_idmap_start should be page-aligned") +ASSERT(_idmap_end - _idmap_start <= PAGE_SIZE, "Identity mapped code is larger than a page size") From patchwork Tue Jun 6 19:55:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269707 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 5F5F2C7EE45 for ; Tue, 6 Jun 2023 19:55:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544186.849781 (Exim 4.92) (envelope-from ) id 1q6cm4-00038p-Ly; Tue, 06 Jun 2023 19:55:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544186.849781; Tue, 06 Jun 2023 19:55:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm4-00038i-I7; Tue, 06 Jun 2023 19:55:24 +0000 Received: by outflank-mailman (input) for mailman id 544186; Tue, 06 Jun 2023 19:55:23 +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 1q6cm3-0002er-1m for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:23 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 119c6400-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:21 +0200 (CEST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f3bb395e69so8248867e87.2 for ; Tue, 06 Jun 2023 12:55:21 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:20 -0700 (PDT) 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: 119c6400-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081320; x=1688673320; 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=t+18CatWiKovUOnQdDJlhtreSRlIgkyqtkY8A4pd8sw=; b=R75eONep1sHqYGlAQtJiVqzQtXpLFmwkLqxeB+GmSvuq/ciEdTvPszXfLahAMY7tGc D+uGE+KDjR/Utps1OLY6tk0WCWJsQAewCzZOidD8GjfgRsH6lz5Z8o+B4bvIopkJJwTO Xwzou3FZJGb/U8rkEEMl21Rd7QvyGPg69R6yhHwn8eIDksUHY2uYzlYQELOc+nTisMSx iENa3+/+nRb6vpqcGC7NUDL8OuRm62HzmsraTfCNxcWFqZDnMEHQRsQljCHyY4LUjmvm i5eGvMY7dJu3acRn0wIpTMTsk8Hfn9kZQ71AY3EN+4jCu84S3DuPUtV4P3k/BSPL3muf 3wCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081320; x=1688673320; 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=t+18CatWiKovUOnQdDJlhtreSRlIgkyqtkY8A4pd8sw=; b=IOmyx6k4QuBbpt5rj0qkgG/Ay5CBoIHgMC1+mqKfU4MT5EtO647ggSfgPSsLliQRhr N5KXzhtZrWa9D6aKpHYVEZ+Jag1OuxCile2lj3/JTGKPojKW2KzZF0MrFADssu7jFyrl EMBYFq37LIcuB+ECAI+/6elFqwtE37czEEV8W+VSU3nCYYC+tZU6fMuKFy1kBdJKnEhF DHBWi00LAgGpHuPhPVkRlr6SzhcBs4Nv/NfSAortl4zUJohNe9fkAuysXIXhhfbh+J0t 9G8zywmk6anD+8GELKn+IEEt7gtYHKpaifokmidIRMfF6oNxljGqD5YDH0c3HVHvNtyd BUzg== X-Gm-Message-State: AC+VfDzv7aWGP30ZYXcQ0TdItwcqxBg4/ydWUx0isSTbpK7ludycjjN/ 0VcX5vAa57ScB+4qEhyqRyq4Z16iz2c= X-Google-Smtp-Source: ACHHUZ4UcloTqSs1Y4vaiE14ffnJJkLDv6vbidnhs+aE6gUIqCSpz0KuNcZqnYToz8dqHx/nXt0q0w== X-Received: by 2002:ac2:4ac5:0:b0:4ec:8524:65a4 with SMTP id m5-20020ac24ac5000000b004ec852465a4mr1178650lfp.55.1686081320441; Tue, 06 Jun 2023 12:55:20 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 2/8] xen/riscv: add .sbss section to .bss Date: Tue, 6 Jun 2023 22:55:10 +0300 Message-Id: <6a0f3171323f0092b8374f2244182c7e7ca850c0.1686080337.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Sometimes variables are located in .sbss section but it won't be mapped after MMU will be enabled. To avoid MMU failures .sbss should be mapped Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- xen/arch/riscv/xen.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S index 74afbaab9b..9a2799bab5 100644 --- a/xen/arch/riscv/xen.lds.S +++ b/xen/arch/riscv/xen.lds.S @@ -151,7 +151,7 @@ SECTIONS *(.bss.percpu.read_mostly) . = ALIGN(SMP_CACHE_BYTES); __per_cpu_data_end = .; - *(.bss .bss.*) + *(.bss .bss.* .sbss) . = ALIGN(POINTER_ALIGN); __bss_end = .; } :text From patchwork Tue Jun 6 19:55:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269704 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 5F649C7EE37 for ; Tue, 6 Jun 2023 19:55:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544187.849791 (Exim 4.92) (envelope-from ) id 1q6cm5-0003Oi-TJ; Tue, 06 Jun 2023 19:55:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544187.849791; Tue, 06 Jun 2023 19:55:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm5-0003OZ-Pl; Tue, 06 Jun 2023 19:55:25 +0000 Received: by outflank-mailman (input) for mailman id 544187; Tue, 06 Jun 2023 19:55:24 +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 1q6cm4-0002er-1t for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:24 +0000 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [2a00:1450:4864:20::12e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 120e5a7a-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:22 +0200 (CEST) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f611ac39c5so6324491e87.2 for ; Tue, 06 Jun 2023 12:55:22 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:20 -0700 (PDT) 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: 120e5a7a-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081321; x=1688673321; 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=P5ZlKuhoRDHAHEke7zy4B0qROcvwjfCq2K3tRqo2H9M=; b=YZ6C4Se0SQL9HgctTBmHpY8KVbIgMujcltWIX4TOTMQExmGRAxe1gkS6ctvFACrp3O AL/vpiYPZcMu+OdCzIKaoAUXI+BKSSF5zRoLw35yDnqhzBeXnkUvhdKjg023fXttztMZ 1mspfAnNg7hVGwiOa3nQxHrWyD7PnSsTYgvZeYrgLtzVcxsT1KzjCVAQLSR1BWqQczkO G/jc18/nY7Gf4JsB5+AUC3R9iacO+/JXdDFxt49CC2HPcelBMEzpdmY94hNLIMO9DWGF HKVPsBqNdPmEyzonh2LvAJJMvUXOGj/eqiMi3HyU0+bA0nMVC68zc1E5OH/Ue7ApHnWT ZbpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081321; x=1688673321; 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=P5ZlKuhoRDHAHEke7zy4B0qROcvwjfCq2K3tRqo2H9M=; b=RmEsusTUYTf5jhWEX4iKaEtwSONodE/3mn0RznQjCzxzfGPlgFraX/n+HKTzCvKFSz FRiForrmp0snxeBlKCa6aMm71TOgr8vdNYxUjvWey7ax5GN/YAOSipjtH/lVNbGgASV1 w3JsuwS2cRDlEGTg7fxMd99I4ZtJwf2Ass5GtxgQPmbHD+XPraOM4MWNEqBNawBcUdMy oew0NerKslBhi68aXA02BPKvKSxGGgefC0QrQwwxc5xqtvSlmOFmSzSA5esEnlxIpocf FErshvyeiKgdTAs6z2ymCKyEOtt+LvXx1CiMp5QFU9tFotY/Wq7SWHsp+sOt8HOnLFRL qvsg== X-Gm-Message-State: AC+VfDySJBJ8Y6cu63vRRHPbQsJpOSbsBHa5SESWc6jnF5wSHneN32C3 7utpq9VrT3VvybLQ+kJAwoHBjInq7GA= X-Google-Smtp-Source: ACHHUZ6L0qbELbOxHqUXbl6i3ZhhXr/xDqThMRfeDj1DFSSjpLayi8x1Z0w/qzO67vt1VLNDqC6QuA== X-Received: by 2002:ac2:46c6:0:b0:4f6:3000:4d5a with SMTP id p6-20020ac246c6000000b004f630004d5amr1524831lfo.38.1686081321296; Tue, 06 Jun 2023 12:55:21 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 3/8] xen/riscv: introduce reset_stack() function Date: Tue, 6 Jun 2023 22:55:11 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko Reviewed-by: Alistair Francis --- xen/arch/riscv/riscv64/head.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 8887f0cbd4..6fb7dd80fd 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -27,8 +27,14 @@ ENTRY(start) add t3, t3, __SIZEOF_POINTER__ bltu t3, t4, .L_clear_bss + jal reset_stack + + tail start_xen + +ENTRY(reset_stack) la sp, cpu0_boot_stack li t0, STACK_SIZE add sp, sp, t0 - tail start_xen + ret + From patchwork Tue Jun 6 19:55:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269709 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 D33D2C87FDC for ; Tue, 6 Jun 2023 19:55:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544188.849798 (Exim 4.92) (envelope-from ) id 1q6cm6-0003St-El; Tue, 06 Jun 2023 19:55:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544188.849798; Tue, 06 Jun 2023 19:55:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm6-0003SR-7N; Tue, 06 Jun 2023 19:55:26 +0000 Received: by outflank-mailman (input) for mailman id 544188; Tue, 06 Jun 2023 19:55:25 +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 1q6cm5-0002er-1x for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:25 +0000 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [2a00:1450:4864:20::12f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 127d81b0-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:22 +0200 (CEST) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f6148f9679so5914935e87.3 for ; Tue, 06 Jun 2023 12:55:22 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:21 -0700 (PDT) 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: 127d81b0-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081322; x=1688673322; 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=R9dfuEcyOpcttJDizez0uwxVrhy0pEYRLPEtmcdqVH0=; b=cO8vQhjZKZBCx/OMXvcYedquJasxp/5/p/DIaMDSm2K3nQHlfOGDVpPnc9bY5HDhKK RPlE5am5L3iXLcij5OkzvzvNpdl3+Rfp2dKxUNFnGX0M7MsIGMKzOYS81zP8nygsuM80 eBInYtgi+/j7NN3H0eNvGjBZuvc/AOJvzrufzepeZtMJCn97QH5d4Ivhhe9W6qWqwi2K qOVeKgRz8ptdjKNhpeeE35ZyZvPpf80CF8fEblojihRui3ViqhqnXkiG8u2+BxZH6Tnl Jkm6JAZzGhE0eSFNKEjDbgKuDc6GBj5eq1o8d2j2jh0XGcDQ4qvVnNvj/B7jHjFdZ/y7 KmfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081322; x=1688673322; 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=R9dfuEcyOpcttJDizez0uwxVrhy0pEYRLPEtmcdqVH0=; b=Ivig9W9Wh5s+b122Y9EsCksV7KaME+9udVpCVVa1qxKyTkKPbfSQxwOeRz3qSBDvEQ xOE4udFdTU+h/62nBVighrfC2HA0GJcV0D057mrkyr8hAAViukyWXlNqRrKS/pUdbM9E OU4tyGCUJxzH/59Hi2gKu6ARGmmObio3fsu1rHLQ8VeXZtCeTd7HFRflr0WMJrLeAoNj cYk5Q+uSuDH3SqcrKnDq/xbLS0QfctHa2daoADWjgI3dplfDNUcxIugE93y8Z2C2/LxZ X+F5nWHSfjr9VLa+7MTczNPdhhN8nsQxJZ1lK41zhT26jnW9uNjOxfAn9iorMfDA7XuZ aarg== X-Gm-Message-State: AC+VfDyPYfMd2xR2WvXZrwqFVCN0ye/vhTLTrgE4Yr4dL3yT1mxiBnxv WjJcH4H9NKXh1M+rWPEMT02zf4vsaLs= X-Google-Smtp-Source: ACHHUZ4U3H6nveqzFxmohTnQISG3EbtKgdJoOK4rxT3Anq8lXoVZ8R0n4farW5PFO3Mkc81zgFmGhw== X-Received: by 2002:ac2:46fc:0:b0:4f3:a91c:23d0 with SMTP id q28-20020ac246fc000000b004f3a91c23d0mr1668492lfo.31.1686081322050; Tue, 06 Jun 2023 12:55:22 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 4/8] xen/riscv: introduce function for physical offset calculation Date: Tue, 6 Jun 2023 22:55:12 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 The function was introduced to not calculate and save physical offset before MMU is enabled because access to start() is PC-relative and in case of linker_addr != load_addr it will result in incorrect value in phys_offset. Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/mm.h | 2 ++ xen/arch/riscv/mm.c | 18 +++++++++++++++--- xen/arch/riscv/riscv64/head.S | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h index 64293eacee..996041ce81 100644 --- a/xen/arch/riscv/include/asm/mm.h +++ b/xen/arch/riscv/include/asm/mm.h @@ -11,4 +11,6 @@ void setup_initial_pagetables(void); void enable_mmu(void); void cont_after_mmu_is_enabled(void); +void calc_phys_offset(void); + #endif /* _ASM_RISCV_MM_H */ diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c index 8ceed445cf..c092897f9a 100644 --- a/xen/arch/riscv/mm.c +++ b/xen/arch/riscv/mm.c @@ -19,9 +19,11 @@ struct mmu_desc { extern unsigned char cpu0_boot_stack[STACK_SIZE]; -#define PHYS_OFFSET ((unsigned long)_start - XEN_VIRT_START) -#define LOAD_TO_LINK(addr) ((addr) - PHYS_OFFSET) -#define LINK_TO_LOAD(addr) ((addr) + PHYS_OFFSET) +static unsigned long phys_offset; + +#define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset) +#define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset) + /* * It is expected that Xen won't be more then 2 MB. @@ -273,3 +275,13 @@ void __init noreturn noinline enable_mmu() switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE, cont_after_mmu_is_enabled); } + +/* + * calc_phys_offset() should be used before MMU is enabled because access to + * start() is PC-relative and in case when load_addr != linker_addr phys_offset + * will have an incorrect value + */ +void calc_phys_offset(void) +{ + phys_offset = (unsigned long)start - XEN_VIRT_START; +} diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 6fb7dd80fd..69f3a24987 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -29,6 +29,8 @@ ENTRY(start) jal reset_stack + jal calc_phys_offset + tail start_xen ENTRY(reset_stack) From patchwork Tue Jun 6 19:55:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269705 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 E1E92C77B7A for ; Tue, 6 Jun 2023 19:55:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544189.849811 (Exim 4.92) (envelope-from ) id 1q6cm7-0003ur-N9; Tue, 06 Jun 2023 19:55:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544189.849811; Tue, 06 Jun 2023 19:55:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm7-0003u8-J1; Tue, 06 Jun 2023 19:55:27 +0000 Received: by outflank-mailman (input) for mailman id 544189; Tue, 06 Jun 2023 19:55:26 +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 1q6cm6-0002er-21 for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:26 +0000 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [2a00:1450:4864:20::12e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 13064545-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:23 +0200 (CEST) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f611ac39c5so6324518e87.2 for ; Tue, 06 Jun 2023 12:55:23 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:22 -0700 (PDT) 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: 13064545-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081323; x=1688673323; 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=efjoH6YD/NFQ9wxK29jeXVZ4gBqY6bo96HJMQ+wU7+s=; b=IzT6WqJv+D8ugHDKjmTICaR1Sxn3wyRwA3GFTrztineoxv69HfJ+OkIeiDmKwLV+fK 6I0m5K40P4q4b4jNbvtResiQ10VttI2r77l+iucyWTUv+2RhchZudesKoAREn4YRSvUW Y2WqVxdKrSMMCKQNC3NVaBw/QdsTX4/AzXJAewKHSKT38TOgQA3+LMg3OkoRlWqi4wkl 9P7S6tNcyvc9ThPkTQmj5dgySiXH4baKXK1puCTBQemMQJ8mgoYrP4lEiWfCGLsTMpwv nqRgR5mVCzxbC4xALShu791X1yzngMlNO0dNpj6pbgiiUFTsdGgXNcttJlGY9YMvw0pQ WPlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081323; x=1688673323; 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=efjoH6YD/NFQ9wxK29jeXVZ4gBqY6bo96HJMQ+wU7+s=; b=Tb47hrsiwhdjSgkExIlIj7OCgnTmyrzDmoj1sOh5F2+8JzjoeN1Kk/gZKnAGABhSOU nEZvzinCJvPaFE1i+3sHSmAW+0K6eLk5Fl9zaz0jcH76hCTzXocfOVjVx7BkzYlHXjIx dxxTCCU8TRnGsHpMBFSujJCXaXq8eav6tcXA5qSlFN3yge3Px1hk+mY9pQuBw3j6SGWv dNjktVxjKJ85fPJ5Praf+ZwWj+I3NXrLKZeyU+9e4XnNUnCluFn/SgxTwYs0HTf4/5Or bedYkdKjhela6JrQBPZ5iSSkGq7CACHeXXEeubtOjOrgIPxEhPdpZ6P6BnFWdoM2Mon5 w9pw== X-Gm-Message-State: AC+VfDykR1/JU5UH+23hLzdY4Q8q1XsjNg7vKgtojCZ92p4ucZD4lExH 46WFgFRhaIdmlLaP2Cfo2wLIf9DC95A= X-Google-Smtp-Source: ACHHUZ5c9Rv5X/veMwg4l2ZWaYseSRPYtCf8TDawy3b6rVcB/VpclMQuUaY9txvzD8tLgvANkIjmGA== X-Received: by 2002:ac2:4c18:0:b0:4f2:6651:7c7b with SMTP id t24-20020ac24c18000000b004f266517c7bmr1328798lfq.61.1686081322877; Tue, 06 Jun 2023 12:55:22 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 5/8] xen/riscv: introduce identity mapping Date: Tue, 6 Jun 2023 22:55:13 +0300 Message-Id: <32aef31768cd81ffc8c848af6c29cd8510bbbf6d.1686080337.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 The way how switch to virtual address was implemented in the commit e66003e7be ("xen/riscv: introduce setup_initial_pages") wasn't safe enough so identity mapping was introduced and used. Fixes: e66003e7be ("xen/riscv: introduce setup_initial_pages") Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/mm.h | 3 +- xen/arch/riscv/mm.c | 99 ++++++++++++++++++++++----------- xen/arch/riscv/riscv64/head.S | 30 ++++++++++ xen/arch/riscv/setup.c | 14 +---- 4 files changed, 99 insertions(+), 47 deletions(-) diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h index 996041ce81..500fdc9c5a 100644 --- a/xen/arch/riscv/include/asm/mm.h +++ b/xen/arch/riscv/include/asm/mm.h @@ -9,7 +9,8 @@ void setup_initial_pagetables(void); void enable_mmu(void); -void cont_after_mmu_is_enabled(void); + +void remove_identity_mapping(void); void calc_phys_offset(void); diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c index c092897f9a..ab790f571d 100644 --- a/xen/arch/riscv/mm.c +++ b/xen/arch/riscv/mm.c @@ -24,6 +24,11 @@ static unsigned long phys_offset; #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset) #define LINK_TO_LOAD(addr) ((unsigned long)(addr) + phys_offset) +/* + * Should be removed as soon as enough headers will be merged for inclusion of + * . + */ +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) /* * It is expected that Xen won't be more then 2 MB. @@ -35,8 +40,10 @@ static unsigned long phys_offset; * * It might be needed one more page table in case when Xen load address * isn't 2 MB aligned. + * + * 3 additional page tables are needed for identity mapping. */ -#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1) +#define PGTBL_INITIAL_COUNT ((CONFIG_PAGING_LEVELS - 1) + 1 + 3) pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE) stage1_pgtbl_root[PAGETABLE_ENTRIES]; @@ -75,6 +82,7 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc, unsigned int index; pte_t *pgtbl; unsigned long page_addr; + bool is_identity_mapping = (map_start == pa_start); if ( (unsigned long)_start % XEN_PT_LEVEL_SIZE(0) ) { @@ -108,16 +116,18 @@ static void __init setup_initial_mapping(struct mmu_desc *mmu_desc, { unsigned long paddr = (page_addr - map_start) + pa_start; unsigned int permissions = PTE_LEAF_DEFAULT; + unsigned long addr = (is_identity_mapping) ? + page_addr : LINK_TO_LOAD(page_addr); pte_t pte_to_be_written; index = pt_index(0, page_addr); - if ( is_kernel_text(LINK_TO_LOAD(page_addr)) || - is_kernel_inittext(LINK_TO_LOAD(page_addr)) ) - permissions = - PTE_EXECUTABLE | PTE_READABLE | PTE_VALID; + if ( is_kernel_text(addr) || + is_kernel_inittext(addr) ) + permissions = + PTE_EXECUTABLE | PTE_READABLE | PTE_VALID; - if ( is_kernel_rodata(LINK_TO_LOAD(page_addr)) ) + if ( is_kernel_rodata(addr) ) permissions = PTE_READABLE | PTE_VALID; pte_to_be_written = paddr_to_pte(paddr, permissions); @@ -232,22 +242,27 @@ void __init setup_initial_pagetables(void) linker_start, linker_end, load_start); + + if ( linker_start == load_start ) + return; + + setup_initial_mapping(&mmu_desc, + load_start, + load_start + PAGE_SIZE, + load_start); + + setup_initial_mapping(&mmu_desc, + (unsigned long)cpu0_boot_stack, + (unsigned long)cpu0_boot_stack + PAGE_SIZE, + (unsigned long)cpu0_boot_stack); } -void __init noreturn noinline enable_mmu() +/* + * enable_mmu() can't be __init because __init section isn't part of identity + * mapping so it will cause an issue after MMU will be enabled. + */ +void enable_mmu(void) { - /* - * Calculate a linker time address of the mmu_is_enabled - * label and update CSR_STVEC with it. - * MMU is configured in a way where linker addresses are mapped - * on load addresses so in a case when linker addresses are not equal - * to load addresses, after MMU is enabled, it will cause - * an exception and jump to linker time addresses. - * Otherwise if load addresses are equal to linker addresses the code - * after mmu_is_enabled label will be executed without exception. - */ - csr_write(CSR_STVEC, LOAD_TO_LINK((unsigned long)&&mmu_is_enabled)); - /* Ensure page table writes precede loading the SATP */ sfence_vma(); @@ -255,25 +270,41 @@ void __init noreturn noinline enable_mmu() csr_write(CSR_SATP, PFN_DOWN((unsigned long)stage1_pgtbl_root) | RV_STAGE1_MODE << SATP_MODE_SHIFT); +} + +void __init remove_identity_mapping(void) +{ + int i, j; + pte_t *pgtbl; + unsigned int index, xen_index; - asm volatile ( ".p2align 2" ); - mmu_is_enabled: /* - * Stack should be re-inited as: - * 1. Right now an address of the stack is relative to load time - * addresses what will cause an issue in case of load start address - * isn't equal to linker start address. - * 2. Addresses in stack are all load time relative which can be an - * issue in case when load start address isn't equal to linker - * start address. - * - * We can't return to the caller because the stack was reseted - * and it may have stash some variable on the stack. - * Jump to a brand new function as the stack was reseted + * id_addrs should be in sync with id mapping in + * setup_initial_pagetables() */ + unsigned long id_addrs[] = { + LINK_TO_LOAD(_start), + LINK_TO_LOAD(cpu0_boot_stack), + }; - switch_stack_and_jump((unsigned long)cpu0_boot_stack + STACK_SIZE, - cont_after_mmu_is_enabled); + pgtbl = stage1_pgtbl_root; + + for ( j = 0; j < ARRAY_SIZE(id_addrs); j++ ) + { + for ( pgtbl = stage1_pgtbl_root, i = CONFIG_PAGING_LEVELS - 1; i >= 0; i-- ) + { + index = pt_index(i, id_addrs[j]); + xen_index = pt_index(i, XEN_VIRT_START); + + if ( index != xen_index ) + { + pgtbl[index].pte = 0; + break; + } + + pgtbl = &pgtbl[index]; + } + } } /* diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S index 69f3a24987..582078798a 100644 --- a/xen/arch/riscv/riscv64/head.S +++ b/xen/arch/riscv/riscv64/head.S @@ -31,6 +31,36 @@ ENTRY(start) jal calc_phys_offset + jal setup_initial_pagetables + + jal enable_mmu + + /* + * Calculate physical offset + * + * We can't re-use a value in phys_offset variable here as + * phys_offset is located in .bss and this section isn't + * 1:1 mapped and an access to it will cause MMU fault + */ + li t0, XEN_VIRT_START + la t1, start + sub t1, t1, t0 + + /* Calculate proper VA after jump from 1:1 mapping */ + la t0, .L_primary_switched + sub t0, t0, t1 + + /* Jump from 1:1 mapping world */ + jr t0 + +.L_primary_switched: + /* + * cpu0_boot_stack address is 1:1 mapping related so it should be + * recalculated after jump from 1:1 mapping world as 1:1 mapping + * will be removed soon in start_xen(). + */ + jal reset_stack + tail start_xen ENTRY(reset_stack) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index 845d18d86f..c4ef0b3165 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -11,20 +11,10 @@ unsigned char __initdata cpu0_boot_stack[STACK_SIZE] void __init noreturn start_xen(unsigned long bootcpu_id, paddr_t dtb_addr) { - early_printk("Hello from C env\n"); - - setup_initial_pagetables(); - - enable_mmu(); - - for ( ;; ) - asm volatile ("wfi"); + remove_identity_mapping(); - unreachable(); -} + early_printk("Hello from C env\n"); -void __init noreturn cont_after_mmu_is_enabled(void) -{ early_printk("All set up\n"); for ( ;; ) From patchwork Tue Jun 6 19:55:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269708 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 95328C83003 for ; Tue, 6 Jun 2023 19:55:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544190.849821 (Exim 4.92) (envelope-from ) id 1q6cm9-0004EL-5L; Tue, 06 Jun 2023 19:55:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544190.849821; Tue, 06 Jun 2023 19:55:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm9-0004E7-1A; Tue, 06 Jun 2023 19:55:29 +0000 Received: by outflank-mailman (input) for mailman id 544190; Tue, 06 Jun 2023 19:55:27 +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 1q6cm7-0002er-2B for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:27 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 1376451d-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:24 +0200 (CEST) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so3358224e87.1 for ; Tue, 06 Jun 2023 12:55:24 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:23 -0700 (PDT) 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: 1376451d-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081324; x=1688673324; 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=Wh8BJIh+57sl7bOo0QhYsWa0pXdWsiCtmsxwnxt2RAU=; b=OSf8GtFqo2NuhZtcfIkC5FDn0ebuqJ1uQ7XzI6k3YI5keBWCuq9M2u4IyY7MPhvifJ t9P+Unj9Do1Vv0q570IxL+3snR23gk601FSsU5RGhzuSEZlMwRgfmMke9h2VcBD0d0Qq QAMaRW9r92Ind9Nued7KPU36F1bZdwJRmEodOIYP/Ck9DQ3HQ+W5Kqf/hJNVwsgFiBIQ NLahdPMnJ/xo1F+xZOb40fT5Zr2kvYPvnHZcrOZ0hTTahPclSVxkfkSsr0yhskFStN0d 0iON0sDj0jujKz12uzRbavsPR92hompWo6Fj/neSMErhluLfIW6FyjycSBqYddpXa4EW Dwjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081324; x=1688673324; 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=Wh8BJIh+57sl7bOo0QhYsWa0pXdWsiCtmsxwnxt2RAU=; b=ibpWWxE2hkbEfwm1K1Liz4MRGgd1HPF78CcNa0a/QZ9IC+mi0fXR/9VyMVlOvxNJ8Q H+iHALOMqF8q0QIFOB6mK4tvTyOHB9u6dD90RgYDrDRTQfppXj1kQ8lQ1reDArKbxuvz gO7GtcAN6MOJ1nmA0AOh9s8gZYZjWdtC+yO5px5xidCPaDfKFJQIlRRBtkvvpf7eU9yl Jm3QtRnvA/QLv7sanPMHcNiESdaMoPsyp2srPFeTK1qJykKypyxUZRZwBLwmaDvfxwpO bGWEgjA33xtdeJqO66VIiSVhpZdmzsrnwk7aL88NC3W8hmdTbujMj3gJiKc9VRgd5Dj7 +Uog== X-Gm-Message-State: AC+VfDzvBK3Pe8EeEJ/t3MjC3nFTUpjN2NzMHSk+T0e5jKImbklo72SM XVvZa1N5mNHrK/PWRsC9Z7hRV6LSNQ4= X-Google-Smtp-Source: ACHHUZ7ntaUUio4KqesGs58TcVUdN7fp9cmIMj6BHSnc/mxy+bAhUnPCb+zwH0hWVqW0u7H9Bk9iaA== X-Received: by 2002:ac2:519a:0:b0:4f3:aa73:562 with SMTP id u26-20020ac2519a000000b004f3aa730562mr1307466lfi.2.1686081323644; Tue, 06 Jun 2023 12:55:23 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 6/8] xen/riscv: add SPDX tags Date: Tue, 6 Jun 2023 22:55:14 +0300 Message-Id: <1034fa44a9b589a18f89b7849877c00ee0a362d5.1686080337.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/config.h | 2 ++ xen/arch/riscv/include/asm/current.h | 2 ++ xen/arch/riscv/include/asm/early_printk.h | 2 ++ xen/arch/riscv/include/asm/mm.h | 2 ++ xen/arch/riscv/include/asm/page-bits.h | 2 ++ xen/arch/riscv/include/asm/page.h | 2 ++ xen/arch/riscv/include/asm/traps.h | 2 ++ xen/arch/riscv/include/asm/types.h | 2 ++ xen/arch/riscv/mm.c | 2 ++ xen/arch/riscv/setup.c | 2 ++ 10 files changed, 20 insertions(+) diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h index 38862df0b8..3ae35f57b3 100644 --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef __RISCV_CONFIG_H__ #define __RISCV_CONFIG_H__ diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/asm/current.h index d87e6717e0..b08f204df4 100644 --- a/xen/arch/riscv/include/asm/current.h +++ b/xen/arch/riscv/include/asm/current.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef __ASM_CURRENT_H #define __ASM_CURRENT_H diff --git a/xen/arch/riscv/include/asm/early_printk.h b/xen/arch/riscv/include/asm/early_printk.h index 05106e160d..c11693bbe1 100644 --- a/xen/arch/riscv/include/asm/early_printk.h +++ b/xen/arch/riscv/include/asm/early_printk.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef __EARLY_PRINTK_H__ #define __EARLY_PRINTK_H__ diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h index 500fdc9c5a..3b04131628 100644 --- a/xen/arch/riscv/include/asm/mm.h +++ b/xen/arch/riscv/include/asm/mm.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef _ASM_RISCV_MM_H #define _ASM_RISCV_MM_H diff --git a/xen/arch/riscv/include/asm/page-bits.h b/xen/arch/riscv/include/asm/page-bits.h index 4a3e33589a..94190b3c61 100644 --- a/xen/arch/riscv/include/asm/page-bits.h +++ b/xen/arch/riscv/include/asm/page-bits.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef __RISCV_PAGE_BITS_H__ #define __RISCV_PAGE_BITS_H__ diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h index a7e2eee964..8e8ec9ee36 100644 --- a/xen/arch/riscv/include/asm/page.h +++ b/xen/arch/riscv/include/asm/page.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef _ASM_RISCV_PAGE_H #define _ASM_RISCV_PAGE_H diff --git a/xen/arch/riscv/include/asm/traps.h b/xen/arch/riscv/include/asm/traps.h index f3fb6b25d1..2e896e0913 100644 --- a/xen/arch/riscv/include/asm/traps.h +++ b/xen/arch/riscv/include/asm/traps.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef __ASM_TRAPS_H__ #define __ASM_TRAPS_H__ diff --git a/xen/arch/riscv/include/asm/types.h b/xen/arch/riscv/include/asm/types.h index 0c0ce78c8f..7505663efe 100644 --- a/xen/arch/riscv/include/asm/types.h +++ b/xen/arch/riscv/include/asm/types.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #ifndef __RISCV_TYPES_H__ #define __RISCV_TYPES_H__ diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c index ab790f571d..b50641a80e 100644 --- a/xen/arch/riscv/mm.c +++ b/xen/arch/riscv/mm.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #include #include #include diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index c4ef0b3165..befbd07fde 100644 --- a/xen/arch/riscv/setup.c +++ b/xen/arch/riscv/setup.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + #include #include From patchwork Tue Jun 6 19:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269710 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 C8837C83005 for ; Tue, 6 Jun 2023 19:55:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544191.849825 (Exim 4.92) (envelope-from ) id 1q6cm9-0004H9-JJ; Tue, 06 Jun 2023 19:55:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544191.849825; Tue, 06 Jun 2023 19:55:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cm9-0004Gf-C3; Tue, 06 Jun 2023 19:55:29 +0000 Received: by outflank-mailman (input) for mailman id 544191; Tue, 06 Jun 2023 19:55:28 +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 1q6cm8-0002er-2C for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:28 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 1411477f-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:25 +0200 (CEST) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f6195d2b3fso4971252e87.1 for ; Tue, 06 Jun 2023 12:55:25 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:24 -0700 (PDT) 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: 1411477f-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081324; x=1688673324; 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=+EcH5kcQKxxsGaNTd34XZ5jD66PVUtcw5BEPk5sk3Zo=; b=KJtpN5WDntZQgXJogrcQsPMis5suzLL0SLmEgaWEi22vWDVOv3Bpb5PVNwWtPgt4BF St2cD6/IOhij+eOJS9ADx+HetjbAJ++T53Mno7FDKIKbESTq3skRfX2o9uhfABX7su7c +8MVBnbhnNsreAGTP09p1IZtrK57fjTep27eYAzq2xUqYgX3Fdpt+MxNH57k9QwmaLVv va/ZQsGfC21RG00Vc+Bsf4vhP0hyfwlu7F7S/PKtuVyqsKDgQjQtyzxqej22C7EhPsWO 4Ph+w7cuaenaYB6DSBf6w8O6UI/vEPYTFtfJHSN2JBsFchDO7i3nMegcEmijrsuZ/7ra tovQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081324; x=1688673324; 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=+EcH5kcQKxxsGaNTd34XZ5jD66PVUtcw5BEPk5sk3Zo=; b=TN6tf5S6gh9tnm2D0R4Kgt8lalstoxLEYhYdqEhK9tzQUlPpsnSpJJKGCBgrwvjORF Z0CLbL1SQrbK/ZslG6qWs/k2+QYFjL6b4qY5tRI1+MvXAFg6J3rSRfPgG9ZwMdUgMufh +3kT0t/hwSi93QZhhF3PfFMfQnW9bJGMo1h8uWp4rqzTfLeG0zM1aGKZHHSdvjE55J2W 5h2WBmQGa2IP+y2Ss19gc3ZAwvrwxBNoNIMbU2FnMpa5/FiQ4zakINKM0IGgDlfE/wem whSkd2PXjTJ783ztZ7mvVgBSw7RTfM7KWrv3IZd19P4j1Q3cJo9Z4OX6dy+W70FIRQi9 A1bw== X-Gm-Message-State: AC+VfDyTqSICThWaJyhOSVm9nLMWlwCdbiFnH//F0qorQixs4eoofQSK 6Jsl68ZgnKvchxQ74Uw3tFT8/HsocSk= X-Google-Smtp-Source: ACHHUZ5oZksC0xqC4aMn5c8xPi0PD3LcmIk7XGGr3hG0ChIOf7A7YAiWxUtT2YhBvjCN3CqOmwUgAw== X-Received: by 2002:ac2:4c14:0:b0:4e9:bafc:88d0 with SMTP id t20-20020ac24c14000000b004e9bafc88d0mr1583584lfq.23.1686081324490; Tue, 06 Jun 2023 12:55:24 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 7/8] xen/riscv: add __ASSEMBLY__ guards Date: Tue, 6 Jun 2023 22:55:15 +0300 Message-Id: <298e8876fca284eac7caf7e62339ead177da9609.1686080337.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko Acked-by: Alistair Francis --- xen/arch/riscv/include/asm/page.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h index 8e8ec9ee36..1c6add70a5 100644 --- a/xen/arch/riscv/include/asm/page.h +++ b/xen/arch/riscv/include/asm/page.h @@ -3,6 +3,8 @@ #ifndef _ASM_RISCV_PAGE_H #define _ASM_RISCV_PAGE_H +#ifndef __ASSEMBLY__ + #include #include @@ -60,4 +62,6 @@ static inline bool pte_is_valid(pte_t p) return p.pte & PTE_VALID; } +#endif /* __ASSEMBLY__ */ + #endif /* _ASM_RISCV_PAGE_H */ From patchwork Tue Jun 6 19:55:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13269712 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 ED085C7EE37 for ; Tue, 6 Jun 2023 19:55:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.544192.849841 (Exim 4.92) (envelope-from ) id 1q6cmB-0004kk-2R; Tue, 06 Jun 2023 19:55:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 544192.849841; Tue, 06 Jun 2023 19:55:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6cmA-0004ji-S1; Tue, 06 Jun 2023 19:55:30 +0000 Received: by outflank-mailman (input) for mailman id 544192; Tue, 06 Jun 2023 19:55:29 +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 1q6cm9-0002er-2M for xen-devel@lists.xenproject.org; Tue, 06 Jun 2023 19:55:29 +0000 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [2a00:1450:4864:20::129]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 144bf0ef-04a4-11ee-8611-37d641c3527e; Tue, 06 Jun 2023 21:55:25 +0200 (CEST) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f62b552751so3270312e87.3 for ; Tue, 06 Jun 2023 12:55:25 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id j29-20020ac2551d000000b004f1383d57ecsm1563284lfk.202.2023.06.06.12.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 12:55:24 -0700 (PDT) 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: 144bf0ef-04a4-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686081325; x=1688673325; 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=adjWBIjLafrAFiXOiNb5AAc0fFbNojcht2Nhfx9j3rY=; b=lLlE/Lkij5rFq1/swnQoTR/UnZJQUo2DNCfhq+FuydN0XGEcQCBCzeQudJxwRbtqFw cCWF0IHBvJkM3Ja/hbU3SSXSR4MBwgkgywR49W0FC4ISBLfVF+XFFndNNg1QO3Z2VHyU tgrMW4wePwhSIllB7WAUJck6VNsXiC4CbFLMv3k8qf8olqIL/MWPQVdGGrarwAWRhEus F4ftcQrY7w6WeICbhEbeUGHCsfri9C+hvymcstaifuOOuSpejhre30mZ8L3dy8LLV76h n79zx4qAE/j8H/kF9IR0PCuleFACwzY7IAFvKMwfcwKDD0Xp573LTo2czdFY8MZ7iyM+ 8z6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686081325; x=1688673325; 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=adjWBIjLafrAFiXOiNb5AAc0fFbNojcht2Nhfx9j3rY=; b=CwLEGPnjvnbRP0rv5HeNBgZSEqpMc44RQqANgKLoFytEsaBGvBghV6ISAlvTCPbkK9 kI3uwgWeC/rQuuHDb6b0ENxv9BxP4m2aRj9RlXwMIKKmAJE/6Gq2CQISCeFgmtHAQ1OO 806q603HICL+NTL30/OJLhloqD5/LuKCptxw87tjEtl5bp+7cpttVowUoH0k92u5Tz2d 4k4ecsz7n9m5a486mNjlwKdKFPuueSwkO0BgRTyio/VG7bxNaLY40CnoKYNKUqZKR8DA oNLE6jKFvz/gqkzueBHN0X2bH0234a/62AGedRpicAK9PZlOzbtfdzBCb5zwUFPSnHow Jndg== X-Gm-Message-State: AC+VfDxjvnXSbqSZO6BuskXKm5wKVA0381xJAcVe9qjVjTssCV0c2G4b gxasLrHzZ7ULhqy6JIDAOHEZbyuPRIY= X-Google-Smtp-Source: ACHHUZ5S3DssVanCU7X8GAZ1N4I05W+hlWQgRzwYEaGaONJ5RY9mmFBjBatvPLclkbh7M3F93PaCVg== X-Received: by 2002:a19:f809:0:b0:4f6:3677:54e with SMTP id a9-20020a19f809000000b004f63677054emr1178416lff.36.1686081325083; Tue, 06 Jun 2023 12:55:25 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 8/8] xen/riscv: move extern of cpu0_boot_stack to header Date: Tue, 6 Jun 2023 22:55:16 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/mm.h | 2 ++ xen/arch/riscv/mm.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h index 3b04131628..fc3afa5521 100644 --- a/xen/arch/riscv/include/asm/mm.h +++ b/xen/arch/riscv/include/asm/mm.h @@ -8,6 +8,8 @@ #define pfn_to_paddr(pfn) ((paddr_t)(pfn) << PAGE_SHIFT) #define paddr_to_pfn(pa) ((unsigned long)((pa) >> PAGE_SHIFT)) +extern unsigned char cpu0_boot_stack[]; + void setup_initial_pagetables(void); void enable_mmu(void); diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c index b50641a80e..56d3bbb422 100644 --- a/xen/arch/riscv/mm.c +++ b/xen/arch/riscv/mm.c @@ -19,8 +19,6 @@ struct mmu_desc { pte_t *pgtbl_base; }; -extern unsigned char cpu0_boot_stack[STACK_SIZE]; - static unsigned long phys_offset; #define LOAD_TO_LINK(addr) ((unsigned long)(addr) - phys_offset)