-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guest test td func 1213 #154
Changes from 3 commits
0bef27e
fbde880
205ecaf
fc167cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
halt_test.ko |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
|
||
MODULES = halt_test.ko | ||
|
||
obj-m += halt_test.o | ||
|
||
KDIR ?= /lib/modules/$(shell uname -r)/build | ||
|
||
all: | ||
make -C $(KDIR) M=$(PWD) modules | ||
clean: | ||
make -C $(KDIR) M=$(PWD) clean |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
|
||
static int __init test_tdx_hlt_init(void) | ||
{ | ||
pr_info("[TD guest test] Start to trigger hlt instr.\n"); | ||
asm("cli"); | ||
asm("hlt"); | ||
return 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worthwhile to create a separate kernel module for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that would be nice, let's discuss your common test module solution |
||
} | ||
|
||
static void __exit test_tdx_hlt_exit(void) | ||
{ | ||
pr_info("[TD guest test] Complete of hlt instr. test, test module exit\n"); | ||
} | ||
|
||
module_init(test_tdx_hlt_init); | ||
module_exit(test_tdx_hlt_exit); | ||
MODULE_INFO(intree, "Y"); | ||
MODULE_LICENSE("GPL"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent missing here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, my bad (miss-leading by the EOF line before), revised all such issues in this source code.