|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V2] x86, amd_ucode: Verify max allowed patch size before apply
On 4/29/2014 4:33 PM, Aravind Gopalakrishnan wrote: On 4/29/2014 3:02 AM, Jan Beulich wrote:@@ -123,8 +151,17 @@ static bool_t microcode_fits(const struct microcode_amd *mc_amd, int cpu)
couple of ideas about implementing this:
1. something similar to mwait-idle.c:
+#ifdef DEBUG
+# define pr_debug(fmt...) printk(KERN_DEBUG fmt)
+#else
+# define pr_debug(fmt...)
+#endif
2. a custom_param: something like mce_verbosity:
(reference code)
+//arav
+int ucode_verbosity;
+static void __init ucode_set_verbosity(char *str)
+{
+ if (strcmp("verbose", str) == 0)
+ ucode_verbosity = 1;
+ else
+ printk(KERN_DEBUG "Microcode verbosity level %s not recognised"
+ "use ucode_verbosity=verbose", str);
+}
+custom_param("ucode_verbosity", ucode_set_verbosity);
+
+#define pr_debug(v, fmt...) do { \
+ if ((v) <= ucode_verbosity) \
+ printk(fmt); \
+ } while (0)
+
and using: (example)
+ pr_debug(1,"microcode: patch size mismatch\n");
We can probably put it in a 'microcode.h' (?) file and extend functionality
to microcode_intel as well.. (microcode_intel will only need some very
minor edits)
I have tried both options and they work fine. (well, second option i know works for sure on AMD :) ) Thoughts? -Aravind. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |