From patchwork Wed Jan 22 01:58:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bobby Eshleman X-Patchwork-Id: 11344981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 260441398 for ; Wed, 22 Jan 2020 05:14:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 01E3924656 for ; Wed, 22 Jan 2020 05:14:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L60pT08D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01E3924656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iu8L9-00058Q-NF; Wed, 22 Jan 2020 05:14:07 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iu5Kn-00069C-5q for xen-devel@lists.xenproject.org; Wed, 22 Jan 2020 02:01:33 +0000 X-Inumbo-ID: 0344cbae-3cbb-11ea-b833-bc764e2007e4 Received: from mail-yw1-xc44.google.com (unknown [2607:f8b0:4864:20::c44]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0344cbae-3cbb-11ea-b833-bc764e2007e4; Wed, 22 Jan 2020 02:00:50 +0000 (UTC) Received: by mail-yw1-xc44.google.com with SMTP id d7so2476447ywl.12 for ; Tue, 21 Jan 2020 18:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i+rEX8O6S9+veG9wMoy7cCMlNnRtHJYvsqiOpzSqXRQ=; b=L60pT08D7Q2bBZ22haUeQcX2IcWe8oAvuHq/EpGbtFmuji3VIDfUHe17XyVkYECCD4 ESwxq9Qbz7VaYU4yhQLAM3ED49h0V/aTLeLhqWldPJcbS52dnnlnnvik8fck7+rSUVPg GhJL3bXxa1QQPIWgt1Tt6vjBZoiu0PmPXRk5pdi0jgYqE47RTMcJz6lWPZR53t+bUFud B4yyojQspOA57CwdbEHkF4i25DZrYm1JwCK/fUSLBDlvIjs4maU1e0peXEcoiFBXgXNU nWzR0U8mcxkK3F5M9zgAsOOcsZ6gZga0eUMmSnPVM3fjHRhJChCKsaH/7BrZ/M7ywB2W AHBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i+rEX8O6S9+veG9wMoy7cCMlNnRtHJYvsqiOpzSqXRQ=; b=tb1k28P6peQdxPf0VlhnQIoTJGWIGJO01RzAg0ug9iRE0wV0W/Yznuyl7/Fs+9NHFJ MMMs0YotUidfd8ZgWMOz8tpG97PqS9G9K6lViRvBOUVez5PVTsKieOWm7OJaG+sWJHG9 V2VFshLo8yfANgZ8ZY9WbJLGWUo8MusjQNqfN12OWjACdnsNDxmiDM9abaAEQ5az7HZM U6744zGGKu4FJMW/S5nK/Lbbdim/uKGmd0BdWAK774VbSsB1oa2iMDNm24leisiKPnB8 sxag9dryzz9HjIiC9ssfHN632/kweosTVj+eG4nbi7Q5KuEsNlWhA1zOJn3upBYkHGKw R1IA== X-Gm-Message-State: APjAAAXTAbVpBFrcLfPOI5nmYV4FX3Xv0t5TySX/sNKK6HEw1B3ihDKA Px2MV5RDfkB+dkpG/PJwm/tKHcosI6C55w== X-Google-Smtp-Source: APXvYqyYpCPCFFHphp5NkgQt3SEvOynCKlSmpWiS9OArvUwEdvojmPMrkxDlQfeiUoqaMIx2jQZ1vQ== X-Received: by 2002:a81:294c:: with SMTP id p73mr801068ywp.477.1579658449437; Tue, 21 Jan 2020 18:00:49 -0800 (PST) Received: from bobbye-pc.knology.net ([216.186.244.35]) by smtp.gmail.com with ESMTPSA id q185sm17504248ywh.61.2020.01.21.18.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:00:49 -0800 (PST) From: Bobby Eshleman To: xen-devel@lists.xenproject.org Date: Tue, 21 Jan 2020 19:58:52 -0600 Message-Id: X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Jan 2020 05:14:01 +0000 Subject: [Xen-devel] [RFC XEN PATCH 13/23] riscv: Add smp.c X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Bobby Eshleman , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Bobby Eshleman , Dan Robertson , Alistair Francis Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Alistair Francis Signed-off-by: Alistair Francis --- xen/arch/riscv/smp.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 xen/arch/riscv/smp.c diff --git a/xen/arch/riscv/smp.c b/xen/arch/riscv/smp.c new file mode 100644 index 0000000000..735da22cd2 --- /dev/null +++ b/xen/arch/riscv/smp.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include +#include + +volatile unsigned long start_secondary_pen_release = HARTID_INVALID; + +void flush_tlb_mask(const cpumask_t *mask) +{ + flush_all_guests_tlb(); +} + +void smp_send_event_check_mask(const cpumask_t *mask) +{ + /* TODO */ +} + +void smp_send_call_function_mask(const cpumask_t *mask) +{ + cpumask_t target_mask; + + cpumask_andnot(&target_mask, mask, cpumask_of(smp_processor_id())); + + if ( cpumask_test_cpu(smp_processor_id(), mask) ) + { + local_irq_disable(); + smp_call_function_interrupt(); + local_irq_enable(); + } +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */