[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 11/11] xsm: remove alternate xsm hook interface


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 7 Sep 2021 10:03:24 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631023510; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=GDLLgnfggnonVh83Z26KWmFNzxC2njX3v4Ulq7RK37o=; b=El0mEU8QogFCmZvWlx5baQjQITtDhMYQ7QHP4OE9zDsttTahbauYGL8F4CaYbCGmib63Ls8TT2zIth7ENcepYPUuE3ikClAet8G3ExM51JFJuse8/ko6RnXdpG6oYo6RX+shc8qIdRAhgsUzy6b9ZOepqW2t+RUhYkq0IhtVYPY=
  • Arc-seal: i=1; a=rsa-sha256; t=1631023510; cv=none; d=zohomail.com; s=zohoarc; b=DwVlQ8X2gwzBmofhZa0/mLTHPEFlZjcMnPjguUG6rAl52TJYQ1DLpmpEN4Ye3zovYIVKjdpMMPeR/11Jooh2ZCky0kTwuOA7fLDtb0UxS0OvMNfhl3ZEKekUxESMEy2Hcw3UbKGp2A/N3JCQFEPGps51Pdc8c47dltQNpke+uNQ=
  • Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 07 Sep 2021 14:05:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 9/6/21 3:18 PM, Andrew Cooper wrote:
On 03/09/2021 20:06, Daniel P. Smith wrote:
-static inline int xsm_memtype(xsm_default_t def, uint32_t access)
+#if 0
+/* Could not find any usages */
+static inline int xsm_memtype(xsm_default_t action, uint32_t access)
  {
      return alternative_call(xsm_ops.memtype, access);
  }
+#endif

There wants to be an earlier patch deleting dead code.  We don't want to
retain this if-0'd out.

I can transition this to a standalone patch at the beginning to drop the benign code.

diff --git a/xen/xsm/dummy.h b/xen/xsm/dummy.h
new file mode 100644
index 0000000000..b9a7e8c40f
--- /dev/null
+++ b/xen/xsm/dummy.h
@@ -0,0 +1,739 @@
+/*
+ *  Default XSM hooks - IS_PRIV and IS_PRIV_FOR checks
+ *
+ *  Author: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2,
+ *  as published by the Free Software Foundation.
+ *
+ *
+ *  Dummy XSM hooks implementing the default access check. Each hook should
+ *  have as its first line XSM_DEFAULT_ACTION declaring the privilege level
+ *  required for this access.
+ */
+
+#ifndef __XSM_DUMMY_H__
+#define __XSM_DUMMY_H__
+
+#include <xen/sched.h>
+#include <xsm/xsm-core.h>
+#include <public/hvm/params.h>
+
+#define XSM_DEFAULT_ACTION(def) xsm_default_t action = def; (void)action
+
+static always_inline int xsm_default_action(
+    xsm_default_t action, struct domain *src, struct domain *target)
+{
+    switch ( action ) {

Either here (because you're moving code), or in the style fix, the brace
wants to be on the next line.

I will promote to the style patch and carry it through the move.

v/r,
dps



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.