All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: "Oleksii Kurochko" <oleksii.kurochko@gmail.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: [PATCH v1 3/4] xen/x86: switch x86 to use generic implemetation of bug.h
Date: Fri,  3 Feb 2023 19:05:49 +0200	[thread overview]
Message-ID: <b2f6ed2cd9f02c9f21b716595a158906499a22eb.1675441720.git.oleksii.kurochko@gmail.com> (raw)
In-Reply-To: <cover.1675441720.git.oleksii.kurochko@gmail.com>

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c  |  2 +-
 xen/arch/x86/include/asm/asm_defns.h |  2 +-
 xen/arch/x86/include/asm/bug.h       | 32 ++--------------------------
 3 files changed, 4 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index c27cbb2304..18ff2a443b 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -27,6 +27,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
+#include <xen/bug.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/delay.h>
@@ -35,7 +36,6 @@
 #include <xen/sched.h>
 #include <xen/timer.h>
 #include <xen/xmalloc.h>
-#include <asm/bug.h>
 #include <asm/msr.h>
 #include <asm/io.h>
 #include <asm/processor.h>
diff --git a/xen/arch/x86/include/asm/asm_defns.h b/xen/arch/x86/include/asm/asm_defns.h
index d9431180cf..a8526cf36c 100644
--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -6,7 +6,7 @@
 /* NB. Auto-generated from arch/.../asm-offsets.c */
 #include <asm/asm-offsets.h>
 #endif
-#include <asm/bug.h>
+#include <xen/bug.h>
 #include <asm/x86-defns.h>
 #include <xen/stringify.h>
 #include <asm/cpufeature.h>
diff --git a/xen/arch/x86/include/asm/bug.h b/xen/arch/x86/include/asm/bug.h
index b7265bdfbe..6ead21d9fe 100644
--- a/xen/arch/x86/include/asm/bug.h
+++ b/xen/arch/x86/include/asm/bug.h
@@ -1,19 +1,10 @@
 #ifndef __X86_BUG_H__
 #define __X86_BUG_H__
 
-#define BUG_DISP_WIDTH    24
-#define BUG_LINE_LO_WIDTH (31 - BUG_DISP_WIDTH)
-#define BUG_LINE_HI_WIDTH (31 - BUG_DISP_WIDTH)
-
-#define BUGFRAME_run_fn 0
-#define BUGFRAME_warn   1
-#define BUGFRAME_bug    2
-#define BUGFRAME_assert 3
-
-#define BUGFRAME_NR     4
-
 #ifndef __ASSEMBLY__
 
+#define BUG_FRAME_STUFF
+
 struct bug_frame {
     signed int loc_disp:BUG_DISP_WIDTH;
     unsigned int line_hi:BUG_LINE_HI_WIDTH;
@@ -58,13 +49,6 @@ struct bug_frame {
                    :: _ASM_BUGFRAME_INFO(type, line, ptr, msg) );            \
 } while (0)
 
-
-#define WARN() BUG_FRAME(BUGFRAME_warn, __LINE__, __FILE__, 0, NULL)
-#define BUG() do {                                              \
-    BUG_FRAME(BUGFRAME_bug,  __LINE__, __FILE__, 0, NULL);      \
-    unreachable();                                              \
-} while (0)
-
 /*
  * TODO: untangle header dependences, break BUILD_BUG_ON() out of xen/lib.h,
  * and use a real static inline here to get proper type checking of fn().
@@ -75,19 +59,7 @@ struct bug_frame {
         BUG_FRAME(BUGFRAME_run_fn, 0, fn, 0, NULL);             \
     } while ( 0 )
 
-#define assert_failed(msg) do {                                 \
-    BUG_FRAME(BUGFRAME_assert, __LINE__, __FILE__, 1, msg);     \
-    unreachable();                                              \
-} while (0)
-
-extern const struct bug_frame __start_bug_frames[],
-                              __stop_bug_frames_0[],
-                              __stop_bug_frames_1[],
-                              __stop_bug_frames_2[],
-                              __stop_bug_frames_3[];
-
 #else  /* !__ASSEMBLY__ */
-
 /*
  * Construct a bugframe, suitable for using in assembly code.  Should always
  * match the C version above.  One complication is having to stash the strings
-- 
2.39.0



  parent reply	other threads:[~2023-02-03 17:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 17:05 [PATCH v1 0/4] introduce generic implementation of macros from bug.h Oleksii Kurochko
2023-02-03 17:05 ` [PATCH v1 1/4] xen: introduce CONFIG_GENERIC_BUG_FRAME Oleksii Kurochko
2023-02-13 12:24   ` Jan Beulich
2023-02-13 13:19     ` Julien Grall
2023-02-13 13:30       ` Jan Beulich
2023-02-13 13:56         ` Julien Grall
2023-02-13 15:02           ` Jan Beulich
2023-02-13 15:07             ` Julien Grall
2023-02-13 15:14               ` Jan Beulich
2023-02-13 13:33       ` Andrew Cooper
2023-02-13 13:55         ` Julien Grall
2023-02-14 16:22     ` Oleksii
2023-02-14 16:55       ` Jan Beulich
2023-02-15 15:06         ` Oleksii
2023-02-15 17:59         ` Oleksii
2023-02-16  7:31           ` Jan Beulich
2023-02-16 10:44             ` Oleksii
2023-02-16 12:09               ` Oleksii
2023-02-16 12:19                 ` Andrew Cooper
2023-02-16 20:44                   ` Oleksii
2023-02-17  7:12                     ` Jan Beulich
2023-02-17  9:33                       ` Oleksii
2023-02-16 14:55               ` Jan Beulich
2023-02-16 10:48             ` Andrew Cooper
2023-02-16 12:21               ` Oleksii
2023-02-16 14:53               ` Jan Beulich
2023-02-03 17:05 ` [PATCH v1 2/4] xen/arm: switch ARM to use generic implementation of bug.h Oleksii Kurochko
2023-02-13 13:02   ` Jan Beulich
2023-02-14 16:28     ` Oleksii
2023-02-03 17:05 ` Oleksii Kurochko [this message]
2023-02-13 13:10   ` [PATCH v1 3/4] xen/x86: switch x86 to use generic implemetation " Jan Beulich
2023-02-14 16:41     ` Oleksii
2023-02-03 17:05 ` [PATCH v1 4/4] xen: change <asm/bug.h> to <xen/bug.h> Oleksii Kurochko
2023-02-13 13:13   ` Jan Beulich
2023-02-14 16:44     ` Oleksii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2f6ed2cd9f02c9f21b716595a158906499a22eb.1675441720.git.oleksii.kurochko@gmail.com \
    --to=oleksii.kurochko@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.